mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
don't use isinstance(AnimControl)
This commit is contained in:
parent
4d59f04134
commit
1900e24dc1
@ -831,7 +831,7 @@ class Actor(DirectObject, NodePath):
|
|||||||
|
|
||||||
# loop through all anims for named part and find if any are playing
|
# loop through all anims for named part and find if any are playing
|
||||||
for animName, anim in animDict.items():
|
for animName, anim in animDict.items():
|
||||||
if isinstance(anim.animControl, AnimControl) and anim.animControl.isPlaying():
|
if anim.animControl and anim.animControl.isPlaying():
|
||||||
return animName
|
return animName
|
||||||
|
|
||||||
# we must have found none, or gotten an error
|
# we must have found none, or gotten an error
|
||||||
@ -856,7 +856,7 @@ class Actor(DirectObject, NodePath):
|
|||||||
|
|
||||||
# loop through all anims for named part and find if any are playing
|
# loop through all anims for named part and find if any are playing
|
||||||
for animName, anim in animDict.items():
|
for animName, anim in animDict.items():
|
||||||
if isinstance(anim.animControl, AnimControl) and anim.animControl.isPlaying():
|
if anim.animControl and anim.animControl.isPlaying():
|
||||||
return anim.animControl.getFrame()
|
return anim.animControl.getFrame()
|
||||||
|
|
||||||
# we must have found none, or gotten an error
|
# we must have found none, or gotten an error
|
||||||
@ -1572,7 +1572,7 @@ class Actor(DirectObject, NodePath):
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
# bind the animation first if we need to
|
# bind the animation first if we need to
|
||||||
if not isinstance(anim.animControl, AnimControl):
|
if not anim.animControl:
|
||||||
self.__bindAnimToPart(animName, partName, lodName)
|
self.__bindAnimToPart(animName, partName, lodName)
|
||||||
return anim.animControl
|
return anim.animControl
|
||||||
|
|
||||||
@ -1648,7 +1648,7 @@ class Actor(DirectObject, NodePath):
|
|||||||
# get all playing animations
|
# get all playing animations
|
||||||
for thisPart, animDict in animDictItems:
|
for thisPart, animDict in animDictItems:
|
||||||
for anim in animDict.values():
|
for anim in animDict.values():
|
||||||
if isinstance(anim.animControl, AnimControl) and anim.animControl.isPlaying():
|
if anim.animControl and anim.animControl.isPlaying():
|
||||||
controls.append(anim.animControl)
|
controls.append(anim.animControl)
|
||||||
else:
|
else:
|
||||||
# get the named animation only.
|
# get the named animation only.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user