[x3d-public] Turning on and off simultaneous animations individually
John Carlson
yottzumm at gmail.com
Sat Feb 1 16:22:55 PST 2025
What I’m trying to achieve is pressing multiple buttons, and resetting all
transforms when any button is clicked (either on or off).
On Sat, Feb 1, 2025 at 5:55 PM Andreas Plesch <andreasplesch at gmail.com>
wrote:
> Both x-ite and x3dom behave the same. Each animation is independent and
> resets individually after it is stopped and then restarted.
>
> It seems you aim for another behaviour with some dependency between
> animations.
>
> -Andreas
>
> On Sat, Feb 1, 2025 at 4:35 PM John Carlson <yottzumm at gmail.com> wrote:
>
>> I'm trying very hard to look at this, but I'm not seeing the animation
>> reset when one turns an animation off. Perhaps I should try X3DOM?
>>
>>
>> https://create3000.github.io/x_ite/playground/?url=https://gist.githubusercontent.com/andreasplesch/6fd2fd0b0f745b3549b74150b7752d89/raw/c02637b602f9241c9ea73b5ad859ab330c071e25/toggleReset.x3d
>>
>> Trying to compare with:
>>
>> https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/6fd2fd0b0f745b3549b74150b7752d89/raw/c02637b602f9241c9ea73b5ad859ab330c071e25/toggleReset.x3d
>>
>>
>> If I click multiple checkboxes, AFAICT, the whole animation doesn't
>> reset. I want ALL animations to reset when a button is pressed in, and
>> when any button is unpressed.
>>
>> This is a better link for mine:
>>
>>
>> https://create3000.github.io/x_ite/playground/?url=https://raw.githubusercontent.com/coderextreme/ci2had/refs/heads/main/resources/CleanedYouClocks.x3d
>>
>> So probably there needs to be a global start/stop time for all enabled
>> TimeSensors?
>>
>> I see you have two ProtoDeclares and I only have one. I might be able to
>> do something like that.
>>
>> Hmm!
>>
>> John
>>
>>
>> On Sat, Feb 1, 2025 at 2:35 PM Andreas Plesch <andreasplesch at gmail.com>
>> wrote:
>>
>>> Hi John,
>>>
>>>
>>> https://gist.githubusercontent.com/andreasplesch/6fd2fd0b0f745b3549b74150b7752d89/raw/c02637b602f9241c9ea73b5ad859ab330c071e25/toggleReset.x3d
>>>
>>> resets the animation everytime it is restarted after stopping.
>>>
>>> The only change is replacing resumeTime and pauseTime with startTime and
>>> stopTime .
>>> Instead of a toggle button, it would be possible to have two separate
>>> buttons, one for stopping and one for resetting.
>>>
>>> This may be what you are looking for, -Andreas
>>>
>>> On Sat, Feb 1, 2025 at 6:16 AM John Carlson <yottzumm at gmail.com> wrote:
>>>
>>>> Andreas,
>>>>
>>>> For extra credit, reset the animation each time a toggle button is
>>>> pressed. So far, it looks dubious without scripting.
>>>>
>>>> Got a reliable solution for resetting the animations?
>>>>
>>>> On Wed, Dec 11, 2024 at 3:08 PM Andreas Plesch <andreasplesch at gmail.com>
>>>> wrote:
>>>>
>>>>> Hi John, group,
>>>>>
>>>>> Exploring how far one could get without X3D scripts and only using
>>>>> event utilities, let me share an example of a panel of individually
>>>>> controlled toggle buttons which then drive a simple assemblage of
>>>>> individually animated spheres:
>>>>>
>>>>>
>>>>> https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/6fd2fd0b0f745b3549b74150b7752d89/raw/37f94755f763ecc9a0439a0dab2f32441e8b12aa/toggleButtonExample.x3d
>>>>>
>>>>> https://gist.github.com/andreasplesch/6fd2fd0b0f745b3549b74150b7752d89
>>>>>
>>>>> There are two sections, one for the control panel and one for the
>>>>> controlled assemblage. Each section has a Proto as the main building
>>>>> block for simple reuse. The toggle button Proto is based on wrapping,
>>>>> synced Integer and BooleanSequencers for color toggling and outputting
>>>>> useful events corresponding to the state of the button. This is
>>>>> probably the most useful and interesting part. Everything else is more
>>>>> for demonstration.
>>>>> There is also an animatedBlob Proto which shows how animations might
>>>>> be controlled by routing events from a toggle button.
>>>>> The animations all start out in sync after being enabled by a button
>>>>> but then can be individually paused and resumed for arbitrarily
>>>>> pulsating patterns.
>>>>>
>>>>> Event utilities generally turn out to require verbose declarative
>>>>> code, compared to logic in scripts but that can be mitigated to a good
>>>>> extent by Protos which also help with scene structure.
>>>>>
>>>>> There is one standard related question which came up for me and I
>>>>> think that may have been raised before. The question is what the
>>>>> value_changed should be after a Sequencer receives a first 'next'
>>>>> event without ever having received a set_fraction or other event. In
>>>>> this case there is not a next value because there was never any value
>>>>> in the first place. Both x3dom and x_ite currently output the first
>>>>> keyValue and set the first key as the current key in this case.
>>>>>
>>>>> x_ite and x3dom work almost the same with the example. x_ite
>>>>> immediately starts the animations where x3dom waits as intended until
>>>>> the related Timesensors receive a first 'enabled' event. There may be
>>>>> a simple fix for x_ite use but I could not find it.
>>>>>
>>>>> Thanks, -Andreas
>>>>>
>>>>> On Sat, Dec 7, 2024 at 4:37 PM John Carlson <yottzumm at gmail.com>
>>>>> wrote:
>>>>> >
>>>>> > So here’s an interesting question: If I have the same ROUTE in two
>>>>> different choices in a Switch, is one of them ignored?
>>>>> >
>>>>> > Not that I’m going to do that.
>>>>> >
>>>>> > I’m probably going to try using a Switch unless someone says that
>>>>> ROUTEs are always active in a Switch, disagreeing with the AI.
>>>>> >
>>>>> > John
>>>>> >
>>>>> > On Sat, Dec 7, 2024 at 3:29 PM John Carlson <yottzumm at gmail.com>
>>>>> wrote:
>>>>> >>
>>>>> >> From X3D4:
>>>>> >>
>>>>> >>
>>>>> >> 4.4.8.2 Routes
>>>>> >>
>>>>> >> Routes are not nodes.
>>>>> >>
>>>>> >> [snip]
>>>>> >>
>>>>> >> 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.
>>>>> >>
>>>>> >>
>>>>> >> 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???
>>>>> >>
>>>>> >> John
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> On Sat, Dec 7, 2024 at 2:40 PM John Carlson <yottzumm at gmail.com>
>>>>> wrote:
>>>>> >>>
>>>>> >>> Would it be possible to put an animation’s ROUTEs in a Switch that
>>>>> could be toggled on and off with a boolean toggle?
>>>>> >>>
>>>>> >>> Google AI says:
>>>>> >>>
>>>>> >>> 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.
>>>>> >>>
>>>>> >>> I didn’t realize that statements were affected by Switch.
>>>>> >>>
>>>>> >>> John
>>>>> >>>
>>>>> >>> On Sat, Dec 7, 2024 at 1:43 PM John Carlson <yottzumm at gmail.com>
>>>>> wrote:
>>>>> >>>>
>>>>> >>>> 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.
>>>>> >>>>
>>>>> >>>> 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).
>>>>> >>>>
>>>>> >>>> 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).
>>>>> >>>>
>>>>> >>>> Here’s what we currently have
>>>>> >>>>
>>>>> https://github.com/coderextreme/ci2had/blob/main/resources/SingleMenuJin.x3d
>>>>> >>>>
>>>>> >>>> As you can see, lots of duplication.
>>>>> >>>>
>>>>> >>>> Viewed best in FreeWRL and Sunrize/X_ITE.
>>>>> >>>>
>>>>> >>>> John
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Andreas Plesch
>>>>> Waltham, MA 02453
>>>>>
>>>>
>>>
>>> --
>>> Andreas Plesch
>>> Waltham, MA 02453
>>>
>>
>
> --
> Andreas Plesch
> Waltham, MA 02453
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250201/c9e8bbcd/attachment.html>
More information about the x3d-public
mailing list