diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-01-30 04:04:39 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-01-30 04:04:39 +0300 |
commit | 9c1ae550174d8bd9d8e159fc53653494cf19e202 (patch) | |
tree | bf415f047feddec7165e6375dc282edcb8d3880e /source/blender/src/poseobject.c | |
parent | 45d486f0f34f87b86527283e7d084f50bfc302e4 (diff) |
Bugfix:
Calculate Paths for Armatures didn't work if called from the WKEY menu
before doing so from the Armature Visualisations panel. Was caused by
the absence of version-patches for older-files where the settings used for
path calculation were uninitialised.
Diffstat (limited to 'source/blender/src/poseobject.c')
-rw-r--r-- | source/blender/src/poseobject.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 94b6cdb7617..38a622971e9 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -235,6 +235,15 @@ void pose_calculate_path(Object *ob) return; arm= ob->data; + /* version patch for older files here (do_versions patch too complicated) */ + if ((arm->pathsf == 0) || (arm->pathef == 0)) { + arm->pathsf = SFRA; + arm->pathef = EFRA; + } + if (arm->pathsize == 0) { + arm->pathsize = 1; + } + /* set frame values */ cfra= CFRA; sfra = arm->pathsf; @@ -258,7 +267,6 @@ void pose_calculate_path(Object *ob) } for(CFRA=sfra; CFRA<=efra; CFRA++) { - /* do all updates */ for(base= FIRSTBASE; base; base= base->next) { if(base->object->recalc) { @@ -290,6 +298,7 @@ void pose_calculate_path(Object *ob) CFRA= cfra; allqueue(REDRAWVIEW3D, 0); /* recalc tags are still there */ + allqueue(REDRAWBUTSEDIT, 0); } @@ -500,9 +509,9 @@ void pose_copy_menu(void) i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ if (i<25) - nr= pupmenu("Copy Pose Attributes %t|Location%x1|Rotation%x2|Size%x3|Constraints (All)%x4|Constraints...%x5|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); + nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); else - nr= pupmenu("Copy Pose Attributes %t|Location%x1|Rotation%x2|Size%x3|Constraints (All)%x4|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); + nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); if(nr==-1) return; if(nr!=5) { @@ -543,6 +552,26 @@ void pose_copy_menu(void) case 8: pchan->custom = pchanact->custom; break; + case 9: + armature_loc_pose_to_bone(pchan, pchanact->pose_mat[3], pchan->loc); + break; + case 10: + { + float delta_mat[4][4], quat[4]; + + armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat); + Mat4ToQuat(delta_mat, quat); + QUATCOPY(pchan->quat, quat); + } + break; + case 11: + { + float delta_mat[4][4], size[4]; + + armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat); + Mat4ToSize(delta_mat, size); + VECCOPY(pchan->size, size); + } } } } |