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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-05-17 15:33:34 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-05-17 15:33:34 +0300
commitd0ceb1821bb202fdd0ebd82539abc7ae7a395b02 (patch)
tree64003d4972fe62174de9b4a1501a2b886a662ef1 /source/blender/draw/modes/object_mode.c
parent3c799ba8013405142430d7e20c272fe92457852d (diff)
DwM: Armature: fix bone distance outline drawing.
This indeed needed its own draw pass, thank to @fclem for the hints! Also fixes a stupid mistake in bones head/tail coloring.
Diffstat (limited to 'source/blender/draw/modes/object_mode.c')
-rw-r--r--source/blender/draw/modes/object_mode.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index f7ffa7bbbb2..0a781e61b19 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -77,6 +77,7 @@ typedef struct OBJECT_PassList {
struct DRWPass *grid;
struct DRWPass *bone_solid;
struct DRWPass *bone_wire;
+ struct DRWPass *bone_envelope;
} OBJECT_PassList;
typedef struct OBJECT_FramebufferList {
@@ -603,6 +604,12 @@ static void OBJECT_cache_init(void *vedata)
}
{
+ /* distance outline around envelope bones */
+ DRWState state = DRW_STATE_ADDITIVE | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND;
+ psl->bone_envelope = DRW_pass_create("Bone Envelope Outline Pass", state);
+ }
+
+ {
/* Non Meshes Pass (Camera, empties, lamps ...) */
struct Batch *geom;
@@ -1250,7 +1257,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
if (arm->edbo == NULL) {
if (DRW_state_is_select() || !DRW_pose_mode_armature(ob, draw_ctx->obact)) {
DRW_shgroup_armature_object(
- ob, sl, psl->bone_solid, psl->bone_wire,
+ ob, sl, psl->bone_solid, psl->bone_wire, psl->bone_envelope,
stl->g_data->relationship_lines);
}
}
@@ -1340,6 +1347,7 @@ static void OBJECT_draw_scene(void *vedata)
}
/* This needs to be drawn after the oultine */
+// DRW_draw_pass(psl->bone_envelope); /* Never drawn in Object mode currently. */
DRW_draw_pass(psl->bone_wire);
DRW_draw_pass(psl->bone_solid);
DRW_draw_pass(psl->non_meshes);