MoI discussion forum
MoI discussion forum

Full Version: Scripting

Show messages:  1-16  17-36  37-56  57-68

From: Michael Gibson
27 Dec 2017   [#57] In reply to [#56]
Hi Brian, well it kind of depends on how you want to structure the script - a dropdown (which will display in listbox mode if you use the size attribute like that), is good if you're trying to make things interactive with something updating when the dropdown is changed.

If you want something more simple like you just want the user to decide between 2 different possible modes of operation for the rest of the command, and you're not wanting to make it a choice they can flip back and forth and see something change immediately in response to that, it might be easiest to just make 2 <moi:PushButton> elements and then when the user clicks on one of those buttons that's what controls the mode you use after that. Does that sound like something that would fit? An example would be the Edit > History command, it shows 2 buttons like that.

Let me know if I have misunderstood what you're trying to do or if you need more information.

- Michael
From: bemfarmer
27 Dec 2017   [#58] In reply to [#57]
Thank you very much Michael.
Right, different, appropriate, interactivity for different scripts.

I think I'll redo cone unwrap using pointpicker of the apex with frustum selection button as the split between menus.
(The alternative would be two mode buttons at the beginning, using the History style pair of buttons to split into two selection menus.)
(Both seem to be good choices.) (I'll redo the prompts also.)

For my simple 2D curve script, a pair of mode buttons seems a better choice.

Since I've used History button only a couple of times over the last several years, I did not realize it had a pair of buttons.
---unexplored MoI gems---
I'll study the History script today :-)

- Brian
From: Bravlin
29 Nov 2018   [#59]
Is there some kind of a "UserData" mechanism in Moid3D ?
In Softimage "UserData" store information available any moment for plugin functions and objects.
Its like a global variable for plugin that lie in dynamic memory.
It helps store information between launches of the plugin.
So your first run plugin result calculations can be transferred to second run etc.
From: Michael Gibson
29 Nov 2018   [#60] In reply to [#59]
Hi Bravlin, sorry no there isn't currently any mechanism like that set up for MoI scripting.

- Michael
From: Bravlin
13 Dec 2018   [#61]
How shall i query current tool context ? Is it possible ?
For example if i start Trim command dialog ?
From: Michael Gibson
13 Dec 2018   [#62] In reply to [#61]
Hi Bravlin, do you mean you want to get the name of the currently running command, if there is one, from script?

- Michael
From: Bravlin
13 Dec 2018   [#63]
Yes currently runing command or dialog.
From: Michael Gibson
13 Dec 2018   [#64] In reply to [#63]
Hi Bravlin, there isn't anything set up for a script to get that currently but I will add a property at moi.command.currentCommandName for the next v4 beta.

- Michael
From: bemfarmer
21 Dec 2021   [#65]
Hi Michael,

What are the inputs for "network"?

Inputs for network:

0 : ObjectList - curves.
1 :
2 :
3 :
4:
5:
6:

From network.js Moi command:
4 moi.ui.bindUIToInput( 'mode', 'value', factory.getInput(4) );
5 moi.ui.bindUIToInput( 'tolerance', 'value', factory.getInput(5) );
6 moi.ui.bindUIToInput( 'numpoints', 'value', factory.getInput(6) );

From network.nod:
4 nFac.setInput(4, this.properties.mode[0]);
// nFac.setInput(4, 'normal');
5 nFac.setInput(5, this.properties.tolerance[0]);
6 nFac.setInput(6, this.properties.numPts[0]);

- Brian

(I plan on using network in a .js, .htm script.)

Thank you
From: Michael Gibson
21 Dec 2021   [#66] In reply to [#65]
Hi Brian, the inputs for Network go like this:

0: Object list - U curves
1: Object list - V curves
2: List of curve orientation values - U orientations, each has a "flipped" bool value and a "seam" parameter value.
3: List of curve orientation values - V orientations
4: String - Mode, one of "normal", "lighter", "custom", "uniform"
5: number - Custom tolerance, Fitting tolerance to use when mode = "custom"
6: int - Uniform Num Points, Number of interior points to use when mode = "uniform".

If you pile up all the curves in input 0 and leave input 1 blank and the orientation lists blank it will automatically sort the curves into separate U and V lists and generate the orientations.

- Michael
From: bemfarmer
21 Dec 2021   [#67] In reply to [#66]
Thank you very much Michael.
Separate u v inputs, availability seems nice.
Does this have any speed advantage?

I wonder a bit about what "List of curve orientation values means and how it works.
But probably do not need it.

Saw something about coons patch also...

- Brian
From: Michael Gibson
21 Dec 2021   [#68] In reply to [#67]
Hi Brian,

re:
> Does this have any speed advantage?

Not much speed advantage, but if you already know which set a curve is supposed to be in if you separate them then you won't run the risk of the automatic sorter making a mistake in classifying them.


re:
> I wonder a bit about what "List of curve orientation values means and how it works.
> But probably do not need it.

They will be created automatically for you if you leave it blank. It stores whether a curve should be flipped from its natural direction when used in the network and where the closing seam point of a closed curve should be switched to from its natural seam when used in the network.


> Saw something about coons patch also...

A Coons patch is when you have just 4 boundary curves, there is an "exact" option that can be used in this case.

- MIchael

Show messages:  1-16  17-36  37-56  57-68