add feature to toggle wireframe visibility for linked models - no testcases

This commit is contained in:
Jesusbill
2022-04-13 18:28:48 +02:00
parent c099a6cb75
commit 4aa91cfa7f
4 changed files with 25 additions and 0 deletions
@@ -685,10 +685,31 @@ class LoadLink(bpy.types.Operator):
continue
bpy.data.scenes[0].collection.children.link(child)
link = context.scene.BIMProjectProperties.links.get(filepath)
link.collection_name = child.name
link.is_loaded = True
return {"FINISHED"}
class ToggleLinkVisibility(bpy.types.Operator):
bl_idname = "bim.toggle_link_visibility"
bl_label = "Toggle Link Visibility"
bl_options = {"REGISTER", "UNDO"}
bl_description = "Toggle visibility between SOLID and WIREFRAME"
collection_name: bpy.props.StringProperty()
def execute(self, context):
collection_name = self.collection_name
objs = filter(lambda obj: "IfcOpeningElement" not in obj.name, bpy.data.collections[collection_name].all_objects)
for i,obj in enumerate(objs):
if i == 0:
if obj.display_type == "WIRE":
display_type = "TEXTURED"
else:
display_type = "WIRE"
obj.display_type = display_type
return {"FINISHED"}
class ExportIFC(bpy.types.Operator):
bl_idname = "export_ifc.bim"
bl_label = "Export IFC"