[Bf-committers] De-referencing materials in mesh, bug?
Campbell Barton
cbarton at metavr.com
Mon May 2 09:54:02 CEST 2005
Hi, I recently noticed an interesting thing.
When a mesh has no users then its looses the reference to its materials.
The result is that a mesh with no users cant have any materials. This is
an interesting problem. If you think about it :).
This is a bug since making DATA have no users shouldent modify the data
its self, especialy loose data.
Its actually causing a bug in a plugin Im writing. since all meshs need
materials for exporting, and I only want to import an object once from
an extarnal library.
So objects that are created from a mesh with no users immediatly loose
all materials.
On the flip side, keeping a mesh with no users links to materials will
make a material have links when it would look like it shouldent,. and
also twice as many save/opens to dereference the material.
the F betton to make it have a fake user is okay, but dosent solve the
problem, only a workaround and isnt accsessable from python.
WHats the Best solution?
Keep the meshes reference to the material, but still remove one user
from the material.
If the mesh is used later on, then bump up the users of materials. else
they will both be de-allocated at once. so the mesh will never reference
a materail that isnt there.
- Cam
BUG REPORT
https://projects.blender.org/tracker/index.php?func=detail&aid=2509&group_id=9&atid=125
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.blender.org/pipermail/bf-committers/attachments/20050502/3fa4ca16/attachment.htm
More information about the Bf-committers
mailing list