Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoiding the crash of reading curve data in Blender 3.2 #4631

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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