mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
avoid full shader rebuilds in intermediate property write
This commit is contained in:
@@ -782,8 +782,12 @@ class EditSurfaceStyle(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
self.props = tool.Style.get_style_props()
|
self.props = tool.Style.get_style_props()
|
||||||
self.style = tool.Ifc.get().by_id(self.props.is_editing_style)
|
self.style = tool.Ifc.get().by_id(self.props.is_editing_style)
|
||||||
|
prev_update_graph = self.props.update_graph
|
||||||
|
self.props["update_graph"] = False
|
||||||
|
|
||||||
|
try:
|
||||||
style_elements = tool.Style.get_style_elements(self.style)
|
style_elements = tool.Style.get_style_elements(self.style)
|
||||||
|
|
||||||
# NOTE: currently this operator is used to edit existing (and only existing) IfcSurfaceStyles
|
# NOTE: currently this operator is used to edit existing (and only existing) IfcSurfaceStyles
|
||||||
# or new or existing IfcSurfaceStyle components (shading, etc)
|
# or new or existing IfcSurfaceStyle components (shading, etc)
|
||||||
# which is kind of confusing.
|
# which is kind of confusing.
|
||||||
@@ -810,6 +814,8 @@ class EditSurfaceStyle(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
material = tool.Ifc.get_object(self.style)
|
material = tool.Ifc.get_object(self.style)
|
||||||
msprops = tool.Style.get_material_style_props(material)
|
msprops = tool.Style.get_material_style_props(material)
|
||||||
msprops.active_style_type = msprops.active_style_type
|
msprops.active_style_type = msprops.active_style_type
|
||||||
|
finally:
|
||||||
|
self.props["update_graph"] = prev_update_graph
|
||||||
|
|
||||||
def edit_existing_style(self) -> None:
|
def edit_existing_style(self) -> None:
|
||||||
ifc_file = tool.Ifc.get()
|
ifc_file = tool.Ifc.get()
|
||||||
|
|||||||
Reference in New Issue
Block a user