mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
name actor nodes somewhat more meaningfully
This commit is contained in:
parent
6d5f4b9bd3
commit
a1b9c34397
@ -89,6 +89,7 @@ class Actor(PandaObject, NodePath):
|
|||||||
# act like a normal contructor
|
# act like a normal contructor
|
||||||
|
|
||||||
# create base hierarchy
|
# create base hierarchy
|
||||||
|
self.gotName = 0
|
||||||
self.assign(hidden.attachNewNode('actor'))
|
self.assign(hidden.attachNewNode('actor'))
|
||||||
self.setGeomNode(self.attachNewNode('actorGeom'))
|
self.setGeomNode(self.attachNewNode('actorGeom'))
|
||||||
self.__LODNode = None
|
self.__LODNode = None
|
||||||
@ -180,6 +181,7 @@ class Actor(PandaObject, NodePath):
|
|||||||
# copy the scene graph elements of other
|
# copy the scene graph elements of other
|
||||||
otherCopy = other.copyTo(hidden)
|
otherCopy = other.copyTo(hidden)
|
||||||
# assign these elements to ourselve
|
# assign these elements to ourselve
|
||||||
|
self.gotName = other.gotName
|
||||||
self.assign(otherCopy)
|
self.assign(otherCopy)
|
||||||
self.setGeomNode(otherCopy.getChild(0))
|
self.setGeomNode(otherCopy.getChild(0))
|
||||||
|
|
||||||
@ -1061,6 +1063,13 @@ class Actor(PandaObject, NodePath):
|
|||||||
if (bundle.isEmpty()):
|
if (bundle.isEmpty()):
|
||||||
Actor.notify.warning("%s is not a character!" % (modelPath))
|
Actor.notify.warning("%s is not a character!" % (modelPath))
|
||||||
else:
|
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
|
# we rename this node to make Actor copying easier
|
||||||
bundle.node().setName(Actor.partPrefix + partName)
|
bundle.node().setName(Actor.partPrefix + partName)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user