mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
add forceUpdate
This commit is contained in:
parent
af62a2ad3c
commit
6afb9a87ab
@ -34,7 +34,7 @@ class ActorInterval(Interval.Interval):
|
|||||||
def __init__(self, actor, animName, loop=0, duration=None,
|
def __init__(self, actor, animName, loop=0, duration=None,
|
||||||
startTime=None, endTime=None,
|
startTime=None, endTime=None,
|
||||||
startFrame=None, endFrame=None,
|
startFrame=None, endFrame=None,
|
||||||
playRate=1.0, name=None):
|
playRate=1.0, name=None, forceUpdate=0):
|
||||||
"""__init__(name)
|
"""__init__(name)
|
||||||
"""
|
"""
|
||||||
# Generate unique id
|
# Generate unique id
|
||||||
@ -45,6 +45,7 @@ class ActorInterval(Interval.Interval):
|
|||||||
self.animName = animName
|
self.animName = animName
|
||||||
self.controls = self.actor.getAnimControls(self.animName)
|
self.controls = self.actor.getAnimControls(self.animName)
|
||||||
self.loopAnim = loop
|
self.loopAnim = loop
|
||||||
|
self.forceUpdate = forceUpdate
|
||||||
|
|
||||||
# If no name specified, use id as name
|
# If no name specified, use id as name
|
||||||
if (name == None):
|
if (name == None):
|
||||||
@ -126,6 +127,8 @@ class ActorInterval(Interval.Interval):
|
|||||||
|
|
||||||
control.pose(frame)
|
control.pose(frame)
|
||||||
|
|
||||||
|
if self.forceUpdate:
|
||||||
|
self.actor.update()
|
||||||
self.state = CInterval.SStarted
|
self.state = CInterval.SStarted
|
||||||
self.currT = t
|
self.currT = t
|
||||||
|
|
||||||
@ -142,6 +145,8 @@ class ActorInterval(Interval.Interval):
|
|||||||
else:
|
else:
|
||||||
for control in self.controls:
|
for control in self.controls:
|
||||||
control.pose(self.endFrame)
|
control.pose(self.endFrame)
|
||||||
|
if self.forceUpdate:
|
||||||
|
self.actor.update()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Otherwise, the user-specified duration determines which
|
# Otherwise, the user-specified duration determines which
|
||||||
|
Loading…
x
Reference in New Issue
Block a user