Setting ipokey for material rgb in python

Hello,

Can anyone tell me how to set an ipokey for a material color using python?

I’m currently using the following code to change the color of the material, but I need to know how to actually set the ipokey for the material color for a certain frame.

mat_shoe1 = Material.Get(“shoe”)
mat_shoe1.setRGBCol(1.0,0.5,0.0)

Thanks for your help,
brian311

P.S. I’m using Blender 2.48 (thus Python 2.5)

Here is my set keyframe for position, maybe you can derive something from it?

http://blenderartists.org/forum/showthread.php?t=131739

Atom,

Thanks for the reply. I tried unsucessfully to make a parallel between you object ipokey position code and what I want to do with changing mesh colors and then setting the ipokey. Any more ideas or does anyone have an explicit code showing how to do this?

Thanks,

matshoe1.insertIpoKey(Ipo.MA_R & Ipo.MA_G & Ipo.MA_B)

Crouch,

Thanks for the reply. Would I actually place my RGB values in the code like this?

matshoe1.insertIpoKey(Ipo.MA_R & Ipo.MA_G & Ipo.MA_B)
matshoe1.insertIpoKey(Ipo.1.0 & Ipo.0.5 & Ipo.0.0)

I’m not exactly sure how to place my specific RGB values in the code. Or is the following correct?

mat_shoe1 = Material.Get(“shoe”)
mat_shoe1.setRGBCol(1.0,0.5,0.0)
matshoe1.insertIpoKey(Ipo.MA_R & Ipo.MA_G & Ipo.MA_B)

Thanks,
brian311

This is the correct one:

mat_shoe1 = Material.Get("shoe")
mat_shoe1.setRGBCol(1.0,0.5,0.0)
matshoe1.insertIpoKey(Ipo.MA_R & Ipo.MA_G & Ipo.MA_B)

In Atom’s example you can see one of the ways to change the framenumber, so you can insert different values at different frames. He’s using Blender.Set(“curframe”,100)

Thanks for your help Crouch. I’ll give that a try!