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/edit_armature_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/edit_armature_mode.c')
-rw-r--r--source/blender/draw/modes/edit_armature_mode.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c
index 7d13dbd78ee..3487ceba141 100644
--- a/source/blender/draw/modes/edit_armature_mode.c
+++ b/source/blender/draw/modes/edit_armature_mode.c
@@ -38,6 +38,7 @@ extern GlobalsUboStorage ts;
typedef struct EDIT_ARMATURE_PassList {
struct DRWPass *bone_solid;
struct DRWPass *bone_wire;
+ struct DRWPass *bone_envelope;
struct DRWPass *relationship;
} EDIT_ARMATURE_PassList;
@@ -84,6 +85,12 @@ static void EDIT_ARMATURE_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 ...) */
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND | DRW_STATE_WIRE;
psl->relationship = DRW_pass_create("Bone Relationship Pass", state);
@@ -102,7 +109,8 @@ static void EDIT_ARMATURE_cache_populate(void *vedata, Object *ob)
if (ob->type == OB_ARMATURE) {
if (arm->edbo) {
- DRW_shgroup_armature_edit(ob, psl->bone_solid, psl->bone_wire, stl->g_data->relationship_lines);
+ DRW_shgroup_armature_edit(
+ ob, psl->bone_solid, psl->bone_wire, psl->bone_envelope, stl->g_data->relationship_lines);
}
}
}
@@ -111,6 +119,7 @@ static void EDIT_ARMATURE_draw_scene(void *vedata)
{
EDIT_ARMATURE_PassList *psl = ((EDIT_ARMATURE_Data *)vedata)->psl;
+ DRW_draw_pass(psl->bone_envelope);
DRW_draw_pass(psl->bone_solid);
DRW_draw_pass(psl->bone_wire);
DRW_draw_pass(psl->relationship);