[x3d-public] [...] set_Value prefix and value_changedsuffix, potential v4 issue
yottzumm at gmail.com
yottzumm at gmail.com
Mon Apr 24 08:17:14 PDT 2017
Okay, I have changed my serializer to NOT remove set_ and _changed, and things are looking good! I will run more tests later…
I have a couple of items left, I’m sure you smart fellows can figure out:
Based on flowers7.x3d:
org.web3d.x3d.sai.InvalidFieldValueException: ROUTE details: FROM Animate.a_changed (Script.SFFloat.outputOnly) TO cobweb.set_a (ComposedShader.ERROR_UNKNOWN_FIELD_TYPE.ERROR_UNKNOWN_FIELD_ACCESSTYPE)
ROUTE has source-destination type mismatch, fromField='a_changed' source and toField='set_a' destination have different types. ROUTE toField (destination) event can only have accessType='inputOutput' or accessType='inputOnly'.
at org.web3d.x3d.jsail.Core.ROUTEObject.validate(ROUTEObject.java:720)
at org.web3d.x3d.jsail.Core.SceneObject.validate(SceneObject.java:607)
at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.java:1855)
at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:746)
at flowers7.main(flowers7.java:79)R_UNKNOWN_FIELD_ACCESSTYPE)
I’m assuming in the programmable shader GLSL, if I have an inputOnly field, I have to use set_ in the GLSL shader code as well. That may explain why my X3DOM shader wasn’t working.
Based on x3dconnectorProto.x3d:
org.web3d.x3d.sai.InvalidFieldValueException: ROUTE details: FROM G1.translation_changed (Transform.SFVec3f.inputOutput) TO connector1.set_startpoint (ProtoInstance.ERROR_UNKNOWN_FIELD_TYPE.ERROR_UNKNOWN_FIELD_ACCESSTYPE)
ROUTE has source-destination type mismatch, fromField='translation_changed' source and toField='set_startpoint' destination have different types. ROUTE toField (destination) event can only have accessType='inputOutput' or accessType='inputOnly'.
at org.web3d.x3d.jsail.Core.ROUTEObject.validate(ROUTEObject.java:720)
at org.web3d.x3d.jsail.Core.SceneObject.validate(SceneObject.java:607)
at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.java:1855)
at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:746)
at x3dconnectorProto.main(x3dconnectorProto.java:79)
Both are attached.
Sent from Mail for Windows 10
From: yottzumm at gmail.com
Sent: Monday, April 24, 2017 7:24 AM
To: Michalis Kamburelis; Don Brutzman
Cc: Andreas Plesch; X3D Graphics public mailing list
Subject: RE: [x3d-public] [...] set_Value prefix and value_changedsuffix,potential v4 issue
I will try taking out my code to remove set_ and _changed and see what happens. Perhaps I can patch my XML.
John
Sent from Mail for Windows 10
From: Michalis Kamburelis
Sent: Monday, April 24, 2017 5:03 AM
To: Don Brutzman
Cc: Andreas Plesch; X3D Graphics public mailing list
Subject: Re: [x3d-public] [...] set_Value prefix and value_changed suffix,potential v4 issue
2017-04-24 5:40 GMT+02:00 Don Brutzman <brutzman at nps.edu>:
> So for example, am not finding any specification prose that would permit
> routing from a TimeSensor.fraction (it is defined as
> TimeSensor.fraction_changed) or into a PositionInterpolator.fraction (it is
> defined as PositionInterpolator.set_fraction).
>
I always understood the X3D specification (the
http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#FieldSemantics
section) to mean that "if you want to refer to the input event of the
xxx inputOutput, you MUST write it set_xxx". (And, analogously, you
MUST write "xxx_changed" to refer to the output event.)
I guess it comes from the VRML times, when the concept of "fields" and
"events" felt more separated in the specification. We had "exposed
field" that I understood as equivalent to a sum of 1 field + 2 events.
The specification says
"""
An inputOutput field named zzz can be referred to as 'set_zzz' and
treated as an inputOnly, and can be referred to as 'zzz_changed' and
treated as an outputOnly field.
"""
I understood the "referred to as 'set_zzz' and treated as an
inputOnly" as a requirement: you have to refer to it as 'set_zzz', in
order to treat it as an inputOnly.
Consequently, view3dscene does not allow
ROUTE MyTimeSensor.fraction TO MyPositionInterpolator.fraction
You must use
ROUTE MyTimeSensor.fraction_changed TO MyPositionInterpolator.set_fraction
Attaching the smallest testcase possible:) If any other X3D browser
allows the 1st ROUTE above (just "MyTimeSensor.fraction"), or if the
specification allows it, I would like to know about it, so that I can
fix view3dscene.
Out of curiosity, I looked at what VRML 97 specification says about it:
1. VRML 97 spec says basically the same thing as X3D spec (
http://www.web3d.org/documents/specifications/14772/V2.0/part1/concepts.html#4.7
):
"""An exposedField named zzz can be referred to as 'set_zzz' and
treated as an eventIn, and can be referred to as 'zzz_changed' and
treated as an eventOut."""
2. The "Annotated VRML 97 Reference Manual" (
http://www.x-3-x.net/vrml/archive/annotatedVRML2/BOOK.HTM ) adds a
"tip" (not present in the spec):
"""Note that the names of exposedFields do not include a prefix or
suffix. For example, the PointLight node's on exposedField is not
named isOn. However, the set_ and _changed conventions may be used
when referring to the eventIn and eventOut of the exposedField
respectively."""
Hm, the words "may be used" inside the above sentence indeed suggest
that the set_/_changed are optional. I'm curious what other VRML and
X3D browsers do!
P.S. I don't have an opinion about whether this requirement should be
relaxed for X3D 4.0 or not. As the DOM compatibility is not in my main
usecase for X3D, I don't have any argument in favor. But the necessary
change in the browser implementation, to make set_/_changed optional,
would be absolutely trivial, so I don't see any argument against. So,
as long as the specification is clear about whether it should be
allowed or not, I'm fine either way:)
Regards,
Michalis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170424/5f0bbc2e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flowers7.x3d
Type: application/octet-stream
Size: 13174 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170424/5f0bbc2e/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x3dconnectorProto.x3d
Type: application/octet-stream
Size: 6958 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170424/5f0bbc2e/attachment-0003.obj>
More information about the x3d-public
mailing list