[Bf-python] Getting mesh materials with the bmesh API, add bmesh.types.BMesh.materials?

Campbell Barton ideasman42 at gmail.com
Fri Jun 1 13:58:46 CEST 2012


Use bpy.types.Mesh.materials, bmesh data doesnt know about materials,
only their index - this is the case in our C code too.

On Fri, Jun 1, 2012 at 12:13 PM, Antonio Ospite
<ospite at studenti.unina.it> wrote:
> Hi,
>
> I am playing with the bmesh API for VRM[1].
>
> There are still a couple of things I miss, one of them is: how can
> I access mesh materials from the bmesh interface?
>
> I see that there is a bmesh.types.BMFace.material_index but there is
> not a bmesh.types.BMesh.materials so I am not able to retrieve the
> actual material of a face using only the bmesh API.
>
> Can bmesh.types.BMesh.materials be added?
> Or am I supposed to keep using bpy.types.Mesh.materials to retrieve mesh
> materials?
>
> Thanks,
>   Antonio
>
> [1] http://vrm.ao2.it/
>
> --
> Antonio Ospite
> http://ao2.it
>
> A: Because it messes up the order in which people normally read text.
>   See http://en.wikipedia.org/wiki/Posting_style
> Q: Why is top-posting such a bad thing?
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python



-- 
- Campbell



More information about the Bf-python mailing list