[x3d-public] STEP interpolation, was Blender > Exporting rig transforms to HAnim?

Andreas Plesch andreasplesch at gmail.com
Wed Jul 19 18:56:43 PDT 2023


Hi Joe,

On Wed, Jul 19, 2023 at 3:34 PM Joseph D Williams <joedwil at earthlink.net> wrote:
> From: Andreas Plesch
> Sent: Wednesday, July 19, 2023 8:40 AM
> To: Joseph D Williams
> Cc: Michalis Kamburelis; X3D Graphics public mailing list
> Subject: Re: STEP interpolation, was Blender > Exporting rig transforms to HAnim?
> On Wed, Jul 19, 2023 at 12:26 AM Joseph D Williams
>
> <joedwil at earthlink.net> wrote:
>
> > OK, I have master TimeSensor and a master BooleanSequencer that connect to various other sequencers and timer/trigger/conversion utilities to control and monitor stuffs. I need a reliable stream of time signals for ‘analog’ operations and a reliable stream of Boolean signals for my ‘digital’ controls . Just seems like if I need a true event at 0  0.2 0.4 and 0.6 and 1 then I shouldn’t  have to do any coding tricks like setting a quick false.
>
> >>I guess the question still would be in which situation a true event would be really needed if there was no change.
>
> Ok, thanks Andreas but I am relying an SFTime => SFBool event happening at some key, not that the event has happened in the past. For example the previous event may have set a state that needs the next event.
>
> And an added item, what happens with next and previous if no change. I do think I want a certain next or previous event, even if same as current.
>
> >>I can see that an IntegerSequencer could be linked to step to the next integer for a Switch node which is useful.
>
> Great, that is the point. Expected ‘new’ logic signals at certain keys that author defines. For this, I would say that the sequencer is not working right if it sends multiple events for the same key, which is essentially what is happening if the event is set at every fraction_changed.
>
> >>In x3dom, sequencers in contrast to interpolators will send a value_changed event even if the value did not actually change, as long as the fraction is in the next interval. This will accommodate the described scenario.
>
> I’m not clear about how many events get sent. I think I want only one event to get sent per key, even if the time is a bit late for the key that starts the current interval.

We agree on how a Sequencer should function. What you describe is
exactly how x3dom is sending events: one per key (really per interval
between keys because the fraction may not be exactly at a key), even
if unchanged relative to the previously emitted value. Next and
Previous inputs always trigger output.

> Is a new event sent, even same as previous at every set_fraction and next and previous? To me that seems like I am generating more events that l need. I only need a new event at certain keys and at next and previous.

Agreed, only one event per key.

> >>So it is possible that STEP mode for interpolators should also behave like this, eg. always generate an output event if the fraction is in a new key interval.
  >
> Right, I want to know that when I am at a certain key, I get an event. I am currently in the interval between the previous and next, and say I don’t need to know about that anymore, I have dealt with the logic event at the time it happened. I am waiting for the next event.
>
> However, I might see that if the current set_fraction is slow relative to the previous key and the previous key has not actually been sent, then maybe I want it to send a new event, so to get the state caught up with a ‘past’ key. Or else I want to know about that and fix timing somehow.

Missing intervals is always possible due to lack of performance. I do
not think X3D currently has a way to detect skipped intervals. The
browser reports overall fps.

> For some reason I am still wanting to reduce events that are not needed and only get new events when requested.
>

Yes, this seems more deterministic than sending events as fast as possible.

> Then, for other parameter types that actually get interpolated I will probably want to always send new event at every set_fraction. For the Step type interpolators, since they may be involved in rendering or animations, then maybe optional for event every set_fraction or only at keys.
>
> >On the other hand this behaviour seems only useful for Boolean and Integer values for which there is no Interpolator (because they cannot be interpolated).
>
> Thanks for this.
>
> SFBool|SFFloat => SFBool

I have to admit that was a bit too concise for me to follow.

> I think I can depend on SFTime, and in this case SFFloat, signals and I want to link that as closely as possible to timing of logic signals. That means I want a certain logic signal at a specified time if and only if I actually ask for it. The objective is to be able to keep all the correct parameters in the correct frame.

>
> > But maybe there is a more dependable way to get that. Other types of parameter interpolators?
>
> Yes,  looks like a lot of ways to hook up those Event Utilities.
>
> Objective for this: 3) emit value_changed Only once at each key even if there is no change. And, sent once if set_fraction is past key in new interval and the event for this interval has not been set (a potential problem, but just to be safe?).

Yes, this applies to sequencers. I suppose the question is if it also
should apply STEP interpolators, and therefore also to all
interpolators for consistency. It seems as if it perhaps should but
that would be a slight departure from current practice.

An example of a PositionInterpolator where value_changed events are
needed for two subsequent keys even if the value does not actually
change would be good. This is different from Michalis' example which
actually needs output events for each input event.

Thanks, Andreas

> Joe



More information about the x3d-public mailing list