[Bf-blender-cvs] [1c9690e7607] greasepencil-object: Fix transform center after merge

Antonio Vazquez noreply at git.blender.org
Tue Apr 10 10:55:02 CEST 2018


Commit: 1c9690e7607bc990cc4a3e6ba839949bb83a78af
Author: Antonio Vazquez
Date:   Tue Apr 10 10:54:53 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB1c9690e7607bc990cc4a3e6ba839949bb83a78af

Fix transform center after merge

This code fix the error of rotation center calculation, but need a review to check if this is the best way to do it.

I commit the change while we check other solutions  to be sure we have a correct rotation function.

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

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

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

diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 3645e521410..ec686915b25 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1718,7 +1718,19 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
 		float cent[2];
 		float mval[3] = { x, y, 0.0f };
 
-		projectFloatViewEx(t, t->center_global, cent, V3D_PROJ_TEST_CLIP_ZERO);
+		Object *ob = t->obedit;
+
+		if ((t->flag & T_POINTS) && (t->options & CTX_GPENCIL_STROKES) &&
+			(ob) && (ob->type == OB_GPENCIL))
+		{
+			float vecrot[3];
+			copy_v3_v3(vecrot, t->center);
+			mul_m4_v3(ob->obmat, vecrot);
+			projectFloatViewEx(t, vecrot, cent, V3D_PROJ_TEST_CLIP_ZERO);
+		}
+		else {
+			projectFloatViewEx(t, t->center_global, cent, V3D_PROJ_TEST_CLIP_ZERO);
+		}
 
 		gpuPushMatrix();



More information about the Bf-blender-cvs mailing list