diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-10-25 02:20:30 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-10-25 02:20:30 +0400 |
commit | 42127966288d44509ff12463bfc0dd2de9de07d8 (patch) | |
tree | 0e9746b24a06115b682da4cf54396df3f4a31899 /source | |
parent | 0a3993ec0f4938b0235e31065b3e9e9e95bfa99e (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 3 | ||||
-rw-r--r-- | source/blender/src/drawarmature.c | 23 | ||||
-rw-r--r-- | source/blender/src/editface.c | 2 | ||||
-rw-r--r-- | source/blender/src/unwrapper.c | 4 |
4 files changed, 20 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index c1d24bf5deb..f567e3dde6e 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1170,8 +1170,9 @@ static void execute_posetree(Object *ob, PoseTree *tree) /* bone offset */ if (pchan->parent && (a > 0)) - VecCopyf(start, bone->head); + VecSubf(start, pchan->pose_head, pchan->parent->pose_tail); else + /* only root bone (a = 0) has no parent */ start[0]= start[1]= start[2]= 0.0f; /* change length based on bone size */ diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c index 112731b5814..e35e45ab626 100644 --- a/source/blender/src/drawarmature.c +++ b/source/blender/src/drawarmature.c @@ -1105,10 +1105,10 @@ static void bgl_sphere_project(float ax, float az) float dir[3], sine, q3; 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[1]= 1.0-2.0*sine; + dir[1]= 1.0f-2.0f*sine; dir[2]= ax*q3; glVertex3fv(dir); @@ -1134,11 +1134,11 @@ static void draw_dof_ellipse(float ax, float az) glColor4ub(70, 70, 70, 50); glBegin(GL_QUADS); - pz= 0.0; + pz= 0.0f; for(i=1; i<n; i++) { z= staticSine[i]; - px= 0.0; + px= 0.0f; for(j=1; j<n-i+1; j++) { x = staticSine[j]; @@ -1186,17 +1186,22 @@ static void draw_pose_dofs(Object *ob) if(bone && !(bone->flag & BONE_HIDDEN_P)) { if(bone->flag & BONE_SELECTED) { 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; int a, i; - + /* in parent-bone pose, but own restspace */ glPushMatrix(); + + VECCOPY(posetrans, pchan->pose_mat[3]); + glTranslatef(posetrans[0], posetrans[1], posetrans[2]); + if(pchan->parent) { - glMultMatrixf(pchan->parent->pose_mat); - glTranslatef(0.0f, bone->parent->length, 0.0f); + Mat4CpyMat4(mat, pchan->parent->pose_mat); + 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); glMultMatrixf(mat); diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index 1a9e4b9ac21..787b6a6471a 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -487,6 +487,8 @@ void calculate_uv_map(unsigned short mapmode) BIF_undo_push("UV calculation"); + object_uvs_changed(OBACT); + allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); } diff --git a/source/blender/src/unwrapper.c b/source/blender/src/unwrapper.c index 4747a26825a..c1bf0d3fa3f 100644 --- a/source/blender/src/unwrapper.c +++ b/source/blender/src/unwrapper.c @@ -1158,12 +1158,12 @@ void unwrap_lscm(void) BIF_undo_push("UV lscm unwrap"); + object_uvs_changed(OBACT); + allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); } - - /* Set tface seams based on edge data, uses hash table to find seam edges. */ void set_seamtface() |