PDA

View Full Version : Weird Adding Attribute Dilema


InvaZimm
05-15-2005, 08:25 PM
Nevermind. Stupidity Avoided. Gotta love how when you're having insignificant problem in MEL and you post about it, you'll almost always come across the solution.

markbones
05-15-2005, 09:59 PM
I'm currently writing a script and have come across a weird error while trying to add attributes to a control:

Error:
// Error: line 126: No object matches name: addAttr //

Lines it's referring to:
//make sure control is selected
select $control
//add attributes
addAttr -longName FOOT -attributeType bool -keyable 1;

Has anyone else come across this? Anyone have an idea on how I might be able to fix this problem? Greatly Appreciative.

Are the above lines copied directly from a larger script? The way I reproduced the error was by copying and pasting your 2 lines of code - if those are directly form your script, you are missing the semi colon after your 'select $control' statement.

//make sure control is selected
select $control;
//add attributes
addAttr -longName FOOT -attributeType bool -keyable 1;

Cheers.

john_homer
05-15-2005, 11:07 PM
you dont actually need to select the object...

addAttr -longName FOOT -attributeType bool -keyable 1 $control;

.j

InvaZimm
05-16-2005, 05:17 AM
Thanks for looking, the both of you. Appreciate it. I did end up finding that little mistake about the semicolon like right after I posted about the problem.

john_homer - yeah, you're definitely right about that, I keep forgetting that you can do that. guess I was thinking more in the typical state of things, having to select the object while clicking the modify>add attribute and so on. I'll try and keep that in mind more often.

CGTalk Moderation
05-16-2005, 05:17 AM
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.