[Bf-blender-cvs] [ce3adc090d6] blender2.8: Merge branch 'master' into blender2.8
Campbell Barton
noreply at git.blender.org
Wed Apr 11 09:42:14 CEST 2018
Commit: ce3adc090d6cb380e345b0112079b01a61aa3544
Author: Campbell Barton
Date: Wed Apr 11 09:41:49 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBce3adc090d6cb380e345b0112079b01a61aa3544
Merge branch 'master' into blender2.8
===================================================================
===================================================================
diff --cc source/blender/editors/armature/pose_edit.c
index 5b1975a92a0,d0c467b2d2c..520ecc797aa
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@@ -82,9 -81,8 +82,8 @@@ Object *ED_pose_object_from_context(bCo
}
/* 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(Object *ob)
++bool ED_object_posemode_enter_ex(struct Main *bmain, Object *ob)
{
- Object *ob = base->object;
BLI_assert(!ID_IS_LINKED(ob));
bool ok = false;
@@@ -92,9 -90,8 +91,10 @@@
case OB_ARMATURE:
ob->restore_mode = ob->mode;
ob->mode |= OB_MODE_POSE;
+ /* 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;
@@@ -109,27 -106,30 +109,35 @@@ bool ED_object_posemode_enter(bContext
BKE_report(reports, RPT_WARNING, "Cannot pose libdata");
return false;
}
- bool ok = ED_object_posemode_enter_ex(ob);
+ 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(Object *ob)
++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)
+ {
- bool ok = ED_object_posemode_exit_ex(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 */
diff --cc source/blender/editors/include/ED_armature.h
index 25e792535e0,ae54dd802ee..0dcc4f32e43
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@@ -205,12 -195,13 +205,13 @@@ void ED_armature_ebone_listbase_free(st
void ED_armature_ebone_listbase_copy(struct ListBase *lb_dst, struct ListBase *lb_src);
/* poseobject.c */
- void ED_object_posemode_exit(struct bContext *C, struct Base *base);
- bool ED_object_posemode_enter_ex(struct Main *bmain, struct Base *base);
- bool ED_object_posemode_enter(struct bContext *C, struct Base *base);
-bool ED_object_posemode_exit_ex(struct Object *ob);
++bool ED_object_posemode_exit_ex(struct Main *bmain, struct Object *ob);
+ bool ED_object_posemode_exit(struct bContext *C, struct Object *ob);
-bool ED_object_posemode_enter_ex(struct Object *ob);
++bool ED_object_posemode_enter_ex(struct Main *bmain, struct Object *ob);
+ bool ED_object_posemode_enter(struct bContext *C, struct Object *ob);
void ED_pose_de_selectall(struct Object *ob, int select_mode, const bool ignore_visibility);
void ED_pose_bone_select(struct Object *ob, struct bPoseChannel *pchan, bool select);
-void ED_pose_recalculate_paths(struct Scene *scene, struct Object *ob);
+void ED_pose_recalculate_paths(struct bContext *C, struct Scene *scene, struct Object *ob);
struct Object *ED_pose_object_from_context(struct bContext *C);
/* sketch */
diff --cc source/blender/editors/object/object_edit.c
index 85f8869a73d,844ed168157..f4066360805
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@@ -527,11 -718,12 +527,11 @@@ static int posemode_exec(bContext *C, w
}
if (is_mode_set) {
- ED_object_posemode_exit(C, base);
+ ED_object_posemode_exit(C, ob);
}
else {
- ED_object_posemode_enter(C, base);
+ ED_object_posemode_enter(C, ob);
}
-
return OPERATOR_FINISHED;
}
diff --cc source/blender/editors/space_outliner/outliner_select.c
index 5019e3b1696,27c96bd0232..2f44420f3b7
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@@ -667,13 -714,16 +667,16 @@@ static eOLDrawState tree_element_active
}
if (set != OL_SETSEL_NONE) {
- if (OBEDIT_FROM_VIEW_LAYER(view_layer))
- if (scene->obedit) {
++ if (OBEDIT_FROM_VIEW_LAYER(view_layer)) {
ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR | EM_DO_UNDO);
+ }
- if (ob->mode & OB_MODE_POSE)
- ED_object_posemode_exit(C, base);
- else
- ED_object_posemode_enter(C, base);
+ if (ob->mode & OB_MODE_POSE) {
+ ED_object_posemode_exit(C, ob);
+ }
+ else {
+ ED_object_posemode_enter(C, ob);
+ }
}
else {
if (ob->mode & OB_MODE_POSE) {
More information about the Bf-blender-cvs
mailing list