diff --git a/blenderkit/append_link.py b/blenderkit/append_link.py index c6cc02c41aef5dc62f4cec13831f95d0c0c095ad..ed14083f0de2f23223aa8240216bc42d5c3d284d 100644 --- a/blenderkit/append_link.py +++ b/blenderkit/append_link.py @@ -107,7 +107,7 @@ def link_group(file_name, obnames=[], location=(0, 0, 0), link=False, **kwargs): if col.library is not None: fp = bpy.path.abspath(col.library.filepath) fp1 = bpy.path.abspath(file_name) - if fp1 == fp1: + if fp == fp1: main_object.instance_collection = col break; diff --git a/blenderkit/ui_panels.py b/blenderkit/ui_panels.py index 5a7582912fdbe5a7e271c006f2d16371971d07b3..9339b80ffaac3dc66ea26b048fb6a9d3a13563e1 100644 --- a/blenderkit/ui_panels.py +++ b/blenderkit/ui_panels.py @@ -584,12 +584,15 @@ class VIEW3D_PT_blenderkit_unified(Panel): wm = bpy.context.window_manager layout = self.layout + # layout.prop_tabs_enum(ui_props, "asset_type", icon_only = True) row = layout.row() - + row.scale_x = 1.6 + row.scale_y = 1.6 # row.prop(ui_props, 'down_up', expand=True, icon_only=True) # row.label(text='') row = row.split().row() + row.prop(ui_props, 'asset_type', expand=True, icon_only=True) w = context.region.width diff --git a/blenderkit/utils.py b/blenderkit/utils.py index 688346c0023ac92bd8beaa25a5d411e131731b81..0b1221926ffb6fc9f39cd96cf6b099cff99703d5 100644 --- a/blenderkit/utils.py +++ b/blenderkit/utils.py @@ -315,17 +315,18 @@ def get_bounds_snappable(obs, use_modifiers=False): # to_mesh(context.depsgraph, apply_modifiers=self.applyModifiers, calc_undeformed=False) obcount += 1 - for c in mesh.vertices: - coord = c.co - parent_coord = matrix_parent.inverted() @ mw @ Vector( - (coord[0], coord[1], coord[2])) # copy this when it works below. - minx = min(minx, parent_coord.x) - miny = min(miny, parent_coord.y) - minz = min(minz, parent_coord.z) - maxx = max(maxx, parent_coord.x) - maxy = max(maxy, parent_coord.y) - maxz = max(maxz, parent_coord.z) - # bpy.data.meshes.remove(mesh) + if mesh is not None: + for c in mesh.vertices: + coord = c.co + parent_coord = matrix_parent.inverted() @ mw @ Vector( + (coord[0], coord[1], coord[2])) # copy this when it works below. + minx = min(minx, parent_coord.x) + miny = min(miny, parent_coord.y) + minz = min(minz, parent_coord.z) + maxx = max(maxx, parent_coord.x) + maxy = max(maxy, parent_coord.y) + maxz = max(maxz, parent_coord.z) + # bpy.data.meshes.remove(mesh) if ob.type == 'CURVE': object_eval.to_mesh_clear() @@ -356,15 +357,16 @@ def get_bounds_worldspace(obs, use_modifiers=False): ob_eval = ob.evaluated_get(depsgraph) mesh = ob_eval.to_mesh() obcount += 1 - for c in mesh.vertices: - coord = c.co - world_coord = mw @ Vector((coord[0], coord[1], coord[2])) - minx = min(minx, world_coord.x) - miny = min(miny, world_coord.y) - minz = min(minz, world_coord.z) - maxx = max(maxx, world_coord.x) - maxy = max(maxy, world_coord.y) - maxz = max(maxz, world_coord.z) + if mesh is not None: + for c in mesh.vertices: + coord = c.co + world_coord = mw @ Vector((coord[0], coord[1], coord[2])) + minx = min(minx, world_coord.x) + miny = min(miny, world_coord.y) + minz = min(minz, world_coord.z) + maxx = max(maxx, world_coord.x) + maxy = max(maxy, world_coord.y) + maxz = max(maxz, world_coord.z) ob_eval.to_mesh_clear() if obcount == 0: