MoI discussion forum
MoI discussion forum

Full Version: Exploration of Scripting in MOI

Show messages: All  1-7  8

From: Michael Gibson
13 Sep 2019   [#8] In reply to [#6]
Hi Dave, that's great that you're making good progress!

So for include edges the way to figure out how to replicate that in a script is to first look at the Silhouette.htm file and find the "Include edges" button which is this:

code:
<moi:CheckButton id="includeedges"><moi:Text textid="Include edges checkbox"/></moi:CheckButton>


The key thing that you're looking for is the id value. So then go to the Silhouette command script file (Silhouette.js) and search for includeedges, which is this:

code:
ui.bindUIToInput( 'includeedges', 'value', factory.getInput(4) );


So what the regular command is doing there is making a link between the includeedges checkbox UI controls's value property and the silhouette factory's input with index 4.

In your script you'd want to do something like factory.setInput( 4, true ); to turn it on.

Some UI will set up a binding like that and others will look for a UI event of that id value being triggered if they need to do other stuff in addition to just setting a value on the factory.

Hope that helps!

- Michael

Show messages: All  1-7  8