set Attribute by slider?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  07 July 2007
set Attribute by slider?

Good day everybody,

I'm just busy figthing my way through my very first script and it's
almost finished. The one thing left is a slider I want to have in my
little window that changes a deformers envelope.
The code itself works (when I open my window, drag the slider,
highlight the code below and execute it):

float $strengthValue = `floatSliderGrp -q -value strengthSlider`;
setAttr "GridDeformer.envelope" $strengthValue ;

But I fail to use the /dragCommand/ of the /floatSliderGrp/ to execute
these two lines every time the slider becomes moved, here's the part
I'm stuck at:

/rowLayout -numberOfColumns 1 ;
floatSliderGrp -label "Strength" -field true -pre 2
-minValue 0 -maxValue 1
-dc "float $strengthValue = `floatSliderGrp -q -value strengthSlider`;
setAttr"GridDeformer.envelope" $strengthValue ;"
setParent ..;

As I earlier mentioned, I'm a newb and pretty afraid my mistake is
insanely obvious, but I'd be glad if someone could point me in the
right direction.
  07 July 2007
You want to use attrFieldSliderGrp instead.
Fredrik Brännbacka | Technical Director
  07 July 2007

thank you very much for the fast reply, works like a charm

Best, flo.
  07 July 2007
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 06:57 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.