PDA

View Full Version : Float fields


shazam
11-07-2002, 12:03 AM
How do you pass float field values to objects? For example: You want to scale an object to certain value, and you have a little float field with a button saying "Go." How would you apply the value in the float field to the object?

bigfatMELon
11-07-2002, 06:57 AM
Simply: setAttr. If you are talking about having a field in your own window with a button to apply the value in that field to an object's attrs, then the logic would go something like:

-define the button with with a command that calls a global proc
-the global proc queries the float field value
-it then, perhaps gets the current selection and applies that value to whatever attrs in a for loop such as:

float $data = `button -q floatFieldAddress`;

for ($x in $sel){
setAttr ($x + ".attrName") $data;
}

-jl

CGTalk Moderation
01-13-2006, 09: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.