[Bf-blender-cvs] [9a41b44197a] master: Fix T91481: Grease Pencil Layer Double Transformations

Henrik Dick noreply at git.blender.org
Fri Sep 17 13:30:16 CEST 2021


Commit: 9a41b44197a61622446be7b3b6bf59933f8f7694
Author: Henrik Dick
Date:   Fri Sep 17 13:29:05 2021 +0200
Branches: master
https://developer.blender.org/rB9a41b44197a61622446be7b3b6bf59933f8f7694

Fix T91481: Grease Pencil Layer Double Transformations

Use the inverse of the grease pencil object. This patch fixes the issue for bones and objects.

Maniphest Tasks: T91481

Differential Revision: https://developer.blender.org/D12539

===================================================================

M	source/blender/blenkernel/intern/gpencil.c

===================================================================

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index a143645c2ee..82a44afbbb1 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -3063,13 +3063,12 @@ void BKE_gpencil_update_layer_transforms(const Depsgraph *depsgraph, Object *ob)
         Object *ob_parent = DEG_get_evaluated_object(depsgraph, gpl->parent);
         /* calculate new matrix */
         if (ELEM(gpl->partype, PAROBJECT, PARSKEL)) {
-          copy_m4_m4(cur_mat, ob_parent->obmat);
+          mul_m4_m4m4(cur_mat, ob->imat, ob_parent->obmat);
         }
         else if (gpl->partype == PARBONE) {
           bPoseChannel *pchan = BKE_pose_channel_find_name(ob_parent->pose, gpl->parsubstr);
           if (pchan != NULL) {
-            copy_m4_m4(cur_mat, ob->imat);
-            mul_m4_m4m4(cur_mat, ob_parent->obmat, pchan->pose_mat);
+            mul_m4_series(cur_mat, ob->imat, ob_parent->obmat, pchan->pose_mat);
           }
           else {
             unit_m4(cur_mat);



More information about the Bf-blender-cvs mailing list