[x3d-public] Fw: ProtoInstance USE without name

Don Brutzman brutzman at nps.edu
Sun Nov 29 12:54:52 PST 2020


On 11/29/2020 10:51 AM, John Carlson wrote:
> 
> This seems to be a pointer to part of the thread:
> 
> http://web3d.org/pipermail/x3d-public_web3d.org/2017-September/007480.html <http://web3d.org/pipermail/x3d-public_web3d.org/2017-September/007480.html>

yup.

Nice to test implementations, checking out the playing field.  Meanwhile specification remains paramount and validation tools implement those rules.  This is definitely an "edge case" since strict validation is challenging, but (mercifully) strict correctness is possible.

Wondering, did you test your examples A B and C in X3D Validator?  Hard to be confident they are correct otherwise. Confounding unrelated problems can confuse, GIGO... further if you find a curious or badly responding case, then that will help us improve diagnostics even further.

* X3D Validator is a Web application that comprehensively checks X3D scene validity
   https://savage.nps.edu/X3dValidator

> On Sun, Nov 29, 2020 at 12:46 PM John Carlson <yottzumm at gmail.com <mailto:yottzumm at gmail.com>> wrote:
> 
>     Everyone please remember this conversation. Or perhaps put a link to this thread on a website which discusses USE and name tradeoffs for nodes.

put prior summary reported to Christophe into tooltips for ProtoInstance name and USE.

* X3D Scene Authoring Hints: Inline Scenes and Prototype Templates
   https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#Inlines

* X3D Scene Authoring Hints: 🔖 Prototype Instances
   https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#ProtoInstance

* X3D4 Tooltips.html ProtoInstance has links to schema, dtd, mail list search, mantis issues, schema doctype SAI etc.
   https://www.web3d.org/x3d/tooltips/X3dTooltips.html#ProtoInstance

* https://www.web3d.org/x3d/tooltips/X3dTooltips.html#ProtoInstance.name

"Warning: name must be specified unless this ProtoInstance is a USE node. Do not include name with ProtoInstance USE since it is duplicative (i.e. name is already defined in the DEF instance) and this approach avoids potential name mismatches."

* https://www.web3d.org/x3d/tooltips/X3dTooltips.html#ProtoInstance.USE

"Warning: do not define a name field in a USE node, the correct name can already be found in the original ProtoInstance DEF node."

... and these tooltip improvements ripple helpfully into documentation embedded during next build/deploy of X3DUOM, X3DJSAIL Java, X3DPSAIL x3d.py Python package, and X3D Ontology turtle comments/labels.  So continued scrutiny and improvements remains welcome.

p.s. InstantReality is truly great but it also has a handful of bugs/quirks that haven't been touched for years.  Am having trouble installing it on an alternate machine because it seems to be demanding obsolete Microsoft VisualStudio dll installations...  Wondering if anyone is home there??

have fun with X3D!  8)


>     There's another thread somewhere on the same ProtoInstance topic, if anyone cares to look.
> 
>     No changes to JSON Schema that I know of required!
> 
>     I believe there are still some statements which may have both USE and name.   Those are OK, and noted.
> 
>     Thanks, guys!
> 
>     John
> 
>     On Sun, Nov 29, 2020 at 12:24 PM Andreas Plesch <andreasplesch at gmail.com <mailto:andreasplesch at gmail.com>> wrote:
> 
>         Some results of testing browsers:
> 
>         freeWrl: A and B works, C does not
>         InstantPlayer: A and C renders, B does not, warning: "obligatory name is missing"; no sound in any on my system
>         view3dscene: A, B and C work, no warnings in any.
>         Octaga: A,B and C work, no warnings in any.
> 
>         In addition, I replaced "Script" with "Group" in C, with the same results in all browsers. This indicates that some browsers essentially ignore the Node type in a xml encoded USE node, following the VRML style of USE.
> 
>         [ So, in the XML encoding, we could have had a <USE name="DEFname" /> construct which may have been discussed but was decided against, perhaps for reasons of validation. ]
> 
>         Only InstantPlayer requires the name attribute in a USE ProtoInstance, indicating a gap in the xml specification. While requiring the name attribute would be cleaner, in my view, it would break backward compatibility. Therefore explicitly USE without name for ProtoInstances makes the most sense to me. This would make InstantPlayer a little non-compliant.
> 
>         Cheers, -Andreas
> 
> 
> 
>         On Sun, Nov 29, 2020 at 10:00 AM Christoph Valentin <christoph.valentin at gmx.at <mailto:christoph.valentin at gmx.at>> wrote:
> 
>             The archive has been updated.
>             . Removed the unused prototype
>               two additional editorial corrections
>             to be crystal clear: the optimum would be to have a clear X3D standard and to remove the workaround forever.
>             @all: do other users have similar experiences with ProtoInstances, DEF and USE? I am not the only user of X3D, am I?
>             kr
>             *Gesendet:* Sonntag, 29. November 2020 um 15:39 Uhr
>             *Von:* "Christoph Valentin" <christoph.valentin at gmx.at <mailto:christoph.valentin at gmx.at>>
>             *An:* "Andreas Plesch" <andreasplesch at gmail.com <mailto:andreasplesch at gmail.com>>
>             *Cc:* "X3D Graphics public mailing list" <x3d-public at web3d.org <mailto:x3d-public at web3d.org>>
>             *Betreff:* Re: [x3d-public] ProtoInstance USE without name
>             Hi Andreas,
> 
>             The MoosTrigger can be deleted. I forgot it there, sorry (it would be used for MU capability). I will correct asap.
> 
>             The only theory I have is that the external behaviour of scripts and protos regarding the event cascade is very similar. Both have fields that can be arbitrarily defined. So a reference to a script can hold a reference to a ProtoInstance.
> 
>             Sorry I am not a Browser developer, but I am a (potential) user of X3D, dont know so much about X3D internals. It could even be an intention of the standard.
> 
>             kr
> 
>             --
>             Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.
>             Am 29.11.20, 15:24 schrieb Andreas Plesch <andreasplesch at gmail.com <mailto:andreasplesch at gmail.com>>:
> 
>                 Hi Christoph,
>                 The Pig proto is using a "Moostrigger" proto. Should the Mosstrigger proto be included in the archive, or can it be ignored, eg. commented out ?
>                 I am struggling to understand how Version C, the Script workaround, could work:
>                 <!-- the second pig , version C - ProtoInstance WITHOUT name -->
>                          <Transform translation='3 0 0' rotation='0 1 0 -1.57'>
>                              <Script USE="ThePig"/>
>                          </Transform>
>                 and the ThePig DEF is:
>                 <ProtoInstance DEF="ThePig" name='Pig'/>
>                 So the ThePig DEF is not a Script node. ( And the Pig proto is of Group type. ). It seems like it is just a coincidence that it works with BSContact. Perhaps BSContact somehow treats all ProtoInstances as Scripts ?
>                 Do  you have a theory why the workaround actually works with some browsers ?
>                 Thanks, Andreas
>                 On Sat, Nov 28, 2020 at 3:46 PM Andreas Plesch <andreasplesch at gmail.com <mailto:andreasplesch at gmail.com>> wrote:
> 
>                     Thanks, I will take a look.
>                     ---on the phone---
>                     On Sat, Nov 28, 2020, 9:17 AM Christoph Valentin <christoph.valentin at gmx.at <mailto:christoph.valentin at gmx.at>> wrote:
> 
>                         Hi Andreas,
>                         I felt free to provide an example scene in three flavors.
>                         The prototype renders a little pig that says "Eatme!", when you touch it (in remembrance of Douglas Adams)
>                         Version A: <ProtoInstance USE="xxx" name="yyy"/>    WITH name attribute - standards compliant
>                         Version B: <ProtoInstance USE="xxx"/>  WITHOUT name attribute
>                         Version C: <Script USE="xxx"/>  WORKAROUND - works for all browsers
>                         I tested with BS Contact --- he can cope with all three versions.
>                         Download the .zip file at https://lc-soc-lc.at/experimental/ProtoInstanceWithUSE/ <https://lc-soc-lc.at/experimental/ProtoInstanceWithUSE/>     I provide it by a GPLv3.
>                         Feed Back welcome. You may take it and give it to your benchmark tests, if you like.
>                         Kind regards,
>                         Christoph
>                         *Gesendet:* Dienstag, 24. November 2020 um 00:30 Uhr
>                         *Von:* "Andreas Plesch" <andreasplesch at gmail.com <mailto:andreasplesch at gmail.com>>
>                         *An:* "Christoph Valentin" <christoph.valentin at gmx.at <mailto:christoph.valentin at gmx.at>>
>                         *Cc:* "X3D Graphics public mailing list" <x3d-public at web3d.org <mailto:x3d-public at web3d.org>>
>                         *Betreff:* Re: [x3d-public] ProtoInstance USE without name
>                         Hi Christoph,
>                         thanks, interesting. Perhaps it will be useful to try a USE ProtoInstance in a very simple scene, in multiple browsers.
>                         -Andreas
>                         On Mon, Nov 23, 2020 at 1:01 PM Christoph Valentin <christoph.valentin at gmx.at <mailto:christoph.valentin at gmx.at>> wrote:
> 
>                             Hi
>                             This bug is common to many X3D players (even classical non-WebGL X3D players).
>                             I was used to use following workaround, which worked for all relevant players:
>                             If I want to USE a DEFd ProtoInstance, I will actually instantiate a <Script> node with USE.
>                             KR,
>                             Christoph
>                             *Gesendet:* Montag, 23. November 2020 um 00:00 Uhr
>                             *Von:* "Andreas Plesch" <andreasplesch at gmail.com <mailto:andreasplesch at gmail.com>>
>                             *An:* "X3D Graphics public mailing list" <x3d-public at web3d.org <mailto:x3d-public at web3d.org>>
>                             *Betreff:* [x3d-public] ProtoInstance USE without name
>                             Looking at why the old Prototypes for HAnim did not work properly for x3dom, I found that the xml examples typically have a ProtoInstance statement with a USE attribute but without the corresponding name attribute defining the actual node type. However, x3dom expects a name attribute with every ProtoInstance statement, even USE ones, to be able to insert the appropriate node.
>                             The xml spec  at
>                             https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#ProtoInstanceAndFieldValueStatement <https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#ProtoInstanceAndFieldValueStatement>
>                             does not address USE of ProtoInstances but all examples always have a name attribute.
>                             Also, in my quite extensive testing of Protos, I did not come across other examples of ProtoInstance elements without a name attribute.
>                             To be fair, the name attribute is not strictly necessary for USE ProtoInstances since the type of the inserted node can be determined from the referenced DEF node. But having the name attribute makes ProtoInstance elements more similar to regular nodes. So I think not requiring the name attribute for USE ProtoInstances should be explicitly allowed in the xml spec., but still be encouraged.
>                             I do not think the xml spec. would be otherwise affected by V.4 ?
>                             Best, Andreas


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list