[Arch] [Draft] Add guard for RootNode specific child

This commit is contained in:
Syres916
2024-02-05 11:00:38 +00:00
committed by GitHub
parent 963652c6a7
commit e4bb7a98e2
3 changed files with 31 additions and 28 deletions

View File

@@ -138,9 +138,10 @@ class SubelementHighlight(gui_base_original.Modifier):
obj.ViewObject.PointColor = (1.0, 0.0, 0.0)
obj.ViewObject.LineColor = (1.0, 0.0, 0.0)
xray = coin.SoAnnotation()
xray.addChild(obj.ViewObject.RootNode.getChild(2).getChild(0))
xray.setName("xray")
obj.ViewObject.RootNode.addChild(xray)
if obj.ViewObject.RootNode.getNumChildren() > 2:
xray.addChild(obj.ViewObject.RootNode.getChild(2).getChild(0))
xray.setName("xray")
obj.ViewObject.RootNode.addChild(xray)
def restore_editable_objects_graphics(self):
"""Restore the editable objects' appearance."""