[Bf-python] material lists

Willian Padovani Germano wgermano at ig.com.br
Sat Jul 17 20:46:03 CEST 2004


Hi Yann,

It's been months since I played with this part of NMesh, but yesterday I took a
look at makesdna/ , objects and meshes headers to confirm a few things before
replying.  Also I'm not sure I understand what you meant, so please reply to
clarify any point you think I may have missed.

Blender stores material lists in objects and meshes as a pointer to pointers to
mat structs.  So it only keeps existing ones itself.  The patch you sent only
had changes to the bpython side.  Blender itself requires both the ob and mesh
mat lists to have the same size, as you probably saw it has functions to confirm
/ fix that case their sizes differ.

Changing this to allow empty (null) slots probably means making many changes in
Blender, specially in the renderer, since it probably doesn't expect null mats
or will stop upon finding one.  This also means more pointers stored per obj and
mesh, but anyway it's a change in Blender, not only bpython.  To get it in you'd
need to discuss / get approval in the bf-committers list first.

On the other hand, without code changes: at the bpython side, you can define a
"Null" or "Foo" material and use it in you importer where an empty slot would be
placed.  Setting this material's alpha to 0, maybe also its color to white is
enough to make it have no effect.  And since the face mat indices won't refer to
it, the "foo" mats won't be used anyway, it'll just serve as your empty mat case
you want to export the data back later.

To export the same thing can work: check if a mat is called "Null" or something
and put an empty slot where it would be.

About crashes: please tell us about any you find, they should not be there.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list