Bugfixes:

* Action Editor "Open/Close Level" now works with Action Groups. Groups have priority over Action Channels for collapsing/expanding.

* Custom bone shapes using the new 'wire' option, were drawing with the wrong wireframe colour at times (i.e.  when out of posemode, this happened quite often). 

* Fixed/added a few comments in various places
This commit is contained in:
Joshua Leung
2008-02-06 11:10:34 +00:00
parent f05778a980
commit 14ea52bdd8
4 changed files with 55 additions and 26 deletions

View File

@@ -100,7 +100,7 @@ typedef enum eArmature_Flag {
ARM_MIRROR_EDIT = (1<<8),
ARM_AUTO_IK = (1<<9),
ARM_NO_CUSTOM = (1<<10), /* made option negative, for backwards compat */
ARM_COL_CUSTOM = (1<<11), /* draw custom colours - not yet used... */
ARM_COL_CUSTOM = (1<<11), /* draw custom colours */
ARM_GHOST_ONLYSEL = (1<<12) /* when ghosting, only show selected bones (this should belong to ghostflag instead) */
} eArmature_Flag;

View File

@@ -1118,6 +1118,7 @@ static void add_bezt_to_keyblockslist(ListBase *blocks, IpoCurve *icu, int index
/* get beztriples */
beztn= (icu->bezt + index);
/* we need to go through all beztriples, as they may not be in order (i.e. during transform) */
for (v=0, bezt=icu->bezt; v<icu->totvert; v++, bezt++) {
/* skip if beztriple is current */
if (v != index) {
@@ -1270,7 +1271,7 @@ static void draw_keylist(gla2DDrawInfo *di, ListBase *keys, ListBase *blocks, fl
/* get co-ordinate to draw at */
gla2DDrawTranslatePt(di, ak->cfra, ypos, &sc_x, &sc_y);
/* draw using icons - slower */
/* draw using icons - old way which is slower but more proven */
//if(ak->sel & 1) BIF_icon_draw_aspect(sc_x-7, sc_y-6, ICON_SPACE2, 1.0f);
//else BIF_icon_draw_aspect(sc_x-7, sc_y-6, ICON_SPACE3, 1.0f);

View File

@@ -1589,9 +1589,15 @@ static void draw_pose_channels(Base *base, int dt)
set_pchan_colorset(ob, pchan);
if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) {
/* BONE_DRAWWIRE case is here too, as sometimes wire overlay won't be done */
if (pchan->bone->flag & BONE_DRAWWIRE)
draw_custom_bone(pchan->custom, OB_WIRE, arm->flag, flag, index, bone->length);
/* BONE_DRAWWIRE case is here too, as wire overlay won't be done when in Object Mode
* It's a bit of a hack, and we make sure TH_WIRE is used (just in case).
*/
if (pchan->bone->flag & BONE_DRAWWIRE) {
if ((arm->flag & ARM_POSEMODE) == 0) {
BIF_ThemeColor(TH_WIRE);
draw_custom_bone(pchan->custom, OB_WIRE, arm->flag, flag, index, bone->length);
}
}
else
draw_custom_bone(pchan->custom, OB_SOLID, arm->flag, flag, index, bone->length);
}
@@ -1695,8 +1701,9 @@ static void draw_pose_channels(Base *base, int dt)
set_pchan_colorset(ob, pchan);
if ((pchan->custom) && !(arm->flag & ARM_NO_CUSTOM)) {
if ((dt < OB_SOLID) || (pchan->bone->flag & BONE_DRAWWIRE))
if ((dt < OB_SOLID) || (pchan->bone->flag & BONE_DRAWWIRE)) {
draw_custom_bone(pchan->custom, OB_WIRE, arm->flag, flag, index, bone->length);
}
}
else if (arm->drawtype==ARM_ENVELOPE) {
if (dt < OB_SOLID)

View File

@@ -3675,15 +3675,19 @@ void rearrange_action_channels (short mode)
/* Expand all channels to show full hierachy */
void expand_all_action (void)
{
void *data;
short datatype;
bAction *act;
bActionChannel *achan;
bActionGroup *agrp;
short mode= 1;
/* Get the selected action, exit if none are selected */
// TODO: really this should be done with the "action editor api" stuff, but this will suffice for now
act = G.saction->action;
if (act == NULL) return;
data = get_action_context(&datatype);
if (data == NULL) return;
if (datatype != ACTCONT_ACTION) return;
act= (bAction *)data;
/* check if expand all, or close all */
for (agrp= act->groups.first; agrp; agrp= agrp->next) {
@@ -3729,40 +3733,57 @@ void expand_all_action (void)
/* For visible channels, expand/collapse one level */
void openclose_level_action (short mode)
{
void *data;
short datatype;
bAction *act;
bActionChannel *achan;
bActionGroup *agrp;
/* Get the selected action, exit if none are selected */
// TODO: really this should be done with the "action editor api" stuff, but this will suffice for now
act = G.saction->action;
if (act == NULL) return;
data = get_action_context(&datatype);
if (data == NULL) return;
if (datatype != ACTCONT_ACTION) return;
act= (bAction *)data;
/* Abort if no operation required */
if (mode == 0) return;
/* Only affect selected channels */
// FIXME: check for action-groups
for (achan= act->chanbase.first; achan; achan= achan->next) {
if (VISIBLE_ACHAN(achan) && SEL_ACHAN(achan)) {
if (EXPANDED_ACHAN(achan)) {
if (FILTER_IPO_ACHAN(achan) || FILTER_CON_ACHAN(achan)) {
if (mode < 0)
achan->flag &= ~(ACHAN_SHOWIPO|ACHAN_SHOWCONS);
/* make sure if there is a group, it isn't about to be collapsed and is open */
if ( (achan->grp==NULL) || (EXPANDED_AGRP(achan->grp) && SEL_AGRP(achan->grp)==0) ) {
if (VISIBLE_ACHAN(achan) && SEL_ACHAN(achan)) {
if (EXPANDED_ACHAN(achan)) {
if (FILTER_IPO_ACHAN(achan) || FILTER_CON_ACHAN(achan)) {
if (mode < 0)
achan->flag &= ~(ACHAN_SHOWIPO|ACHAN_SHOWCONS);
}
else {
if (mode > 0)
achan->flag |= (ACHAN_SHOWIPO|ACHAN_SHOWCONS);
else
achan->flag &= ~ACHAN_EXPANDED;
}
}
else {
if (mode > 0)
achan->flag |= (ACHAN_SHOWIPO|ACHAN_SHOWCONS);
else
achan->flag &= ~ACHAN_EXPANDED;
}
}
else {
if (mode > 0)
achan->flag |= ACHAN_EXPANDED;
achan->flag |= ACHAN_EXPANDED;
}
}
}
}
/* Expand/collapse selected groups */
for (agrp= act->groups.first; agrp; agrp= agrp->next) {
if (SEL_AGRP(agrp)) {
if (mode < 0)
agrp->flag &= ~AGRP_EXPANDED;
else
agrp->flag |= AGRP_EXPANDED;
}
}
/* Cleanup and do redraws */
BIF_undo_push("Expand/Collapse Action Level");
allqueue(REDRAWACTION, 0);