diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2012-02-22 04:06:15 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2012-02-22 04:06:15 +0400 |
commit | c7185d26527ef1ef56e0fe54cdef0d54578ae1b1 (patch) | |
tree | 7405af4365ea9aebb8f70e0776cf857331af499c /source/blender/editors/uvedit/uvedit_draw.c | |
parent | a4e69673233e2506075ff43e3cdb09652fd66236 (diff) |
Stitch tool fully functional again. Many thanks to Howard Trickey for proposing the loop winding criterion for normal disambiguation of edges. Unfortunately some extra memory has to be allocated for this to work correctly. If the tool had been initially written for bmesh I would have used the already present adjacency information to make it work, avoiding some extra allocations. Maybe a project for another day though, when I am more proficient with bmesh internals.
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_draw.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 8de03f330d9..ef09ec3c3e8 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -877,6 +877,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) /* finally draw stitch preview */ if(stitch_preview) { + int i, index = 0; glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); glEnableClientState(GL_VERTEX_ARRAY); @@ -887,13 +888,17 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) glVertexPointer(2, GL_FLOAT, 0, stitch_preview->static_tris); glDrawArrays(GL_TRIANGLES, 0, stitch_preview->num_static_tris*3); - glVertexPointer(2, GL_FLOAT, 0, stitch_preview->preview_tris); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - UI_ThemeColor4(TH_STITCH_PREVIEW_FACE); - glDrawArrays(GL_TRIANGLES, 0, stitch_preview->num_tris*3); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - UI_ThemeColor4(TH_STITCH_PREVIEW_EDGE); - glDrawArrays(GL_TRIANGLES, 0, stitch_preview->num_tris*3); + glVertexPointer(2, GL_FLOAT, 0, stitch_preview->preview_polys); + for(i = 0; i < stitch_preview->num_polys; i++){ + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + UI_ThemeColor4(TH_STITCH_PREVIEW_FACE); + glDrawArrays(GL_POLYGON, index, stitch_preview->uvs_per_polygon[i]); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + UI_ThemeColor4(TH_STITCH_PREVIEW_EDGE); + glDrawArrays(GL_POLYGON, index, stitch_preview->uvs_per_polygon[i]); + + index += stitch_preview->uvs_per_polygon[i]; + } glPolygonMode(GL_FRONT_AND_BACK, GL_POINT); /*UI_ThemeColor4(TH_STITCH_PREVIEW_VERT); glDrawArrays(GL_TRIANGLES, 0, stitch_preview->num_tris*3);*/ |