diff options
Diffstat (limited to 'source/blender/editors/space_view3d/drawarmature.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index dfa373f111f..f7698b0e9f3 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -61,7 +61,6 @@ #include "ED_armature.h" #include "ED_keyframes_draw.h" -#include "BLF_api.h" #include "UI_resources.h" @@ -1548,7 +1547,7 @@ static void draw_pose_dofs(Object *ob) glPushMatrix(); copy_v3_v3(posetrans, pchan->pose_mat[3]); - glTranslatef(posetrans[0], posetrans[1], posetrans[2]); + glTranslate3fv(posetrans); if (pchan->parent) { copy_m4_m4(mat, pchan->parent->pose_mat); @@ -1620,7 +1619,7 @@ static void draw_pose_dofs(Object *ob) for (a = -16; a <= 16; a++) { /* *0.5f here comes from M_PI/360.0f when rotations were still in degrees */ float fac = ((float)a) / 16.0f * 0.5f; - phi = (float)(0.5 * M_PI) + fac * (pchan->limitmax[0] - pchan->limitmin[0]); + phi = (float)M_PI_2 + fac * (pchan->limitmax[0] - pchan->limitmin[0]); i = (a == -16) ? 2 : 3; corner[i][0] = 0.0f; @@ -1779,7 +1778,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, } draw_custom_bone(scene, v3d, rv3d, pchan->custom, - OB_SOLID, arm->flag, flag, index, bone->length); + OB_SOLID, arm->flag, flag, index, PCHAN_CUSTOM_DRAW_SIZE(pchan)); } } else { @@ -1870,7 +1869,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, flag |= BONE_DRAW_ACTIVE; draw_custom_bone(scene, v3d, rv3d, pchan->custom, - OB_WIRE, arm->flag, flag, index, bone->length); + OB_WIRE, arm->flag, flag, index, PCHAN_CUSTOM_DRAW_SIZE(pchan)); glPopMatrix(); } @@ -2088,6 +2087,10 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, if (v3d->zbuf) glEnable(GL_DEPTH_TEST); } } + + if (index != -1) { + GPU_select_load_id(-1); + } } /* in editmode, we don't store the bone matrix... */ @@ -2363,7 +2366,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base bArmature *arm = ob->data; bPose *posen, *poseo; float start, end, stepsize, range, colfac; - int cfrao, flago, ipoflago; + int cfrao, flago; start = (float)arm->ghostsf; end = (float)arm->ghostef; @@ -2378,8 +2381,6 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base cfrao = CFRA; flago = arm->flag; arm->flag &= ~(ARM_DRAWNAMES | ARM_DRAWAXES); - ipoflago = ob->ipoflag; - ob->ipoflag |= OB_DISABLE_PATH; /* copy the pose */ poseo = ob->pose; @@ -2392,7 +2393,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base if (v3d->zbuf) glDisable(GL_DEPTH_TEST); /* draw from first frame of range to last */ - for (CFRA = (int)start; CFRA < end; CFRA += (int)stepsize) { + for (CFRA = (int)start; CFRA <= end; CFRA += (int)stepsize) { colfac = (end - (float)CFRA) / range; UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128 - (int)(120.0f * sqrtf(colfac))); @@ -2415,7 +2416,6 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base ob->pose = poseo; arm->flag = flago; ob->mode |= OB_MODE_POSE; - ob->ipoflag = ipoflago; } /* draw ghosts on keyframes in action within range @@ -2459,8 +2459,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base * cfrao = CFRA; flago = arm->flag; arm->flag &= ~(ARM_DRAWNAMES | ARM_DRAWAXES); - ob->ipoflag |= OB_DISABLE_PATH; - + /* copy the pose */ poseo = ob->pose; BKE_pose_copy_data(&posen, ob->pose, 1); |