Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / How many links per attribute?
  RSS 2.0 ATOM  

How many links per attribute?
Rate this thread
 
56304
 
Permlink of this thread  
avatar
  • Total Posts: 1
  • Joined: 03 October 2009 08:13 AM

Hi all,
I am new at mel scripting and i don’t know many things about mel so i would like your help.
I want to write an expression that will link the translate attributes tX, tY, tZ of 30 locators with the low bound attribute of a sine deformer.
I wrote this and its working, for just one locator:

string $sel[] = `ls -sl`;
for($tmp in $sel){
expression -s ("if (("+$tmp+".translateX !=0) || ("+$tmp+".translateY !=0) || ("+$tmp+".translateZ != 0)) “ +
“sine1.lowBound = -0.8 ;” +
“ else “ +
“sine1.lowBound = -0.4; “);
};

The issue is that is not working when i am trying to connect all of them with the sine’s attribute and i get this error:

// Error: Attribute already controlled by an expression, keyframe, or other connection: sine1.lowBound //

i really need some help with this thank you in advance.



Replies: 0
avatar
  • THNKR
  • Posted: 27 May 2011 02:39 AM

A plug has one input. One “link per attribute” in other words.

Create a proc that will return a true or false and use that in the expression:

if (`isIdentity`)
 
sine1.lowBound = -0.8 ;
else
 
sine1.lowBound = -0.4;

the proc can then loop over the locators and figure out if they’re where you want them or not and modify the return value as necessary.



Replies: 0