Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-05-02 12:39:23 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-05-02 13:15:00 +0300
commit81175eb40ddbbd8ea9c98eb71f590b148012eb06 (patch)
tree75c3942ed83873519c60733799e77d4e61953ba1 /source/blender/modifiers/intern/MOD_armature.c
parentbaf0547de57397d2f12404d1cc1e861aa1e90d83 (diff)
Modifiers: ported Bevel modifier DerivedMesh → Mesh
This introduces `BKE_mesh_to_bmesh_ex()`, which exposes all of the `BMeshFromMeshParams` parameters to the caller. This is required to enable the `calc_face_normal` flag, which is required for the Bevel modifier. This also introduces `BKE_bmesh_to_mesh()`, which allocates a new `Mesh`, converts the `BMesh` to it, and returns it. The returned mesh is owned by the caller.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_armature.c')
-rw-r--r--source/blender/modifiers/intern/MOD_armature.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index f354ed3aada..d48c4e2549d 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -136,12 +136,9 @@ static void deformVertsEM(
ArmatureModifierData *amd = (ArmatureModifierData *) md;
Mesh *mesh_src = mesh;
- /* TODO(sybren): possibly lift this code to modifier.c and use it for all modifiers */
if (!mesh) {
struct BMeshToMeshParams params = {0};
- mesh_src = BKE_libblock_alloc_notest(ID_ME);
- BKE_mesh_init(mesh_src);
- BM_mesh_bm_to_me(em->bm, mesh_src, &params);
+ mesh_src = BKE_bmesh_to_mesh(em->bm, &params);
}
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
@@ -169,12 +166,9 @@ static void deformMatricesEM(
ArmatureModifierData *amd = (ArmatureModifierData *) md;
Mesh *mesh_src = mesh;
- /* TODO(sybren): possibly lift this code to modifier.c and use it for all modifiers */
if (!mesh) {
struct BMeshToMeshParams params = {0};
- mesh_src = BKE_libblock_alloc_notest(ID_ME);
- BKE_mesh_init(mesh_src);
- BM_mesh_bm_to_me(em->bm, mesh_src, &params);
+ mesh_src = BKE_bmesh_to_mesh(em->bm, &params);
}
armature_deform_verts(amd->object, ctx->object, mesh_src, vertexCos, defMats, numVerts,