[x3d-public] Turning on and off simultaneous animations individually
John Carlson
yottzumm at gmail.com
Tue Feb 4 14:15:52 PST 2025
Comments inline.
On Tue, Feb 4, 2025 at 3:23 PM Michalis Kamburelis <michalis.kambi at gmail.com>
wrote:
> Hi,
>
> Sorry for not following this thread from the start, I just saw a
> mention of castle-model-converter making warnings on the testcase. I
> confirm they also occur with latest Castle Model Viewer.
>
> Looking at the testcase, I think Castle Model Viewer/Converter
> warnings are right. They say:
>
> """
> X3D: X3D XML: <fieldValue> element references unknown field name
> "startTime"
> X3D: X3D XML: <fieldValue> element references unknown field name "stopTime"
> X3D: X3D XML: <fieldValue> element references unknown field name "enabled"
> """
>
> because you have XML elements
>
> <fieldValue name="startTime" />
> <fieldValue name="stopTime" />
> <fieldValue name="enabled" />
>
> inside the prototype instance of MenuItem (<ProtoInstance ....
> name="MenuItem">).
>
> But the prototype declaration (<ProtoDeclare name="MenuItem">) says
> these are "output only" events. They are "events", not fields, so
> strictly speaking they have no "persistent" value, at least that's how
> X3D specification treats them. (And that's how CGE implements them,
> events really hold no persistent value, they only pass values.)
>
> """
> <field name="startTime" accessType="outputOnly" type="SFTime"
> value='0' />
> <field name="stopTime" accessType="outputOnly" type="SFTime"
> value='0'/>
> <field name="enabled" accessType="outputOnly" type="SFBool"
> value='false'/>
> """
>
> I understand that for JS scripts, it may make sense to specify a value
> even for outputOnly field (if one accesses from JS Script a value of
> output event that wasn't yet generated, which I understand is possible
> from standard JS API), but that's X3DOM extension, as Andreas pointed
> out.
More recent versions have not included any Script nodes. That’s the main
current requirement.
>
>
> I don't think spec allows to specify values for such output events --
> again, they are not even "fields" using spec terminology, so
> "fieldValue" would be confusing :) The spec specifies "default value
> of an uninitialized xxx field" in
>
> https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/fieldTypes.html
> to serve as a fallback in edge-cases, like above.
Interesting take on events versus fields.
>
>
> Moreover, note that in this specific case, these do not seem to serve
> any purpose. XML elements
>
> <fieldValue name="startTime" />
> <fieldValue name="stopTime" />
> <fieldValue name="enabled" />
>
> .... do not actually contain any value :) ( Again, sorry for not
> following this thread from start -- I do not know how the file was
> generated/created. ) I looks like they should just be removed.
These <fieldValue>s are mentioned in ROUTEs outside the Proto. Search for
Reset and Reset_Clock, for example.
I will try to create a simple example, but this is super frustrating to get
anything beyond Sunrize and X_ITE working. Sunrize won’t allow me to pass
a TimeSensor USE into a Proto, and ROUTE to the TimeSensor inside the
Proto, so that’s super frustrating too. Maybe I should use
type=“TimeSensor” in the interface?
The time triggers inside the Proto pretty much require the use of
outputOnly. Suggestions for other options would be helpful. These lines
look problematic:
<TimeTrigger DEF='startTime'>
<IS> <connect nodeField='triggerTime' protoField='startTime'/> </IS>
</TimeTrigger>
<TimeTrigger DEF='stopTime'> <IS> <connect nodeField='triggerTime'
protoField='stopTime'/> </IS> </TimeTrigger>
<BooleanFilter DEF='veryTrue'> <IS> <connect nodeField='inputTrue'
protoField='enabled'/> </IS> </BooleanFilter>
Since I can’t “input” triggerTime, it requires that I use outputOnly.
> Regards,
> Michalis
>
> wt., 4 lut 2025 o 21:55 John Carlson <yottzumm at gmail.com> napisał(a):
> >
> > I have added default values in the ProtoDeclare for outputOnly fields,
> reverting back to passing out startTime, stopTime and enabled.
> >
> > Referring to this repository:
> >
> > https://github.com/coderextreme/ci2had/
> >
> > I primarily wish to get this working:
> https://github.com/coderextreme/ci2had/blob/main/resources/CleanedYouClocks.x3d,
> but first, I want to get ManyClocks.x3d working, because it precedes
> CleanedYouClocks.x3d, but feel free to get it working first (it's a cleaned
> up version).
> >
> > If all else fails, I'll probably strip out the Proto (ugh!).
> > --------------------------------------------------------------
> > I have confirmed that this doesn't animate:
> >
> >
> https://andreasplesch.github.io/Library/Viewer/index.html?url=https://raw.githubusercontent.com/coderextreme/ci2had/refs/heads/main/resources/ManyClocks.x3d
> > --------------------------------------------------------------
> > This does animate:
> >
> >
> https://create3000.github.io/x_ite/playground/?url=https://raw.githubusercontent.com/coderextreme/ci2had/refs/heads/main/resources/ManyClocks.x3d
> > ---------------------------------------------------------------
> > Castle Model Converter produces errors. The viewer doesn't animate,
> probably because I use HAnimDisplacers. There are no scripts, in an attempt
> to appease people who don't like scripts. We now have a good example that
> has HAnimDisplacers, but no scripts.
> >
> > $
> ~/Downloads/castle-model-viewer-5.3.0-win64-x86_64/castle-model-viewer/castle-model-converter.exe
> --validate resources/ManyClocks.x3d 2>&1 |sort -u
> > castle-model-converter: Warning: X3D: X3D XML: <fieldValue> element
> references unknown field name "enabled"
> > castle-model-converter: Warning: X3D: X3D XML: <fieldValue> element
> references unknown field name "startTime"
> > castle-model-converter: Warning: X3D: X3D XML: <fieldValue> element
> references unknown field name "stopTime"
> > Exception "Exception":
> > Validation failed (consult the warnings above), exiting with non-zero
> status
> > ---------------------------------------------------------------
> > FreeWRL kills JavaScript for some reason (there's no Script), but still
> doesn;'t animate (try pressing Fear).
> >
> > $ /c/Program\ Files\ \(x86\)/freeWRL/freeWRL.6.7/freeWRL.exe
> resources/ManyClocks.x3d
> >
> > MidiInWinMM::initialize: no MIDI input devices currently available.
> >
> > libfreewrl version 6.7.0
> > -h for commandline use
> > openGL version 4.6.0 NVIDIA 560.94
> > GLSL shader max version 4.60 NVIDIA 460
> > maximum texture size system/gpu: 32768 runtime/freewrl: 16384
> > processor architecture x64
> > maxiumum image texture units 32
> > depth bits 24
> > Skinning Method: GPU
> > calling kill_javascript()
> > done kill_javascript
> > Ending texture load thread gracefully
> > finalizeRenderSceneUpdateScene
> >
> ---------------------------------------------------------------------------------------------------
> > Schematron reports a bunch of problems, all of which I ignore. See
> attached. log and build.xml
> >
> ---------------------------------------------------------------------------------------------------
> > There are many info issues when validating with X3DJSAIL, but I'm not
> sure about this one:
> > $ java -cp ~/Downloads/X3DJSAIL.4.0.full.jar
> org.web3d.x3d.jsail.CommandLine -validate resources/ManyClocks.x3d|grep -v
> > info
> > [snip]
> > org.web3d.x3d.sai.InvalidFieldException: IndexedFaceSet containing
> TextureCoordinate node with 295 values must also include texCoordIndex or
> coordIndex field
> > at
> org.web3d.x3d.jsail.Geometry3D.IndexedFaceSet.validate(IndexedFaceSet.java:3756)
> > at org.web3d.x3d.jsail.Shape.Shape.validate(Shape.java:2060)
> > at
> org.web3d.x3d.jsail.Grouping.Transform.validate(Transform.java:2556)
> > at
> org.web3d.x3d.jsail.HAnim.HAnimSegment.validate(HAnimSegment.java:6175)
> > at
> org.web3d.x3d.jsail.HAnim.HAnimJoint.validate(HAnimJoint.java:7476)
> > at
> org.web3d.x3d.jsail.HAnim.HAnimJoint.validate(HAnimJoint.java:7476)
> > at
> org.web3d.x3d.jsail.HAnim.HAnimHumanoid.validate(HAnimHumanoid.java:6317)
> > at
> org.web3d.x3d.jsail.Grouping.Transform.validate(Transform.java:2556)
> > at org.web3d.x3d.jsail.Core.Scene.validate(Scene.java:869)
> > at org.web3d.x3d.jsail.Core.X3D.validate(X3D.java:4549)
> > at org.web3d.x3d.jsail.CommandLine.run(CommandLine.java:1098)
> > at org.web3d.x3d.jsail.CommandLine.main(CommandLine.java:242)
> >
> > I don't have a recent version of X3DJSAIL
> >
> > On Tue, Feb 4, 2025 at 2:22 PM Andreas Plesch <andreasplesch at gmail.com>
> wrote:
> >>
> >> Thanks, exactly what I was looking for.
> >>
> >> Best, Andreas
> >>
> >>
> >> On Tue, Feb 4, 2025, 2:01 PM Holger Seelig <holger.seelig at yahoo.de>
> wrote:
> >>>
> >>> The default value for a field is either specified for each node type
> or the default value for Script or ComposedShader node custom fields is
> defined in
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/fieldTypes.html.
> Mostly false, 0, „“, identity, ...
> >>>
> >>> A proto instance will inherit its default values from the proto
> declaration its fields. Fields such as outputOnly will normally have a
> default value from fieldTypes.html.
> >>>
> >>> There is an exception with X3DInterpolatorNode.value_changed:
> >>>
> >>>
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/components/interpolators.html#X3DInterpolatorNode
> >>>
> >>> If an X3DInterpolatorNode value_changed outputOnly field is read
> before it receives any inputs, keyValue[0] is returned if keyValue is not
> empty...
> >>>
> >>> Best regards,
> >>> Holger
> >>>
> >>> --
> >>> Holger Seelig
> >>> Leipzig, Germany
> >>>
> >>> holger.seelig at yahoo.de
> >>> https://create3000.github.io/x_ite/
> >>>
> >>> Am 04.02.2025 um 19:26 schrieb Andreas Plesch via x3d-public <
> x3d-public at web3d.org>:
> >>>
> >>> Hi John, all,
> >>>
> >>> It turns out that x3dom currently expects a default value for Proto
> fields even for outputOnly fields. This is due to how Proto fields are
> initialized. They always need to have a value. While the spec. does not
> require this, it seems still good practice to always define a default value
> in the ProtoInterface. There may be a case where an outputOnly field is
> used in ISing where a valid value would be expected. There may be other
> corner cases.
> >>>
> >>> Here is your example with added default values for outputOnly fields:
> >>>
> >>>
> https://andreasplesch.github.io/Library/Viewer/index.html?url=https://gist.githubusercontent.com/andreasplesch/af5ff3148c1159f71d34fb78c1f63024/raw/b3d4470107ab74e301ed48448ab2a4f4154672e0/ManyClocks_John.x3d
> >>>
> >>> This could be fixed in x3dom, by always setting some default value. Is
> there a list of recommended defaults for each data type if no other source
> of defaults is available? For SFTime it seems to be -1.
> >>>
> >>> -Andreas
> >>>
> >>>
> >>> On Mon, Feb 3, 2025 at 7:39 AM Andreas Plesch <andreasplesch at gmail.com>
> wrote:
> >>>>
> >>>> Hi John,
> >>>>
> >>>> On Mon, Feb 3, 2025 at 12:48 AM John Carlson <yottzumm at gmail.com>
> wrote:
> >>>>>
> >>>>> Andreas, "startTime" is an accessType outputOnly field, so why do I
> need to provide a value attribute in fieldValue? I'm kind of confused.
> I'm probably missing something in the spec.
> >>>>
> >>>>
> >>>> You are right, I only outlined scenarios where the accessType allows
> input or initialization..
> >>>> In the outputOnly case it is not necessary to provide a fieldValue
> node at all since there is no value which can be provided. Providing the
> node would indeed be confusing, to both the user code reader and any X3D
> browser.
> >>>> I believe the spec. is silent on this case in any encoding.
> >>>>
> >>>> Best, Andreas
> >>>>
> >>>>> Thanks for any clarification.
> >>>>>
> >>>>> I have finally enabled schematron on the project, but I'm finding it
> hard to understand the messages, and modifications that I make, while
> removing the immediate problems, seem to move the problems elsewhere.
> >>>>>
> >>>>> Explaining why I need a "startTime" fieldValue value is my main lack
> of understanding, but perhaps I need a whole review of accessType.
> >>>>>
> >>>>> Castle Model Converter reports:
> >>>>>
> >>>>> castle-model-converter: Warning: X3D: X3D XML: <fieldValue> element
> references unknown field name "enabled"
> >>>>> castle-model-converter: Warning: X3D: X3D XML: <fieldValue> element
> references unknown field name "startTime"
> >>>>> castle-model-converter: Warning: X3D: X3D XML: <fieldValue> element
> references unknown field name "stopTime"
> >>>>>
> >>>>> I will try providing a field value in the ProtoInterface
> >>>>>
> >>>>> If I "cleanup" enabled, startTime and stopTime, I get:
> >>>>>
> >>>>> castle-model-converter: Warning: VRML/X3D: Within prototype
> "MenuItem", event "inputTrue" references (by "IS" clause) non-existing
> event "enabled"
> >>>>> castle-model-converter: Warning: VRML/X3D: Within prototype
> "MenuItem", event "triggerTime" references (by "IS" clause) non-existing
> event "startTime"
> >>>>> castle-model-converter: Warning: VRML/X3D: Within prototype
> "MenuItem", event "triggerTime" references (by "IS" clause) non-existing
> event "stopTime"
> >>>>>
> >>>>> I guess what I conclude at this point is, startTime and stopTime are
> bad DEF names, but what about enabled as a field? The dominoes are falling.
> >>>>>
> >>>>> About your two scenarios in the other message, perhaps this is
> revealing.
> >>>>>
> >>>>> See attached attempt to fix original issue, which resulted in the
> above.
> >>>>>
> >>>>> John
> >>>>>
> >>>>> On Sun, Feb 2, 2025 at 3:59 PM Andreas Plesch <
> andreasplesch at gmail.com> wrote:
> >>>>>>
> >>>>>> I think x3dom, reasonably, expects a value for the fieldValue nodes:
> >>>>>>
> >>>>>> For example:
> >>>>>>
> >>>>>> <fieldValue name="startTime" />
> >>>>>>
> >>>>>> and others.
> >>>>>>
> >>>>>> On Sun, Feb 2, 2025 at 5:42 AM John Carlson <yottzumm at gmail.com>
> wrote:
> >>>>>>>
> >>>>>>> Andreas, Joe,
> >>>>>>>
> >>>>>>> Reset Button, Reset_Clock added.
> >>>>>>>
> >>>>>>> See attached zip for details, or visit link;
> >>>>>>>
> >>>>>>>
> https://create3000.github.io/x_ite/playground/?url=https://raw.githubusercontent.com/coderextreme/ci2had/refs/heads/main/resources/CleanedYouClocks.x3d
> >>>>>>>
> >>>>>>> For some reason, this link doesn't show the live scene?
> >>>>>>>
> >>>>>>>
> https://andreasplesch.github.io/Library/Viewer/index.html?url=https://raw.githubusercontent.com/coderextreme/ci2had/refs/heads/main/resources/CleanedYouClocks.x3d
> >>>>>>>
> >>>>>>> Puzzled, haven't researched it yet. Looks good in Sunrize and
> X_ITE, will try FreeWRL next.
> >>>>>>>
> >>>>>>> John
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> Andreas Plesch
> >>>>>> Waltham, MA 02453
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Andreas Plesch
> >>>> Waltham, MA 02453
> >>>
> >>>
> >>>
> >>> --
> >>> Andreas Plesch
> >>> Waltham, MA 02453
> >>> _______________________________________________
> >>> 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/20250204/dcebb03e/attachment-0001.html>
More information about the x3d-public
mailing list