PDA

View Full Version : Slider Driving Multiple attributes


tomjelfs
01-24-2007, 08:51 AM
Hey everyone,

I'm just scripting a UI for a character and in the past I've simply had individual sliders to drive the fingers but I'd like to have one slider drive all the fingers at once to make a Fist.

how do you have multiple attributes driven by 1 slider?

Here's my current slider:



rollout LhandCTRL "Left Hand Control" width:221 height:117
(
spinner spnLMakeFist "Make Fist" pos:[20,10] width:100 height:15 range:[0,10,0]
on spnLMakeFist changed val do
$'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes.Thumb_Curl = val
)

characterUI = newRolloutFloater "Fist Control" 200 100

addRollout LhandCTRL characterUI



I'm hoping its something as simple as


$'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes.Thumb_Curl&Ring_Curl = val


Obviously I've tried '&' and it didn't work.

Any ideas?

Zbuffer
01-24-2007, 12:04 PM
a=$'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes
a.Thumb_Curl = a.Ring_Curl = val

tomjelfs
01-24-2007, 12:17 PM
-- Syntax error: at ., expected name

-- In line: a.Thumb_Curl = a.Ring_Curl = val

Thanks but didn't work. Wouln't the first variable override the second anyway?

PEN
01-24-2007, 02:07 PM
I don't think that it will allow this. You can do it with custom attributes in the pb2 and list multiple tracks but with the controller property of a spinner I think that it will only take one controller.

In the past I have had to write the tracks to be controlled into the event handler and then add a call back that updates the spinner with the value of the controllers when they are animated.

Zbuffer
01-24-2007, 02:52 PM
ok,
does this work ?

$'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes.Thumb_Curl = $'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes.Ring_Curl = val

luigi
01-24-2007, 03:25 PM
what i do in my rigs and normally work quite good is:

for each slider i just put on the controller a float list:
on the float list i got th first controller wired to fist slider
and the second channel with a normal bezier and active.

whta thas will do is when you move the fist slider will move al the finger slider because you have all the slider with a float list and the first on the float list wired.

Remember to wire the finger rotation to the actual float list instead of a individual controller of the slider for each finger.so the rotation willl be done with the wired + normal bezier

And if you want to be more acurate, on top on the float list, put a float limit with the limit of the slider so it can go further.

Hope this help.

tomjelfs
01-24-2007, 05:21 PM
I was just about to post on here saying I've figured it out anad it turns out Zbuffer was right :

Oooh I got it working

rollout LhandCTRL "Left Hand Control" width:221 height:117
(
spinner spnLMakeFist "Make Fist" pos:[20,10] width:100 height:15 range:[0,10,0]
on spnLMakeFist changed val do
$'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes.Thumb_Curl =
$'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes.Index_Curl =
$'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes.Middle_Curl =
$'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes.Ring_Curl =
$'CTRL_L_Wrist'.Attribute_Holder.Custom_Attributes.Pinky_Curl =

val
)

characterUI = newRolloutFloater "Fist Control" 200 100

addRollout LhandCTRL characterUI

PEN
01-24-2007, 05:33 PM
Like I said, add it to the event handler, how ever the problem is that the spinner in the rollout doesn't get animated with the values that you are driving. If you want that you will need call backs.

PEN
01-24-2007, 05:34 PM
Although a work around would be to add one of them to the controller property of the spinner so that it updates the spinner durring animation.

tomjelfs
01-24-2007, 06:07 PM
Cheers I'm gonna do some reading on call backs

CGTalk Moderation
01-24-2007, 06:07 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.