I need to create a LerpPosHprInterval which uses a function to change the pos, and, following the examples that are explained in the manual, I wrote this very basic code:
But it doesn’t work: the interval doen’t start except if I don’t use a function for the position.
So, my issue is this: how can I do a working hpr pos interval using functions?
Thanks in advance
could you post the code and model??
that could help
Hmm, there does appear to be a bug in the interval code here. Looks like some code rot that has gone undetected for a while; I guess this feature isn’t often used.
Ah, I see the problem. Not code rot at all, just an undocumented design limitation.
When you use a function like this, you have to wrap the interval inside a Sequence or Parallel or something–it won’t play directly. So just do this:
David, your suggestion is right, but it doesn’t close my issue.
In fact I need to create an hpr pos interval which moves the node following a curve line.
What should I do?
I have read about it but I need to generate the path by a python function that allows me to set curve path to an object and not by importing it from egg files.
Is there a faster way or the Mopathnterval is the only solution?
The easiest and simple way is to specify posHprIntervals between all points. Put them into one Sequence and just play it.
maybe something like this:
interval1 = node.posHprInterval(1, pos = point1Pos, hpr = (1,1,1))
interval2 = node.posHprInterval(1, pos = point2Pos, hpr = (1,1,1))
seq = Sequence(interval1, interval2)
or, in case you want to use mopath… feel free to look at my snippset
just create an instance of that class, add as many points as you want, and use getNodepath. the nodepath you get can directly be fed to the mopath interval.
the sequence gives me this error:
StandardError: using deprecated CInterval.play() interface
It was a typo. Call start() instead of play().
ThomasEgi, thanks, it works
Yes, calling start instead of play it works, but I think I’ll use mopath because I need to define a curve and with sequences it seems harder.
Thanks at all