PDA

View Full Version : Using floatFieldGrp in an equation?


Ekenryd
11-24-2011, 09:37 PM
Hello

Iīm trying to get the value from my float field and use it in an equation, but it doesnīt work. If I query it directly in my equation I get "// Error: Cannot use data of type no type in a scalar operation. // ". Why is it "no typ"? If I use a float field, shouldnīt it return a float?

I tried making it like this and all I get is 0 in $heightMultiplier. Donīt mind the structure of the code, just copied the important parts.

floatFieldGrp -label "Height Multiplier"
-numberOfFields 1
-value1 1.000
"heightMultiplier_FFG";

float $height;
float $heightMultiplier = `floatFieldGrp -query "heightMultiplier_FFG"`;

$height = rand(0.75,1.1) * $heightMultiplier;

What am I not understanding here?

NaughtyNathan
11-24-2011, 10:28 PM
you are not telling it what PROPERTY of the floatFieldGrp you want to query. How does it know whether you want to query the label, the value, the width, etc...
float $heightMultiplier = `floatFieldGrp -query -value1 "heightMultiplier_FFG"`;:nathaN

Ekenryd
11-25-2011, 12:12 AM
Oh damn, so obvious. Thanks! :)

CGTalk Moderation
11-25-2011, 12:13 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.