Materials not linking

Hi All,

sorry for flooding the forum and thanks a lot for the help!

So I have a matherial:

mat=Material.get(words[1])
print ‘Will use material <’, mat.name, ‘>’

it gives me out the name I wanted. I assume everything is ok.

Then I want to assign it to a curve. It is called curve. Here is what I do with it:

    curve = Blender.Curve.New( name )

(…)
curve.materials.append(mat)

    ob = Blender.Object.New('Curve', name)
    ob.link(curve) 
    
    scn = Blender.Scene.GetCurrent()
    scn.link(ob) 

It should work like this, shouldn’t it?
But when I type

   print 'Materials: ', curve.getTotcol()

it says that there aren’t any materials. :frowning: Needless to say, the curve is rendered without a material.

What am I doing wrong?

Thanks!