Introduction to Maya - Modeling Fundamentals Vol 2
This course will look in the fundamentals of modeling in Maya with an emphasis on creating good topology. It's aimed at people that have some modeling experience in Maya but are having trouble with complex objects.
# 1 14-08-2009 , 04:03 PM
Registered User
Join Date: Sep 2008
Location: maryland
Posts: 1

MEL command for toonline

I'm working on a project using the toon shader and toon lines. Its a pretty big project with about 50 scenes, and multiple shots per scene, but almost every scene will be using the same model. I know that you have to connect the camera.translate to the pfxToonShape.cameraPoint. The scrips is:

connectAttr -f "camera1.translate" "pfxToonShape1.cameraPoint";

What I want to do though instead of executing this command 400 times on this project, is create a MEL script that I can put on my shelf. So what I would like to do is change the above scipt to use the active camera's translate rather than having to type in the camera name, and connect it to the cameraPoint of a selected pfxToonShape. So what is the code that I would have to replace "camera1" and "pfxToonShape1" with?

# 2 14-08-2009 , 10:56 PM
bendingiscool's Avatar
Subscriber
Join Date: Jul 2006
Location: London
Posts: 567
Haven't got Maya in front of me but the rough code should be something along these lines...

string $sel[] = `ls -sl`;
string $toonStuff = `toon command`;

connectAttr -f ($sel[0] + ".translate") ($toonStuff[1] + ".cameraPoint");

Chris

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads