Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHabib Gahbiche <habibgahbiche@gmail.com>2018-11-09 14:25:14 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-11-09 14:39:46 +0300
commitab77f5b5fe59a8f0ff60b637883a53554b1de40c (patch)
tree738f6ac69a474a2592b880f6543e08518a45d2fd /source/blender/editors/curve/editcurve_select.c
parent9ee9a257c93b1902f64d413a2513c6ec2616ea2e (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.c16
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)