Scripting
 1-11  12-31  32-51  52-68

Previous
Next
 From:  LAWRENCE
7238.52 
hi

a silly question...
how to debug script ?
we can't use a debugger, isn't it ?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7238.53 In reply to 7238.52 
Hi Lawrence - sorry no there isn't any way currently to run a script in a debugger, you have to debug it old fashioned style by calling moi.ui.alert( 'msg' ) in places where you want to see what a particular variable holds.

In the future I do want to try and make some kind of integrated debugger that would help make scripting easier. There will be quite a lot of work involved to make that happen though.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Bryan (BCGREEN24)
7238.54 In reply to 7238.6 
"Just copy each script to the clipboard, hit TAB in MOI, paste the script and press ENTER.
Experiment and enjoy
Martin"



Martin-- pressing TAB in MoI3D just moves the cursor between the input fields at the bottom of the interface. So-- I'm confused as to how these snippets are pasted into and run within MoI...

Thanks!
Bryan

EDITED: 6 Dec 2016 by BCGREEN24

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Bryan (BCGREEN24)
7238.55 In reply to 7238.54 
Never mind! I didn't realize that the 'location' input field doubled as a command line!

Bryan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7238.56 
Hi Michael,

Is there a simple way to allow the user to chose which mode of a script to run?
For example, one button for mode: unwrap cone,
another button for mode: unwrap frustum?

Another example, one button for "Enter radius points,"
another button for "Enter Mu value".

The Trim command relies on objectpicker to trigger selection of "Add trim points" button.
The Helix command relies on pointpicker to trigger selection of "Flat spiral" button.

I did try a dropdown box, with

code:
		<div id="ModeOptions" class="hiddencommandoptions">
			<table>
				<tr>
					<td>Mode:</td>
					<td>
						<select size = "2" id="Mode" style="width: 155px; height: 50px">
							<option value="radiusSpiral">Enter Radius Points</option>
							<option value="muSpiral">Enter Mu Value</option>
						</select>
					</td>
				</tr>
			</table>
		</div>

Which would need an Update button?
The select size = "2"... shows both options.
There was white space below the two options, which height: 50px removed, but maybe the css would control this?

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7238.57 In reply to 7238.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7238.58 In reply to 7238.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Bravlin
7238.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.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7238.60 In reply to 7238.59 
Hi Bravlin, sorry no there isn't currently any mechanism like that set up for MoI scripting.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Bravlin
7238.61 
How shall i query current tool context ? Is it possible ?
For example if i start Trim command dialog ?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7238.62 In reply to 7238.61 
Hi Bravlin, do you mean you want to get the name of the currently running command, if there is one, from script?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Bravlin
7238.63 
Yes currently runing command or dialog.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7238.64 In reply to 7238.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7238.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7238.66 In reply to 7238.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7238.67 In reply to 7238.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
7238.68 In reply to 7238.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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages:  1-11  12-31  32-51  52-68