mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
bim.update_current_style - optimization for updating styles for multiple objects
This commit is contained in:
@@ -219,10 +219,12 @@ class UpdateCurrentStyle(bpy.types.Operator):
|
|||||||
context.scene.BIMStylesProperties.active_style_type = current_style_type
|
context.scene.BIMStylesProperties.active_style_type = current_style_type
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
updated_materials = set()
|
||||||
for obj in context.selected_objects:
|
for obj in context.selected_objects:
|
||||||
for mat in obj.data.materials:
|
for mat in obj.data.materials:
|
||||||
if mat and mat.BIMStyleProperties.ifc_definition_id != 0:
|
if mat and mat not in updated_materials and mat.BIMStyleProperties.ifc_definition_id != 0:
|
||||||
mat.BIMStyleProperties.active_style_type = current_style_type
|
mat.BIMStyleProperties.active_style_type = current_style_type
|
||||||
|
updated_materials.add(mat)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user