mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
fix update() some more
This commit is contained in:
parent
d7ec81bcea
commit
668610700d
@ -649,8 +649,7 @@ class Actor(DirectObject, NodePath):
|
|||||||
if center != None:
|
if center != None:
|
||||||
self.__LODNode.node().setCenter(center)
|
self.__LODNode.node().setCenter(center)
|
||||||
|
|
||||||
def update(self, lod=0, animName=None, partName='modelRoot',
|
def update(self, lod=0, partName=None, lodName=None, force=False):
|
||||||
lodName=None, force=False):
|
|
||||||
""" Updates all of the Actor's joints in the indicated LOD.
|
""" Updates all of the Actor's joints in the indicated LOD.
|
||||||
The LOD may be specified by name, or by number, where 0 is the
|
The LOD may be specified by name, or by number, where 0 is the
|
||||||
highest level of detail, 1 is the next highest, and so on.
|
highest level of detail, 1 is the next highest, and so on.
|
||||||
@ -667,14 +666,22 @@ class Actor(DirectObject, NodePath):
|
|||||||
lodNames = [lodName]
|
lodNames = [lodName]
|
||||||
|
|
||||||
anyChanged = False
|
anyChanged = False
|
||||||
if (lod < len(lodNames)):
|
if lod < len(lodNames):
|
||||||
partBundle = self.getPartBundle(partName, lodNames[lod])
|
lodName = lodNames[lod]
|
||||||
if force:
|
if partName == None:
|
||||||
if partBundle.forceUpdate():
|
partBundleDict = self.__partBundleDict[lodName]
|
||||||
anyChanged = True
|
partNames = partBundleDict.keys()
|
||||||
else:
|
else:
|
||||||
if partBundle.update():
|
partNames = [partName]
|
||||||
anyChanged = True
|
|
||||||
|
for partName in partNames:
|
||||||
|
partBundle = self.getPartBundle(partName, lodNames[lod])
|
||||||
|
if force:
|
||||||
|
if partBundle.forceUpdate():
|
||||||
|
anyChanged = True
|
||||||
|
else:
|
||||||
|
if partBundle.update():
|
||||||
|
anyChanged = True
|
||||||
else:
|
else:
|
||||||
self.notify.warning('update() - no lod: %d' % lod)
|
self.notify.warning('update() - no lod: %d' % lod)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user