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-04-11 10:41:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-11 10:41:49 +0300
commitce3adc090d6cb380e345b0112079b01a61aa3544 (patch)
tree807962bc12d15111c976a655de9c2b64aec0c7b3 /source/blender/editors/armature/pose_edit.c
parenta3a76bc0fed3efa9d30ac5d0647a5449b7dcc38a (diff)
parentc963488b5e25b906ff72cbaabdcc76cbfbc77172 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/armature/pose_edit.c')
-rw-r--r--source/blender/editors/armature/pose_edit.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 5b1975a92a0..520ecc797aa 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -82,9 +82,8 @@ Object *ED_pose_object_from_context(bContext *C)
}
/* This function is used to process the necessary updates for */
-bool ED_object_posemode_enter_ex(struct Main *bmain, Base *base)
+bool ED_object_posemode_enter_ex(struct Main *bmain, Object *ob)
{
- Object *ob = base->object;
BLI_assert(!ID_IS_LINKED(ob));
bool ok = false;
@@ -95,6 +94,7 @@ bool ED_object_posemode_enter_ex(struct Main *bmain, Base *base)
/* Inform all CoW versions that we changed the mode. */
DEG_id_tag_update_ex(bmain, &ob->id, DEG_TAG_COPY_ON_WRITE);
ok = true;
+
break;
default:
break;
@@ -102,34 +102,42 @@ bool ED_object_posemode_enter_ex(struct Main *bmain, Base *base)
return ok;
}
-bool ED_object_posemode_enter(bContext *C, Base *base)
+bool ED_object_posemode_enter(bContext *C, Object *ob)
{
ReportList *reports = CTX_wm_reports(C);
- if (ID_IS_LINKED(base->object)) {
+ if (ID_IS_LINKED(ob)) {
BKE_report(reports, RPT_WARNING, "Cannot pose libdata");
return false;
}
struct Main *bmain = CTX_data_main(C);
- bool ok = ED_object_posemode_enter_ex(bmain, base);
+ bool ok = ED_object_posemode_enter_ex(bmain, ob);
if (ok) {
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_POSE, NULL);
}
return ok;
}
-void ED_object_posemode_exit(bContext *C, Base *base)
+bool ED_object_posemode_exit_ex(struct Main *bmain, Object *ob)
{
- if (base) {
- Object *ob = base->object;
-
+ bool ok = false;
+ if (ob) {
ob->restore_mode = ob->mode;
ob->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);
-
+ DEG_id_tag_update_ex(bmain, &ob->id, DEG_TAG_COPY_ON_WRITE);
+ ok = true;
+ }
+ return ok;
+}
+bool ED_object_posemode_exit(bContext *C, Object *ob)
+{
+ struct Main *bmain = CTX_data_main(C);
+ bool ok = ED_object_posemode_exit_ex(bmain, ob);
+ if (ok) {
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_OBJECT, NULL);
}
+ return ok;
}
/* if a selected or active bone is protected, throw error (oonly if warn == 1) and return 1 */