From a1b9c34397a1204ef80edf2361844867ef22d7be Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 12 Oct 2001 00:14:38 +0000 Subject: [PATCH] name actor nodes somewhat more meaningfully --- direct/src/actor/Actor.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 320df38e8c..38fd7258fe 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -89,6 +89,7 @@ class Actor(PandaObject, NodePath): # act like a normal contructor # create base hierarchy + self.gotName = 0 self.assign(hidden.attachNewNode('actor')) self.setGeomNode(self.attachNewNode('actorGeom')) self.__LODNode = None @@ -180,6 +181,7 @@ class Actor(PandaObject, NodePath): # copy the scene graph elements of other otherCopy = other.copyTo(hidden) # assign these elements to ourselve + self.gotName = other.gotName self.assign(otherCopy) self.setGeomNode(otherCopy.getChild(0)) @@ -1061,6 +1063,13 @@ class Actor(PandaObject, NodePath): if (bundle.isEmpty()): Actor.notify.warning("%s is not a character!" % (modelPath)) else: + # Rename the node at the top of the hierarchy, if we + # haven't already, to make it easier to identify this + # actor in the scene graph. + if not self.gotName: + self.node().setName(bundle.node().getName()) + self.gotName = 1 + # we rename this node to make Actor copying easier bundle.node().setName(Actor.partPrefix + partName)