[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12755] trunk/blender/source/blender: == Bone Path Drawing - More Tweaks Again ==
Joshua Leung
aligorith at gmail.com
Sun Dec 2 06:50:38 CET 2007
Revision: 12755
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12755
Author: aligorith
Date: 2007-12-02 06:50:38 +0100 (Sun, 02 Dec 2007)
Log Message:
-----------
== Bone Path Drawing - More Tweaks Again ==
Bugfixes:
* "Clear Paths" change from last commit wasn't complete yet. Now it REALLY only clears the paths of the selected bones
* Button layout in "Armature Visualisation" panel has been reorganised a bit to better present the options (clearer separation between Display and Calculation buttons)
New Stuff (Yay!):
* Paths of active bones now draw more visibly than those of unselected bones. This makes it easier to identify the path that is taken by the bone
* The part of path on the current frame is now drawn in green (the same shade that is used for the current-frame line in the Animation Editors). This nicely blends between the black and blue parts of the path (before and after current frame, respectively), and looks much nicer.
* The colour of the current-frame marker in the Animation Editors and the 3D-View, are now theme-colours. This is needed to make the previous option work.
Modified Paths:
--------------
trunk/blender/source/blender/include/BIF_resources.h
trunk/blender/source/blender/makesdna/DNA_userdef_types.h
trunk/blender/source/blender/src/buttons_editing.c
trunk/blender/source/blender/src/drawaction.c
trunk/blender/source/blender/src/drawarmature.c
trunk/blender/source/blender/src/drawipo.c
trunk/blender/source/blender/src/drawsound.c
trunk/blender/source/blender/src/drawtime.c
trunk/blender/source/blender/src/poseobject.c
trunk/blender/source/blender/src/resources.c
trunk/blender/source/blender/src/usiblender.c
Modified: trunk/blender/source/blender/include/BIF_resources.h
===================================================================
--- trunk/blender/source/blender/include/BIF_resources.h 2007-12-02 04:33:04 UTC (rev 12754)
+++ trunk/blender/source/blender/include/BIF_resources.h 2007-12-02 05:50:38 UTC (rev 12755)
@@ -494,6 +494,7 @@
TH_NORMAL,
TH_FACE_DOT,
TH_FACEDOT_SIZE,
+ TH_CFRAME,
TH_SYNTAX_B,
TH_SYNTAX_V,
Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2007-12-02 04:33:04 UTC (rev 12754)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2007-12-02 05:50:38 UTC (rev 12755)
@@ -41,8 +41,7 @@
/* themes; defines in BIF_resource.h */
struct ColorBand;
-// global, button colors
-
+/* global, button colors */
typedef struct ThemeUI {
char outline[4];
char neutral[4];
@@ -68,8 +67,9 @@
} ThemeUI;
-// try to put them all in one, if needed a special struct can be created as well
-// for example later on, when we introduce wire colors for ob types or so...
+/* try to put them all in one, if needed a special struct can be created as well
+ * for example later on, when we introduce wire colors for ob types or so...
+ */
typedef struct ThemeSpace {
char back[4];
char text[4];
@@ -94,6 +94,7 @@
char normal[4];
char bone_solid[4], bone_pose[4];
char strip[4], strip_select[4];
+ char cframe[4], pad[4];
char vertex_size, facedot_size;
char bpad[2];
@@ -104,16 +105,25 @@
char movie[4], image[4], scene[4], audio[4]; // for sequence editor
char effect[4], plugin[4], transition[4], meta[4];
char editmesh_active[4];
-
} ThemeSpace;
+/* set of colors for use as a custom color set for Objects/Bones wire drawing */
+typedef struct ThemeWireColor {
+ char unselected[3];
+ char selected[3];
+ char active[3];
+ char pad[7];
+} ThemeWireColor;
+/* A theme */
typedef struct bTheme {
struct bTheme *next, *prev;
char name[32];
+ /* Interface Elements (buttons, menus, icons) */
ThemeUI tui;
+ /* Individual Spacetypes */
ThemeSpace tbuts;
ThemeSpace tv3d;
ThemeSpace tfile;
@@ -129,9 +139,12 @@
ThemeSpace toops;
ThemeSpace ttime;
ThemeSpace tnode;
+
+ /* 20 sets of bone colors for this theme */
+ ThemeWireColor tarm[20];
+ /*ThemeWireColor tobj[20];*/
unsigned char bpad[4], bpad1[4];
-
} bTheme;
typedef struct SolidLight {
Modified: trunk/blender/source/blender/src/buttons_editing.c
===================================================================
--- trunk/blender/source/blender/src/buttons_editing.c 2007-12-02 04:33:04 UTC (rev 12754)
+++ trunk/blender/source/blender/src/buttons_editing.c 2007-12-02 05:50:38 UTC (rev 12755)
@@ -3986,10 +3986,10 @@
uiDefBut(block, LABEL, 0, "Ghost Options", 10,180,150,20, 0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
- uiDefButS(block, MENU, REDRAWVIEW3D, "Ghosts %t|Around Current Frame %x0|In Range %x1",
- 10, 160, 150, 20, &arm->ghosttype, 0, 0, 0, 0, "Choose range of Ghosts to draw for current Action");
-
- uiDefButS(block, NUM, REDRAWVIEW3D, "GStep: ", 10,140,150,20, &arm->ghostsize, 1.0f, 20.0f, 0, 0, "How many frames between Ghost instances");
+ uiDefButS(block, MENU, REDRAWVIEW3D, "Ghosts %t|Around Current Frame %x0|In Range %x1",
+ 10, 160, 150, 20, &arm->ghosttype, 0, 0, 0, 0, "Choose range of Ghosts to draw for current Action");
+
+ uiDefButS(block, NUM, REDRAWVIEW3D, "GStep: ", 10,140,150,20, &arm->ghostsize, 1.0f, 20.0f, 0, 0, "How many frames between Ghost instances");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
@@ -4005,31 +4005,37 @@
uiBlockEndAlign(block);
/* Bone Path Drawing Options */
- uiDefBut(block, LABEL, 0, "Bone Paths", 165,180,150,20, 0, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "Bone Paths Drawing:", 165,180,170,20, 0, 0, 0, 0, 0, "");
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");
- 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");
+ 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);
- uiDefButBitS(block, TOG, ARM_PATH_ACFRA, REDRAWVIEW3D, "Around Current Frame", 170, 105, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Only show Bone Path around the current frame");
- if (arm->pathflag & ARM_PATH_ACFRA) {
- uiDefButI(block, NUM,REDRAWVIEW3D,"PPre:",170,85,80,20, &arm->pathbc, 1.0, MAXFRAMEF/2, 0, 0, "The number of frames before current frame for Bone Path display range");
- uiDefButI(block, NUM,REDRAWVIEW3D,"PPost:",250,85,80,20, &arm->pathac, 1.0, MAXFRAMEF/2, 0, 0, "The number of frames after current frame for Bone Path display range");
- }
- else {
- uiDefButI(block, NUM,REDRAWVIEW3D,"PSta:",170,85,80,20, &arm->pathsf, 1.0, MAXFRAMEF, 0, 0, "The start frame for Bone Path display range");
- uiDefButI(block, NUM,REDRAWVIEW3D,"PEnd:",250,85,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, 65, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Calculate the Path travelled by the Bone's Head instead of Tail");
+ uiDefButBitS(block, TOG, ARM_PATH_ACFRA, REDRAWVIEW3D, "Around Current Frame", 170, 110, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Only show Bone Path around the current frame");
+
+ /* only show extra ranges when needed */
+ if (arm->pathflag & ARM_PATH_ACFRA) {
+ uiDefButI(block, NUM, REDRAWVIEW3D,"PPre:",170,90,80,20, &arm->pathbc, 1.0, MAXFRAMEF/2, 0, 0, "The number of frames before current frame for Bone Path display range");
+ uiDefButI(block, NUM, REDRAWVIEW3D,"PPost:",250,90,80,20, &arm->pathac, 1.0, MAXFRAMEF/2, 0, 0, "The number of frames after current frame for Bone Path display range");
+ }
uiBlockEndAlign(block);
+ /* Bone Path Calculation Options */
+ uiDefBut(block, LABEL, 0, "Bone Paths Calc.", 10,50,170,20, 0, 0, 0, 0, 0, "");
+
uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_ARM_CALCPATHS, "Calculate Paths", 170,30,160,20, 0, 0, 0, 0, 0, "(Re)calculates the paths of the selected bones");
- uiDefBut(block, BUT, B_ARM_CLEARPATHS, "Clear All Paths", 170,10,160,20, 0, 0, 0, 0, 0, "Clears bone paths of the selected bones");
+ uiDefBut(block, BUT, B_ARM_CALCPATHS, "Calculate Paths", 10,30,155,20, 0, 0, 0, 0, 0, "(Re)calculates the paths of the selected bones");
+ uiDefBut(block, BUT, B_ARM_CLEARPATHS, "Clear Paths", 10,10,155,20, 0, 0, 0, 0, 0, "Clears bone paths of the selected bones");
uiBlockEndAlign(block);
+
+ uiBlockBeginAlign(block);
+ uiDefButBitS(block, TOG, ARM_PATH_HEADS, REDRAWVIEW3D, "Bone-Head Path", 170, 30, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Calculate the Path travelled by the Bone's Head instead of Tail");
+ uiDefButI(block, NUM,REDRAWVIEW3D,"PSta:",170,10,80,20, &arm->pathsf, 1.0, MAXFRAMEF, 0, 0, "The start frame for Bone Path display range");
+ uiDefButI(block, NUM,REDRAWVIEW3D,"PEnd:",250,10,80,20, &arm->pathef, arm->pathsf, MAXFRAMEF, 0, 0, "The end frame for Bone Path display range");
+ uiBlockEndAlign(block);
}
/* autocomplete callback for editbones */
Modified: trunk/blender/source/blender/src/drawaction.c
===================================================================
--- trunk/blender/source/blender/src/drawaction.c 2007-12-02 04:33:04 UTC (rev 12754)
+++ trunk/blender/source/blender/src/drawaction.c 2007-12-02 05:50:38 UTC (rev 12755)
@@ -362,7 +362,7 @@
vec[0]*= G.scene->r.framelen;
vec[1]= G.v2d->cur.ymin;
- glColor3ub(0x60, 0xc0, 0x40);
+ BIF_ThemeColor(TH_CFRAME);
glLineWidth(2.0);
glBegin(GL_LINE_STRIP);
@@ -373,10 +373,10 @@
/* Draw dark green line if slow-parenting/time-offset is enabled */
ob= (G.scene->basact) ? (G.scene->basact->object) : 0;
- if(ob && ob->sf!=0.0 && (ob->ipoflag & OB_OFFS_OB) ) {
+ if ((ob) && (ob->sf!=0.0) && (ob->ipoflag & OB_OFFS_OB)) {
vec[0]-= ob->sf;
- glColor3ub(0x10, 0x60, 0);
+ BIF_ThemeColorShade(TH_CFRAME, -30);
glBegin(GL_LINE_STRIP);
glVertex2fv(vec);
Modified: trunk/blender/source/blender/src/drawarmature.c
===================================================================
--- trunk/blender/source/blender/src/drawarmature.c 2007-12-02 04:33:04 UTC (rev 12754)
+++ trunk/blender/source/blender/src/drawarmature.c 2007-12-02 05:50:38 UTC (rev 12755)
@@ -1787,35 +1787,60 @@
}
/* draw curve-line of path */
- if ((CFRA > sfra) && (CFRA < efra)) {
- /* Show before/after current frame with slight difference in colour intensity
- * This is done in two loops, as there seems to be some problems with changing color
- * or something during a loop (noted somewhere in the codebase)
+ glShadeModel(GL_SMOOTH);
+
+ glBegin(GL_LINE_STRIP);
+ for (a=0, fp=fp_start; a<len; a++, fp+=3) {
+ float intensity; /* how faint */
+
+ /* set colour
+ * - more intense for active/selected bones, less intense for unselected bones
+ * - black for before current frame, green for current frame, blue for after current frame
+ * - intensity decreases as distance from current frame increases
*/
+ #define SET_INTENSITY(A, B, C, min, max) (((1.0f - ((C - B) / (C - A))) * (max-min)) + min)
+ if ((a+sfra) < CFRA) {
+ /* black - before cfra */
+ if (pchan->bone->flag & BONE_SELECTED) {
+ // intensity= 0.5;
+ intensity = SET_INTENSITY(sfra, a, CFRA, 0.25f, 0.75f);
+ }
+ else {
+ //intensity= 0.8;
+ intensity = SET_INTENSITY(sfra, a, CFRA, 0.55f, 0.90f);
+ }
+ BIF_ThemeColorBlend(TH_WIRE, TH_BACK, intensity);
+ }
+ else if ((a+sfra) > CFRA) {
+ /* blue - after cfra */
+ if (pchan->bone->flag & BONE_SELECTED) {
+ //intensity = 0.5;
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list