mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
Fix for assign_class and object with modifiers in Blender <4.4 #6701
This commit is contained in:
@@ -274,8 +274,15 @@ class AssignClass(bpy.types.Operator, tool.Ifc.Operator):
|
||||
# Apply geometry.
|
||||
if obj.modifiers:
|
||||
ensure_single_user_mesh(obj.data)
|
||||
# In older Blender versions 'object.convert'
|
||||
# still requires object to be both selected and active.
|
||||
is_old_blender = bpy.app.version < (4, 4, 0)
|
||||
with context.temp_override(selected_editable_objects=[obj]):
|
||||
if is_old_blender:
|
||||
tool.Blender.set_active_object(obj)
|
||||
bpy.ops.object.convert(target="MESH")
|
||||
if is_old_blender:
|
||||
tool.Blender.clear_objects_selection()
|
||||
|
||||
# Apply scale.
|
||||
if obj.scale != (1, 1, 1):
|
||||
|
||||
Reference in New Issue
Block a user