[Bf-python] Re: [Bf-blender-cvs] CVS commit: blender/source/blender/python/api2_2x Mesh.c

Martin Poirier theeth at yahoo.com
Fri Dec 30 18:06:18 CET 2005



--- Campbell Barton <cbarton at metavr.com> wrote:

> campbellbarton (Campbell Barton) 2005/12/30 10:56:02
> CET
> 
>   Modified files:
>     blender/source/blender/python/api2_2x Mesh.c 
>   
>   Log:
>   for Mesh_getFromObject made Mesh and Surf types
> copy the material list to the new mesh.
>   Still need to do Mball and Text.
>   Ken- this is fairly straight fwd but if you dont
> like it - its line 4867 of Mesh.c and 1 block that
> can be removed.
>   I tested for memory leaks and correct material
> user adjustment.
>   This is realy needed for using getFromObject to
> export to external rendering engines.

There's a recuring issue with how we handle materials
in BPy (not only relevant to this commit, but I
thought I'd raise the issue again). I think I
mentioned this when I added code to convert from
non-mesh to GetRawFromObject.

BPy doesn't take into account the bitfield that
specifies if the material comes from the object or
from the obdata, it always assumes obdata. Making it
work correctly would need some good changes in how we
handle material lists since the bitfield is per
object, specifying for each slot where to take the
material.
Technically, there is two "real" material lists (ob
and obdata) and the effective material list
(intersection of the two based on the bitfield).

Food for thoughts.

Martin



		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 




More information about the Bf-python mailing list