Draft: Fixed move/rotate of objects inside PArt containers - fixes #3485

This commit is contained in:
Yorik van Havre
2019-02-19 19:55:20 -03:00
parent be49b27010
commit a661bbb211

View File

@@ -613,6 +613,14 @@ class ghostTracker(Tracker):
sep = coin.SoSeparator()
try:
sep.addChild(obj.ViewObject.RootNode.copy())
# add Part container offset
if hasattr(obj,"getGlobalPlacement"):
if obj.Placement != obj.getGlobalPlacement():
if sep.getChild(0).getNumChildren() > 0:
if isinstance(sep.getChild(0).getChild(0),coin.SoTransform):
gpl = obj.getGlobalPlacement()
sep.getChild(0).getChild(0).translation.setValue(tuple(gpl.Base))
sep.getChild(0).getChild(0).rotation.setValue(gpl.Rotation.Q)
except:
print("ghostTracker: Error retrieving coin node (full)")
return sep