mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
Conveniently preselect object representation template if an object is selected
This commit is contained in:
@@ -181,7 +181,7 @@ class AddOccurrence(bpy.types.Operator, PolylineOperator):
|
||||
context.workspace.status_text_set(text=None)
|
||||
PolylineDecorator.uninstall()
|
||||
context.scene.BIMPolylineProperties.product_preview.clear()
|
||||
tool.Snap.clear_polyline()
|
||||
tool.Polyline.clear_polyline()
|
||||
tool.Blender.update_viewport()
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -336,6 +336,11 @@ class AddElement(bpy.types.Operator, tool.Ifc.Operator):
|
||||
return IfcStore.execute_ifc_operator(self, context, is_invoke=True)
|
||||
|
||||
def _invoke(self, context, event):
|
||||
# For convenience, preselect OBJ representation template if applicable
|
||||
if (obj := context.active_object) and obj.type == "MESH":
|
||||
props = context.scene.BIMRootProperties
|
||||
props.representation_template = "OBJ"
|
||||
props.representation_obj = obj
|
||||
return context.window_manager.invoke_props_dialog(self)
|
||||
|
||||
def _execute(self, context):
|
||||
|
||||
Reference in New Issue
Block a user