diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-18 10:12:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-18 10:16:15 +0300 |
commit | 7d055da327b9555f76035075ce4e228d31f04df4 (patch) | |
tree | 1baf55c36ba068acf764febed0a8ddf4bedca438 /source/blender/editors/transform/transform.c | |
parent | 33ba170f5c2fc3b8b26b895b092a86ebd85d3e13 (diff) |
Move transform orientation to scene
This was stored in the workspace, selected from the view.
Move both to scene since custom orientations are closely related to your
scene data.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 3752d7f6c26..b6d794a7812 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -62,6 +62,7 @@ #include "BKE_constraint.h" #include "BKE_particle.h" #include "BKE_unit.h" +#include "BKE_scene.h" #include "BKE_mask.h" #include "BKE_report.h" #include "BKE_workspace.h" @@ -2009,13 +2010,10 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) if ((prop = RNA_struct_find_property(op->ptr, "constraint_orientation")) && !RNA_property_is_set(op->ptr, prop)) { - View3D *v3d = t->view; - - v3d->twmode = t->current_orientation; - - BLI_assert(((v3d->custom_orientation_index == -1) && (t->custom_orientation == NULL)) || - (BKE_workspace_transform_orientation_get_index( - CTX_wm_workspace(C), t->custom_orientation) == v3d->custom_orientation_index)); + t->scene->orientation_type = t->current_orientation; + BLI_assert(((t->scene->orientation_index_custom == -1) && (t->custom_orientation == NULL)) || + (BKE_scene_transform_orientation_get_index( + t->scene, t->custom_orientation) == t->scene->orientation_index_custom)); } } } @@ -2040,12 +2038,11 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) short orientation = (t->con.mode & CON_APPLY) ? t->con.orientation : t->current_orientation; if (orientation == V3D_MANIP_CUSTOM) { - WorkSpace *workspace = CTX_wm_workspace(C); - const int custom_orientation_index = BKE_workspace_transform_orientation_get_index( - workspace, t->custom_orientation); + const int orientation_index_custom = BKE_scene_transform_orientation_get_index( + t->scene, t->custom_orientation); /* Maybe we need a t->con.custom_orientation? Seems like it would always match t->custom_orientation. */ - orientation = V3D_MANIP_CUSTOM + custom_orientation_index; + orientation = V3D_MANIP_CUSTOM + orientation_index_custom; BLI_assert(orientation >= V3D_MANIP_CUSTOM); } RNA_enum_set(op->ptr, "constraint_orientation", orientation); |