You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to create a quick workaround solution for #1616, a LerpFunctionInterval() can be used with a duration of 0.0. The idea is, when the Interval gets triggered and returns fromData, it has been played backwards or the cursor of the interval has been set before the position of the interval building block.
At the moment, when the duration is 0.0, the interval returns the toData when played back in both directions (playRate >0 and <0). The expected behaviour is that it returns toData when it gets played back forwards, and fromData when it gets played back backwards, to reset the data range.
The expected behaviour works when the duration is set >0.0, e. g. 0.000000000000001.
Steps to Reproduce
Reproducer:
from panda3d.core import *
from direct.showbase.ShowBase import ShowBase
from direct.interval.FunctionInterval import *
from direct.interval.MetaInterval import *
from direct.interval.LerpInterval import *
class Test(ShowBase):
def __init__(self):
ShowBase.__init__(self)
self.accept('1', self.one)
self.accept('2', self.two)
def one(self):
print('pressed 1')
w1 = Wait(2.0)
w2 = Wait(2.0)
fi = LerpFunctionInterval(self.fi_func, 0.0000000000000000000000000000, 0.0, 1.0)
#fi = Func(self.fi_func) # this will/should only trigger in forward direction
self.seq = Sequence(w1, fi, w2)
self.seq.start()
def fi_func(self, a):
print('fi_func triggered')
if a == 1.0:
print('should only print on forward')
if a == 0.0:
print('should only print on backward')
print(f'a is {a}')
print(self.seq.getT())
def two(self):
print('pressed 2')
self.seq.setPlayRate(-1.0)
self.seq.resume()
player = Test()
player.run()
Environment
Operating system: Windows 8.1
System architecture: x86_64
Panda3D version: master, current revision
Installation method: built from source
Python version (if using Python): 3.8.18
Compiler (if using C++): MSVC 14.0 (VS 2015)
The text was updated successfully, but these errors were encountered:
Description
In order to create a quick workaround solution for #1616, a LerpFunctionInterval() can be used with a duration of 0.0. The idea is, when the Interval gets triggered and returns
fromData
, it has been played backwards or the cursor of the interval has been set before the position of the interval building block.At the moment, when the duration is 0.0, the interval returns the
toData
when played back in both directions (playRate
>0 and <0). The expected behaviour is that it returnstoData
when it gets played back forwards, andfromData
when it gets played back backwards, to reset the data range.The expected behaviour works when the duration is set >0.0, e. g. 0.000000000000001.
Steps to Reproduce
Reproducer:
Environment
The text was updated successfully, but these errors were encountered: