Sync viewport visibility based on EPset_Drawing/Include Exclude #2613

It's not real time, it's triggered on using "Activate view" button in "Drawings" section.
This commit is contained in:
Andrej730
2023-04-05 16:27:57 +05:00
parent 534c3ad329
commit ea3065dbc2
+10
View File
@@ -1240,3 +1240,13 @@ class Drawing(blenderbim.core.tool.Drawing):
project_collection.children["Views"].children[camera.users_collection[0].name].hide_viewport = False
bpy.data.collections.get(camera.users_collection[0].name).hide_render = False
tool.Spatial.set_active_object(camera)
# sync viewport objects visibility with selectors from EPset_Drawing/Include and /Exclude
drawing_elements = cls.get_drawing_elements(tool.Ifc.get_entity(camera))
for element in tool.Ifc.get().by_type("IfcElement"):
if element.is_a() in ("IfcOpeningElement", ):
continue
obj = tool.Ifc.get_object(element)
obj.hide_viewport = element not in drawing_elements
obj.hide_render = element not in drawing_elements