mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
added a few more functions in actor
This commit is contained in:
parent
995ce8b11a
commit
326cdd21e5
@ -191,7 +191,6 @@ class Actor(DirectObject, NodePath):
|
||||
|
||||
else:
|
||||
# act like a copy constructor
|
||||
|
||||
# copy the scene graph elements of other
|
||||
otherCopy = other.copyTo(hidden)
|
||||
otherCopy.detachNode()
|
||||
@ -346,24 +345,27 @@ class Actor(DirectObject, NodePath):
|
||||
Actor cleanup function
|
||||
"""
|
||||
self.stop()
|
||||
self.flush()
|
||||
self.__geomNode.removeNode()
|
||||
if not self.isEmpty():
|
||||
self.removeNode()
|
||||
|
||||
def flush(self):
|
||||
"""
|
||||
Actor flush function
|
||||
"""
|
||||
self.__partBundleDict = {}
|
||||
self.__subpartDict = {}
|
||||
self.__sortedLODNames = []
|
||||
self.__animControlDict = {}
|
||||
self.__controlJoints = {}
|
||||
|
||||
self.__geomNode.removeNode()
|
||||
|
||||
if self.__LODNode:
|
||||
self.__LODNode.removeNode()
|
||||
self.__LODNode = None
|
||||
|
||||
self.__hasLOD = 0
|
||||
|
||||
if not self.isEmpty():
|
||||
self.removeNode()
|
||||
|
||||
# accessing
|
||||
|
||||
def getAnimControlDict(self):
|
||||
@ -1584,9 +1586,16 @@ class Actor(DirectObject, NodePath):
|
||||
for lodName in other.__partBundleDict.keys():
|
||||
self.__partBundleDict[lodName] = {}
|
||||
self.__updateSortedLODNames()
|
||||
# find the lod :Asad:
|
||||
partLod = self.find("**/" + lodName)
|
||||
if (partLod == None):
|
||||
Actor.notify.warning("no lod named: %s" % (lodName))
|
||||
return None
|
||||
for partName in other.__partBundleDict[lodName].keys():
|
||||
# find the part in our tree
|
||||
partBundle = self.find("**/" + Actor.partPrefix + partName)
|
||||
#partBundle = self.find("**/" + Actor.partPrefix + partName)
|
||||
# Asad: changed above line to below
|
||||
partBundle = partLod.find("**/" + Actor.partPrefix + partName)
|
||||
if (partBundle != None):
|
||||
# store the part bundle
|
||||
self.__partBundleDict[lodName][partName] = partBundle
|
||||
|
Loading…
x
Reference in New Issue
Block a user