Changing the parameters from a linked script

Hi there,

I want to change the material from objects between changed frame.

Can you address the parameters or some variables in the linked script from an outside script?
-> kind of link the linked script.

#------------ Linked script ---------------
import Blender as B

NAME = ‘material_cube_1’

ob= B.Material.Get(NAME)
ob.rgbCol = [R,G,B] # var R, G, B from an external script?

#------------------------------------------

Gr.

Marcel

Changing the colour of a material based on values coming from a text-file is quite easy actually.

An example:
.blend-file
.txt-file

Save both files to your harddisk and then open the .blend file. Change line 8 to the location of where you saved the txt-file. Now change frame until you reach frame 35 (use the ARROW-RIGHT key) and you can see the cube change colour.

Short explanation of how the .txt-file is constructed: the first number is the frame-number, the following numbers are the values for red, green and blue. The lines are in ascending order based on the frame-number.

If you’ve still got any questions, just ask.