mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-07 12:23:16 -04:00
fixed a crash with new loadAnims function
This commit is contained in:
parent
d1843ea81a
commit
b4f7896e0c
@ -1728,7 +1728,9 @@ class Actor(DirectObject, NodePath):
|
|||||||
to 'lodRoot' for non-LOD actors) and dict of corresponding
|
to 'lodRoot' for non-LOD actors) and dict of corresponding
|
||||||
anims in the form animName:animPath{}
|
anims in the form animName:animPath{}
|
||||||
"""
|
"""
|
||||||
|
reload = True
|
||||||
if (lodName == 'all'):
|
if (lodName == 'all'):
|
||||||
|
reload = False
|
||||||
lodNames = self.switches.keys()
|
lodNames = self.switches.keys()
|
||||||
lodNames.sort()
|
lodNames.sort()
|
||||||
for i in range(0,len(lodNames)):
|
for i in range(0,len(lodNames)):
|
||||||
@ -1740,13 +1742,17 @@ class Actor(DirectObject, NodePath):
|
|||||||
(anims, partName, lodNames[0]))
|
(anims, partName, lodNames[0]))
|
||||||
|
|
||||||
firstLoad = True
|
firstLoad = True
|
||||||
for lName in lodNames:
|
if not reload:
|
||||||
try:
|
try:
|
||||||
self.__animControlDict[lName][partName]
|
self.__animControlDict[lodNames[0]][partName]
|
||||||
firstLoad = False
|
firstLoad = False
|
||||||
except:
|
except:
|
||||||
|
pass
|
||||||
|
for lName in lodNames:
|
||||||
|
if firstLoad:
|
||||||
self.__animControlDict.setdefault(lName, {})
|
self.__animControlDict.setdefault(lName, {})
|
||||||
self.__animControlDict[lName].setdefault(partName, {})
|
self.__animControlDict[lName].setdefault(partName, {})
|
||||||
|
|
||||||
for animName, filename in anims.items():
|
for animName, filename in anims.items():
|
||||||
# make sure this lod is in anim control dict
|
# make sure this lod is in anim control dict
|
||||||
for lName in lodNames:
|
for lName in lodNames:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user