PDA

View Full Version : Floaters and accessing custom attributes...


Mattrne
03-23-2004, 11:04 AM
I have a point helper object, called EXP_Control, which has various custom attributes on it, hooked up to my facial skeleton. When these custom attributes are changed, it changes the rotations and or scales on bones in the face, to allow for facial animation. What I want to do, is creat a floater, with sliders on, which drive these custom attributes. However, I'm having a bit of trouble getting my floaters sliders to update the value on the custom attributes. What I have so far is this;

--USER INTERFACE ITEMS

FirstDialog = newRolloutFloater"IMM Facial Animation Floater" 200 175
rollout FirstRollout "Mouth Controls:"
(
slider MouthRootLateral "Mouth Root Lateral: " range:[-10,10,0] orient:#horizontal ticks:20 type: #float
on MouthRootLateral changed val do EXP_Control.Mouth_Root_Lateral = val
)

addrollout FirstRollout FirstDialog

However, when i evaluate this and try to move the slider, I get the following error;

--Unknow property:"Mouth_Root_Lateral" in undefined

The custom attribute I'm trying to update is called Mouth_Root_Lateral, but for some reason, it aint picking it up! What do I have to do to get this working? I'm (once again) pulling my hair out here!:cry:

magicm
03-23-2004, 12:45 PM
Change :
on MouthRootLateral changed val do EXP_Control.Mouth_Root_Lateral = val
to :
on MouthRootLateral changed val do $EXP_Control.Mouth_Root_Lateral = val

The object needs to be prefixed by a $ sign for maxscript to recognize it as an object.



Another (and probably easier) option to set up your floater, is to assign the slider to the Mouth_Root_Lateral controller directly:

slider MouthRootLateral "Mouth Root Lateral: " range:[-10,10,0] orient:#horizontal ticks:20 type:#float controller:$EXP_Control.Mouth_Root_Lateral.controller

This creates a direct connection between the slider and the controller. See the online reference for more info on the controller: property of the slider control..

- Martijn

magicm
03-25-2004, 09:11 AM
so... how did it work out?

Mattrne
03-25-2004, 09:23 AM
I ended up changing it from sliders to spinners and have something like this;

spinner MouthRootLateral "Mouth Root Lateral " range:[-10,10,0] fieldwidth: 35 type: #float

controller:$EXP_Control.Custom_Attributes.Mouth_Root_Lateral.controller)

Seems to work nicely. Now I'm just attempting to work out how to only get the floater to generate if my EXP_Control object exists in the scene (which is proving harder than I expected!)

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