Hi,
I’m writing a science visualization script in which everything is automated using Python. I’ve succeeded in texturing an mesh object with a node based red/white checkerboard pattern as follows:
# Create new material
bpy.ops.material.new()
parachute_mat = bpy.data.materials[-1] # new material is the last one in the list
parachute_mat.name = "ParachuteMat" # rename
# Add material slot to parachute mesh object (currently active)
bpy.ops.object.material_slot_add()
# Assign the material to the new material slot (currently active)
bpy.context.object.active_material = parachute_mat
# Create new texture
bpy.ops.texture.new()
parachute_text = bpy.data.textures[-1] # new texture is the last one in the list
parachute_text.name = 'ParachuteText' # rename
# Add texture slot to parachute material
parachute_mat.texture_slots.add()
# Enable 'use nodes' on the texture to use default checkerboard pattern (red/white)
parachute_text.use_nodes = True
# Assign the texture to the new texture slot (currently active)
parachute_mat.active_texture = parachute_text
I would like to proceed by changing the colors of the pattern and scaling it, as can be done in the node editor GUI (e.g. http://www.youtube.com/watch?v=9vE3k7dgDyc at 3:30).
How do I do that using Python? I have trouble finding this in the Blender documentation.
Thank you very much,
Bart