<div><div dir="auto">Holger suggests:</div><div dir="auto"><div><div dir="auto" style="font-family:-apple-system,"helvetica neue";font-size:16px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:1px;text-decoration:none;color:rgb(49,49,49)"><pre style="white-space:pre-wrap;font-family:monospace"><span style="font-size:1rem;font-family:monospace">function</span> <span style="font-size:1rem;font-family:monospace">initialize</span><span style="font-size:1rem;font-family:monospace">(</span><span style="font-size:1rem;font-family:monospace">)</span> <span style="font-size:1rem;font-family:monospace">{</span>
  <span style="font-size:1rem;font-family:monospace">var</span> <span style="font-size:1rem;font-family:monospace">touchSensor</span> <span style="font-size:1rem;font-family:monospace">=</span> <span style="font-size:1rem;font-family:monospace">Browser</span><span style="font-size:1rem;font-family:monospace">.</span><span style="font-size:1rem;font-family:monospace">currentScene</span><span style="font-size:1rem;font-family:monospace">.</span><span style="font-size:1rem;font-family:monospace">createNode</span><span style="font-size:1rem;font-family:monospace">(</span><span style="font-size:1rem;font-family:monospace">'TouchSensor'</span><span style="font-size:1rem;font-family:monospace">)</span><span style="font-size:1rem;font-family:monospace">;</span>
  <span style="font-size:1rem;font-family:monospace">Browser</span><span style="font-size:1rem;font-family:monospace">.</span><span style="font-size:1rem;font-family:monospace">currentScene</span><span style="font-size:1rem;font-family:monospace">.</span><span style="font-size:1rem;font-family:monospace">addNamedNode</span><span style="font-size:1rem;font-family:monospace">(</span><span style="font-size:1rem;font-family:monospace">"FOOBAR"</span><span style="font-size:1rem;font-family:monospace">,</span> <span style="font-size:1rem;font-family:monospace">touchSensor</span><span style="font-size:1rem;font-family:monospace">)</span><span style="font-size:1rem;font-family:monospace">;</span>
<span style="font-size:1rem;font-family:monospace">}</span></pre></div><br></div>And</div></div><div dir="auto"><br></div><div dir="auto"><div><pre style="white-space:pre-wrap;color:rgb(49,49,49);font-size:19px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:1px;text-decoration:none"><span style="font-size:1rem">console</span><span style="font-size:1rem">.</span><span style="font-size:1rem">log</span><span style="font-size:1rem">(</span><span style="font-size:1rem">touchSensor</span><span style="font-size:1rem">.</span><span style="font-size:1rem">getNodeName</span><span style="font-size:1rem">(</span><span style="font-size:1rem">)</span><span style="font-size:1rem">)</span></pre></div><br></div><div dir="auto">I hope to generate a bunch of examples using these.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">This is a warmup!</div><div dir="auto"><br></div><div dir="auto">Thanks, Holger!</div><div dir="auto"><br></div><div dir="auto">John</div><div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 2, 2025 at 11:09 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr">I'm trying to achieve a large checkbox menu, with animations on the X axis and body parts on the Y axis, plus a row for all body parts for convenience.<div><br></div><div>(sorry, large image)<br><div><br></div><div><img src="cid:ii_m5gagawh0" alt="image.png" style="width:932px;max-width:100%"><br></div></div><div><br></div><div>My guess is that a PROTO with ProtoInstance code generation will be the best way to achieve this (no, I don't want to type all that in)!</div><div><br></div><div>Source code is available for interested parties.</div><div><br></div><div>It would be OK, if people told me to do this in HTML, but I would probably switch to X_ITE or X_ITE vscode.</div></div><div dir="ltr"><div><br></div><div>John</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 2, 2025 at 10:47 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr">I want to use a TouchSensor in a ROUTE that I am adding in Sunrize ECMAScript (SAI, embedded scripts), but I can't seem to set the DEF, so I can't really add the ROUTE.<div><br></div><div>I can't use createX3DFromString(), perhaps, because I might not be able to access DEF to get the DEF value.  I don't have experience using the result from createX3DFromString().</div><div><br></div><div>I am creating TouchSensors in a double loop, and it appears the only way to do it is with  code generation.</div><div><br></div><div>Hmm.  AFAIK, setting DEF is super simple in Java and Python, especially in DOM.</div><div><br></div><div>I don't really feel like code generation is reasonable, because I will have to rewrite my code.</div><div><br></div><div>This is where I through my hands up and use something like raylib or HTML.</div><div><br></div><div>Using a PROTO might be much more reasonable.</div><div><br></div><div>John</div></div>
</blockquote></div>
</blockquote></div></div>
</div>