From f43c2d9abe0f8b6efca8fa803774a065a6749a88 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Mon, 3 Oct 2022 15:18:28 +0300 Subject: Armature Modifier: skip non-deforming vertices in Multi-Modifier mode. The modifier already contained a check to skip complex processing of vertices that won't produce any deformation due to the vertex group mask, but this only works for the non-Multi Modifier case. This adds a similar check for the Multi Modifier mode. Differential Revision: https://developer.blender.org/D16152 --- source/blender/blenkernel/intern/armature_deform.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/armature_deform.c b/source/blender/blenkernel/intern/armature_deform.c index 4acbcbfb13e..89afb886fc2 100644 --- a/source/blender/blenkernel/intern/armature_deform.c +++ b/source/blender/blenkernel/intern/armature_deform.c @@ -301,12 +301,22 @@ static void armature_vert_task_with_dvert(const ArmatureUserdata *data, } /* check if there's any point in calculating for this vert */ - if (armature_weight == 0.0f) { - return; + if (vert_coords_prev) { + if (prevco_weight == 1.0f) { + return; + } + + /* get the coord we work on */ + co = vert_coords_prev[i]; } + else { + if (armature_weight == 0.0f) { + return; + } - /* get the coord we work on */ - co = vert_coords_prev ? vert_coords_prev[i] : vert_coords[i]; + /* get the coord we work on */ + co = vert_coords[i]; + } /* Apply the object's matrix */ mul_m4_v3(data->premat, co); -- cgit v1.2.3