<div dir="auto">Andreas,</div><div dir="auto"><br></div><div dir="auto">I’m dealing with a variable number of HAnimDisplacers each set being run by ScalarInterpolators.  I’d love to be able to send an event to an MFNode, but I guess that’s not possible without scripts.  I might as well use add/delete Route.</div><div dir="auto"><br></div><div dir="auto">My original plan was to have dummy HAnimDisplacers to fill in,  but that idea was nixed.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Dec 11, 2024 at 3:08 PM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi John, group,<br>
<br>
Exploring how far one could get without X3D scripts and only using<br>
event utilities, let me share an example of a panel of individually<br>
controlled toggle buttons which then drive a simple assemblage of<br>
individually animated spheres:<br>
<br>
<a href="https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/6fd2fd0b0f745b3549b74150b7752d89/raw/37f94755f763ecc9a0439a0dab2f32441e8b12aa/toggleButtonExample.x3d" rel="noreferrer" target="_blank">https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/6fd2fd0b0f745b3549b74150b7752d89/raw/37f94755f763ecc9a0439a0dab2f32441e8b12aa/toggleButtonExample.x3d</a><br>
<br>
<a href="https://gist.github.com/andreasplesch/6fd2fd0b0f745b3549b74150b7752d89" rel="noreferrer" target="_blank">https://gist.github.com/andreasplesch/6fd2fd0b0f745b3549b74150b7752d89</a><br>
<br>
There are two sections, one for the control panel and one for the<br>
controlled assemblage. Each section has a Proto as the main building<br>
block for simple reuse. The toggle button Proto is based on wrapping,<br>
synced Integer and BooleanSequencers for color toggling and outputting<br>
useful events corresponding to the state of the button. This is<br>
probably the most useful and interesting part. Everything else is more<br>
for demonstration.<br>
There is also an animatedBlob Proto which shows how animations might<br>
be controlled by routing events from a toggle button.<br>
The animations all start out in sync after being enabled by a button<br>
but then can be individually paused and resumed for arbitrarily<br>
pulsating patterns.<br>
<br>
Event utilities generally turn out to require verbose declarative<br>
code, compared to logic in scripts but that can be mitigated to a good<br>
extent by Protos which also help with scene structure.<br>
<br>
There is one standard related question which came up for me and I<br>
think that may have been raised before. The question is what the<br>
value_changed should be after a Sequencer receives a first 'next'<br>
event without ever having received a set_fraction or other event. In<br>
this case there is not a next value because there was never any value<br>
in the first place. Both x3dom and x_ite currently output the first<br>
keyValue and set the first key as the current key in this case.<br>
<br>
x_ite and x3dom work almost the same with the example. x_ite<br>
immediately starts the animations where x3dom waits as intended until<br>
the related Timesensors receive a first 'enabled' event. There may be<br>
a simple fix for x_ite use but I could not find it.<br>
<br>
Thanks, -Andreas<br>
<br>
On Sat, Dec 7, 2024 at 4:37 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br>
><br>
> So here’s an interesting question:  If I have the same ROUTE in two different choices in a Switch, is one of them ignored?<br>
><br>
> Not that I’m going to do that.<br>
><br>
> I’m probably going to try using a Switch unless someone says that ROUTEs are always active in a Switch, disagreeing with the AI.<br>
><br>
> John<br>
><br>
> On Sat, Dec 7, 2024 at 3:29 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br>
>><br>
>> From X3D4:<br>
>><br>
>><br>
>> 4.4.8.2 Routes<br>
>><br>
>> Routes are not nodes.<br>
>><br>
>> [snip]<br>
>><br>
>> Redundant routing is ignored. If an X3D file repeats a routing path, the second and subsequent identical routes are ignored. This also applies for routes created dynamically using the X3D SAI.<br>
>><br>
>><br>
>> Can someone clarify how statements are affected by Switches?  Can I have different choices of a PROTO inside a Switch?  Effectively changing ProtoBody content at run-time???<br>
>><br>
>> John<br>
>><br>
>><br>
>><br>
>> On Sat, Dec 7, 2024 at 2:40 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br>
>>><br>
>>> Would it be possible to put an animation’s ROUTEs in a Switch that could be toggled on and off with a boolean toggle?<br>
>>><br>
>>> Google AI says:<br>
>>><br>
>>> Yes, you can absolutely put "ROUTE" nodes within a "Switch" node in X3D; in fact, it's a common practice to use them together to dynamically control which set of connections (via ROUTE) are active depending on which child node of the Switch is currently selected.<br>
>>><br>
>>> I didn’t realize that statements were affected by Switch.<br>
>>><br>
>>> John<br>
>>><br>
>>> On Sat, Dec 7, 2024 at 1:43 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br>
>>>><br>
>>>> We are dealing with multiple facial animations.  The thing we want to do is combine animations using HAnimDisplacers.  Currently, our animations go from key = 0 to key = 1, (weight = 0 to weight = 1) and each animation is controlled by a single TimeSensor that we enable or disable.  What we want to do is enable multiple facial animations, yet retain a single TimeSensor.  I have done something with enabling multiple time sensors all at the same time.  So, ideally, we could toggle each facial animation individually.<br>
>>>><br>
>>>> Note that one can have multiple simultaneous HAnimDisplacer animations on a single Coordinate, they all add up just fine.  There’s no single animation per body part requirement as there is in other places in X3D (according to Michalis, from my understanding).<br>
>>>><br>
>>>> I don’t currently know how to individually toggle multiple animations without toggling multiple TimeSensors, so assistance is welcome!  Indeed, a multiple toggle button X3D example would be welcome (hopefully, something we can put in a scenegraph).<br>
>>>><br>
>>>> Here’s what we currently have<br>
>>>> <a href="https://github.com/coderextreme/ci2had/blob/main/resources/SingleMenuJin.x3d" rel="noreferrer" target="_blank">https://github.com/coderextreme/ci2had/blob/main/resources/SingleMenuJin.x3d</a><br>
>>>><br>
>>>> As you can see, lots of duplication.<br>
>>>><br>
>>>> Viewed best in FreeWRL and Sunrize/X_ITE.<br>
>>>><br>
>>>> John<br>
<br>
<br>
<br>
-- <br>
Andreas Plesch<br>
Waltham, MA 02453<br>
</blockquote></div></div>