mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +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
|
||||
return {"FINISHED"}
|
||||
|
||||
updated_materials = set()
|
||||
for obj in context.selected_objects:
|
||||
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
|
||||
updated_materials.add(mat)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user