[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17489] branches/projection-paint/source/ blender: better enable seam correction by default
Campbell Barton
ideasman42 at gmail.com
Tue Nov 18 02:01:34 CET 2008
Revision: 17489
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17489
Author: campbellbarton
Date: 2008-11-18 02:01:31 +0100 (Tue, 18 Nov 2008)
Log Message:
-----------
better enable seam correction by default
Modified Paths:
--------------
branches/projection-paint/source/blender/makesdna/DNA_scene_types.h
branches/projection-paint/source/blender/src/buttons_editing.c
branches/projection-paint/source/blender/src/imagepaint.c
Modified: branches/projection-paint/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/projection-paint/source/blender/makesdna/DNA_scene_types.h 2008-11-18 00:17:13 UTC (rev 17488)
+++ branches/projection-paint/source/blender/makesdna/DNA_scene_types.h 2008-11-18 01:01:31 UTC (rev 17489)
@@ -345,10 +345,8 @@
typedef struct ImagePaintSettings {
struct Brush *brush;
short flag, tool;
- int pad3;
- /* for projection painting only */
- short xray, backface;
+ /* for projection painting only - todo - use flags */
float seam_bleed;
} ImagePaintSettings;
@@ -803,6 +801,11 @@
#define IMAGEPAINT_DRAW_TOOL 2
#define IMAGEPAINT_DRAW_TOOL_DRAWING 4
+/* projection painting only */
+#define IMAGEPAINT_PROJECT_XRAY 8
+#define IMAGEPAINT_PROJECT_BACKFACE 16
+#define IMAGEPAINT_PROJECT_IGNORE_SEAMS 32
+
/* toolsettings->uvcalc_flag */
#define UVCALC_FILLHOLES 1
#define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
Modified: branches/projection-paint/source/blender/src/buttons_editing.c
===================================================================
--- branches/projection-paint/source/blender/src/buttons_editing.c 2008-11-18 00:17:13 UTC (rev 17488)
+++ branches/projection-paint/source/blender/src/buttons_editing.c 2008-11-18 01:01:31 UTC (rev 17489)
@@ -6372,9 +6372,10 @@
/* Projection Painting */
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOGN|BIT, 1, B_NOP, "Occlude", xco+10,yco-70,butw,19, &settings->imapaint.xray, 0, 0, 0, 0, "Only paint onto the faces directly under the brush");
- uiDefButBitS(block, TOGN|BIT, 1, B_NOP, "Backface Cull", xco+10,yco-90,butw,19, &settings->imapaint.backface, 0, 0, 0, 0, "Ignore faces pointing away from the view");
- uiDefButF(block, NUM, B_NOP, "Bleed ", xco+10,yco-110,butw,19, &settings->imapaint.seam_bleed, 0.0, 8.0, 0, 0, "Extend paint beyond the faces UVs to reduce seams");
+ uiDefButBitS(block, TOGN|BIT, IMAGEPAINT_PROJECT_XRAY, B_NOP, "Occlude", xco+10,yco-70,butw,19, &settings->imapaint.flag, 0, 0, 0, 0, "Only paint onto the faces directly under the brush (slower)");
+ uiDefButBitS(block, TOGN|BIT, IMAGEPAINT_PROJECT_BACKFACE, B_NOP, "Backface Cull", xco+10,yco-90,butw,19, &settings->imapaint.flag, 0, 0, 0, 0, "Ignore faces pointing away from the view (faster)");
+ uiDefButBitS(block, TOGN|BIT, IMAGEPAINT_PROJECT_IGNORE_SEAMS, B_NOP, "Bleed", xco+10,yco-110,butw/2,19, &settings->imapaint.flag, 0, 0, 0, 0, "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)");
+ uiDefButF(block, NUM, B_NOP, "", xco+10 + (butw/2),yco-110,butw/2,19, &settings->imapaint.seam_bleed, 2.0, 8.0, 0, 0, "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
Modified: branches/projection-paint/source/blender/src/imagepaint.c
===================================================================
--- branches/projection-paint/source/blender/src/imagepaint.c 2008-11-18 00:17:13 UTC (rev 17488)
+++ branches/projection-paint/source/blender/src/imagepaint.c 2008-11-18 01:01:31 UTC (rev 17489)
@@ -3693,10 +3693,17 @@
if (project) {
/* setup projection painting data */
- ps.do_backfacecull = settings->imapaint.backface ? 0 : 1;
- ps.do_occlude = settings->imapaint.xray ? 0 : 1;
+ ps.do_backfacecull = (settings->imapaint.flag & IMAGEPAINT_PROJECT_BACKFACE) ? 0 : 1;
+ ps.do_occlude = (settings->imapaint.flag & IMAGEPAINT_PROJECT_XRAY) ? 0 : 1;
#ifndef PROJ_DEBUG_NOSEAMBLEED
- ps.seam_bleed_px = settings->imapaint.seam_bleed; /* pixel num to bleed */
+ if (settings->imapaint.flag & IMAGEPAINT_PROJECT_IGNORE_SEAMS) {
+ ps.seam_bleed_px = 0.0;
+ } else {
+ ps.seam_bleed_px = settings->imapaint.seam_bleed; /* pixel num to bleed */
+ if (ps.seam_bleed_px < 2.0)
+ ps.seam_bleed_px = 2.0;
+ }
+
#endif
project_paint_begin(&ps, mval);
More information about the Bf-blender-cvs
mailing list