Notifications
Clear all

[Closed] Scripting Slider value into rollout GUI

Hi everybody,

I´m building a character with some face morph controls. Looking good so far, I even wired facial morphs, teeth and tongue to slider objects in my viewport. So far so good. However the sliders cluttering my viewport annoyed me. So I had the idea of building some sort of scripted rollout window. Nothing fancy, for starters, just a place to organize my sliders.

Now, here´s my problem. I cant manage to have my scripted slider control my slider object. Here´s my code so far:

rollout slider1 "Mouth Controls"
   (
   	slider mouth_open "Mouth open" orient:#horizontal value: 0 ticks:10 Controller: (slider_object1[#value]) ange:[0,100,0]
   )

I think I am still missing something? Set up the value as a variable? Or is it that I need to create some sort of controller for my slider object first that can be accessed by my script? Currently I´m out of answers, searched the forum to no avail. Any suggestions/pushing in the right direction for this problem are greatly appreciated.

Thank you in advance for helping a Max Script newbie

Chris

5 Replies

Hi chris,

the ‘controller’ property needs exactly that in order to bind a scripted UI to a viewport control. Your method is passing a ‘value’ which would probably be a number (integer or float) which is the value of the controller. So first you need to see if your viewport control has a controller to bind to – i dont know in your case what that would be but it is usually something like ‘slider_object1.controller’

Thanks LoneRobot,

took up your tip and found the solution by meddling a bit around with the script listener. Seems the slider objects already have a controller when created. So here´s the corrected script which will create a slider window which in turn remote control your viewport sliders

rollout Selection1 "Selection Sets"
 (
 
 	slider mouth_open "Mouth open" orient:#horizontal value: 0 Controller:$sl_mouth_open.value.controller ticks:10  range:[0,100,0]
 	slider eyes_open "Eyes open" orient:#horizontal value: 0 Controller:$sl_eyes_open.value.controller ticks:10  range:[0,100,0]
 
 	)
 
 if SelectorFloater != undefined do
 				(
 				closerolloutfloater SelectorFloater
 				)
 SelectorFloater = newRolloutFloater "Animation Controls v0.1" 250 250
 				
 addRollout Selection1 SelectorFloater rolledup:false
 

It seems so easy once you finish, but until I´m there I feel like a total moron.

Thanks, case closed

Chris

that’s the stuff, you could now consider removing the link to to viewport slider and passing the controller of the actual object you are influencing, it might speed your rig up if that was an issue. The other thing is to wire to a custom attribute on the character’s rig somewhere (i usually choose the head) and launch your floater from there.

Yes, Custom Attributes are the next logical step. I already bought the neccesary DVD´s by Mr.PEN, but haven´t had the time to watch them yet.

Anyway, the sliders work nicely now, the character isn´t that complicated (med poly resolution, CAT rig and about 10 CAT muscles to work out foldings and creases of skin and clothes), but for future productions I´d better take a look at CA´s.

Cheers

Chris

Hi everybody,

just started digging into Custom Attributes and it looks very promising. Currently I am creating those with the Parameter Editor, and then wiring them to my facial controls. Both steps are done by hand. Then I use this command:

slider brow_up_l "Brow up left" orient:#horizontal value: 0 Controller:$Head.Custom_Attributes[#01].controller ticks:10  range:[0,100,0]

to have my slider GUI control the Custom Attributes. Works like a charm…

…but…

while I have been able to create a Attribute Holder modifer by script, I haven´t found the script command to add/remove/administrate Custom Attributes to objects. This would be very interesting.

Any help/further nudges in the right direction here to keep me on my path?

Cheers

Chris