added a few more functions in actor

This commit is contained in:
Asad M. Zaman 2006-02-18 01:21:44 +00:00
parent 995ce8b11a
commit 326cdd21e5

View File

@ -191,7 +191,6 @@ class Actor(DirectObject, NodePath):
else: else:
# act like a copy constructor # act like a copy constructor
# copy the scene graph elements of other # copy the scene graph elements of other
otherCopy = other.copyTo(hidden) otherCopy = other.copyTo(hidden)
otherCopy.detachNode() otherCopy.detachNode()
@ -346,24 +345,27 @@ class Actor(DirectObject, NodePath):
Actor cleanup function Actor cleanup function
""" """
self.stop() self.stop()
self.flush()
self.__geomNode.removeNode()
if not self.isEmpty():
self.removeNode()
def flush(self):
"""
Actor flush function
"""
self.__partBundleDict = {} self.__partBundleDict = {}
self.__subpartDict = {} self.__subpartDict = {}
self.__sortedLODNames = [] self.__sortedLODNames = []
self.__animControlDict = {} self.__animControlDict = {}
self.__controlJoints = {} self.__controlJoints = {}
self.__geomNode.removeNode()
if self.__LODNode: if self.__LODNode:
self.__LODNode.removeNode() self.__LODNode.removeNode()
self.__LODNode = None self.__LODNode = None
self.__hasLOD = 0 self.__hasLOD = 0
if not self.isEmpty():
self.removeNode()
# accessing # accessing
def getAnimControlDict(self): def getAnimControlDict(self):
@ -1583,10 +1585,17 @@ class Actor(DirectObject, NodePath):
""" """
for lodName in other.__partBundleDict.keys(): for lodName in other.__partBundleDict.keys():
self.__partBundleDict[lodName] = {} self.__partBundleDict[lodName] = {}
self.__updateSortedLODNames() 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(): for partName in other.__partBundleDict[lodName].keys():
# find the part in our tree # 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): if (partBundle != None):
# store the part bundle # store the part bundle
self.__partBundleDict[lodName][partName] = partBundle self.__partBundleDict[lodName][partName] = partBundle