forked from bartvdbraak/blender
fix for drawing bones names twice in object with viewport 'Outline' option enabled.
This commit is contained in:
parent
897b570c1a
commit
ac089ddd15
@ -1577,7 +1577,7 @@ static void bone_matrix_translate_y(float mat[][4], float y)
|
||||
}
|
||||
|
||||
/* assumes object is Armature with pose */
|
||||
static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, short ghost)
|
||||
static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, const short is_ghost, const short is_outline)
|
||||
{
|
||||
RegionView3D *rv3d= ar->regiondata;
|
||||
Object *ob= base->object;
|
||||
@ -1737,7 +1737,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
|
||||
}
|
||||
|
||||
/* prepare colors */
|
||||
if(ghost) {
|
||||
if(is_ghost) {
|
||||
/* 13 October 2009, Disabled this to make ghosting show the right colors (Aligorith) */
|
||||
}
|
||||
else if (arm->flag & ARM_POSEMODE)
|
||||
@ -1905,7 +1905,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
|
||||
draw_pose_dofs(ob);
|
||||
|
||||
/* finally names and axes */
|
||||
if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES)) {
|
||||
if (arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES) && is_outline == 0) {
|
||||
/* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
|
||||
if ((G.f & G_PICKSEL) == 0) {
|
||||
float vec[3];
|
||||
@ -2259,7 +2259,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
|
||||
|
||||
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
|
||||
where_is_pose(scene, ob);
|
||||
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE);
|
||||
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
|
||||
}
|
||||
glDisable(GL_BLEND);
|
||||
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
|
||||
@ -2338,7 +2338,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
|
||||
|
||||
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
|
||||
where_is_pose(scene, ob);
|
||||
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE);
|
||||
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
|
||||
}
|
||||
glDisable(GL_BLEND);
|
||||
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
|
||||
@ -2408,7 +2408,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
|
||||
if (CFRA != cfrao) {
|
||||
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
|
||||
where_is_pose(scene, ob);
|
||||
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE);
|
||||
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2423,7 +2423,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
|
||||
if (CFRA != cfrao) {
|
||||
BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
|
||||
where_is_pose(scene, ob);
|
||||
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE);
|
||||
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2444,7 +2444,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
|
||||
/* ********************************** Armature Drawing - Main ************************* */
|
||||
|
||||
/* called from drawobject.c, return 1 if nothing was drawn */
|
||||
int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag)
|
||||
int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag, const short is_outline)
|
||||
{
|
||||
Object *ob= base->object;
|
||||
bArmature *arm= ob->data;
|
||||
@ -2510,7 +2510,7 @@ int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, in
|
||||
}
|
||||
}
|
||||
}
|
||||
draw_pose_bones(scene, v3d, ar, base, dt, FALSE);
|
||||
draw_pose_bones(scene, v3d, ar, base, dt, FALSE, is_outline);
|
||||
arm->flag &= ~ARM_POSEMODE;
|
||||
|
||||
if(ob->mode & OB_MODE_POSE)
|
||||
|
@ -5441,7 +5441,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
|
||||
}
|
||||
else if(ob->type==OB_ARMATURE) {
|
||||
if(!(ob->mode & OB_MODE_POSE))
|
||||
draw_armature(scene, v3d, ar, base, OB_WIRE, 0);
|
||||
draw_armature(scene, v3d, ar, base, OB_WIRE, FALSE, TRUE);
|
||||
}
|
||||
|
||||
glLineWidth(1.0);
|
||||
@ -5977,7 +5977,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
|
||||
case OB_ARMATURE:
|
||||
if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
|
||||
if(dt>OB_WIRE) GPU_enable_material(0, NULL); // we use default material
|
||||
empty_object= draw_armature(scene, v3d, ar, base, dt, flag);
|
||||
empty_object= draw_armature(scene, v3d, ar, base, dt, flag, FALSE);
|
||||
if(dt>OB_WIRE) GPU_disable_material();
|
||||
}
|
||||
break;
|
||||
|
@ -120,7 +120,7 @@ void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, floa
|
||||
#define V3D_CACHE_TEXT_ASCII (1<<2)
|
||||
|
||||
/* drawarmature.c */
|
||||
int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag);
|
||||
int draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, int dt, int flag, const short is_outline);
|
||||
|
||||
/* drawmesh.c */
|
||||
void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, struct Object *ob, struct DerivedMesh *dm, int faceselect);
|
||||
|
Loading…
Reference in New Issue
Block a user