View Full Version : MEL-Multi-attr-value setting
11 November 2002, 08:58 AM
Anyone know of a way to wildcard objects and attrs to change values?
I have a list of objects each with different names (sequential) and I'm trying to change values of the attributes in each to the same value, but I'm getting an object not found error in my really pathetic mel "pasting"
I select obects --> select -r "*Constraint1";
Then I want to change the attrs, but the wildcard doesn't work right..
setAttr "*Constraint1.*_SPLW2" 0;
I'm using the wildcard because the attributes have similar names. They vary slightly.
Maybe there's another way to type it in there. Or a script that does it. The Trick is the attributes have similar names. Not exact.
11 November 2002, 05:29 PM
You are probably going to have to write a script to iterate through and find the object and attributes that need changing. You can find the objects by using something like
string $listObjects  = `ls "Constraint1"`;
for ($objCurr in $listObjects)
// search for and change your attributes.
Then for the attribute searching you'd need something like
string $listAttribs = `listAttr $objCurr`;
for ($strCurrAttrib in $listAttribs)
if (`gmatch $strCurrAttrib "*_SPLW2"`)
setAttr ($objCurr + "." + $strCurrAttrib) 0;
Note that I'm just typing this off the top of my head, so no promises to it being bug free. (^_^)
Hope this helps,
11 November 2002, 10:04 AM
Mel off the top? Thanks alot man...
I'll give it a shot!
01 January 2006, 11:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.