[Bf-committers] Curves and materials

Ken Hughes khughes at pacific.edu
Thu Feb 24 18:16:29 CET 2005


Gergely Erdelyi wrote:

> Could somebody please shed some light on how materials should be added
> to curves? I have the feeling there is something I don't clearly understand
> yet. It would be nice to get this implemented.

Well, I did something similar this week, but I'm not adding material to
curves but to objects which are linked to curves.  Not sure if that's
what you're trying to do:

       nobj = Blender.Object.New('Curve')
       ncur = Blender.Curve.New()             # create new  curve data
       scene = Blender.Scene.getCurrent()     # get current scene
       nobj.link(ncur)                        # link curve data with this object
       scene.link(nobj)                       # link object into scene
       mat = Blender.Material.New('textmat')
       mat.mode = Blender.Material.Modes.SHADELESS
       nobj.setMaterials([mat])
       nobj.colbits=1  # make object use first material

I did come across some bug in Curve.appendPoint() while
trying to build the curve itself which caused a segfault.





More information about the Bf-committers mailing list