View Full Version : help on intField pls...
01-22-2008, 07:31 AM
thanks for viewing
i have an intField. and i need to put the number thats typed onto into a variable. so i can use it for some procedures.
thanks guys. this is driving me nuts.
you are my brother
01-22-2008, 07:54 AM
hmm...sorry i don't really get the problem.
so you have an int array and you want to use those values in a procedure?
values = 3;
i'm pretty sure that this isn't really your problem so please specify where you get errors.
01-22-2008, 08:15 AM
that was a fast reply hehehe
anyways...heres my problem in more detail...
i made a UI that has an intField in it.
i need to get whatever value was typed in the intField into a variable.
int $number = `intSliderName`;
so that i can use the $number to drive some other stuff in my procedures.
anyways. i hope you understood me. pls forgive me since i am just new to programming,so im still getting a hold on programming jargons hehehe
thanks a lot :)
01-22-2008, 03:17 PM
well this is an attribute that you've defined. to get the values of a attribute do this:
int $value = 0;
$value = `getAttr Object.number`;
...where $value is the place where the float value will be stored. object is your node and number is your float attribute.
if you need more details just ask or look it up in the documentation. there are some examples
01-23-2008, 02:08 AM
getAttr would be easy if i were querying an attribute. however,i need to get the exact number that was typed in the intField. ill try to post some stuff later :) my boss is here.
01-23-2008, 02:45 AM
it's a very simple task, so i'm assuming you're somewhat new to mel.
hope the following code makes sense to you.
////////////// create a UI
window myWindow; // create a window called "myWindow"
columnLayout; // create a columnLayout
intField myIntField; // create an intField called "myIntField"
showWindow myWindow; // display the window
///////////// query whatever value is in the intField
int $myVar; // create a variable called "myVar"
$myVar = `intField -query -value myIntField`; // query the value from the intField called "myIntField" and save it in the variable "myVar"
01-23-2008, 02:58 AM
$myVar = `intField -query -value myIntField`;
COOL! i guess thats what i needed. i always knew that its the -q flag but i just didnt know how to format it. LOL
thanks :D ill try it as soon as i can.
01-23-2008, 02:58 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.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.