[Bf-extensions-cvs] [1760af58] master: BlenderKit: several fixes - crucial typo bug in previous timers commit(linking of collections gone wrong) - increase size of first row of UI in panel - fix a bug when mesh isn't generated in bounding box calculations (reported bug)

Vilém Duha noreply at git.blender.org
Tue Sep 10 16:56:18 CEST 2019


Commit: 1760af58fc28c96cb2c10baf654fc9d00775d7c3
Author: Vilém Duha
Date:   Sat Sep 7 20:20:10 2019 +0200
Branches: master
https://developer.blender.org/rBA1760af58fc28c96cb2c10baf654fc9d00775d7c3

BlenderKit: several fixes
 - crucial typo bug in previous timers commit(linking of collections gone wrong)
 - increase size of first row of UI in panel
 - fix a bug when mesh isn't generated in bounding box calculations (reported bug)

===================================================================

M	blenderkit/append_link.py
M	blenderkit/ui_panels.py
M	blenderkit/utils.py

===================================================================

diff --git a/blenderkit/append_link.py b/blenderkit/append_link.py
index c6cc02c4..ed14083f 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 5a758291..9339b80f 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 688346c0..0b122192 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:



More information about the Bf-extensions-cvs mailing list