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-02-08 13:14:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-08 13:14:26 +0300
commit345c6298e995ea618c34282ba6d7ab5af032f191 (patch)
treef4fbc4798e17d0f19efc28b51a41425d0c552be8 /source/blender/editors/armature
parent14a19fed788af0cf3695eb5def92510841056e08 (diff)
Object Mode: move to workspace struct
- Read-only access can often use EvaluationContext.object_mode - Write access to go to WorkSpace.object_mode. - Some TODO's remain (marked as "TODO/OBMODE") - Add-ons will need updating (context.active_object.mode -> context.workspace.object_mode) - There will be small/medium issues that still need resolving this does work on a basic level though. See D3037
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/armature_relations.c5
-rw-r--r--source/blender/editors/armature/pose_edit.c12
2 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c
index de2611f7092..8fc7aeaf029 100644
--- a/source/blender/editors/armature/armature_relations.c
+++ b/source/blender/editors/armature/armature_relations.c
@@ -281,7 +281,6 @@ int join_armature_exec(bContext *C, wmOperator *op)
/* get pose of active object and move it out of posemode */
pose = ob->pose;
- ob->mode &= ~OB_MODE_POSE;
CTX_DATA_BEGIN(C, Base *, base, selected_editable_bases)
{
@@ -302,8 +301,6 @@ int join_armature_exec(bContext *C, wmOperator *op)
/* Get Pose of current armature */
opose = base->object->pose;
- base->object->mode &= ~OB_MODE_POSE;
- //BASACT->flag &= ~OB_MODE_POSE;
/* Find the difference matrix */
invert_m4_m4(oimat, ob->obmat);
@@ -608,8 +605,6 @@ static int separate_armature_exec(bContext *C, wmOperator *op)
/* 1) store starting settings and exit editmode */
oldob = obedit;
oldbase = view_layer->basact;
- oldob->mode &= ~OB_MODE_POSE;
- //oldbase->flag &= ~OB_POSEMODE;
ED_armature_from_edit(obedit->data);
ED_armature_edit_free(obedit->data);
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 74e29b2e8da..119a27cd4a7 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -94,13 +94,16 @@ void ED_armature_enter_posemode(bContext *C, Base *base)
switch (ob->type) {
case OB_ARMATURE:
- ob->restore_mode = ob->mode;
- ob->mode |= OB_MODE_POSE;
+ {
+ WorkSpace *workspace = CTX_wm_workspace(C);
+ workspace->object_mode_restore = workspace->object_mode;
+ workspace->object_mode |= OB_MODE_POSE;
/* Inform all CoW versions that we changed the mode. */
DEG_id_tag_update_ex(CTX_data_main(C), &ob->id, DEG_TAG_COPY_ON_WRITE);
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_POSE, NULL);
break;
+ }
default:
return;
}
@@ -112,10 +115,11 @@ void ED_armature_enter_posemode(bContext *C, Base *base)
void ED_armature_exit_posemode(bContext *C, Base *base)
{
if (base) {
+ WorkSpace *workspace = CTX_wm_workspace(C);
Object *ob = base->object;
- ob->restore_mode = ob->mode;
- ob->mode &= ~OB_MODE_POSE;
+ workspace->object_mode_restore = workspace->object_mode;
+ workspace->object_mode &= ~OB_MODE_POSE;
/* Inform all CoW versions that we changed the mode. */
DEG_id_tag_update_ex(CTX_data_main(C), &ob->id, DEG_TAG_COPY_ON_WRITE);