[x3d-public] unconnected proto fields

Holger Seelig holger.seelig at yahoo.de
Mon Oct 26 01:40:24 PDT 2020


X_ITE does add those fields to the instance and gives them the default value as specified in the prototype. The fields can be used, read and written like normal, especially in from Script nodes and routes can be connected  but those fields do not affect the internal state of the instance.
Holger
-------- Ursprüngliche Nachricht --------Von: Don Brutzman <brutzman at nps.edu> Datum: 25.10.20  21:55  (GMT+01:00) An: Joseph D Williams <joedwil at earthlink.net>, "Richard F. Puk" <puk at igraphics.com>, 'Michalis Kamburelis' <michalis.kambi at gmail.com>, 'Andreas Plesch' <andreasplesch at gmail.com> Cc: 'X3D Graphics public mailing list' <x3d-public at web3d.org> Betreff: Re: [x3d-public] unconnected proto fields On 10/24/2020 10:13 AM, Joseph D Williams wrote:> >   * If the field is not used by the prototype instance, the underlying "node" should use the default value for that field.> > … and if the prototype instance uses ( is’s ) a field that is not in the prototype declaration, the prototype instance (underlying "node") should (must) fail.> > Same as if a script tried to access any not declared or initializeonly field of any node instance> > Sorry, no such node field available – void node -  authortime error on protoinstance and whatever standard warning for bad node field - runtime should stop with named error.> > JoeSure, agreed.  But all these concerns can be confusing troublesome when troubleshooting software or models.So, I added and improved a number of IS/connect tests in X3D Schematron & X3D Validator.Also adapted your test-case scene Michalis and am adding it to X3D Examples Basic development archive.     <ProtoDeclare name='MyShape'>       <ProtoInterface>         <field accessType='inputOutput' name='geometry' type='SFNode'>           <Sphere/>         </field>         <field accessType='inputOutput' name='color' type='SFColor' value='1 1 0'/>       </ProtoInterface>       <ProtoBody>         <Shape DEF='ContainedShape'>           <IS>             <connect nodeField='geometry' protoField='geometry'/>             <connect nodeField='bboxCenter' protoField='undefinedProtoField'/>           </IS>           <Appearance DEF='NoConnection'>             <Material/>           </Appearance>         </Shape>       </ProtoBody>     </ProtoDeclare>===================[excerpt from X3D Validator, https://savage.nps.edu/X3dValidator]7. Performing X3D Schematron check...Based on file name, TestProtoDeclareDisconnectedField.x3d is considered a test model supporting X3D Quality Assurance (QA).https://www.web3d.org/x3d/content/examples/X3dResources.html#QualityAssurance[/X3D/head, diagnostic]Missing connection for field in ProtoBody: <ProtoDeclare name='MyShape'> <ProtoInterface> <field name='color' accessType='inputOutput' type='SFColor'/> is unused with no <ProtoDeclare name='MyShape'> <ProtoBody> ... <IS> <connect protoField='color' nodeField='someParentNodeFieldName'/> found in corresponding ProtoBody content [/X3D/Scene/ProtoDeclare/ProtoInterface/field[2], warning]Not finding connect protoField: <IS> <connect nodeField='bboxCenter' protoField='undefinedProtoField'/> does not have a corresponding protoField declaration <ProtoDeclare name='MyShape'> <ProtoInterface> <field name='undefinedProtoField'>[/X3D/Scene/ProtoDeclare/ProtoBody/Shape/IS/connect[2], error]Error(s) detected during this validation test.X3D Schematron check: fail.Good practice is to fix errors and warnings wherever possible, and consider silencing harmless informational messages, so that important indicators remain noticeable.===================Have fun with X3D4 quality assurance!  8)all the best, Don-- Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.eduWatkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20201026/0c278acf/attachment.html>


More information about the x3d-public mailing list