[x3d-public] Turning on and off simultaneous animations individually
John Carlson
yottzumm at gmail.com
Sat Dec 7 16:07:13 PST 2024
Figuring how to do what Holger proposes, with Python and ElementTree might
be difficult. I haven’t analyzed it yet. I have known it’s an issue.
What I will probably do is collect all TouchSensors and all
HAnimDisplacers/ScalarInterpolators, and also figure out how to send 0
SFFloat events, probably with a Script. Then generate lots of ROUTEs for
routing out of the Script to the displacers/interpolators, and lots of
ROUTEs from the TouchSensors to the Script when a Sensor is toggled on or
off.
Also, visual feedback in the menu as to which items are selected is also a
goal.
What I’d like to do is prioritize resetting and multiple simultaneous
animations over a single TimeSensor. I know a single TimeSensor is highly
desirable! What I’d like to accomplish is get all the ROUTEs we need, and
then figure out what needs to be in Switches, with the understanding that
nodes will still be active in all Switch choices, even if not visible.
Other possibilities like putting displacers or interpolators in Switches
are being considered.
I do like the idea of adding and removing a single ROUTE leading to a
cascade for each facial expression attractive. Once we get toggling
multiple animations on and off, I’ll tackle that. There may be a need for
a way to merge events, like an AND gate.
Here’s the next question. Do we really want to hard reset the animation
when animation selection changes? Ideally, the animation being unselected
would be reset to 0 (slowly).
So before resetting, I will work on toggling individual animations, such
that any subset can be selected.
There’s lots of important work to explore here.
John
On Sat, Dec 7, 2024 at 5:12 PM Holger Seelig <holger.seelig at yahoo.de> wrote:
> The menu is working. The only thing I would change is to send a SFFloat 0
> to all interpolators if you click any TouchSensor, to reset all weights.
>
> Holger
>
> --
> Holger Seelig
> Leipzig, Germany
>
> holger.seelig at yahoo.de
> https://create3000.github.io/x_ite/
>
> Am 08.12.2024 um 00:06 schrieb John Carlson <yottzumm at gmail.com>:
>
> I’m on board with multiple TimeSensors, but Joe is saying one TimeSensor.
> *shrugs*
>
> The link previously sent does this. I really need to figure out how to
> select multiple animations at the same time. That’s harder, and resetting
> each animation may be required for a good result.
>
> I think the issue is that the weight in the HAnimDisplacer doesn’t get
> reset.
>
> John
> On Sat, Dec 7, 2024 at 4:08 PM Holger Seelig <holger.seelig at yahoo.de>
> wrote:
>
>> With animations, it is actually usual to only have as many TimeSensor
>> nodes as there are animations and then switch them on and off one after the
>> other by toggling the *enabled* field, or via *startTime* and *stopTime*.
>> The *fraction_changed* field of each TimeSensor node can also be connected
>> to several interpolators, which is more optimal.
>>
>> Holger
>>
>> --
>> Holger Seelig
>> Leipzig, Germany
>>
>> holger.seelig at yahoo.de
>> https://create3000.github.io/x_ite/
>>
>> Am 07.12.2024 um 22:58 schrieb John Carlson <yottzumm at gmail.com>:
>>
>> What I get from that is I have to keep a list of ROUTEs for each
>> animation and add and remove them as each facial animation is toggled.
>>
>> My argument is to possibly change X3D semantics to go along with what the
>> AI suggested, such that ROUTEs can be enabled/disabled by including them in
>> Switches. But perhaps I can do something with addChildren and
>> removeChildren without using SAI?
>>
>> I’m stumbling around for answers which are probably in event utilities,
>> except in a much less understandable way. I’m looking for something
>> straightforward. If anyone has a mechanism to enable HAnimDisplacers in
>> groups without Switch, how did you do it?
>>
>> At some point, I just try it and see what happens. I’m wondering if
>> someone else has solved this without Switches.
>>
>> John
>>
>> On Sat, Dec 7, 2024 at 3:41 PM Holger Seelig via x3d-public <
>> x3d-public at web3d.org> wrote:
>>
>>> Routes are not part of the scene-graph. They exist outside of it. Every
>>> X3DExecutionContext has a list of all routes:
>>>
>>>
>>> https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#ExecutionContextServices
>>>
>>> Holger
>>>
>>> --
>>> Holger Seelig
>>> Leipzig, Germany
>>>
>>> holger.seelig at yahoo.de
>>> https://create3000.github.io/x_ite/
>>>
>>> Am 07.12.2024 um 22:16 schrieb John Carlson via x3d-public <
>>> x3d-public at web3d.org>:
>>>
>>> Okay, I’m attempting to read the spec:
>>>
>>> “All nodes under a Switch continue to receive and send events
>>> regardless of the value of *whichChoice*. For example, if an active
>>> TimeSensor is contained within an inactive choice of a Switch, the
>>> TimeSensor sends events regardless of the Switch's state.”
>>>
>>> So I’m guessing that ROUTEs are not nodes, and thus are susceptible to
>>> stop receiving and sending events in a Switch.
>>>
>>> I don’t even know if ROUTEs can send and receive events. Sure, they can
>>> transmit or transfer events.
>>>
>>> Clarification in some place in the standard is welcome!
>>>
>>>
>>> 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
>>>>>
>>>> _______________________________________________
>>> x3d-public mailing list
>>> x3d-public at web3d.org
>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>
>>>
>>> _______________________________________________
>>> x3d-public mailing list
>>> x3d-public at web3d.org
>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20241207/e1eee718/attachment-0001.html>
More information about the x3d-public
mailing list