Notifications
Clear all

[Closed] Visablity contoler roll out window

Hey guys, I’m ok with max scripting im trying to make a roll-out with slider or spinners that can be keyed with a value of 0-1 to animate the viability of objects. all i would need is one working i could do the rest to adapted it. many thanks

Cheers

basically it would look like this

Eyes”
left
right
up
down
Mouth:
open
close
quarter
and so on

6 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

simply set the spinner (slider) controller property to corresponding node visibility controller.

Take a look at the checkbox UI control, it gives you an easy on/off binary function.

For the visibility, are you speaking of hiding it from view in the viewport? Or making it unrenderable. If you are trying to make it go away from the viewport, you simple need to hide it

hide $object
unhide $object

If you would like to still see the object but have it unrenderable, you need to edit it’s renderable property.

$object.renderable = off

I would if i can get the max listener to work it wont display anything

Some how i got Reaction manager to work correctly, its still wonky as it display odd number then goes back to normal . i really wish they would make this a bit more easier to use an stable to use its not like they cant look to see how mayas SDKs work

here is a way how it can be done. (i personally prefer to add CA to baseobject and use the wiring instead of the instancing controllers but most of developers like to do the things how i show below):


   delete objects
 global visAttr = attributes visAttr
 (
 	parameters main rollout:main
 	(
 		R_Eye_Open type:#float default:1 ui:(ui_R_Eye_Open_sl, ui_R_Eye_Open_sp)
 		R_Eye_Close type:#float default:0 ui:(ui_R_Eye_Close_sl, ui_R_Eye_Close_sp) 
 	)
 	rollout main "Parameters"
 	(
 		group "Right Eye: "
 		(
 			label lb_R_Eye_Open "Open" align:#left
 			slider ui_R_Eye_Open_sl range:[0,1,0] ticks:0 width:90 align:#left offset:[0,-2] across:2
 			spinner ui_R_Eye_Open_sp range:[0,1,0] type:#float scale:0.01 fieldwidth:40 align:#right offset:[0,0]
 			label lb_R_Eye_Close "Close" align:#left
 			slider ui_R_Eye_Close_sl range:[0,1,0] ticks:0 width:90 align:#left offset:[0,-2] across:2
 			spinner ui_R_Eye_Close_sp range:[0,1,0] type:#float scale:0.01 fieldwidth:40 align:#right offset:[0,0]
 		)
 	)
 )
 at time 0, undo off, redraw off, animate off
 (
 	max create mode
 	Head = plane name:"Head" width:40 length:40 widthsegs:1 lengthsegs:1 pos:[0,10,0] wirecolor:orange
 
 	R_Eye_Open = plane name:"R_Eye_Open" width:10 length:10 widthsegs:1 lengthsegs:1 pos:[-10,20,1] wirecolor:green
 	R_Eye_Close = plane name:"R_Eye_Close" width:10 length:10 widthsegs:1 lengthsegs:1 pos:[-10,20,1] wirecolor:(green*0.5)
 
 	L_Eye_Open = plane name:"L_Eye_Open" width:10 length:10 widthsegs:1 lengthsegs:1 pos:[10,20,1] wirecolor:blue
 
 	#(R_Eye_Open, R_Eye_Close, L_Eye_Open).parent = Head
 	Head.transform = translate ((eulerangles 90 0 0) as matrix3) [0,0,20]
 	
 	modi = EmptyModifier name:"Face Control"
 	custattributes.add modi visAttr
 
 	R_Eye_Open.visibility = Bezier_Float()
 	modi.R_Eye_Open.controller = R_Eye_Open.visibility.controller
 	modi.R_Eye_Open = 1
 	R_Eye_Close.visibility = Bezier_Float()
 	modi.R_Eye_Close.controller = R_Eye_Close.visibility.controller
 	
 	max modify mode
 	select Head
 	addmodifier Head modi
 	modpanel.setcurrentobject modi
 )
   

also the sample shows how to use both slider and spinner to control the same parameter

oh sweet thanks ill mess with this, much appreciated