I get the error
AttributeError: addMaterial
I have tried many things and posted a question on www.elysiun.com
Is there a new command?
At the moment there is no way to add a material to a mesh.
in 2.27 or 2.28pre
Code: Select all
from Blender import Material, NMesh, Object, Scene
m = Material.New() # create free Material datablock
m.rgbCol = (1.0, 0.0, 0.3) # assign RGB values
mesh = NMesh.GetRaw() # get new mesh
mesh.addMaterial(m) # add material to mesh
object = Object.New('Mesh') # create new object
object.link(mesh) # link mesh data to object
Scene.getCurrent().link(ob) # link object to current scene
[/code]