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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-03-09 14:40:24 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-03-09 15:02:30 +0300
commitb21e0cccfa29ab87c0f78a4c5ff05827a3efee7f (patch)
treef819d6741fe69e8b328ebdfe94ab98bfad6742ba /source/blender/editors/object/object_constraint.c
parentfd94d2d80fc4b1da6095987e2bef6ec5b42eda8d (diff)
Fix T43872: Adding a constraint to a bone of a proxy armature resets all bones' transformations.
Temp hack for until new depsgraph is here. Thanks the Joshua and Sergey for their help.
Diffstat (limited to 'source/blender/editors/object/object_constraint.c')
-rw-r--r--source/blender/editors/object/object_constraint.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 97d926761b5..231d23b481d 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -1165,7 +1165,17 @@ void ED_object_constraint_dependency_update(Main *bmain, Object *ob)
{
ED_object_constraint_update(ob);
- if (ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels
+ if (ob->pose) {
+ ob->pose->flag |= POSE_RECALC; /* Checks & sort pose channels. */
+ if (ob->proxy && ob->adt) {
+ /* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, else anim data are not reloaded
+ * after calling `BKE_pose_rebuild()`, which causes T43872.
+ * Note that this is a bit wide here, since we cannot be sure whether there are some locked proxy bones
+ * or not...
+ * XXX Temp hack until new depsgraph hopefully solves this. */
+ ob->adt->recalc |= ADT_RECALC_ANIM;
+ }
+ }
DAG_relations_tag_update(bmain);
}
@@ -1725,6 +1735,12 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
if ((ob->type == OB_ARMATURE) && (pchan)) {
ob->pose->flag |= POSE_RECALC; /* sort pose channels */
+ if (BKE_constraints_proxylocked_owner(ob, pchan) && ob->adt) {
+ /* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, else anim data are not reloaded
+ * after calling `BKE_pose_rebuild()`, which causes T43872.
+ * XXX Temp hack until new depsgraph hopefully solves this. */
+ ob->adt->recalc |= ADT_RECALC_ANIM;
+ }
DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
}
else