[Bf-blender-cvs] [b15123d2796] blender2.8: Cleanup: remove unused derived mesh wrappers
Campbell Barton
noreply at git.blender.org
Fri Oct 12 09:14:39 CEST 2018
Commit: b15123d27965f5ef753354b3eb5f6739802848b9
Author: Campbell Barton
Date: Fri Oct 12 18:11:23 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBb15123d27965f5ef753354b3eb5f6739802848b9
Cleanup: remove unused derived mesh wrappers
===================================================================
M source/blender/blenkernel/BKE_modifier.h
M source/blender/blenkernel/intern/modifier.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index 581b69619f2..2be91406524 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -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);
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 558d1537028..41c35de8aea 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -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
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list