mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix #4073. Objects with no applicable context for the drawing view are now hidden.
This commit is contained in:
@@ -1653,10 +1653,12 @@ class Drawing(blenderbim.core.tool.Drawing):
|
||||
subcontext = current_representation.ContextOfItems
|
||||
current_representation_subcontext = tool.Geometry.get_subcontext_parameters(subcontext)
|
||||
|
||||
has_context = False
|
||||
for subcontext in subcontexts:
|
||||
# prioritize already active representation if it matches the subcontext
|
||||
# (element could have multiple representations in the same subcontext)
|
||||
if current_representation and subcontext == current_representation_subcontext:
|
||||
has_context = True
|
||||
break
|
||||
priority_representation = ifcopenshell.util.representation.get_representation(element, *subcontext)
|
||||
if priority_representation:
|
||||
@@ -1669,8 +1671,13 @@ class Drawing(blenderbim.core.tool.Drawing):
|
||||
is_global=True,
|
||||
should_sync_changes_first=True,
|
||||
)
|
||||
has_context = True
|
||||
break
|
||||
|
||||
if not has_context:
|
||||
obj.hide_set(True)
|
||||
obj.hide_render = True
|
||||
|
||||
@classmethod
|
||||
def get_elements_in_camera_view(cls, camera, objs):
|
||||
props = camera.data.BIMCameraProperties
|
||||
|
||||
Reference in New Issue
Block a user