Notifications
Clear all

[Closed] How to make a simple button ?

Thanks Zbuffer…

yea that does work , now the question is… if I have 2 boxes.

how do I get them both to work to change the value of another object ?

I will need to make more then one button but with the same idea.

I still can’t seem to get the script to stay active. any help would be appreciated .

I have got the script to work how I wanted it to.
I had to bastardize the code to get it to work.
I still don’t fully understand all the syntax,
but was able to understand it enough to get it to do what I wanted.

I’m sure there is a much better way to streamline the code.
Once again beyond my skill level.

My last question is how do I get the script to run when
I run the max file ? I don’t want to have to run it manually every time
I open the file…

The key thing that I wanted is to make the button a floating interface
NOT a button that was embedded in max.

Here is a video showing how it works as intended on an actually model with morphs.

Here is how I did the script based on the code that “Zbuffer” posted.

THANK YOU FOR YOUR HELP !

 
( 
deleteAllChangeHandlers id:#foo
 
when select $Sphere01 changes id:#foo do
 
 (
 
  if selection[1]==$Sphere01 do 
 
  $FaceControl01/FaceControlHandle01.controller[1].position = [0,3.9,0]
 
  $FaceControl02/FaceControlHandle02.controller[1].position = [0,-3.9,0]
 
  $FaceControl03/FaceControlHandle03.controller[1].position = [0,-3.9,0]
 
	 )
 
 
 
 
 
deleteAllChangeHandlers id:#fo2
 
when select $Sphere02 changes id:#fo2 do
 
(
 
if selection[1]==$Sphere02 do 
 
$FaceControl02/FaceControlHandle02.controller[1].position = [0,3.9,0]
 
$FaceControl01/FaceControlHandle01.controller[1].position = [0,-3.9,0]
 
$FaceControl03/FaceControlHandle03.controller[1].position = [0,-3.9,0]
 
)
 
 
 
 
 
deleteAllChangeHandlers id:#fo3
 
when select $Sphere03 changes id:#fo3 do
 
(
 
if selection[1]==$Sphere03 do 
 
$FaceControl03/FaceControlHandle03.controller[1].position = [0,3.9,0]
 
$FaceControl02/FaceControlHandle02.controller[1].position = [0,-3.9,0]
 
$FaceControl01/FaceControlHandle01.controller[1].position = [0,-3.9,0] 
 
) 
 
)
 

Throw it in your scripts/startup folder for now since you’re using it. I’m working on a version that asks if you want to run it on startup but it isn’t working right now.

Sorry it took so long to find the solution you’re looking for. The past week I’ve been swamped. There is a script at ScriptSpot that will load the script and run it each time you load the scene. Called Autoexec 0.11. This way you don’t need to run it every time Max starts.
I haven’t used it myself but from it’s description you should be able to distribute your scene anywhere without needing to distribute the script seperately. However according to the description you can also just have the scene point to the external script if you want to go that route.

Link

Enjoy,
Bill

Thanks for your response Bill.

I may also try to embed it into a custom attribute on an object in the scene…
but I have no idea if that will even work I would have to test it.

If all fails I will just use the buttons and sliders that can be scripted in max.

Page 2 / 2