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:
authorCampbell Barton <ideasman42@gmail.com>2010-11-04 00:23:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-04 00:23:02 +0300
commit81fe9d2d04f463c2bbaea599d067beeca6ae2dac (patch)
tree9a8ef75b88b5cd6e3624ec85885392168f930077 /source/blender
parentee4b32c41a4a20cd82d10af7fefd9b20e29a77f3 (diff)
workaround [#24392] 2d Image paint editor: no clone/smear/soften tools etc
the brush system matches the brush mode with the object mode, but this doesn't work for 2D image view paint. since the poll() function doesnt have access to the context, for now just check if no paint modes are active, default to texture paint.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/brush.c2
-rw-r--r--source/blender/blenloader/intern/readfile.c2
-rw-r--r--source/blender/editors/space_info/info_stats.c2
-rw-r--r--source/blender/editors/transform/transform_manipulator.c2
-rw-r--r--source/blender/editors/transform/transform_orientations.c2
-rw-r--r--source/blender/makesdna/DNA_object_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c13
7 files changed, 20 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 7a10f9082e5..649b3e3ad9b 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -67,7 +67,7 @@ static void brush_set_defaults(Brush *brush)
brush->blend = 0;
brush->flag = 0;
- brush->ob_mode = (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT);
+ brush->ob_mode = OB_MODE_ALL_PAINT;
/* BRUSH SCULPT TOOL SETTINGS */
brush->size= 35; /* radius of the brush in pixels */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 595781ac9bd..a9fd383114f 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -11124,7 +11124,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Brush *br;
for(br= main->brush.first; br; br= br->id.next) {
if(br->ob_mode==0)
- br->ob_mode= (OB_MODE_SCULPT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT);
+ br->ob_mode= OB_MODE_ALL_PAINT;
}
}
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index 846812cc1f0..7a6e5dad017 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -339,7 +339,7 @@ static void stats_update(Scene *scene)
/* Pose Mode */
stats_object_pose(ob, &stats);
}
- else if(ob && (ob->flag & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
+ else if(ob && (ob->flag & OB_MODE_ALL_PAINT)) {
/* Sculpt and Paint Mode */
stats_object_paint(ob, &stats);
}
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index b3dbf3c853a..23b4cf5fd99 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -443,7 +443,7 @@ int calc_manipulator_stats(const bContext *C)
mul_m4_v3(ob->obmat, scene->twmax);
}
}
- else if(ob && (ob->mode & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
+ else if(ob && (ob->mode & OB_MODE_ALL_PAINT)) {
;
}
else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) {
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 2d936460c53..085b784b6f0 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -884,7 +884,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
result = ORIENTATION_EDGE;
}
}
- else if(ob && (ob->mode & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT|OB_MODE_PARTICLE_EDIT)))
+ else if(ob && (ob->mode & (OB_MODE_ALL_PAINT|OB_MODE_PARTICLE_EDIT)))
{
}
else {
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 60b4f6a51b6..a5e8e1545b0 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -557,6 +557,9 @@ typedef enum ObjectMode {
OB_MODE_POSE = 64
} ObjectMode;
+/* any mode where the brush system is used */
+#define OB_MODE_ALL_PAINT (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)
+
#define MAX_DUPLI_RECUR 8
#ifdef __cplusplus
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 3b83ec2d3ad..0fe3972104e 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -162,8 +162,19 @@ static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
Scene *scene= (Scene *)ptr->id.data;
Object *ob = OBACT;
Brush *brush= value.id.data;
- return ob->mode & brush->ob_mode;
+
+ /* weak, for object painting we need to check against the object mode
+ * but for 2D view image painting we always want texture brushes
+ * this is not quite correct since you could be in object weightpaint
+ * mode at the same time as the 2D image view, but for now its *good enough* */
+ if(ob->mode & OB_MODE_ALL_PAINT) {
+ return ob->mode & brush->ob_mode;
+ }
+ else {
+ return OB_MODE_TEXTURE_PAINT & brush->ob_mode;
+ }
}
+
#else
static void rna_def_paint(BlenderRNA *brna)