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:
authorCampbell Barton <ideasman42@gmail.com>2018-05-08 15:18:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-08 16:35:04 +0300
commita48186c5d74b3d353c5c65cd4a930dd98cc9a603 (patch)
treec49fd2af2aaac151c5fd1265e414392617043253 /source/blender/editors/transform
parent53a56b7b6c169b21df475ae94795208501581489 (diff)
Orientation for 3D cursor
Currently set when setting the cursor location, optionally used as an orientation type. Intended for use by tools too. See: D3208
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform.c2
-rw-r--r--source/blender/editors/transform/transform_constraints.c4
-rw-r--r--source/blender/editors/transform/transform_generics.c2
-rw-r--r--source/blender/editors/transform/transform_manipulator_3d.c9
-rw-r--r--source/blender/editors/transform/transform_orientations.c7
5 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 6b36e738cc0..41cc2087dea 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2953,7 +2953,7 @@ static void initBend(TransInfo *t)
data = MEM_callocN(sizeof(*data), __func__);
- curs = ED_view3d_cursor3d_get(t->scene, t->view);
+ curs = ED_view3d_cursor3d_get(t->scene, t->view)->location;
copy_v3_v3(data->warp_sta, curs);
ED_view3d_win_to_3d(t->sa->spacedata.first, t->ar, curs, mval_fl, data->warp_end);
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index bd03c0cedba..0b222e54a67 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -689,6 +689,10 @@ void setUserConstraint(TransInfo *t, short orientation, int mode, const char fte
BLI_snprintf(text, sizeof(text), ftext, IFACE_("view"));
setConstraint(t, t->spacemtx, mode, text);
break;
+ case V3D_MANIP_CURSOR:
+ BLI_snprintf(text, sizeof(text), ftext, IFACE_("cursor"));
+ setConstraint(t, t->spacemtx, mode, text);
+ break;
case V3D_MANIP_GIMBAL:
BLI_snprintf(text, sizeof(text), ftext, IFACE_("gimbal"));
setConstraint(t, t->spacemtx, mode, text);
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 195c2ef3986..c3acf8c4350 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1791,7 +1791,7 @@ void calculateCenterCursor(TransInfo *t, float r_center[3])
{
const float *cursor;
- cursor = ED_view3d_cursor3d_get(t->scene, t->view);
+ cursor = ED_view3d_cursor3d_get(t->scene, t->view)->location;
copy_v3_v3(r_center, cursor);
/* If edit or pose mode, move cursor in local space */
diff --git a/source/blender/editors/transform/transform_manipulator_3d.c b/source/blender/editors/transform/transform_manipulator_3d.c
index c3c4abbda37..502cff9a243 100644
--- a/source/blender/editors/transform/transform_manipulator_3d.c
+++ b/source/blender/editors/transform/transform_manipulator_3d.c
@@ -669,6 +669,13 @@ int ED_transform_calc_manipulator_stats(
copy_m4_m3(rv3d->twmat, mat);
break;
}
+ case V3D_MANIP_CURSOR:
+ {
+ float mat[3][3];
+ quat_to_mat3(mat, ED_view3d_cursor3d_get(scene, v3d)->rotation);
+ copy_m4_m3(rv3d->twmat, mat);
+ break;
+ }
case V3D_MANIP_CUSTOM:
{
TransformOrientation *custom_orientation = BKE_scene_transform_orientation_find(
@@ -1083,7 +1090,7 @@ static void manipulator_prepare_mat(
copy_v3_v3(rv3d->twmat[3], tbounds->center);
break;
case V3D_AROUND_CURSOR:
- copy_v3_v3(rv3d->twmat[3], ED_view3d_cursor3d_get(scene, v3d));
+ copy_v3_v3(rv3d->twmat[3], ED_view3d_cursor3d_get(scene, v3d)->location);
break;
}
}
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 9e6f4847b5b..c1a2c99e26d 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -481,6 +481,13 @@ void initTransformOrientation(bContext *C, TransInfo *t)
unit_m3(t->spacemtx);
}
break;
+ case V3D_MANIP_CURSOR:
+ {
+ const View3DCursor *cursor = ED_view3d_cursor3d_get(t->scene, CTX_wm_view3d(C));
+ BLI_strncpy(t->spacename, IFACE_("cursor"), sizeof(t->spacename));
+ quat_to_mat3(t->spacemtx, cursor->rotation);
+ break;
+ }
case V3D_MANIP_CUSTOM:
BLI_strncpy(t->spacename, t->custom_orientation->name, sizeof(t->spacename));