Cleanup: remove unused derived mesh wrappers

This commit is contained in:
Campbell Barton 2018-10-12 18:11:23 +11:00
parent 8962b5e16b
commit b15123d279
2 changed files with 0 additions and 201 deletions

View File

@ -424,33 +424,19 @@ const char *modifier_path_relbase_from_global(struct Object *ob);
/* wrappers for modifier callbacks that ensure valid normals */
struct DerivedMesh *modwrap_applyModifier_DM_deprecated(
ModifierData *md, const struct ModifierEvalContext *ctx,
struct DerivedMesh *dm);
struct Mesh *modwrap_applyModifier(
ModifierData *md, const struct ModifierEvalContext *ctx,
struct Mesh *me);
struct DerivedMesh *modwrap_applyModifierEM_DM_deprecated(
ModifierData *md, const struct ModifierEvalContext *ctx,
struct BMEditMesh *em, struct DerivedMesh *dm);
struct Mesh *modwrap_applyModifierEM(
ModifierData *md, const struct ModifierEvalContext *ctx,
struct BMEditMesh *em, struct Mesh *me);
void modwrap_deformVerts_DM_deprecated(
ModifierData *md, const struct ModifierEvalContext *ctx,
struct DerivedMesh *dm,
float (*vertexCos)[3], int numVerts);
void modwrap_deformVerts(
ModifierData *md, const struct ModifierEvalContext *ctx,
struct Mesh *me,
float (*vertexCos)[3], int numVerts);
void modwrap_deformVertsEM_DM_deprecated(
ModifierData *md, const struct ModifierEvalContext *ctx,
struct BMEditMesh *em, struct DerivedMesh *dm,
float (*vertexCos)[3], int numVerts);
void modwrap_deformVertsEM(
ModifierData *md, const struct ModifierEvalContext *ctx,
struct BMEditMesh *em, struct Mesh *me,
@ -470,33 +456,10 @@ void modwrap_deformVertsEM(
* depending on if the modifier has been ported to Mesh or is still using DerivedMesh
*/
void modifier_deformVerts_DM_deprecated(
struct ModifierData *md, const struct ModifierEvalContext *ctx,
struct DerivedMesh *dm, float (*vertexCos)[3], int numVerts);
void modifier_deformMatrices_DM_deprecated(
struct ModifierData *md, const struct ModifierEvalContext *ctx,
struct DerivedMesh *dm,
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts);
void modifier_deformVertsEM_DM_deprecated(
struct ModifierData *md, const struct ModifierEvalContext *ctx,
struct BMEditMesh *editData, struct DerivedMesh *dm,
float (*vertexCos)[3], int numVerts);
void modifier_deformMatricesEM_DM_deprecated(
struct ModifierData *md, const struct ModifierEvalContext *ctx,
struct BMEditMesh *editData, struct DerivedMesh *dm,
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts);
struct DerivedMesh *modifier_applyModifier_DM_deprecated(
struct ModifierData *md, const struct ModifierEvalContext *ctx,
struct DerivedMesh *dm);
struct DerivedMesh *modifier_applyModifierEM_DM_deprecated(
struct ModifierData *md, const struct ModifierEvalContext *ctx,
struct BMEditMesh *editData, struct DerivedMesh *dm);
struct Mesh *BKE_modifier_get_evaluated_mesh_from_evaluated_object(
struct Object *ob_eval, bool *r_free_mesh);

View File

@ -826,18 +826,6 @@ void modifier_path_init(char *path, int path_maxlen, const char *name)
/* wrapper around ModifierTypeInfo.applyModifier that ensures valid normals */
struct DerivedMesh *modwrap_applyModifier_DM_deprecated(
ModifierData *md, const ModifierEvalContext *ctx,
struct DerivedMesh *dm)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
if (mti->dependsOnNormals && mti->dependsOnNormals(md)) {
DM_ensure_normals(dm);
}
return modifier_applyModifier_DM_deprecated(md, ctx, dm);
}
struct Mesh *modwrap_applyModifier(
ModifierData *md, const ModifierEvalContext *ctx,
struct Mesh *me)
@ -851,18 +839,6 @@ struct Mesh *modwrap_applyModifier(
return mti->applyModifier(md, ctx, me);
}
struct DerivedMesh *modwrap_applyModifierEM_DM_deprecated(
ModifierData *md, const ModifierEvalContext *ctx,
struct BMEditMesh *em, DerivedMesh *dm)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
if (mti->dependsOnNormals && mti->dependsOnNormals(md)) {
DM_ensure_normals(dm);
}
return modifier_applyModifierEM_DM_deprecated(md, ctx, em, dm);
}
struct Mesh *modwrap_applyModifierEM(
ModifierData *md, const ModifierEvalContext *ctx,
struct BMEditMesh *em, Mesh *me)
@ -876,18 +852,6 @@ struct Mesh *modwrap_applyModifierEM(
return mti->applyModifierEM(md, ctx, em, me);
}
void modwrap_deformVerts_DM_deprecated(
ModifierData *md, const ModifierEvalContext *ctx,
DerivedMesh *dm, float (*vertexCos)[3], int numVerts)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
BLI_assert(!dm || CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
DM_ensure_normals(dm);
}
modifier_deformVerts_DM_deprecated(md, ctx, dm, vertexCos, numVerts);
}
void modwrap_deformVerts(
ModifierData *md, const ModifierEvalContext *ctx,
Mesh *me, float (*vertexCos)[3], int numVerts)
@ -901,19 +865,6 @@ void modwrap_deformVerts(
mti->deformVerts(md, ctx, me, vertexCos, numVerts);
}
void modwrap_deformVertsEM_DM_deprecated(
ModifierData *md, const ModifierEvalContext *ctx,
struct BMEditMesh *em, DerivedMesh *dm,
float (*vertexCos)[3], int numVerts)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
BLI_assert(!dm || CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
if (dm && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
DM_ensure_normals(dm);
}
modifier_deformVertsEM_DM_deprecated(md, ctx, em, dm, vertexCos, numVerts);
}
void modwrap_deformVertsEM(
ModifierData *md, const ModifierEvalContext *ctx,
struct BMEditMesh *em, Mesh *me,
@ -937,91 +888,6 @@ void modwrap_deformVertsEM(
/* deprecated variants of above that accept DerivedMesh */
void modifier_deformVerts_DM_deprecated(
struct ModifierData *md, const ModifierEvalContext *ctx,
struct DerivedMesh *dm,
float (*vertexCos)[3], int numVerts)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
mti->deformVerts(md, ctx, mesh, vertexCos, numVerts);
if (mesh != NULL) {
BKE_id_free(NULL, mesh);
}
}
void modifier_deformMatrices_DM_deprecated(
struct ModifierData *md, const ModifierEvalContext *ctx,
struct DerivedMesh *dm,
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
mti->deformMatrices(md, ctx, mesh, vertexCos, defMats, numVerts);
if (mesh != NULL) {
BKE_id_free(NULL, mesh);
}
}
void modifier_deformVertsEM_DM_deprecated(
struct ModifierData *md, const ModifierEvalContext *ctx,
struct BMEditMesh *editData, struct DerivedMesh *dm,
float (*vertexCos)[3], int numVerts)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
mti->deformVertsEM(md, ctx, editData, mesh, vertexCos, numVerts);
if (mesh != NULL) {
BKE_id_free(NULL, mesh);
}
}
void modifier_deformMatricesEM_DM_deprecated(
struct ModifierData *md, const ModifierEvalContext *ctx,
struct BMEditMesh *editData, struct DerivedMesh *dm,
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
mti->deformMatricesEM(md, ctx, editData, mesh, vertexCos, defMats, numVerts);
if (mesh != NULL) {
BKE_id_free(NULL, mesh);
}
}
struct DerivedMesh *modifier_applyModifier_DM_deprecated(
struct ModifierData *md, const ModifierEvalContext *ctx,
struct DerivedMesh *dm)
@ -1051,36 +917,6 @@ struct DerivedMesh *modifier_applyModifier_DM_deprecated(
}
struct DerivedMesh *modifier_applyModifierEM_DM_deprecated(
struct ModifierData *md, const ModifierEvalContext *ctx,
struct BMEditMesh *editData,
struct DerivedMesh *dm)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
struct Mesh *new_mesh = mti->applyModifierEM(md, ctx, editData, mesh);
/* Make a DM that doesn't reference new_mesh so we can free the latter. */
DerivedMesh *ndm = CDDM_from_mesh_ex(new_mesh, CD_DUPLICATE, CD_MASK_EVERYTHING);
if (new_mesh != mesh) {
BKE_id_free(NULL, new_mesh);
}
if (mesh != NULL) {
BKE_id_free(NULL, mesh);
}
return ndm;
}
/**
* Get evaluated mesh for other evaluated object, which is used as an operand for the modifier,
* e.g. second operand for boolean modifier.