return None for getDuration() if __animControlDict is empty

This commit is contained in:
Josh Wilson 2008-04-10 01:03:58 +00:00
parent a667e91dce
commit 9191f85b85

View File

@ -756,13 +756,13 @@ class Actor(DirectObject, NodePath):
If no anim is given, find the current anim for the part. If no anim is given, find the current anim for the part.
NOTE: Returns info only for an arbitrary LOD NOTE: Returns info only for an arbitrary LOD
""" """
# use the first lod if self.__animControlDict:
lodName = self.__animControlDict.keys()[0] # use the first lod
controls = self.getAnimControls(animName, partName) lodName = self.__animControlDict.keys()[0]
if len(controls) == 0: controls = self.getAnimControls(animName, partName)
return None if controls:
return controls[0].getPlayRate()
return controls[0].getPlayRate() return None
def setPlayRate(self, rate, animName, partName=None): def setPlayRate(self, rate, animName, partName=None):
"""setPlayRate(self, float, string, string=None) """setPlayRate(self, float, string, string=None)