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:
authorCampbell Barton <ideasman42@gmail.com>2007-09-24 13:40:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-09-24 13:40:09 +0400
commit1fde6d457091b4ea94e40245eff6d62881eb55bf (patch)
tree67d3c9510826f076024d57580d7e6d8d843dc543 /source/blender/src/drawimage.c
parentadef239fc0f4603513ba92aa3095bbb7249f3d01 (diff)
Made the remaining UV py scripts work with editmesh now.
DrawShadow option didnt check the final derived mesh had CD_MTFACE's can would crash when enabled with mirror modifier.
Diffstat (limited to 'source/blender/src/drawimage.c')
-rw-r--r--source/blender/src/drawimage.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c
index 5bc8dad86af..4c1333d0ce2 100644
--- a/source/blender/src/drawimage.c
+++ b/source/blender/src/drawimage.c
@@ -481,29 +481,34 @@ void draw_uvs_sima(void)
return; /* only draw shadow mesh */
} else if (G.sima->flag & SI_DRAWSHADOW) {
/* draw shadow mesh - this is the mesh with the modifier applied */
- DerivedMesh *finalDM, *cageDM;
-
glColor3ub(112, 112, 112);
- if (G.editMesh->derivedFinal && G.editMesh->derivedFinal->drawUVEdges) {
- G.editMesh->derivedFinal->drawUVEdges(G.editMesh->derivedFinal);
- }
-
- /* draw final mesh with modifiers applied */
- cageDM = editmesh_get_derived_cage_and_final(&finalDM, CD_MASK_BAREMESH | CD_MASK_MTFACE);
-
- if (finalDM->drawUVEdges &&
- DM_get_face_data_layer(finalDM, CD_MTFACE) &&
- /* When sync selection is enabled, all faces are drawn (except for hidden)
- * so if cage is the same as the final, theres no point in drawing the shadowmesh. */
- !((G.sima->flag & SI_SYNC_UVSEL && cageDM==finalDM))
+ if ( em->derivedFinal &&
+ em->derivedFinal->drawUVEdges &&
+ CustomData_has_layer(&em->derivedFinal->faceData, CD_MTFACE)
) {
+ /* we can use the existing final mesh */
glColor3ub(112, 112, 112);
- finalDM->drawUVEdges(finalDM);
+ G.editMesh->derivedFinal->drawUVEdges(G.editMesh->derivedFinal);
+ } else {
+ DerivedMesh *finalDM, *cageDM;
+
+ /* draw final mesh with modifiers applied */
+ cageDM = editmesh_get_derived_cage_and_final(&finalDM, CD_MASK_BAREMESH | CD_MASK_MTFACE);
+
+ if (finalDM->drawUVEdges &&
+ DM_get_face_data_layer(finalDM, CD_MTFACE) &&
+ /* When sync selection is enabled, all faces are drawn (except for hidden)
+ * so if cage is the same as the final, theres no point in drawing the shadowmesh. */
+ !((G.sima->flag & SI_SYNC_UVSEL && cageDM==finalDM))
+ ) {
+ glColor3ub(112, 112, 112);
+ finalDM->drawUVEdges(finalDM);
+ }
+
+ if (cageDM != finalDM)
+ cageDM->release(cageDM);
+ finalDM->release(finalDM);
}
-
- if (cageDM != finalDM)
- cageDM->release(cageDM);
- finalDM->release(finalDM);
}
/* draw transparent faces */