Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Mel Script Help! (https://simplymaya.com/forum/showthread.php?t=6994)

Tierackk 19-07-2003 12:49 AM

Mel Script Help!
 
I am a bit of an idiot when it comes to loading Mel. Can someone please tell me how to load this script into my shelf. The read me appears when you open it in the script editor. I want to use the duplicate camera so I can zoom into my image plane. I saved it a numerous different ways into my shelf but I always have a syntax error. Please help.



http://www.highend3d.com/maya/mel/?...ction=animation

The script is called "AddCamera V1.0" and the matchmove.mel scirpt is also on the same page.

mark_wilkins 24-07-2003 06:26 PM

You don't really want to put this script on your shelf unless you have made a user interface for it, as it requires a camera name on the command line.

Drag both MEL files into somewhere in your script path (usually the maya/scripts directory under your home directory is a good place) and relaunch Maya. Then, type this:

addCameras("persp");

(replacing persp with your camera name)
then hit enter on the numeric keypad. Unless you always run this command on the same camera name, putting it on the shelf wouldn't help you, because you'd have to have a separate button for each camera name.

Of course once you've put the MEL files in your script path you could always drag these lines to your shelf instead:

Code:

string $result = `promptDialog -t "Pick a camera"
                              -m "What camera would you like to add?"
                              -tx "persp"
                              -button "OK"
                              -button "Cancel"
                              -defaultButton "OK"
                              -cancelButton "Cancel"
                              -dismissString "Cancel"`;

if ($result == "OK") {
  string $theCam = `promptDialog -q`;
  print ("Calling addCameras for camera " + $theCam + "\n");
  addCameras($theCam);
}

-- Mark

Tierackk 29-07-2003 12:08 AM

Thanks for taking the time to look into this Mark. I aprreciate your help.


All times are GMT. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018