LED eyes

Hi, I'm new to Maxscript, have 3 years c++ experience, and about 5 years of 3d studio Max experience.
I'm looking for an easy way to animate Led eyes for a robot (like EVE in WALL-E).
So I was hoping if anyone could help me with this, or if there is already a script that could be used for this.
The ideal solution would be something with a window where you have a button for each LED (sphere). Each button controls the visibility/luminosity of the LED(on or off).
Here's a visual example I made for clarity:
http://imageshack.us/photo/my-images/812/examplef.jpg/

It's for my graduation movie (third bachelor year in animation), so there's no budget...

Comments

Comment viewing options

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

Here's the movie!

Enjoy:
http://www.youtube.com/watch?v=djaL5kVoSo4&feature=youtu.be&hd=1

again, thank you everyone for helping me.

barigazy's picture

Hi Mantichore,

you make very interesting short movie.
Is this advertisement for a product, or some peronal project?

barigazy

Mantichore's picture

It was my Bachelor graduation

It was my Bachelor graduation movie, for my third year of animation at RITS (art university in Brussels, Belgium).
the assignment was to make a short animation for children, minimum 1 minute, subject/story was our own choice (but the teacher had to agree).

Anubis's picture

just suggestion

You said never learn maxScript, so you expect some complete working script? Well, I haven't so much time. You wish as well to animate this via dialog but with varied amount of objects? If so you'll need dynamicly created dialog (check in the help for rolloutCreator functions). Also to note that only the Spinner UI-controller has #controller property which simplify it 'binding' to animatable property. To wire CheckButton (or other UI-control) you'll need CustomAttributes.

What I can helps atm anyway is to hint you to use (or at least give it a try) Materail Modifier. This way you can create only 1 (MultiSub) material (with 2 sub materails) and using it for all spheres. Next, apply unique (not instance) mat-mod to each object, and then you can animate the materialID of this modifiers.
The good news in that approach is that you can accomplish your animation without scripting. Another good news, - I have a few scripted examples, very simple and readable at my web site (here). You can watch short videos there too, on what each script do. The third one show very basic usage of Materail Modifier animating method.

Cheers!

my recent MAXScripts RSS (archive here)

jos's picture

How do you see your LED

How do you see your LED lights. controlled by lights or illumination map, or..?

Mantichore's picture

What I had in mind was that

What I had in mind was that each LED in the array is made of two spheres on exactly the same space (one sphere with a very light colour and a high self-illumination, the other very dark).
And each button in the array controls which sphere you show. So, when a button is ON, the corresponding LED sphere with the light material is visible (the other not visible). When the button is OFF, you switch the visibility, and the dark sphere becomes visible, the other becomes hidden.

But the actual materials don't really matter, that's no problem for me.
It's just the rigging/button thing I can't do. (It's been three years since i did some c++ programming, so a bit rusty there and I'm not familiar with the MAXScript language)

so no lights needed, just a bunch of spheres, if possible with a user-adjustable amount, so you can add more/less LED's.

PS: I just saw you are a DAE student? Me too, I was one of the first to graduate, but we never had MAXscript. I'm currently a student at RITS in Brussels. So if you want I can continue in Dutch :)

br0t's picture

I dont know if it would be a

I dont know if it would be a great joy to create and link all those buttons to the spheres or use it for animation. Maybe you can just select the LEDs you want to change and use 2 or 3 buttons to edit their state. I gave it a try here, each Sphere has a simple Standard Material and the script changes its Diffuse and SelfIllumination. To make sure the material changes dont propagate on other objects, you can use the "make unique" button.

try(destroyDialog roLeds)catch()
 
rollout roLeds "LEDs" width:130 height:133
(
	button btnOn "On" pos:[4,40] width:59 height:55
	button btnOff "Off" pos:[68,40] width:58 height:55
	button btnUnique "Make materials unique" pos:[4,5] width:122 height:30
	button btnInvert "Invert" pos:[4,99] width:122 height:30
 
	on btnOn pressed do
	(
		for s in selection where superClassOf s == GeometryClass do
		(
			try
			(
				with animate on
				(
					s.material.Diffuse = color 255 0 0 
					s.material.SelfIllumAmount = 100
				)
			)
			catch(print "Error - wrong material on selected object?")
		)--end for
	)--end on
 
	on btnOff pressed do
	(
		for s in selection where superClassOf s == GeometryClass do
		(
			try
			(
				with animate on
				(
					s.material.Diffuse = color 85 0 0 
					s.material.SelfIllumAmount = 0
				)
			)
			catch(print "Error - wrong material on selected object?")
		)--end for
	)--end on
 
	on btnUnique pressed do
	(
		-- if the material is shared among the objects, changing it will affect more objects than it should
		for s in selection where s.material != undefined do
		(
			theMat = copy s.material -- copy and reassign each material to avoid instances
			s.material = theMat
		)--end for
	)--end on
 
	on btnInvert pressed do
	(
		for s in selection where s.material != undefined do
		(
			try
			(
				with animate on
				(
					if s.material.Diffuse == color 255 0 0 then
					(
						s.material.Diffuse = color 85 0 0
						s.material.SelfIllumAmount = 0
					)
					else
					(
						s.material.Diffuse = color 255 0 0
						s.material.SelfIllumAmount = 100
					)
				)
			)
			catch(print "Error - wrong material on selected object?")
		)--end for
	)--end on
 
)
createDialog roLeds

The "with animate on" context will use the standard tangents, so if you want a harsh switch, change them to linear.

Cheers

Never get low & slow & out of ideas

Mantichore's picture

wow, thanks! I wanted the

wow, thanks!
I wanted the multiple buttons for an easier visualisation when animating (like when you use a facial rig to control facial expressions).
But your script does what I want, which is the most important. So again, thank you.
if you want I'll put your name in the end credits when my movie is finished (not that it will be shown all over the world)

and if anyone still wants to make the multiple button thing, feel free ;)

br0t's picture

haha feel free, just post the

haha feel free, just post the movie here when its done :D

Never get low & slow & out of ideas

jos's picture

with multiple buttons

i made the script with multiple buttons. it does pretty much the same as br0t's script, but with for each LED a button. It makes the spheres as well, to keep the information wich button's for corresponding LED. if you want something changed, yoy can always mail me. (if you want your own mesh for a led i can make you a pickbutton or wathever) script in attachment.

AttachmentSize
ledmain.ms 5.83 KB

Comment viewing options

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