diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh index 113e8ffc93d..76ac0c5dc77 100644 --- a/source/blender/nodes/NOD_node_declaration.hh +++ b/source/blender/nodes/NOD_node_declaration.hh @@ -14,6 +14,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + #pragma once #include @@ -24,6 +25,8 @@ #include "DNA_node_types.h" +#include "BKE_armature.h" + struct bNode; namespace blender::nodes { Possible Solution: diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 8584ce6f508..117b90bd532 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -193,7 +193,7 @@ void BKE_armature_refresh_layer_used(struct Depsgraph *depsgraph, struct bArmatu * Using `vec` with dist to bone `b1 - b2`. */ float distfactor_to_bone( - const float vec[3], const float b1[3], const float b2[3], float rad1, float rad2, float rdist); + const float vec_[3], const float b1_[3], const float b2_[3], float rad1_, float rad2_, float rdist_); /** * Updates vectors and matrices on rest-position level, only needed And diff --git a/source/blender/blenkernel/intern/armature_deform.c b/source/blender/blenkernel/intern/armature_deform.c index a8e74f6b4c3..5241559939d 100644 --- a/source/blender/blenkernel/intern/armature_deform.c +++ b/source/blender/blenkernel/intern/armature_deform.c @@ -122,40 +122,40 @@ static void b_bone_deform(const bPoseChannel *pchan, } float distfactor_to_bone( - const float vec[3], const float b1[3], const float b2[3], float rad1, float rad2, float rdist) + const float vec_[3], const float b1_[3], const float b2_[3], float rad1_, float rad2_, float rdist_) { float dist_sq; float bdelta[3]; float pdelta[3]; float hsqr, a, l, rad; - sub_v3_v3v3(bdelta, b2, b1); + sub_v3_v3v3(bdelta, b2_, b1_); l = normalize_v3(bdelta); - sub_v3_v3v3(pdelta, vec, b1); + sub_v3_v3v3(pdelta, vec_, b1_); a = dot_v3v3(bdelta, pdelta); hsqr = len_squared_v3(pdelta); if (a < 0.0f) { /* If we're past the end of the bone, do a spherical field attenuation thing */ - dist_sq = len_squared_v3v3(b1, vec); - rad = rad1; + dist_sq = len_squared_v3v3(b1_, vec_); + rad = rad1_; } else if (a > l) { /* If we're past the end of the bone, do a spherical field attenuation thing */ - dist_sq = len_squared_v3v3(b2, vec); - rad = rad2; + dist_sq = len_squared_v3v3(b2_, vec_); + rad = rad2_; } else { dist_sq = (hsqr - (a * a)); if (l != 0.0f) { rad = a / l; - rad = rad * rad2 + (1.0f - rad) * rad1; + rad = rad * rad2_ + (1.0f - rad) * rad1_; } else { - rad = rad1; + rad = rad1_; } } @@ -164,14 +164,14 @@ float distfactor_to_bone( return 1.0f; } - l = rad + rdist; + l = rad + rdist_; l *= l; - if (rdist == 0.0f || dist_sq >= l) { + if (rdist_ == 0.0f || dist_sq >= l) { return 0.0f; } a = sqrtf(dist_sq) - rad; - return 1.0f - (a * a) / (rdist * rdist); + return 1.0f - (a * a) / (rdist_ * rdist_); } static float dist_bone_deform(