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:
authorNicholas Bishop <nicholasbishop@gmail.com>2009-08-16 05:25:53 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2009-08-16 05:25:53 +0400
commitebf1c5faca86286aa90ab5ab9fc4d3ddb1f51cdf (patch)
tree1e457366adcd664233760e5e17b20aa6c3f8e4a2 /source/blender/editors/sculpt_paint/paint_image.c
parentdb1cab0f3a75562eebf5aea93753e77582a4c3e4 (diff)
2.5/Texture paint
* Made texture paint object-localized too. Note for Brecht: gpu_draw.c had three uses of G_TEXTUREPAINT that I was not able to cleanly fix, so commented out for now. Can you take a look and see what should be done here?
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 48e07b7a489..565ccb2b903 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -4380,10 +4380,12 @@ static Brush *image_paint_brush(bContext *C)
static int image_paint_poll(bContext *C)
{
+ Object *obact = CTX_data_active_object(C);
+
if(!image_paint_brush(C))
return 0;
- if((G.f & G_TEXTUREPAINT) && CTX_wm_region_view3d(C)) {
+ if((obact && obact->mode & OB_MODE_TEXTURE_PAINT) && CTX_wm_region_view3d(C)) {
return 1;
}
else {
@@ -5144,13 +5146,13 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
me= get_mesh(ob);
- if(!(G.f & G_TEXTUREPAINT) && !me) {
+ if(!(ob->mode & OB_MODE_TEXTURE_PAINT) && !me) {
BKE_report(op->reports, RPT_ERROR, "Can only enter texture paint mode for mesh objects.");
return OPERATOR_CANCELLED;
}
- if(G.f & G_TEXTUREPAINT) {
- G.f &= ~G_TEXTUREPAINT;
+ if(ob->mode & OB_MODE_TEXTURE_PAINT) {
+ ob->mode &= ~OB_MODE_TEXTURE_PAINT;
if(U.glreslimit != 0)
GPU_free_images();
@@ -5159,7 +5161,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
toggle_paint_cursor(C, 0);
}
else {
- G.f |= G_TEXTUREPAINT;
+ ob->mode |= OB_MODE_TEXTURE_PAINT;
if(me->mtface==NULL)
me->mtface= CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT,
@@ -5216,7 +5218,7 @@ static int texture_paint_radial_control_exec(bContext *C, wmOperator *op)
static int texture_paint_poll(bContext *C)
{
if(texture_paint_toggle_poll(C))
- if(G.f & G_TEXTUREPAINT)
+ if(CTX_data_active_object(C)->mode & OB_MODE_TEXTURE_PAINT)
return 1;
return 0;