Skip to content

Commit

Permalink
avoiding the crash of reading curve data in Blender 3.2 (#4631)
Browse files Browse the repository at this point in the history
  • Loading branch information
Durman authored Aug 31, 2022
1 parent c247fa5 commit 7835e38
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions nodes/scene/get_objects_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@
from sverchok.utils.blender_mesh import (
read_verts, read_edges, read_verts_normal,
read_face_normal, read_face_center, read_face_area, read_materials_idx)
from sverchok.utils.logging import debug


class SvOB3BDataCollection(bpy.types.PropertyGroup):
name: bpy.props.StringProperty()
icon: bpy.props.StringProperty(default="BLANK1")


class ReadingObjectDataError(Exception):
pass


class SVOB3B_UL_NamesList(bpy.types.UIList):

def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
Expand Down Expand Up @@ -313,7 +319,10 @@ def process(self):
del bm
else:

if self.modifiers:
# https://developer.blender.org/T99661
if obj.type == 'CURVE' and obj.mode == 'EDIT' and bpy.app.version[:2] == (3, 2):
raise ReadingObjectDataError("Does not support curves in edit mode in Blender 3.2")
elif self.modifiers:
obj = sv_depsgraph.objects[obj.name]
obj_data = obj.to_mesh(preserve_all_data_layers=True, depsgraph=sv_depsgraph)
else:
Expand Down Expand Up @@ -346,8 +355,12 @@ def process(self):

obj.to_mesh_clear()

except ReadingObjectDataError:
raise
except Exception as err:
print('failure in process between frozen area', self.name, err)
# it's not clear which cases this try catch should handle
# probably it should skip wrong object types
debug('failure in process between frozen area', self.name, err)

if o_ms:
ms.append(mtrx)
Expand Down

0 comments on commit 7835e38

Please sign in to comment.