Notifications
Clear all

[Closed] Maxscript on sliders

Hey there,

Im not so skilled in maxscript and i’ve encountered a problem.

I made a setup where a slider controls movement of a bone structure (through wire parameters)

Now i made several custom buttons and i want to program the buttons so it makes the slider move. I want to have a button with 100 value of the slider, of with 50 value and one with 0 value. I’ve tried moving the sliders while having the MacroRecorder on, but it doesn’t record the movement.

Is the thing i want to do even possible? And if so, can anybody give me a hint on where to start:)?

Thanks!

8 Replies

I think what you are trying to do is possible. Is the slider you are trying to control a manipulator from that you have created in the scene or a ui object on a rollout?

It’s a manipulator that is created in the scene

Ok, and are the buttons on a rollout or are they on a running macros from a toolbar?

I hope to make them out of macro’s which i can put in the toolbar. I already made a custom toolbar, but there is nothing in it yet:)

Ok, after running the script go to the ‘Toolbars’ tab on ‘Customize User Interface’. Then look in the category pulldown and you should find a new category ‘Slider’ with 3 new macros. Drag these onto a toolbar and select your slider. The buttons should then be enabled and control your slider.

macroScript sliderZero category:"Slider" tooltip:"Set slider to 0" buttonText:"Slider 0%"
(
	on isEnabled do isKindOf $ sliderManipulator
	on execute do
	(
		$.value = 0
	)
)

macroScript sliderHalf category:"Slider" tooltip:"Set slider to 50%" buttonText:"Slider 50%"
(
	on isEnabled do isKindOf $ sliderManipulator
	on execute do
	(
		$.value = ($.maxVal * 0.5)
	)
)

macroScript sliderMax category:"Slider" tooltip:"Set slider to 100%" buttonText:"Slider 100%"
(
	on isEnabled do isKindOf $ sliderManipulator
	on execute do
	(
		$.value = $.maxVal
	)
)

Thanks a lot for your help Raytracer! This works perfectly:)

Greetings,
Charriej

You’re welcome. You should be able to adapt it to other values or even write new macros.

Yes I’ve already editted it:) It’s simple to do when you already have a code, the hard thing to do is actually think of the code from scratch. So thanks again:)