<div dir="ltr"><div>Stack node > how about for Inlines and Protos - rather than passing through or routing some parameters, would push and pop.</div><div><ProtoDeclare name='funnyBox'></div><div>...</div><div><Shape></div><div><Box/></div><div></Shape></div><div>...</div><div></ProtoDeclare></div><div><Stack type='material' name='MyMat2'></div><div><ProtoInstance name='funnyBox'/></div><div></Stack></div><div><br></div><div>I wonder if this would make libraries of objects easier to use.</div><div>-Doug</div></div><br><div class="gmail_quote"><div class="gmail_attr" dir="ltr">On Thu, Nov 14, 2019 at 2:57 PM Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">OK I'll bite...<br>
<br>
On 11/7/2019 12:24 PM, GPU Group wrote:<br>
> IDEA: a stack-based method for default USE<br>
<br>
hmmm<br>
<br>
> In the past I've used Switch -1 to hide pre-defined nodes for later USE.<br>
<br>
Me too.  Great technique.<br>
<br>
For anyone who wants to see an example, please see<br>
<br>
        X3D Example Archives: X3D for Web Authors, Chapter 09 Event Utilities Scripting, Integer Sequencer Road Sign Switcher<br>
        <a href="https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/IntegerSequencerRoadSignSwitcherIndex.html" target="_blank" rel="noreferrer">https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/IntegerSequencerRoadSignSwitcherIndex.html</a><br>
<br>
Similar approach could apply a separate TouchSensor and IntegerTrigger, shape by shape, to each select an appropriate child under a single Switch.  Pretty common technique.<br>
<br>
> Another idea: to have some generic way to change a default via a stack of some sort:<br>
> <Stack name="material" USE='funnyMaterial'><br>
> <Shape><br>
> - no material mentioned, no USE here, gets the default which is funnyMaterial<br>
> </Shape><br>
> <Stack name='material' USE='seriousMaterial'><br>
> <Shape><br>
> - no material mentioned, gets default which is now seriousMaterial<br>
> </Shape><br>
> </Stack> - pops serious<br>
> <Shape><br>
> - no material mentioned, gets default which is back to funnyMaterial<br>
> </Shape><br>
> </Stack> - pops funny<br>
> <Shape><br>
> - no material mentioned, gets x3d default material<br>
> </Shape><br>
> But I haven't thought about when / what other scenarios that would be useful for. Just something new related to DEF/USE.<br>
> -Doug Sanden<br>
<br>
For this possibility here is a slippery slope to worry about.  It is starting to look like a programming language... Looks like it would either<br>
a. require Script logic, or<br>
b. become unpredictable/nondeterministic.<br>
<br>
Both are more complex, and thus hard to encourage.  Also not sure that a Stack adds some new/valuable capability that can't be accomplished already with the existing palette of X3D nodes.<br>
<br>
If there is a use case that significantly eases existing modeling, then maybe.  But our current Event Utility nodes are pretty darn simple so they will be tough to surpass.<br>
<br>
all the best, Don<br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149<br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" target="_blank" rel="noreferrer">http://faculty.nps.edu/brutzman</a><br>
</blockquote></div>