From 915998111bc45336247a7aaf91eaa1dcd5e8881b Mon Sep 17 00:00:00 2001 From: Lucas Veber Date: Tue, 10 Mar 2020 12:47:43 +0100 Subject: Modifiers: Corrective Smooth modifier, new Scale parameter When scaling the root bone of a rig to apply a global scale, the corrective smooth modifier results in wrong deformation due to incorrect scaling. The delta calculations are not taking into account any scale value. To fix it, a scale property is added to the modifier, allowing to set manually the scale value for the deltas by simply multiplying the vectors by this value. There is a similar implementation in Maya's Delta Mush deformer. This property can be for example driven by the scale of the root bone of the rig, to dynamically update when the animator scale this bone. Reviewed By: brecht, sybren Differential Revision: https://developer.blender.org/D6622 --- source/blender/makesdna/DNA_modifier_types.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 36d21b28b1f..042cf7e874f 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -1684,10 +1684,10 @@ typedef struct CorrectiveSmoothDeltaCache { /* Value of settings when creating the cache. * These are used to check if the cache should be recomputed. */ - float lambda; + float lambda, scale; short repeat, flag; char smooth_type, rest_source; - char _pad[2]; + char _pad[6]; } CorrectiveSmoothDeltaCache; typedef struct CorrectiveSmoothModifierData { @@ -1700,10 +1700,10 @@ typedef struct CorrectiveSmoothModifierData { /* note: -1 is used to bind */ unsigned int bind_coords_num; - float lambda; + float lambda, scale; short repeat, flag; char smooth_type, rest_source; - char _pad[2]; + char _pad[6]; /** MAX_VGROUP_NAME. */ char defgrp_name[64]; -- cgit v1.2.3