*** empty log message ***

This commit is contained in:
Jesse Schell 2000-10-31 23:30:56 +00:00
parent 933b12bbeb
commit 65b5240293
4 changed files with 71 additions and 57 deletions

View File

@ -68,60 +68,64 @@ class Actor(PandaObject, NodePath):
""" """
# initial our NodePath essence try:
NodePath.__init__(self) self.Actor_initialized
except:
# create data structures self.Actor_initialized = 1
self.__partBundleDict = {} # initial our NodePath essence
self.__animControlDict = {} NodePath.__init__(self)
if (other == None): # create data structures
# act like a normal contructor self.__partBundleDict = {}
self.__animControlDict = {}
# create base hierarchy
self.assign(hidden.attachNewNode('actor')) if (other == None):
self.setGeomNode(self.attachNewNode('actorGeom')) # act like a normal contructor
# load models # create base hierarchy
# make sure we have models self.assign(hidden.attachNewNode('actor'))
if (models): self.setGeomNode(self.attachNewNode('actorGeom'))
# if this is a dictionary
if (type(models)==type({})): # load models
# then it must be multipart actor # make sure we have models
for partName in models.keys(): if (models):
self.loadModel(models[partName], partName) # if this is a dictionary
else: if (type(models)==type({})):
# else it is a single part actor # then it must be multipart actor
self.loadModel(models) for partName in models.keys():
self.loadModel(models[partName], partName)
# load anims
# make sure the actor has animations
if (anims):
if (len(anims) >= 1):
# if so, does it have a dictionary of dictionaries
if (type(anims[anims.keys()[0]])==type({})):
# then it must be multipart
for partName in anims.keys():
self.loadAnims(anims[partName], partName)
else: else:
# else it is not multipart # else it is a single part actor
self.loadAnims(anims) self.loadModel(models)
else: # load anims
# act like a copy constructor # make sure the actor has animations
if (anims):
if (len(anims) >= 1):
# if so, does it have a dictionary of dictionaries
if (type(anims[anims.keys()[0]])==type({})):
# then it must be multipart
for partName in anims.keys():
self.loadAnims(anims[partName], partName)
else:
# else it is not multipart
self.loadAnims(anims)
# copy the scene graph elements of other else:
otherCopy = other.copyTo(hidden) # act like a copy constructor
# assign these elements to ourselve
self.assign(otherCopy) # copy the scene graph elements of other
self.setGeomNode(otherCopy.getChild(0)) otherCopy = other.copyTo(hidden)
# assign these elements to ourselve
# copy the part dictionary from other self.assign(otherCopy)
self.__copyPartBundles(other) self.setGeomNode(otherCopy.getChild(0))
# copy the anim dictionary from other # copy the part dictionary from other
self.__copyAnimControls(other) self.__copyPartBundles(other)
# copy the anim dictionary from other
self.__copyAnimControls(other)
return None
def __str__(self): def __str__(self):
"""__str__(self) """__str__(self)

View File

@ -7,8 +7,10 @@ class DistributedActor(DistributedNode.DistributedNode, Actor.Actor):
"""Distributed Actor class:""" """Distributed Actor class:"""
def __init__(self): def __init__(self):
pass try:
self.DistributedActor_initialized
except:
self.DistributedActor_initialized = 1
return None
def generateInit(self, di):
DistributedNode.DistributedNode.generateInit(self, di)

View File

@ -7,7 +7,11 @@ class DistributedNode(DistributedObject.DistributedObject, NodePath.NodePath):
"""Distributed Node class:""" """Distributed Node class:"""
def __init__(self): def __init__(self):
pass try:
self.DistributedNode_initialized
except:
self.DistributedNode_initialized = 1
return None
def generateInit(self, di): def generateInit(self, di):
DistributedObject.DistributedObject.generateInit(self, di) DistributedObject.DistributedObject.generateInit(self, di)

View File

@ -5,13 +5,17 @@ from PandaObject import *
class DistributedObject(PandaObject): class DistributedObject(PandaObject):
"""Distributed Object class:""" """Distributed Object class:"""
def __init__(self): def __init__(self):
pass try:
self.DistributedObject_initialized
except:
self.DistributedObject_initialized = 1
return None
def getDoId(self): def getDoId(self):
"""getDoId(self) """getDoId(self)
Return the distributed object id Return the distributed object id
""" """
return self.__doId return self.doId
def updateRequiredFields(self, cdc, di): def updateRequiredFields(self, cdc, di):
for i in cdc.allRequiredCDU: for i in cdc.allRequiredCDU: