Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_convert.c
| Context not available. | |||||
| * \ingroup bke | * \ingroup bke | ||||
| */ | */ | ||||
| #include "CLG_log.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| Context not available. | |||||
| # define ASSERT_IS_VALID_MESH(mesh) | # define ASSERT_IS_VALID_MESH(mesh) | ||||
| #endif | #endif | ||||
| static CLG_LogRef LOG = { "bke.mesh_convert" }; | |||||
| void BKE_mesh_from_metaball(ListBase *lb, Mesh *me) | void BKE_mesh_from_metaball(ListBase *lb, Mesh *me) | ||||
| { | { | ||||
| DispList *dl; | DispList *dl; | ||||
| Context not available. | |||||
| /* ensure we can use mesh vertex count for derived mesh custom data */ | /* ensure we can use mesh vertex count for derived mesh custom data */ | ||||
| if (mesh_src->totvert != mesh_dest->totvert) { | if (mesh_src->totvert != mesh_dest->totvert) { | ||||
| fprintf(stderr, | CLOG_ERROR(&LOG, "vertex size mismatch (mesh/dm) '%s' (%d != %d)", | ||||
| "%s: vertex size mismatch (mesh/dm) '%s' (%d != %d)\n", | mesh_src->id.name + 2, mesh_src->totvert, mesh_dest->totvert); | ||||
| __func__, mesh_src->id.name + 2, mesh_src->totvert, mesh_dest->totvert); | |||||
| return; | return; | ||||
| } | } | ||||
| Context not available. | |||||
| float *array; | float *array; | ||||
| if (mesh_src->totvert != kb->totelem) { | if (mesh_src->totvert != kb->totelem) { | ||||
| fprintf(stderr, | CLOG_ERROR(&LOG, "vertex size mismatch (Mesh '%s':%d != KeyBlock '%s':%d)", | ||||
| "%s: vertex size mismatch (Mesh '%s':%d != KeyBlock '%s':%d)\n", | mesh_src->id.name + 2, mesh_src->totvert, kb->name, kb->totelem); | ||||
| __func__, mesh_src->id.name + 2, mesh_src->totvert, kb->name, kb->totelem); | |||||
| array = MEM_calloc_arrayN((size_t)mesh_src->totvert, 3 * sizeof(float), __func__); | array = MEM_calloc_arrayN((size_t)mesh_src->totvert, 3 * sizeof(float), __func__); | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
| kb->totelem = mesh_src->totvert; | kb->totelem = mesh_src->totvert; | ||||
| kb->data = MEM_calloc_arrayN(kb->totelem, 3 * sizeof(float), __func__); | kb->data = MEM_calloc_arrayN(kb->totelem, 3 * sizeof(float), __func__); | ||||
| fprintf(stderr, "%s: lost a shapekey layer: '%s'! (bmesh internal error)\n", __func__, kb->name); | CLOG_ERROR(&LOG, "lost a shapekey layer: '%s'! (bmesh internal error)", kb->name); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| uid = kb->uid; | uid = kb->uid; | ||||
| } | } | ||||
| else { | else { | ||||
| printf("%s: error - could not find active shapekey %d!\n", | CLOG_ERROR(&LOG, "could not find active shapekey %d!", ob->shapenr - 1); | ||||
| __func__, ob->shapenr - 1); | |||||
| uid = INT_MAX; | uid = INT_MAX; | ||||
| } | } | ||||
| Context not available. | |||||
| * which should be fed through the modifier | * which should be fed through the modifier | ||||
| * stack */ | * stack */ | ||||
| if (tmp.totvert != mesh_dst->totvert && !did_shapekeys && mesh_dst->key) { | if (tmp.totvert != mesh_dst->totvert && !did_shapekeys && mesh_dst->key) { | ||||
| printf("%s: YEEK! this should be recoded! Shape key loss!: ID '%s'\n", __func__, tmp.id.name); | CLOG_ERROR(&LOG, "YEEK! this should be recoded! Shape key loss!: ID '%s'", tmp.id.name); | ||||
| if (tmp.key && !(tmp.id.tag & LIB_TAG_NO_MAIN)) { | if (tmp.key && !(tmp.id.tag & LIB_TAG_NO_MAIN)) { | ||||
| id_us_min(&tmp.key->id); | id_us_min(&tmp.key->id); | ||||
| } | } | ||||
| Context not available. | |||||