Change object's material based on current frame

Hi all,

Just a newbie, terminology might be a bit rough. I’m trying to find a way to make a row of budlights ‘chase’ during an animation based on three points of flashing.

I have more or less acheived what I am after using particles and altering their life span and quantity in a given number of vertices and over a calculated number of frames but I was hoping there might be a simpler solution.

Is there a way of changing an object’s material back and forth between two different materials at regular frame intervals without having to manually key frame the changes in?

I would need to have the object’s material set to say material “x” for say 5 frames and then set to material “y” for double that - 10 frames and then keep repeating this for up to the vicinity of 5,000 to 10,000 frames.

Anyone know if this is acheivable reasonably simply?

In the rendering attached, I have placed an object which consists of just three vertices (object is positioned so that each vertice floats in the centre of three adjacent glass covers in the row of budlights) and set it to emit halo particles (which do not move) at intervals which gives me the chasing light effect, but…

I’d like to be able to set the glass covers to emit 100% white light while the vertices inside them are emitting the halo particle. If I can change the material based on frame intervals I could probably do away with the whole particle emitting side of it too which is kinda tricky to get right.

Any thoughts would be very much appreciated.:o

Jon.

Attachments


Please avoid crossposting so many threads, the mods don’t like it.

You can some animate material settings by pointing at the Materials panels (F5) and pressing the I key.

You can also draw IPO (animation) curves with Ctrl-LMB in the IPO editor, which is probably what you need here. To keyframe Emit this way:

Select a bulb object. Open an IPO editor window and from the dropdown menu in the header select Material.
Click Emit in the list at the right side.
Ctrl-LMB click in the IPO window to set the first keyframe. Frame numbers are on the horizontal axis, the setting is on the vertical. Try setting keys at (0,0), (10,1), and (20,0).
Press T key in the IPO window and select Constant. This changes the curve from a smooth Bezier to a stepwise curve so the bulb will switch on/off. Note that IPO curves can be edited similar to objects. You can scale/move the whole thing, or hit tab to go into Point-edit mode to move individual keys.
From the Curve menu select Extend->Cyclic.

If you animate you should see the bulb’s Emit step from 0 to 1 repeatedly. Do this with the other bulbs but offset the time to get the chasing effect.

Thanks for that. I had a feeling it would have to be done in the IPO window. That place scares me.

I’ll give it a go.

Sorry bout the crossposting, wasn’t sure which department best suited my request.

By the way, when you say " crossposting so many threads" are you referring to my posting the same thread (this one) across the three different categories or that I am just posting too many different threads in general?

New to this so I just want to make sure I’m using the site properly thats all.

Lots of things are scary at first in Blender, but they become second nature pretty quickly if you practice. Then you say “how did I ever do without that.” For me it was IPO’s, UV mapping, and material/composite nodes. You can’t break anything by playing around – just save the important stuff first.

I was talking about posting the exact same thing in 3 different threads.

I’ve just been playing around with the IPO curves and, I haven’t rendered it to see yet but I think I’m getting that ‘how did I ever do without IPO’s’ feeling already.

Just a quick question though, I can’t for the life of me figure out how to get the points on a curve to exact levels. I know how to snap the points to certain frames but is there a way of typing in the value for Emit for instance? Rather than pressing G and having to eyeball it into position?

Select a control point in the IPO window, press N-Key and enter the values you want. It takes a little getting used to what numbers go where but it’s not difficult (basically X is frame, Y is value). Also note that you can select points, duplicate them and move them to where you want them and hold Ctrl while moving to stick to exact frames.

On cross-posting - don’t worry too much about which forum you post in - but just choose one forum. Obviously questions about how to do something go in one of the support forums so you wouldn’t post in the News forum, for example. Your question here could have gone in either, Basics, Animation or Texturing - there is no “correct” forum for it. Most of us read all the support forums anyway so you’re question will get seen in any of those applicable forums. If you post in two or more forums, the responses become disjointed and hard to follow - for everyone - until a moderator closes some threads down :slight_smile:

Thanks guys, I got the halo working as well using IPO curves by adjusting the Alpha variable.

Very big help, thanks again.