diff options
author | Habib Gahbiche <habibgahbiche@gmail.com> | 2018-11-09 14:25:14 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-11-09 14:39:46 +0300 |
commit | ab77f5b5fe59a8f0ff60b637883a53554b1de40c (patch) | |
tree | 738f6ac69a474a2592b880f6543e08518a45d2fd /source/blender/editors/curve/editcurve_select.c | |
parent | 9ee9a257c93b1902f64d413a2513c6ec2616ea2e (diff) |
Improvements on CURVE_OT_select_similar: SIMCURHAND_DIRECTION
Consider rotation and scale when calculating direction in world space.
Reviewers: dfelinto
Maniphest Tasks: T56948
Differential Revision: https://developer.blender.org/D3911
Diffstat (limited to 'source/blender/editors/curve/editcurve_select.c')
-rw-r--r-- | source/blender/editors/curve/editcurve_select.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c index 8495ef24536..8bd19d42193 100644 --- a/source/blender/editors/curve/editcurve_select.c +++ b/source/blender/editors/curve/editcurve_select.c @@ -1353,22 +1353,22 @@ static const EnumPropertyItem curve_prop_similar_types[] = { {0, NULL, 0, NULL, NULL} }; -/** Note: This function should actually take scaling into consideration. */ static void nurb_bezt_direction_worldspace_get(Object *ob, Nurb *nu, BezTriple *bezt, float r_dir[3]) { - float rmat[3][3]; + float rsmat[3][3]; BKE_nurb_bezt_calc_normal(nu, bezt, r_dir); - BKE_object_rot_to_mat3(ob, rmat, true); - mul_m3_v3(rmat, r_dir); + copy_m3_m4(rsmat, ob->obmat); + mul_m3_v3(rsmat, r_dir); + normalize_v3(r_dir); } -/** Note: This function should actually take scaling into consideration. */ static void nurb_bpoint_direction_worldspace_get(Object *ob, Nurb *nu, BPoint *bp, float r_dir[3]) { - float rmat[3][3]; + float rsmat[3][3]; BKE_nurb_bpoint_calc_normal(nu, bp, r_dir); - BKE_object_rot_to_mat3(ob, rmat, true); - mul_m3_v3(rmat, r_dir); + copy_m3_m4(rsmat, ob->obmat); + mul_m3_v3(rsmat, r_dir); + normalize_v3(r_dir); } static void curve_nurb_selected_type_get(Object *ob, Nurb *nu, const int type, KDTree *r_tree) |