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>2013-06-26 14:14:30 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-06-26 14:14:30 +0400
commit56f5951ed30fa43f9fecf3663a2a4d1e213071fb (patch)
tree5b8029387427eff510ea17da43f59ab4bf0db957 /source/blender/editors/space_view3d/drawmesh.c
parent725543241a95639eb4d445a055664e8ecd8f74b4 (diff)
Fix #34837 Texture Painting using Face Selection Mask fails to show
texture if more than 1 texture is used The problem here is that no flushing is done when the texface image changes between rendered triangles. Added a compare function and slightly modified the draw_tface_mapped__set_draw callback to compliant with the new user data.
Diffstat (limited to 'source/blender/editors/space_view3d/drawmesh.c')
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index d0a34f20c77..6a836c4af13 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -89,6 +89,7 @@ typedef struct drawEMTFMapped_userData {
} drawEMTFMapped_userData;
typedef struct drawTFace_userData {
+ Mesh *me;
MFace *mf;
MTFace *tf;
} drawTFace_userData;
@@ -538,7 +539,7 @@ static void update_tface_color_layer(DerivedMesh *dm)
static DMDrawOption draw_tface_mapped__set_draw(void *userData, int index)
{
- Mesh *me = (Mesh *)userData;
+ Mesh *me = ((drawTFace_userData *)userData)->me;
/* array checked for NULL before calling */
MPoly *mpoly = &me->mpoly[index];
@@ -735,6 +736,7 @@ static int compareDrawOptions(void *userData, int cur_index, int next_index)
return 1;
}
+
static int compareDrawOptionsEm(void *userData, int cur_index, int next_index)
{
drawEMTFMapped_userData *data = userData;
@@ -777,8 +779,14 @@ static void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d
if (ob->mode & OB_MODE_WEIGHT_PAINT)
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions_facemask, GPU_enable_material, NULL, me,
DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
- else
- dm->drawMappedFacesTex(dm, me->mpoly ? draw_tface_mapped__set_draw : NULL, NULL, me);
+ else {
+ drawTFace_userData userData;
+
+ userData.mf = DM_get_tessface_data_layer(dm, CD_MFACE);
+ userData.tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
+ userData.me = me;
+ dm->drawMappedFacesTex(dm, me->mpoly ? draw_tface_mapped__set_draw : NULL, compareDrawOptions, &userData);
+ }
}
else {
if (GPU_buffer_legacy(dm)) {
@@ -794,6 +802,7 @@ static void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d
userData.mf = DM_get_tessface_data_layer(dm, CD_MFACE);
userData.tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
+ userData.me = NULL;
dm->drawFacesTex(dm, draw_tface__set_draw, compareDrawOptions, &userData);
}