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:
authorPhilipp Oeser <info@graphics-engineer.com>2019-02-05 17:43:34 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-03-05 15:10:10 +0300
commit2894e75121d78956f23dfd0f78855fa1c1a8d615 (patch)
tree69399deabb339c4afbaca2e2bf8995a4fcfe37ee /source/blender/blenkernel/intern/object.c
parent76608f5ec5e9737c7ef680a2234b8e3347b61c7b (diff)
Fix parenting objects to bones/vertices causes offset
This reverts part of rBbc5482337669. Problem with above commit is that the evaluated object seems to not have partype, par1, par2, par3 copied from the original (yet). Using original object instead now. Second issue (when parenting to 'Bone Relative') is that the bones BONE_RELATIVE_PARENTING flag is set on the original, but not the evaluated bone (yet), setting this on both now. Fixes T60623 (and part of T59352) Reviewers: brecht, sergey Maniphest Tasks: T60623 Differential Revision: https://developer.blender.org/D4309
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c4d80fdd5e2..ca82353a16a 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2527,7 +2527,6 @@ void BKE_object_where_is_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
*/
void BKE_object_workob_calc_parent(Depsgraph *depsgraph, Scene *scene, Object *ob, Object *workob)
{
- Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
BKE_object_workob_clear(workob);
unit_m4(workob->obmat);
@@ -2537,17 +2536,17 @@ void BKE_object_workob_calc_parent(Depsgraph *depsgraph, Scene *scene, Object *o
/* Since this is used while calculating parenting, at this moment ob_eval->parent is still NULL. */
workob->parent = DEG_get_evaluated_object(depsgraph, ob->parent);
- workob->trackflag = ob_eval->trackflag;
- workob->upflag = ob_eval->upflag;
+ workob->trackflag = ob->trackflag;
+ workob->upflag = ob->upflag;
- workob->partype = ob_eval->partype;
- workob->par1 = ob_eval->par1;
- workob->par2 = ob_eval->par2;
- workob->par3 = ob_eval->par3;
+ workob->partype = ob->partype;
+ workob->par1 = ob->par1;
+ workob->par2 = ob->par2;
+ workob->par3 = ob->par3;
- workob->constraints = ob_eval->constraints;
+ workob->constraints = ob->constraints;
- BLI_strncpy(workob->parsubstr, ob_eval->parsubstr, sizeof(workob->parsubstr));
+ BLI_strncpy(workob->parsubstr, ob->parsubstr, sizeof(workob->parsubstr));
BKE_object_where_is_calc(depsgraph, scene, workob);
}