SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / MEL command for toonline
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 14-08-2009, 04:03 PM   #1
hockey1237
Registered User
 
Join Date: Sep 2008
Location: maryland
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?
hockey1237 is offline   Reply With Quote
Old 14-08-2009, 10:56 PM   #2
bendingiscool
Subscriber
 
bendingiscool's Avatar
 
Join Date: Jul 2006
Location: London
Posts: 567
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
bendingiscool is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MEL headache! happymat27 Members Lounge 5 05-12-2010 08:43 AM
MEL headache!! happymat27 Mel Scripts & Programming 1 03-12-2010 03:41 PM

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.