mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 22:43:41 +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
|
subcontext = current_representation.ContextOfItems
|
||||||
current_representation_subcontext = tool.Geometry.get_subcontext_parameters(subcontext)
|
current_representation_subcontext = tool.Geometry.get_subcontext_parameters(subcontext)
|
||||||
|
|
||||||
|
has_context = False
|
||||||
for subcontext in subcontexts:
|
for subcontext in subcontexts:
|
||||||
# prioritize already active representation if it matches the subcontext
|
# prioritize already active representation if it matches the subcontext
|
||||||
# (element could have multiple representations in the same subcontext)
|
# (element could have multiple representations in the same subcontext)
|
||||||
if current_representation and subcontext == current_representation_subcontext:
|
if current_representation and subcontext == current_representation_subcontext:
|
||||||
|
has_context = True
|
||||||
break
|
break
|
||||||
priority_representation = ifcopenshell.util.representation.get_representation(element, *subcontext)
|
priority_representation = ifcopenshell.util.representation.get_representation(element, *subcontext)
|
||||||
if priority_representation:
|
if priority_representation:
|
||||||
@@ -1669,8 +1671,13 @@ class Drawing(blenderbim.core.tool.Drawing):
|
|||||||
is_global=True,
|
is_global=True,
|
||||||
should_sync_changes_first=True,
|
should_sync_changes_first=True,
|
||||||
)
|
)
|
||||||
|
has_context = True
|
||||||
break
|
break
|
||||||
|
|
||||||
|
if not has_context:
|
||||||
|
obj.hide_set(True)
|
||||||
|
obj.hide_render = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_elements_in_camera_view(cls, camera, objs):
|
def get_elements_in_camera_view(cls, camera, objs):
|
||||||
props = camera.data.BIMCameraProperties
|
props = camera.data.BIMCameraProperties
|
||||||
|
|||||||
Reference in New Issue
Block a user