[Bf-blender-cvs] [9da884b] soc-2013-paint: Merge branch 'master' into soc-2013-paint
Antony Riakiotakis
noreply at git.blender.org
Sun Apr 27 23:13:34 CEST 2014
Commit: 9da884b3fbb8477d1a4d3c6f87ade9f76b103dc5
Author: Antony Riakiotakis
Date: Mon Apr 28 00:08:54 2014 +0300
https://developer.blender.org/rB9da884b3fbb8477d1a4d3c6f87ade9f76b103dc5
Merge branch 'master' into soc-2013-paint
Conflicts:
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_utils.c
===================================================================
===================================================================
diff --cc source/blender/editors/sculpt_paint/paint_image_2d.c
index ee960f0,7007d9b..ee0956a
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@@ -1005,9 -867,10 +1005,9 @@@ static int paint_2d_op(void *state, ImB
ImagePaintRegion region[4];
short torus = s->brush->flag & BRUSH_TORUS;
short blend = s->blend;
- float *offset = s->brush->clone.offset;
+ const float *offset = s->brush->clone.offset;
float liftpos[2];
- float brush_alpha = BKE_brush_alpha_get(s->scene, s->brush);
- unsigned short mask_max = (unsigned short)(brush_alpha * 65535.0f);
+ float mask_max = BKE_brush_alpha_get(s->scene, s->brush);
int bpos[2], blastpos[2], bliftpos[2];
int a, tot;
diff --cc source/blender/editors/sculpt_paint/paint_image_proj.c
index 2563c1e,86a4de9..4bd240a
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@@ -3300,47 -3165,8 +3300,47 @@@ static void project_paint_begin(ProjPai
is_face_sel = true;
}
- if (is_face_sel && (tpage = project_paint_face_image(ps, ps->dm_mtface, face_index))) {
+ if (!ps->do_stencil_brush) {
+ slot = project_paint_face_paint_slot(ps, face_index);
+ /* all faces should have a valid slot, reassert here */
+ if (slot == NULL)
+ continue;
+
+ if (slot != slot_last) {
+ if (!slot->uvname[0] || !(tf_base = CustomData_get_layer_named(&ps->dm->faceData, CD_MTFACE, slot->uvname)))
+ tf_base = CustomData_get_layer(&ps->dm->faceData, CD_MTFACE);
+ slot_last = slot;
+ }
+
+ /* don't allow using the same inage for painting and stencilling */
+ if (slot->ima == ps->stencil_ima)
+ continue;
+ }
+
+ *tf = tf_base + face_index;
+
+ if (ps->do_layer_clone) {
+ slot_clone = project_paint_face_clone_slot(ps, face_index);
+ /* all faces should have a valid slot, reassert here */
+ if (ELEM(slot_clone, NULL, slot))
+ continue;
+
+ tf_clone = ps->dm_mtface_clone + face_index;
+
+ if (slot_clone != slot_last_clone) {
+ if (!slot_clone->uvname[0] || !(tf_clone_base = CustomData_get_layer_named(&ps->dm->faceData, CD_MTFACE, slot_clone->uvname)))
+ tf_clone_base = CustomData_get_layer(&ps->dm->faceData, CD_MTFACE);
+ slot_last_clone = slot_clone;
+ }
+
+ *tf_clone = tf_clone_base + face_index;
+ }
+
+ /* tfbase here should be non-null! */
+ BLI_assert (tf_base != NULL);
+
+ if (is_face_sel && ((slot && (tpage = slot->ima)) || (tpage = project_paint_face_paint_image(ps, face_index)))) {
- float *v1coSS, *v2coSS, *v3coSS, *v4coSS = NULL;
+ const float *v1coSS, *v2coSS, *v3coSS, *v4coSS = NULL;
v1coSS = ps->screenCoords[mf->v1];
v2coSS = ps->screenCoords[mf->v2];
diff --cc source/blender/editors/sculpt_paint/paint_utils.c
index dc5ec98,642c1dd..1ae4c35
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@@ -399,14 -223,11 +399,14 @@@ void flip_v3_v3(float out[3], const flo
}
/* used for both 3d view and image window */
-void paint_sample_color(const bContext *C, ARegion *ar, int x, int y) /* frontbuf */
+void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_proj, bool use_palette)
{
+ Paint *paint = BKE_paint_get_active_from_context(C);
+ Palette *palette = BKE_paint_palette(paint);
+ PaletteColor *color;
Brush *br = BKE_paint_brush(BKE_paint_get_active_from_context(C));
unsigned int col;
- unsigned char *cp;
- const char *cp;
++ const unsigned char *cp;
CLAMP(x, 0, ar->winx);
CLAMP(y, 0, ar->winy);
More information about the Bf-blender-cvs
mailing list