Blender Git Loki

Git Commits -> Revision 6d2f9b1

Revision 6d2f9b1 by Sybren A. Stüvel (master)
July 31, 2019, 10:23 (GMT)
Added BKE_mesh_clear_geometry() function

This function makes it possible to clear/remove/nuke all the geometry in
a mesh, allowing functions like `Mesh.from_python()` to construct a new
mesh in its place. Without this function, code like in T67627 have to
allocate a new Mesh datablock, fill that, and swap out the old Mesh for
the new one. This introduces issues when exporting, as the new mesh
could be seen by an exporter as unrelated to the old one.

Shape keys are not freed by this function. Freeing those would require
tagging the depsgraph for relations update, which is an expensive
operation. They should be removed explicitly if necessary.

Material slots are also not cleared by this function, in the same way
that they are not cleared when manually removing all geometry from a
mesh.

The `BKE_mesh_clear_geometry()` function is available in Python as
`mesh.clear_geometry()`.

Reviewed by: mont29, brecht

Differential Revision: https://developer.blender.org/D5373

Commit Details:

Full Hash: 6d2f9b1dfa98502e9e9f1a73e3dded2ded1f1ce6
Parent Commit: e510675
Lines Changed: +44, -11

3 Modified Paths:

/source/blender/blenkernel/BKE_mesh.h (+1, -0) (Diff)
/source/blender/blenkernel/intern/mesh.c (+30, -11) (Diff)
/source/blender/makesrna/intern/rna_mesh_api.c (+13, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021