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
Loading

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 27-11-2006, 02:22 PM   #1
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default connecting attributes

hi,

I dont get the right syntax for this little script for linking custom attributes. I have a locator with added attributes - schalA...schalH. I need to connect the schalA to 35 object´s zRotation. please view my script and lend a helping hand


for ($i = 0; $i <= 35; ++$i)
{
$object_a = "schalA_" + $i;
eval select -r $object_a;


$object_b = "locator1" ;
eval select -add $object_b;

//commando
connectAttr -f "object_b" + ".rotateZ" object_a.rotateZ;



}


the schal_objects are deep down a hierarchy. hope that´s not the problem.


thx in advance
__________________
everything starts and ends in the right place at the right time.

Last edited by Falott : 27-11-2006 at 02:25 PM.
Falott is offline   Reply With Quote
Old 27-11-2006, 02:32 PM   #2
enhzflep
Subscriber
 
enhzflep's Avatar
 
Join Date: Oct 2006
Location: Melbourne
Posts: 313
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello.

Just wondering, 'ave you tried replacing the line

"connectAttr -f object_b object_a.rotateZ;"

with

"connectAttr -f $object_b $object_a.rotateZ;"

I reckon you're prob is a missing dollar sign (whatever the name for that is in the syntax).

I'm guessin they're variables you've defined in the mel code from the way you refference them. Since execution's making it past the other two refferences to them, I reckon that's your prob.

Simon
enhzflep is offline   Reply With Quote
Old 27-11-2006, 02:43 PM   #3
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

for ($i = 0; $i <= 35; ++$i)
{
$object_a = "schalA_" + $i;
eval select -r $object_a;


$object_b = "locator1" ;
eval select -add $object_b;

//commando
eval("connectAttr -f locator1.schalA schalA_" + $i + ".rotateZ");


}
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 27-11-2006, 02:52 PM   #4
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

thx for your help enhzflep,



this is working now




for ($i = 0; $i <= 16; ++$i)
{
$object_a = "schalB_" + $i;


$object_b = "locator1" ;
eval select -add $object_b;

//commando
eval("connectAttr -f locator1.schalB schalB_" + $i + ".rotateZ;");


}
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 23-12-2006, 04:07 AM   #5
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

you don't need all those eval statements:

for ($i = 0; $i <= 16; ++$i)
{
$object_a = ("schalB_" + $i);


$object_b = "locator1" ;
select -add $object_b;

//commando
connectAttr -f "locator1.schalB" ($object_a + ".rotateZ");


}

this will work better


A
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 23-12-2006, 04:33 AM   #6
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

thx for reply Pure!
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Problem - Unable to change attributes for multiple objects anthonysw3 Technical Issues 4 04-12-2010 11:56 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.