Commit: c038ac8cad0182b10dc3e7f97261b4f688f2b461
Author: Antonio Vazquez
Date:   Thu May 17 19:28:16 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBc038ac8cad0182b10dc3e7f97261b4f688f2b461

Modify rotate around cursor to use Trans Object

Now the object pointer is saved in the transformation data struct instead to 
use the viewlayer active object.

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

M       source/blender/editors/transform/transform_conversions.c
M       source/blender/editors/transform/transform_generics.c

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

diff --git a/source/blender/editors/transform/transform_conversions.c 
b/source/blender/editors/transform/transform_conversions.c
index e7749b0f8cb..49c0bfc940a 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -8310,6 +8310,9 @@ static void createTransGPencil(bContext *C, TransInfo *t)
                                                                        /* 
Triangulation must be calculated again, so save the stroke for recalc function 
*/
                                                                        
td->extra = gps;
 
+                                                                       /* save 
pointer to object */
+                                                                       td->ob 
= obact;
+
                                                                        td++;
                                                                        tail++;
                                                                }
diff --git a/source/blender/editors/transform/transform_generics.c 
b/source/blender/editors/transform/transform_generics.c
index 6d5aa8dcef9..50d896ebeb8 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1808,17 +1808,14 @@ void calculateCenterCursor(TransInfo *t, float 
r_center[3])
                r_center[2] = 0.0f;
        }
        else if (t->options & CTX_GPENCIL_STROKES) {
-               /* TODO: GPXX (segment fault in some situations, maybe related 
to new multiedit) 
-                *
-                * Aded a fix to use the viewlayer active object, but this fix 
will need review
-                * for multiedit 
-                */
-               
                 /* move cursor in local space */
-               Object *ob = OBACT(t->view_layer);
+               TransData *td = NULL;
                FOREACH_TRANS_DATA_CONTAINER (t, tc) {
                        float mat[3][3], imat[3][3];
 
+                       td = tc->data;
+                       Object *ob = td->ob;
+
                        sub_v3_v3v3(r_center, r_center, ob->obmat[3]);
                        copy_m3_m4(mat, ob->obmat);
                        invert_m3_m3(imat, mat);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to