Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 14-08-2009, 05:03 PM   #1
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, 11:56 PM   #2
bendingiscool's Avatar
Join Date: Jul 2006
Location: London
Posts: 567
Thanks: 0
Thanked 1 Time in 1 Post

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");

bendingiscool is offline   Reply With Quote

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

Thread Tools

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.