PDA

View Full Version : Dual way controls


Harrad
01-18-2005, 07:37 PM
Hi,
I'm really new to maxscript, so sorry if this is a really simple question... I've written this so far..



rollout FaceRig "Face Rig" width:200 height:300

(

slider left "Left" pos:[12,8] width:44 height:99 range:[-100,100,0] orient:#vertical ticks:10

slider right "Right" pos:[137,8] width:44 height:99 range:[-100,100,0] orient:#vertical ticks:10

slider jawopen "Jaw" pos:[69,8] width:44 height:99 range:[-45,8,0] orient:#vertical ticks:10

on left changed val do$'head helper'.Right_Mouth = val

on right changed val do$'head helper'.Left_Mouth = val

on jawopen changed val do$'head helper'.Jaw = val



)

CreateDialog FaceRig width:200 height:300




Which i can use to animate my face with.. (its set up to control morph targets) but when i play it back the sliders stay still. How can i make the sliders move in the same way as my morph target sliders? (as tho they had a wire param on them)...

Cheers for any help...

Mat

LFShade
01-18-2005, 08:18 PM
You would need to set the sliders' .controller property to the controllers you want them to track. By sharing the controllers you get realtime update, keyframe marking (the red marks that appear around the control of an animated property), and typically a little bit faster interaction. Try this:

rollout FaceRig "Face Rig" width:200 height:300

(

slider left "Left" pos:[12,8] width:44 height:99 range:[-100,100,0] orient:#vertical ticks:10 controller:($'head helper'.Left_Mouth.controller)

slider right "Right" pos:[137,8] width:44 height:99 range:[-100,100,0] orient:#vertical ticks:10 controller:($'head helper'.Right_Mouth.controller)

slider jawopen "Jaw" pos:[69,8] width:44 height:99 range:[-45,8,0] orient:#vertical ticks:10 controller:($'head helper'.Jaw.controller)

)

CreateDialog FaceRig width:200 height:300


RH

Harrad
01-18-2005, 11:52 PM
That didn't seem to work, it came back with...

"runtime error, atempting to access deleted controller"

:?

Matt

Harrad
01-19-2005, 12:19 AM
This seems to work if i change the slider to a spinner...



rollout FaceRig "Face Rig" width:200 height:300

(

spinner jawSpin "Jaw: " pos:[43,10] width:114 height:16 range:[-45,8,0] type:#integer controller:($'head helper'.Jaw.controller)

spinner left "Left: " pos:[39,41] width:114 height:16 range:[-100,100,0] type:#integer controller:($'head helper'.Left_Mouth.controller)

)

CreateDialog FaceRig



But If i go in to visualMaxScript to move the spinners, it replaces ($'head helper'.LeftMouth.controller) with Controller:Bezier_Float

I can then type in the controller entry ($'head helper'.LeftMouth.controller) but is there a better way of keeping this from changing.

Thanks alot...

Matt

LFShade
01-19-2005, 08:42 AM
I always forget that sliders don't have the controller property like spinners (a major oversight in MXS controls, IMO). Yep, you'll have to go with spinners for that method to work, I guess.

There's really no way to protect your code from being changed by VMS. Some parts of VMS seem not to have been developed very robustly, and one of those is that it tends to want to rewrite the control parameters with the result of any expressions used. When I use VMS I usually try to develop a UI without any functionality, then when it looks like I want I'll abandon VMS entirely to tie in the functionality. Any further tweaking of the UI after that point I will do manually to avoid the pitfalls of running the code through VMS.

-S

CGTalk Moderation
01-20-2006, 11:00 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.