Added wire outlines
authorClément Foucault <foucault.clem@gmail.com>
Tue, 31 Jan 2017 16:27:05 +0000 (17:27 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Tue, 31 Jan 2017 16:27:05 +0000 (17:27 +0100)
source/blender/draw/engines/clay/clay.c

index 844cd5b4ec416c55c4c34131d414d06c73fcc56d..e187affaedf3e15ba37b563c562c76ed2efc164c 100644 (file)
@@ -565,6 +565,8 @@ static void CLAY_create_cache(CLAY_PassList *passes, const struct bContext *C)
                }
 
                struct Batch *geom;
+               bool do_outlines, do_wires;
+
                switch (ob->type) {
                        case OB_MESH:
                                geom = DRW_cache_surface_get(ob);
@@ -573,6 +575,10 @@ static void CLAY_create_cache(CLAY_PassList *passes, const struct bContext *C)
                                DRW_shgroup_call_add(depthbatch, geom, ob->obmat);
                                DRW_shgroup_call_add(default_shgrp, geom, ob->obmat);
 
+                               do_outlines  = ((ob->base_flag & BASE_SELECTED) != 0);
+
+                               DRW_shgroup_wire_outline(passes->wire_outline_pass, ob, false, do_wires, do_outlines);
+
                                /* When encountering a new material :
                                 * - Create new Batch
                                 * - Initialize Batch
@@ -586,7 +592,7 @@ static void CLAY_create_cache(CLAY_PassList *passes, const struct bContext *C)
                        case OB_CAMERA:
                        case OB_EMPTY:
                        default:
-                           DRW_shgroup_non_meshes(passes->non_meshes_pass, ob);
+                               DRW_shgroup_non_meshes(passes->non_meshes_pass, ob);
                                break;
                }
 
@@ -643,6 +649,7 @@ static void CLAY_view_draw(RenderEngine *UNUSED(engine), const struct bContext *
 
        /* Pass 4 : Overlays */
        DRW_framebuffer_texture_attach(buffers->default_fb, textures->depth, 0);
+       DRW_draw_pass(passes->wire_outline_pass);
        DRW_draw_pass(passes->non_meshes_pass);
        DRW_draw_pass(passes->ob_center_pass);