Small fixes;

- Bone Ghost drawing now skips axes and names
- "Snap to cursor" now works for parent-less bones in PoseMode
- Prevented assigning in buttons of negative zero (was confusing)
This commit is contained in:
Ton Roosendaal 2005-11-14 22:21:56 +00:00
parent 0916029683
commit 621d4a700d
4 changed files with 38 additions and 14 deletions

@ -2576,14 +2576,15 @@ static void set_faces_raycountflag(void)
}
else vlr++;
if(vlr->v4) {
if(vlr->v4)
clipval= vlr->v1->flag & vlr->v2->flag & vlr->v3->flag & vlr->v4->flag;
if(clipval==64 || clipval==128)
vlr->raycount= 0;
else
vlr->raycount= 1;
}
else vlr->raycount= 1;
else
clipval= vlr->v1->flag & vlr->v2->flag & vlr->v3->flag;
if(clipval==64 || clipval==128)
vlr->raycount= 0;
else
vlr->raycount= 1;
}
}
@ -2635,7 +2636,7 @@ static void zbuffer_abuf()
if(vlr->flag & R_VISIBLE) {
/* a little advantage for transp rendering (a z offset) */
/* a little advantage for transp rendering (a z offset) */
if( ma->zoffs != 0.0) {
mul= 0x7FFFFFFF;
zval= mul*(1.0+vlr->v1->ho[2]/vlr->v1->ho[3]);

@ -1722,7 +1722,7 @@ static void draw_ghost_poses(Base *base)
bPose *posen, *poseo;
bActionStrip *strip;
float cur, start, end, stepsize, range, colfac, actframe;
int cfrao, maptime;
int cfrao, maptime, flago;
/* pre conditions, get an action with sufficient frames */
if(ob->action==NULL)
@ -1747,13 +1747,15 @@ static void draw_ghost_poses(Base *base)
cfrao= CFRA;
if(maptime) actframe= get_action_frame(ob, (float)CFRA);
else actframe= CFRA;
flago= arm->flag;
arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES);
/* copy the pose */
poseo= ob->pose;
copy_pose(&posen, ob->pose, 1);
ob->pose= posen;
armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
glEnable(GL_BLEND);
if(G.vd->zbuf) glDisable(GL_DEPTH_TEST);
@ -1794,8 +1796,10 @@ static void draw_ghost_poses(Base *base)
free_pose_channels(posen);
MEM_freeN(posen);
/* restore */
CFRA= cfrao;
ob->pose= poseo;
arm->flag= flago;
armature_rebuild_pose(ob, ob->data);
ob->flag |= OB_POSEMODE;

@ -1155,7 +1155,23 @@ void snap_sel_to_curs()
if( ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0))) {
ob= base->object;
if(ob->flag & OB_POSEMODE) {
; // todo
bPoseChannel *pchan;
float cursp[3];
Mat4Invert(ob->imat, ob->obmat);
VECCOPY(cursp, curs);
Mat4MulVecfl(ob->imat, cursp);
for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
if(pchan->bone->flag & BONE_SELECTED) {
if(pchan->parent==NULL) {
VECCOPY(pchan->loc, cursp);
}
/* else todo... */
}
}
ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
ob->recalc |= OB_RECALC_DATA;
}
else {
ob->recalc |= OB_RECALC_OB;

@ -4124,7 +4124,7 @@ static void ui_set_but_val(uiBut *but, double value)
if(but->pointype==0) return;
poin= but->poin;
/* value is a hsv value: convert to rgb */
if( but->type==HSVSLI ) {
float h, s, v, *fp= (float *)but->poin;
@ -4153,8 +4153,11 @@ static void ui_set_but_val(uiBut *but, double value)
}
else if( but->pointype==INT )
*((int *)poin)= (int)floor(value+0.5);
else if( but->pointype==FLO )
*((float *)poin)= value;
else if( but->pointype==FLO ) {
float fval= (float)value;
if(fval>= -0.00001f && fval<= 0.00001f) fval= 0.0f; /* prevent negative zero */
*((float *)poin)= fval;
}
/* update select flag */
ui_is_but_sel(but);