Fix T81707: Spline IK Joints "Floating" above curve
The issue was that where_on_path uses a resampled curve to get the data from the curve. This leads to disconnects between the curve the user sees and the evaluated location data. To fix this we simply use the actual curve data the user can see. The older code needed a cleanup either way as there were hacks in other parts of the code trying to work around some brokenness. This is now fixed and we no longer need to clamp the evaluation range to 0-1 or make helper functions to make it do what we actually want. Reviewed By: Campbell, Sybren Differential Revision: http://developer.blender.org/D10898
This commit is contained in:
@@ -311,8 +311,8 @@ static void object_free_data(ID *id)
|
||||
/* Free runtime curves data. */
|
||||
if (ob->runtime.curve_cache) {
|
||||
BKE_curve_bevelList_free(&ob->runtime.curve_cache->bev);
|
||||
if (ob->runtime.curve_cache->path) {
|
||||
free_path(ob->runtime.curve_cache->path);
|
||||
if (ob->runtime.curve_cache->anim_path_accum_length) {
|
||||
MEM_freeN(ob->runtime.curve_cache->anim_path_accum_length);
|
||||
}
|
||||
MEM_freeN(ob->runtime.curve_cache);
|
||||
ob->runtime.curve_cache = NULL;
|
||||
@@ -1188,8 +1188,8 @@ void BKE_object_free_curve_cache(Object *ob)
|
||||
if (ob->runtime.curve_cache) {
|
||||
BKE_displist_free(&ob->runtime.curve_cache->disp);
|
||||
BKE_curve_bevelList_free(&ob->runtime.curve_cache->bev);
|
||||
if (ob->runtime.curve_cache->path) {
|
||||
free_path(ob->runtime.curve_cache->path);
|
||||
if (ob->runtime.curve_cache->anim_path_accum_length) {
|
||||
MEM_freeN(ob->runtime.curve_cache->anim_path_accum_length);
|
||||
}
|
||||
BKE_nurbList_free(&ob->runtime.curve_cache->deformed_nurbs);
|
||||
MEM_freeN(ob->runtime.curve_cache);
|
||||
@@ -3244,7 +3244,7 @@ static bool ob_parcurve(Object *ob, Object *par, float r_mat[4][4])
|
||||
if (par->runtime.curve_cache == NULL) {
|
||||
return false;
|
||||
}
|
||||
if (par->runtime.curve_cache->path == NULL) {
|
||||
if (par->runtime.curve_cache->anim_path_accum_length == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3260,12 +3260,12 @@ static bool ob_parcurve(Object *ob, Object *par, float r_mat[4][4])
|
||||
else {
|
||||
ctime = cu->ctime;
|
||||
}
|
||||
CLAMP(ctime, 0.0f, 1.0f);
|
||||
|
||||
unit_m4(r_mat);
|
||||
|
||||
/* vec: 4 items! */
|
||||
if (where_on_path(par, ctime, vec, dir, (cu->flag & CU_FOLLOW) ? quat : NULL, &radius, NULL)) {
|
||||
if (BKE_where_on_path(
|
||||
par, ctime, vec, dir, (cu->flag & CU_FOLLOW) ? quat : NULL, &radius, NULL)) {
|
||||
if (cu->flag & CU_FOLLOW) {
|
||||
quat_apply_track(quat, ob->trackflag, ob->upflag);
|
||||
normalize_qt(quat);
|
||||
|
||||
Reference in New Issue
Block a user