Force ppg to open on script launch

16 views
Skip to first unread message

Adam Sale

unread,
Jan 8, 2013, 6:39:43 PM1/8/13
to soft...@listproc.autodesk.com
I'm a little confused as to why the following does not work: 

Get a sphere

Run Deform  > Smooth

PPG appears and all is good. 

Now, take the generated command and run it through the script editor 

ApplyOp("Smooth", "torus", 3, siPersistentOperation, null, 0);

This time, no PPG appears. 

Any idea why? And is there a way to force a ppg launch when I tun the command from a button or from the script editor? 

Thanks :-)

Adam

Peter Agg

unread,
Jan 8, 2013, 6:44:34 PM1/8/13
to soft...@listproc.autodesk.com
Off the top of my head try:

op = Application.ApplyOp("Smooth", "torus", 3, siPersistentOperation, null, 0)
Application.InspectObj(op)

It's a little inconsistent - some commands automatically open the PPGs even from the script and you have to find a silent version. Others are always silent and you have to inspect them afterwards.

Matt Lind

unread,
Jan 8, 2013, 6:47:09 PM1/8/13
to soft...@listproc.autodesk.com

Generally speaking, you don’t want PPGs and other UI displaying when running code.  That’s why ApplyOp() doesn’t spawn a PPG.  The menu that calls the smooth deformer probably has a little code wrapped around ApplyOp() to open the PPG if successful.

 

 

Matt

Vincent Ullmann

unread,
Jan 8, 2013, 8:53:58 PM1/8/13
to soft...@listproc.autodesk.com
quick addition:

Use
op = Application.ApplyOp("Smooth", "torus", 3, siPersistentOperation, null, 0)
Application.InspectObj(op,null,null, silock)

so you could lock the PPG, so that it wont disapear if you run another command after this

Stephen Blair

unread,
Jan 10, 2013, 7:13:58 AM1/10/13
to soft...@listproc.autodesk.com
You could use AutoInspect() on the ops returned by ApplyOp, which is what Softimage does in the code Matt mentioned.
http://wp.me/powV4-2qW
Reply all
Reply to author
Forward
0 new messages