== Armatures - Bone Paths ==

* Shuffled a few bone-path buttons in the Armature Visualisation panel.

* Added a new option for bone-paths drawing: Calculate/show the path
travelled by the 'head' (fat end) of bone. By default, this option is off.

* Also, I forgot to mention in last commit that I had added an option which
specified the time-difference between each highlighted point on the curve.
This commit is contained in:
Joshua Leung
2007-01-01 22:48:09 +00:00
parent e07a76ea3f
commit 4f90a3a627
3 changed files with 16 additions and 7 deletions

View File

@@ -117,6 +117,7 @@ typedef struct bArmature {
/* armature->pathflag */
#define ARM_PATH_FNUMS 0x001
#define ARM_PATH_KFRAS 0x002
#define ARM_PATH_HEADS 0x004
/* armature->ghosttype */
#define ARM_GHOST_CUR 0

View File

@@ -3322,8 +3322,8 @@ static void editing_panel_armature_visuals(Object *ob, bArmature *arm)
/* version patch for older files here (do_versions patch too complicated) */
if ((arm->ghostsf == 0) || (arm->ghostef == 0)) {
arm->ghostsf = CFRA - arm->ghostep;
arm->ghostef = CFRA + arm->ghostep;
arm->ghostsf = CFRA - (arm->ghostep * arm->ghostsize);
arm->ghostef = CFRA + (arm->ghostep * arm->ghostsize);
}
if ((arm->pathsf == 0) || (arm->pathef == 0)) {
arm->pathsf = SFRA;
@@ -3357,13 +3357,14 @@ static void editing_panel_armature_visuals(Object *ob, bArmature *arm)
uiBlockBeginAlign(block);
uiDefButBitS(block, TOG, ARM_PATH_FNUMS, REDRAWVIEW3D, "Frame Nums", 170, 160, 80, 20, &arm->pathflag, 0, 0, 0, 0, "Show frame numbers on path");
uiDefButBitS(block, TOG, ARM_PATH_KFRAS, REDRAWVIEW3D, "Show Keys", 250, 160, 80, 20, &arm->pathflag, 0, 0, 0, 0, "Show key frames on path");
uiDefButS(block, NUM, REDRAWVIEW3D, "PStep:",170,140,160,20, &arm->pathsize,1,100, 10, 50, "Frames between highlighted points on bone path");
uiDefButS(block, NUM, REDRAWVIEW3D, "PStep:",250,160,80,20, &arm->pathsize,1,100, 10, 50, "Frames between highlighted points on bone path");
uiDefButBitS(block, TOG, ARM_PATH_KFRAS, REDRAWVIEW3D, "Show Keys", 170, 140, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Show key frames on path");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
uiDefButI(block, NUM,REDRAWVIEW3D,"PSta:",170,100,160,20, &arm->pathsf, 1.0, MAXFRAMEF, 0, 0, "The start frame for Bone Path display range");
uiDefButI(block, NUM,REDRAWVIEW3D,"PEnd:",170,80,160,20, &arm->pathef, arm->pathsf, MAXFRAMEF, 0, 0, "The end frame for Bone Path display range");
uiDefButI(block, NUM,REDRAWVIEW3D,"PSta:",170,100,80,20, &arm->pathsf, 1.0, MAXFRAMEF, 0, 0, "The start frame for Bone Path display range");
uiDefButI(block, NUM,REDRAWVIEW3D,"PEnd:",250,100,80,20, &arm->pathef, arm->pathsf, MAXFRAMEF, 0, 0, "The end frame for Bone Path display range");
uiDefButBitS(block, TOG, ARM_PATH_HEADS, REDRAWVIEW3D, "Bone-Head Path", 170, 80, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Calculate the Path travelled by the Bone's Head instead of Tail");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);

View File

@@ -273,7 +273,14 @@ void pose_calculate_path(Object *ob)
if(arm->layer & pchan->bone->layer) {
if(pchan->path) {
fp= pchan->path+3*(CFRA-sfra);
VECCOPY(fp, pchan->pose_tail);
if (arm->pathflag & ARM_PATH_HEADS) {
VECCOPY(fp, pchan->pose_head);
}
else {
VECCOPY(fp, pchan->pose_tail);
}
Mat4MulVecfl(ob->obmat, fp);
}
}