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:
authorAntony Riakiotakis <kalast@gmail.com>2014-07-31 13:46:19 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-07-31 13:46:28 +0400
commite7dbf553e867908e668ecb59b78785747d238f2f (patch)
treec96a64b67de7ec2f59aeb03354ce93aad447f384 /source/blender/editors
parent5c3c3abb454c7a11709abee5e3648aa23f82408c (diff)
Fix T41257.
We need to allow faces without slots to initialize a UV layer or seam checking code will go bananas.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 6c41c8efa55..c27cbff20a0 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -356,7 +356,7 @@ static TexPaintSlot *project_paint_face_paint_slot(const ProjPaintState *ps, int
{
MFace *mf = ps->dm_mface + face_index;
Material *ma = ps->dm->mat[mf->mat_nr];
- return &ma->texpaintslot[ma->paint_active_slot];
+ return ma->texpaintslot + ma->paint_active_slot;
}
static Image *project_paint_face_paint_image(const ProjPaintState *ps, int face_index)
@@ -367,7 +367,8 @@ static Image *project_paint_face_paint_image(const ProjPaintState *ps, int face_
else {
MFace *mf = ps->dm_mface + face_index;
Material *ma = ps->dm->mat[mf->mat_nr];
- return ma->texpaintslot[ma->paint_active_slot].ima;
+ TexPaintSlot *slot = ma->texpaintslot + ma->paint_active_slot;
+ return slot ? slot->ima : NULL;
}
}
@@ -3288,18 +3289,20 @@ static void project_paint_begin(ProjPaintState *ps)
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 || !(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;
+ if (slot == NULL) {
+ tf_base = CustomData_get_layer(&ps->dm->faceData, CD_MTFACE);
}
+ else {
+ if (slot != slot_last) {
+ if (!slot->uvname || !(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;
+ /* don't allow using the same inage for painting and stencilling */
+ if (slot->ima == ps->stencil_ima)
+ continue;
+ }
}
*tf = tf_base + face_index;