mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Only activate drawing styles if underlay enabled, and default to default Blender styles to prevent confusion
This commit is contained in:
@@ -235,6 +235,11 @@ def setDefaultProperties(scene):
|
|||||||
ifcopenshell.api.owner.settings.get_application = get_application
|
ifcopenshell.api.owner.settings.get_application = get_application
|
||||||
# TODO: Move to drawing module
|
# TODO: Move to drawing module
|
||||||
if len(bpy.context.scene.DocProperties.drawing_styles) == 0:
|
if len(bpy.context.scene.DocProperties.drawing_styles) == 0:
|
||||||
|
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
|
||||||
|
drawing_style.name = "Blender Default"
|
||||||
|
drawing_style.render_type = "DEFAULT"
|
||||||
|
bpy.ops.bim.save_drawing_style(index="0")
|
||||||
|
|
||||||
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
|
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
|
||||||
drawing_style.name = "Technical"
|
drawing_style.name = "Technical"
|
||||||
drawing_style.render_type = "VIEWPORT"
|
drawing_style.render_type = "VIEWPORT"
|
||||||
@@ -297,8 +302,4 @@ def setDefaultProperties(scene):
|
|||||||
RasterStyleProperty.OVERLAY_SHOW_RELATIONSHIP_LINES.value: False,
|
RasterStyleProperty.OVERLAY_SHOW_RELATIONSHIP_LINES.value: False,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
drawing_style = bpy.context.scene.DocProperties.drawing_styles.add()
|
|
||||||
drawing_style.name = "Blender Default"
|
|
||||||
drawing_style.render_type = "DEFAULT"
|
|
||||||
bpy.ops.bim.save_drawing_style(index="2")
|
|
||||||
AuthoringData.type_thumbnails = {}
|
AuthoringData.type_thumbnails = {}
|
||||||
|
|||||||
@@ -991,7 +991,8 @@ class ActivateView(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
core.activate_drawing_view(tool.Ifc, tool.Drawing, drawing=tool.Ifc.get().by_id(self.drawing))
|
core.activate_drawing_view(tool.Ifc, tool.Drawing, drawing=tool.Ifc.get().by_id(self.drawing))
|
||||||
bpy.context.scene.DocProperties.active_drawing_id = self.drawing
|
bpy.context.scene.DocProperties.active_drawing_id = self.drawing
|
||||||
bpy.ops.bim.activate_drawing_style()
|
if ifcopenshell.util.element.get_pset(drawing, "EPset_Drawing", "HasUnderlay"):
|
||||||
|
bpy.ops.bim.activate_drawing_style()
|
||||||
core.sync_references(tool.Ifc, tool.Collector, tool.Drawing, drawing=tool.Ifc.get().by_id(self.drawing))
|
core.sync_references(tool.Ifc, tool.Collector, tool.Drawing, drawing=tool.Ifc.get().by_id(self.drawing))
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user