*** empty log message ***

This commit is contained in:
Joe Shochet 2002-01-18 07:47:51 +00:00
parent 980f63b235
commit ccec42740b
5 changed files with 38 additions and 29 deletions

View File

@ -85,6 +85,8 @@ class Actor(PandaObject, NodePath):
self.__partBundleDict = {} self.__partBundleDict = {}
self.__animControlDict = {} self.__animControlDict = {}
self.__LODNode = None
if (other == None): if (other == None):
# act like a normal contructor # act like a normal contructor
@ -92,7 +94,6 @@ class Actor(PandaObject, NodePath):
self.gotName = 0 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.__hasLOD = 0 self.__hasLOD = 0
# load models # load models
@ -282,14 +283,16 @@ class Actor(PandaObject, NodePath):
Actor cleanup function Actor cleanup function
""" """
self.stop() self.stop()
self.__partBundleDict = None del self.__partBundleDict
self.__animControlDict = None del self.__animControlDict
self.__geomNode = None self.__geomNode.removeNode()
self.__LODNode = None del self.__geomNode
if self.__LODNode:
self.__LODNode.removeNode()
del self.__LODNode
self.__hasLOD = 0 self.__hasLOD = 0
if not self.isEmpty(): if not self.isEmpty():
self.removeNode() self.removeNode()
# accessing # accessing
def getAnimControlDict(self): def getAnimControlDict(self):
@ -1093,10 +1096,12 @@ class Actor(PandaObject, NodePath):
if (lodName!="lodRoot"): if (lodName!="lodRoot"):
# instance to appropriate node under LOD switch # instance to appropriate node under LOD switch
bundle = bundle.instanceTo( #bundle = bundle.instanceTo(
self.__LODNode.find("**/" + str(lodName))) # self.__LODNode.find("**/" + str(lodName)))
bundle.reparentTo(self.__LODNode.find("**/" + str(lodName)))
else: else:
bundle = bundle.instanceTo(self.__geomNode) #bundle = bundle.instanceTo(self.__geomNode)
bundle.reparentTo(self.__geomNode)
if (needsDict): if (needsDict):
bundleDict[partName] = bundle bundleDict[partName] = bundle

View File

@ -6,6 +6,9 @@ class DistributedNodeAI(DistributedObjectAI.DistributedObjectAI):
def __init__(self, air): def __init__(self, air):
DistributedObjectAI.DistributedObjectAI.__init__(self, air) DistributedObjectAI.DistributedObjectAI.__init__(self, air)
def delete(self):
DistributedObjectAI.DistributedObjectAI.delete(self)
### setParent ### ### setParent ###
def d_setParent(self, parentString): def d_setParent(self, parentString):

View File

@ -36,13 +36,13 @@ class DistributedObject(PandaObject):
self.deleteImminent = 0 self.deleteImminent = 0
return None return None
# def __del__(self): #def __del__(self):
# """ # """
# For debugging purposes, this just prints out what got deleted # For debugging purposes, this just prints out what got deleted
# """ # """
# DistributedObject.notify.debug("Destructing: " + self.__class__.__name__ + # DistributedObject.notify.debug("Destructing: " + self.__class__.__name__ +
# " id: " + str(self.doId)) # " id: " + str(self.doId))
# PandaObject.__del__(self) # PandaObject.__del__(self)
def setNeverDisable(self, bool): def setNeverDisable(self, bool):
assert((bool == 1) or (bool == 0)) assert((bool == 1) or (bool == 0))

View File

@ -148,11 +148,6 @@ class DirectGuiBase(PandaObject.PandaObject):
# no components with this group have been created. # no components with this group have been created.
# self._dynamicGroups = () # self._dynamicGroups = ()
# Looks like they are being deleted, add this back in if
# we need to check again
#def __del__(self):
# print 'Bye'
def defineoptions(self, keywords, optionDefs, dynamicGroups = ()): def defineoptions(self, keywords, optionDefs, dynamicGroups = ()):
""" defineoptions(keywords, optionDefs, dynamicGroups = {}) """ """ defineoptions(keywords, optionDefs, dynamicGroups = {}) """
# Create options, providing the default value and the method # Create options, providing the default value and the method
@ -613,7 +608,8 @@ class DirectGuiBase(PandaObject.PandaObject):
del(self._optionInfo) del(self._optionInfo)
del(self._hookDict) del(self._hookDict)
del(self.__componentInfo) del(self.__componentInfo)
del self.postInitialiseFuncList
def bind(self, event, command, extraArgs = []): def bind(self, event, command, extraArgs = []):
""" """
Bind the command (which should expect one arg) to the specified Bind the command (which should expect one arg) to the specified
@ -935,11 +931,16 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
# Destroy children # Destroy children
for child in self.getChildrenAsList(): for child in self.getChildrenAsList():
messenger.send(DESTROY + child.getName()) messenger.send(DESTROY + child.getName())
# Call superclass destruction method (clears out hooks) del self.frameStyle
DirectGuiBase.destroy(self)
# Get rid of node path # Get rid of node path
self.removeNode() self.removeNode()
for nodePath in self.stateNodePath:
nodePath.removeNode()
del self.stateNodePath
del self.guiItem
# Call superclass destruction method (clears out hooks)
DirectGuiBase.destroy(self)
def printConfig(self, indent = 0): def printConfig(self, indent = 0):
space = ' ' * indent space = ' ' * indent
print space + self.guiId print space + self.guiId

View File

@ -38,16 +38,16 @@ class DirectWaitBar(DirectFrame):
textoptiondefs = () textoptiondefs = ()
# Merge keyword options with default options # Merge keyword options with default options
self.defineoptions(kw, optiondefs + textoptiondefs) self.defineoptions(kw, optiondefs + textoptiondefs)
# Initialize superclasses # Initialize superclasses
DirectFrame.__init__(self, parent) DirectFrame.__init__(self, parent)
self.barStyle = PGFrameStyle() self.barStyle = PGFrameStyle()
# Call option initialization functions # Call option initialization functions
self.initialiseoptions(DirectWaitBar) self.initialiseoptions(DirectWaitBar)
self.updateBarStyle() self.updateBarStyle()
def destroy(self):
del self.barStyle
DirectFrame.destroy(self)
def setRange(self): def setRange(self):
self.guiItem.setRange(self['range']) self.guiItem.setRange(self['range'])