mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -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
|
||||
for animName, anim in animDict.items():
|
||||
if isinstance(anim.animControl, AnimControl) and anim.animControl.isPlaying():
|
||||
if anim.animControl and anim.animControl.isPlaying():
|
||||
return animName
|
||||
|
||||
# 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
|
||||
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()
|
||||
|
||||
# we must have found none, or gotten an error
|
||||
@ -1572,7 +1572,7 @@ class Actor(DirectObject, NodePath):
|
||||
pass
|
||||
else:
|
||||
# bind the animation first if we need to
|
||||
if not isinstance(anim.animControl, AnimControl):
|
||||
if not anim.animControl:
|
||||
self.__bindAnimToPart(animName, partName, lodName)
|
||||
return anim.animControl
|
||||
|
||||
@ -1648,7 +1648,7 @@ class Actor(DirectObject, NodePath):
|
||||
# get all playing animations
|
||||
for thisPart, animDict in animDictItems:
|
||||
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)
|
||||
else:
|
||||
# get the named animation only.
|
||||
|
Loading…
x
Reference in New Issue
Block a user