More bugfixing related to #3149:

Drawing of rotation limits and IK solving was wrong with pose mode
bone offsets.

Also added proper modifier stack update after uv unwrap and lscm.
This commit is contained in:
Brecht Van Lommel 2005-10-24 22:20:30 +00:00
parent 0a3993ec0f
commit 4212796628
4 changed files with 20 additions and 12 deletions

@ -1170,8 +1170,9 @@ static void execute_posetree(Object *ob, PoseTree *tree)
/* bone offset */ /* bone offset */
if (pchan->parent && (a > 0)) if (pchan->parent && (a > 0))
VecCopyf(start, bone->head); VecSubf(start, pchan->pose_head, pchan->parent->pose_tail);
else else
/* only root bone (a = 0) has no parent */
start[0]= start[1]= start[2]= 0.0f; start[0]= start[1]= start[2]= 0.0f;
/* change length based on bone size */ /* change length based on bone size */

@ -1105,10 +1105,10 @@ static void bgl_sphere_project(float ax, float az)
float dir[3], sine, q3; float dir[3], sine, q3;
sine= 1.0f-ax*ax-az*az; sine= 1.0f-ax*ax-az*az;
q3= 2.0*sqrt((sine < 0.0f)? 0.0f: sine); q3= (sine < 0.0f)? 0.0f: 2.0f*sqrt(sine);
dir[0]= -az*q3; dir[0]= -az*q3;
dir[1]= 1.0-2.0*sine; dir[1]= 1.0f-2.0f*sine;
dir[2]= ax*q3; dir[2]= ax*q3;
glVertex3fv(dir); glVertex3fv(dir);
@ -1134,11 +1134,11 @@ static void draw_dof_ellipse(float ax, float az)
glColor4ub(70, 70, 70, 50); glColor4ub(70, 70, 70, 50);
glBegin(GL_QUADS); glBegin(GL_QUADS);
pz= 0.0; pz= 0.0f;
for(i=1; i<n; i++) { for(i=1; i<n; i++) {
z= staticSine[i]; z= staticSine[i];
px= 0.0; px= 0.0f;
for(j=1; j<n-i+1; j++) { for(j=1; j<n-i+1; j++) {
x = staticSine[j]; x = staticSine[j];
@ -1186,17 +1186,22 @@ static void draw_pose_dofs(Object *ob)
if(bone && !(bone->flag & BONE_HIDDEN_P)) { if(bone && !(bone->flag & BONE_HIDDEN_P)) {
if(bone->flag & BONE_SELECTED) { if(bone->flag & BONE_SELECTED) {
if(pose_channel_in_IK_chain(ob, pchan)) { if(pose_channel_in_IK_chain(ob, pchan)) {
float corner[4][3], mat[4][4]; float corner[4][3], posetrans[3], mat[4][4];
float phi=0.0f, theta=0.0f, scale; float phi=0.0f, theta=0.0f, scale;
int a, i; int a, i;
/* in parent-bone pose, but own restspace */ /* in parent-bone pose, but own restspace */
glPushMatrix(); glPushMatrix();
VECCOPY(posetrans, pchan->pose_mat[3]);
glTranslatef(posetrans[0], posetrans[1], posetrans[2]);
if(pchan->parent) { if(pchan->parent) {
glMultMatrixf(pchan->parent->pose_mat); Mat4CpyMat4(mat, pchan->parent->pose_mat);
glTranslatef(0.0f, bone->parent->length, 0.0f); mat[3][0]= mat[3][1]= mat[3][2]= 0.0f;
glMultMatrixf(mat);
} }
glTranslatef(bone->head[0], bone->head[1], bone->head[2]);
Mat4CpyMat3(mat, pchan->bone->bone_mat); Mat4CpyMat3(mat, pchan->bone->bone_mat);
glMultMatrixf(mat); glMultMatrixf(mat);

@ -487,6 +487,8 @@ void calculate_uv_map(unsigned short mapmode)
BIF_undo_push("UV calculation"); BIF_undo_push("UV calculation");
object_uvs_changed(OBACT);
allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWIMAGE, 0); allqueue(REDRAWIMAGE, 0);
} }

@ -1158,12 +1158,12 @@ void unwrap_lscm(void)
BIF_undo_push("UV lscm unwrap"); BIF_undo_push("UV lscm unwrap");
object_uvs_changed(OBACT);
allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWIMAGE, 0); allqueue(REDRAWIMAGE, 0);
} }
/* Set tface seams based on edge data, uses hash table to find seam edges. */ /* Set tface seams based on edge data, uses hash table to find seam edges. */
void set_seamtface() void set_seamtface()