<div dir="ltr"><div dir="ltr">"..assuming that the outer scene<br>Execution Context should apply also to the Proto Execution Context. I<br>do not think this is the case. Or is it ?"</div><div>freewrl: contexts inherit defined protos from parent contexts. </div><div>(as you go down the stack of contexts with nested protos, deeper proto contexts inherit the defined protos of the parent context)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 25, 2022 at 9:21 AM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Apr 25, 2022 at 12:43 AM Brutzman, Donald (Don) (CIV)<br>
<<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br>
<br>
> Actually please look a little more closely at that (admittedly tricky)<br>
> example.<br>
<br>
Thanks, looking closely is when I noticed that the CircleFishLod<br>
ProtoBody is not completely defined within itself.<br>
<br>
> * CircleFish is an ExternProto, separately defined in another file<br>
> * CircleFishLod is a ProtoDeclare defined in that first file,<br>
> CircleFishLodPrototype.x3d<br>
> * CircleFishLod ProtoBody contains two ProtoInstance copies of CircleFish<br>
<br>
Yes, but the CircleFishLod ProtoBody does not contain the CircleFish<br>
ExternProtoDeclare (referencing the CircleFish ExternProto) which the<br>
two copies of CircleFish use. So the ProtoBody is incomplete.<br>
<br>
> * CircleFishLod ProtoDeclare is then followed by a CircleFishLod<br>
> ProtoInstance (again  in CircleFishLodPrototype.x3d)<br>
> So I would expect an X3D Browser to<br>
><br>
> a. load ExternProtoDeclare      CircleFish<br>
<br>
At this point the ProtoDeclaration is only registered under its name,<br>
in the outer scene Execution Context. The protos array of the<br>
Execution Context stores it :<br>
<a href="https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#t-ExecutionContextProperties" rel="noreferrer" target="_blank">https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html#t-ExecutionContextProperties</a>.<br>
<br>
> b. build ProtoDeclare                CircleFishLod<br>
> c. create inner ProtoInstance  CircleFish for use<br>
<br>
This ProtoInstance creation will look for the CircleFish<br>
ProtoDeclaration, in the CircleFishLod Execution Context which is<br>
separate from the scene execution context/name scope. But it is only<br>
registered in the outer scene Context.<br>
<br>
> d. create outer ProtoInstance CircleFishLod<br>
<br>
In the example (not necessarily in the Proto x3d).<br>
<br>
> Order of steps might vary a bit, but those are the dependencies.  Good luck<br>
> sir.<br>
<br>
Well, thanks for listing the specific steps which helped illuminate<br>
that there is a deeper issue with assuming that the outer scene<br>
Execution Context should apply also to the Proto Execution Context. I<br>
do not think this is the case. Or is it ?<br>
<br>
This scrutiny confirms to me that there is likely an oversight in the<br>
CircleFishLod example. The example only happens to work in some<br>
browsers which are more accepting of mixing Execution Contexts. The<br>
example can be easily fixed by moving the ExternProtoDeclare inside<br>
the ProtoBody, similar to other examples of nested Prototypes. In fact<br>
all other examples of nested prototypes I could find do this.<br>
<br>
Happy to be convinced otherwise,<br>
<br>
Andreas<br>
<br>
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149<br>
> X3D graphics, virtual worlds, Navy robotics https://<br>
> <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">faculty.nps.edu/brutzman</a><br>
><br>
> -----Original Message-----<br>
> From: x3d-public <<a href="mailto:x3d-public-bounces@web3d.org" target="_blank">x3d-public-bounces@web3d.org</a>> On Behalf Of Andreas Plesch<br>
> Sent: Sunday, April 24, 2022 9:08 PM<br>
> To: X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
> Subject: [x3d-public] ProtoBody completeness in nested Protos<br>
><br>
> ProtoDeclarations may use ProtoInstances of other Protos inside their<br>
> ProtoBody definitions.<br>
><br>
> For example, the CircleFishLod proto here:<br>
><br>
> <a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fx3dgraphic" rel="noreferrer" target="_blank">https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fx3dgraphic</a><br>
> <a href="http://s.com" rel="noreferrer" target="_blank">s.com</a>%2Fexamples%2FX3dForWebAuthors%2FKelpForestExhibit%2FCircleFishLodProto<br>
> typeIndex.html&amp;data=05%7C01%7Cbrutzman%<a href="http://40nps.edu" rel="noreferrer" target="_blank">40nps.edu</a>%7C0b4a867ba9874e371f9b0<br>
> 8da267152fa%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637864565880708349%<br>
> 7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwi<br>
> LCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=upr4eckI8axT7MO5fAUvAWfyBzUJfhTwqcp<br>
> BuH7tZjc%3D&amp;reserved=0<br>
><br>
> uses ProtoInstances of the CircleFish proto.<br>
><br>
> A more extreme case of nesting is:<br>
><br>
> <a href="https://www.web3d.org/x3d/content/examples/ConformanceNist/Miscellaneous/PRO" rel="noreferrer" target="_blank">https://www.web3d.org/x3d/content/examples/ConformanceNist/Miscellaneous/PRO</a><br>
> TO/fivedeepnestingIndex.html<br>
><br>
> where Proto1 uses ProtoInstance of Proto2 inside its ProtoBody. Proto2<br>
> itself uses a ProtoInstance of Proto3 inside its ProtoBody. And so on to<br>
> five levels deep.<br>
><br>
> The second example with the deep nesting currently works with x3dom but the<br>
> seemingly simpler CircleFishLod proto does not.<br>
><br>
> The reason is that x3dom expects the complete definition of a proto to be<br>
> contained in its ProtoBody. However, The CircleFishLod proto only contains<br>
> the CircleFish ProtoInstances in the body but not the associated CircleFish<br>
> ProtoDeclaration which for some reason occurs outside the CircleFishLod<br>
> ProtoBody (and outside the CircleFishLod ProtoDeclaration).<br>
><br>
> Expecting the ProtoBody to be complete and self-contained seems rather<br>
> natural. Is x3dom too strict in this regard, or is there an oversight in the<br>
> example ? There is not much guidance in the spec., if any.<br>
><br>
> Thanks, Andreas<br>
><br>
> --<br>
> Andreas Plesch<br>
> Waltham, MA 02453<br>
><br>
> _______________________________________________<br>
> x3d-public mailing list<br>
> <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
<br>
<br>
<br>
-- <br>
Andreas Plesch<br>
Waltham, MA 02453<br>
<br>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div>