View Full Version : Use Existing Maya Procedures in Custom Gui
02-25-2009, 05:29 PM
Is there a way to have Maya's existing procedures load into a custom UI. Example:
I've written some scripts that preform some automated actions based on curves. I'd like to give the users the option to rebuild their curves before they do anything and I thought it'd be nice if they could do it right from the UI I created. I realize that I could write my own interface that looks just like the Rebuild Curves Option window and then pass all of the captured arguments to the rebuildCurve command, but it seems to be a bit redundant if all of that stuff has already been written. I'd like to dump the contents of the Rebuild Curve Options window to my own UI, perhaps in a frame or something. Is this feasable?
02-25-2009, 06:28 PM
For your example you would have to edit the proc which builds that UI. Option box UI's in Maya all call a proc that gets them the option box parent widget to use so that they all show up in the same window.
In your case you can look at "rebuildCurveOptions" in performRebuildCurve.mel. You'll see it calls "getOptionBox()" which returns a layout that it uses as its parent.
What you should probably try is to copy/paste that entire proc into your own and change how it gets the layout...eg. instead of calling "getOptionBox" you just create your frame layout. Then if you keep all the naming the same it might just work on it's own. It ends up calling things like rebuildCurveSetup and rebuildCurveCallback...which rely on the names of the controls to do what they need.
02-25-2009, 07:50 PM
Thank you for the hint. I spent some time trying to circumvent the getOptionBox() proc with my own, but there are too many subsequent calls to local procs in getOptionBox.mel, which if I incorporated, would bloat my code well beyond what is tolerable. I'll just stick with a button that opens up the Rebuild Curve Options window.
02-25-2009, 07:50 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.