[Bf-committers] Curves and materials

Gilbert, Joseph jgilbert at tigr.org
Thu Feb 24 18:04:45 CET 2005


Well crashing is not good.  I don't have as much experience with the
curve module but there are people that do. I think this may not be
possible but you should check the python list to be sure. 

-----Original Message-----
From: bf-committers-bounces at projects.blender.org
[mailto:bf-committers-bounces at projects.blender.org] On Behalf Of Gergely
Erdelyi
Sent: Thursday, February 24, 2005 2:12 AM
To: bf-committers at projects.blender.org
Subject: [Bf-committers] Curves and materials

Hello,

Since this is my first post to the list let me take two sentences to
introduce
myself. I'm a 26 year old Hungarian living in Finland. I spend most of
my 
time with computer security-related research and occasional blending.
I have a few years of experience with extending/embedding Python so I
think
my Blender-related coding will start with that.

Now to the question. I'm trying to figure out how to add materials to
curves.
In the Python API this function does not seem to be implemented. I did a
quick
test and came up with the following code sequence (partly adapted from
NMesh.c):

    matlist = EXPP_newMaterialList_fromPyList(pymats);
    EXPP_incr_mats_us( matlist, len );

    if( self->curve->mat )
        MEM_freeN( self->curve->mat );

    self->curve->mat = matlist;
    self->curve->totcol = len;

    test_object_materials( (ID *)self->curve );

With test_object_materials() added the materials get linked to the curve
and
show in the 3D view properly. It crashes Blender during rendering
though.

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.


Thanks in advance,

Gergo
_______________________________________________
Bf-committers mailing list
Bf-committers at projects.blender.org
http://projects.blender.org/mailman/listinfo/bf-committers


More information about the Bf-committers mailing list