running maxscript commands by simply selecting an object...

Is it possible to run maxscript commands simpy by selecting/clicking on an object in the scene.

i.e. I've got a GUI of various sliders for a face controlled with morph targets and bones.
Some of the sliders have a range of -5 to 5. If I want to make the value of the slider exactly 0 in the middle, I have to be in "Parent" coordinate space and the right click on the spinners to the left of the keyframe button in Max. Not a big deal for me, but not as simple as I want to provide for my client.

What would be great, is to have a little box in the GUI, just a little 2 triangle square plane... that when selected, re-sets the slider back to 0 automatically.

I know this is certainly doable by going through and creating custom attribute driven rollouts under the command panel, but I'm really trying to keep the clients workflow directly in the workview, etc.

Any ideas would be greatly appreciated!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

Hi Jason, am trying to figure

Hi Jason,
am trying to figure out your description...
The 'objects' in the rollouts are called rollout controllers, so you need just a button or imgtag, right? if so, you can set it size using 'width' and 'height' properties, set it position using 'pos:[x,y]', for example:
button btnReset "Reset" width:16 height:16 pos:[20,40]

And if the button is inside the same rollout (where is the spinner which you like to reset) then lets to say the spinner is named 'mySpinner' and the button is 'btnReset' then the event w'd like:
on btnReset pressed do (mySpinner.value = 0)

And if the button is located in different rollout then will need to include the full path to the spinner, i.e. for example - if 'mySpinner' is inside rollout named 'myRollout' then the expression:
mySpinner.value = 0
w'd become:
myRollout.mySpinner.value = 0

I hope this help.

my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.