[Bf-blender-cvs] [c2be54f] soc-2013-paint: Fix issue with curves crashing in texture paint mode. Also only do curve manipulation if a curve brush is active (some modes actually use transform for other things as well)

Antony Riakiotakis noreply at git.blender.org
Wed Mar 19 22:22:04 CET 2014


Commit: c2be54f5882397ee51fc82ff3ad4ea878f6fa7de
Author: Antony Riakiotakis
Date:   Wed Mar 19 23:21:49 2014 +0200
https://developer.blender.org/rBc2be54f5882397ee51fc82ff3ad4ea878f6fa7de

Fix issue with curves crashing in texture paint mode. Also only do curve
manipulation if a curve brush is active (some modes actually use
transform for other things as well)

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

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 d67d1ec..d1b2ee6 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -6972,6 +6972,9 @@ void createTransData(bContext *C, TransInfo *t)
 		t->flag |= T_TEXTURE;
 		createTransTexspace(t);
 	}
+	else if (t->options & CTX_PAINT_CURVE) {
+		createTransPaintCurveVerts(C, t);
+	}
 	else if (t->options & CTX_EDGE) {
 		t->ext = NULL;
 		t->flag |= T_EDIT;
@@ -6994,9 +6997,6 @@ void createTransData(bContext *C, TransInfo *t)
 				sort_trans_data_dist(t);
 			}
 		}
-		else if (t->options & CTX_PAINT_CURVE) {
-			createTransPaintCurveVerts(C, t);
-		}
 		else if (t->obedit) {
 			createTransUVs(C, t);
 			if (t->data && (t->flag & T_PROP_EDIT)) {
@@ -7128,15 +7128,6 @@ void createTransData(bContext *C, TransInfo *t)
 			sort_trans_data_dist(t);
 		}
 	}
-	else if (ob && (ob->mode & (OB_MODE_ALL_PAINT))) {
-		/* sculpt mode and project paint have own undo stack
-		 * transform ops redo clears sculpt/project undo stack.
-		 *
-		 * Could use 'OB_MODE_ALL_PAINT' since there are key conflicts,
-		 * transform + paint isn't well supported. */
-		createTransPaintCurveVerts(C, t);
-		t->flag |= T_POINTS | T_2D_EDIT;
-	}
 	else {
 		createTransObject(C, t);
 		t->flag |= T_OBJECT;
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 52fa1ba..f9f9ada 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -38,6 +38,7 @@
 
 #include "DNA_anim_types.h"
 #include "DNA_armature_types.h"
+#include "DNA_brush_types.h"
 #include "DNA_lattice_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_sequence_types.h"
@@ -68,6 +69,7 @@
 #include "BKE_animsys.h"
 #include "BKE_action.h"
 #include "BKE_armature.h"
+#include "BKE_context.h"
 #include "BKE_curve.h"
 #include "BKE_depsgraph.h"
 #include "BKE_displist.h"
@@ -75,7 +77,7 @@
 #include "BKE_lattice.h"
 #include "BKE_mesh.h"
 #include "BKE_nla.h"
-#include "BKE_context.h"
+#include "BKE_paint.h"
 #include "BKE_sequencer.h"
 #include "BKE_editmesh.h"
 #include "BKE_tracking.h"
@@ -1181,8 +1183,10 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
 			}
 		}
 
-		if (ob && ob->mode & OB_MODE_SCULPT) {
-			t->options |= CTX_PAINT_CURVE;
+		if (ob && ob->mode & OB_MODE_ALL_PAINT) {
+			Paint *p = BKE_paint_get_active_from_context(C);
+			if (p && p->brush && (p->brush->flag & BRUSH_CURVE))
+				t->options |= CTX_PAINT_CURVE;
 		}
 
 		/* initialize UV transform from */




More information about the Bf-blender-cvs mailing list