I was hacking around with an old script I was preparing and never finished because 2.23 API didn’t allow to easily add materials, hoping that new 2.25 API could help…
Script is (in a nutshell)
from Blender import *
from random import random
def sub1():
me=Mesh.New()
for j in range(0,4):
x = random()
y = 0
z = 0
me.addVert((x,y,z))
return me
sc = Scene.getCurrent()
ob = Object.New('Mesh','bof')
me = sub1()
mat = Material.New('bof')
mat.rgbCol=(0.8,0.9,1.0)
mat.setHaloMode()
me.link(mat)
ob.link(me)
sc.link(ob)
Which looks fine as for API docs http://www.blender.org/modules/documentation/225PythonDoc/index.html
BUT
I get my four vertices, and my material, but the material tab is RED, Material looks unassigned and rendering tends to crash everithing
What’s wrong?
(Please note I don’t need faces, just vertexes, it is a halo stuff)
Thanx in advance
Stefano