mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
fix issues toggling EDIT mode
1) it was throwing errors if object was linked 2) bim.override_mode_set_edit wasn't considering that toggle_edit_mode might not work out and was changing BIMGeometryProperties.mode though it wasn't needed.
This commit is contained in:
@@ -1669,7 +1669,8 @@ class OverrideModeSetEdit(bpy.types.Operator):
|
||||
# The active object is non-mesh-like. Set a valid object (or None) as active
|
||||
context.view_layer.objects.active = context.selected_objects[0] if context.selected_objects else None
|
||||
if context.active_object:
|
||||
tool.Blender.toggle_edit_mode(context)
|
||||
if tool.Blender.toggle_edit_mode(context) == {"CANCELLED"}:
|
||||
return {"CANCELLED"}
|
||||
context.scene.BIMGeometryProperties.is_changing_mode = True
|
||||
if context.scene.BIMGeometryProperties.mode != "EDIT":
|
||||
context.scene.BIMGeometryProperties.mode = "EDIT"
|
||||
|
||||
@@ -694,6 +694,8 @@ class Blender(blenderbim.core.tool.Blender):
|
||||
ao = context.active_object
|
||||
if not ao:
|
||||
return {"CANCELLED"}
|
||||
if ao.library:
|
||||
return {"CANCELLED"}
|
||||
if ao.type in cls.OBJECT_TYPES_THAT_SUPPORT_EDIT_MODE:
|
||||
return bpy.ops.object.mode_set(mode="EDIT", toggle=True)
|
||||
elif ao.type in cls.OBJECT_TYPES_THAT_SUPPORT_EDIT_GPENCIL_MODE:
|
||||
|
||||
Reference in New Issue
Block a user