Scale and Repeat fields in NLA Transform Properties panel will now ignore negative values instead of clamping them to a near-zero value, which can easily be confused with the strip being 'destroyed'. This shouldn't affect other interface elements, as this change has only been used here.
(Note: negative scaling should be avoided)
#define BUT_TOGDUAL (33<<9)
#define ICONTOGN (34<<9)
#define FTPREVIEW (35<<9)
+#define NUMABS (36<<9)
#define BUTTYPE (63<<9)
uiBlockBeginAlign(block);
// FIXME: repeat and scale are too cramped!
- uiDefButF(block, NUM, B_NLA_SCALE, "Repeat:", 160,100,75,19, &strip->repeat, 0.001, 1000.0f, 100, 0, "Number of times the action should repeat");
+ uiDefButF(block, NUMABS, B_NLA_SCALE, "Repeat:", 160,100,75,19, &strip->repeat, 0.001, 1000.0f, 100, 0, "Number of times the action should repeat");
if ((strip->actend - strip->actstart) < 1.0f) {
uiBlockSetCol(block, TH_REDALERT);
- uiDefButF(block, NUM, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Please run Alt-S to fix up this error");
+ uiDefButF(block, NUMABS, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Please run Alt-S to fix up this error");
uiBlockSetCol(block, TH_AUTO);
}
else
- uiDefButF(block, NUM, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Amount the action should be scaled by");
+ uiDefButF(block, NUMABS, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Amount the action should be scaled by");
but= uiDefButC(block, TEX, B_NLA_PANEL, "OffsBone:", 160,80,150,19, strip->offs_bone, 0, 31.0f, 0, 0, "Name of Bone that defines offset for repeat");
uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob);
uiDefButBitS(block, TOG, ACTSTRIP_HOLDLASTFRAME, B_NLA_PANEL, "Hold", 160,60,75,19, &strip->flag, 0, 0, 0, 0, "Toggles whether to continue displaying the last frame past the end of the strip");
if(mode=='v' && but->lock) return 0;
poin= but->poin;
- if ELEM3(but->type, NUM, NUMSLI, HSVSLI) {
+ if ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI) {
if(poin==NULL);
else if(mode=='c') {
}
if(but->pointype!=FLO) value= (int)value;
-
+
+ if(but->type==NUMABS) value= fabs(value);
if(value<min) value= min;
if(value>max) value= max;
break;
case NUM:
+ case NUMABS:
if(uevent->val) retval= ui_do_but_NUM(but);
break;
but->flag &= ~(UI_ACTIVE|UI_SELECT);
for(but= actbut->next; but; but= but->next) {
- if(ELEM4(but->type, TEX, NUM, NUMSLI, HSVSLI)) {
+ if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
but->flag |= UI_ACTIVE;
return;
}
}
for(but= block->buttons.first; but!=actbut; but= but->next) {
- if(ELEM4(but->type, TEX, NUM, NUMSLI, HSVSLI)) {
+ if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
but->flag |= UI_ACTIVE;
return;
}
but->flag &= ~(UI_ACTIVE|UI_SELECT);
for(but= actbut->prev; but; but= but->prev) {
- if(ELEM4(but->type, TEX, NUM, NUMSLI, HSVSLI)) {
+ if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
but->flag |= UI_ACTIVE;
return;
}
}
for(but= block->buttons.last; but!=actbut; but= but->prev) {
- if(ELEM4(but->type, TEX, NUM, NUMSLI, HSVSLI)) {
+ if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) {
but->flag |= UI_ACTIVE;
return;
}
//Really nasty... to update the num button from the same butblock
for(bt= block->buttons.first; bt; bt= bt->next)
{
- if(bt->type == NUM) {
+ if(ELEM(bt->type, NUM, NUMABS)) {
ui_check_but(bt);
ui_draw_but(bt);
}
for(bt= block->buttons.first; bt; bt= bt->next)
{
- if(bt->type == NUM) {
+ if(ELEM(bt->type, NUM, NUMABS)) {
ui_check_but(bt);
ui_draw_but(bt);
}
case HSVSLI:
value= ui_get_but_val(but);
if(value < but->min) value= but->min;
- if(value > but->max) value= but->max;
- ui_set_but_val(but, value);
+ if(value > but->max) value= but->max;
+ ui_set_but_val(but, value);
+ break;
+
+ case NUMABS:
+ value= fabs( ui_get_but_val(but) );
+ if(value < but->min) value= but->min;
+ if(value > but->max) value= but->max;
+ ui_set_but_val(but, value);
break;
case ICONTOG:
case NUM:
case NUMSLI:
case HSVSLI:
+ case NUMABS:
value= ui_get_but_val(but);
but->ofs= 0;
while(but->strwidth > (int)okwidth ) {
- if ELEM(but->type, NUM, TEX) { // only these cut off left
+ if ELEM3(but->type, NUM, NUMABS, TEX) { // only these cut off left
but->ofs++;
but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, transopts);
case SLI:
case NUM:
case NUMSLI:
+ case NUMABS:
case HSVSLI:
return TH_BUT_NUM;
case TEX:
but->pos= -1; /* cursor invisible */
- if(but->type==NUM) { /* add a space to name */
+ if(ELEM(but->type, NUM, NUMABS)) { /* add a space to name */
slen= strlen(but->str);
if(slen>0 && slen<UI_MAX_NAME_STR-2) {
if(but->str[slen-1]!=' ') {
/* *** EXTRA DRAWING FOR SPECIFIC CONTROL TYPES *** */
switch(type) {
case NUM:
+ case NUMABS:
/* SIDE ARROWS */
/* left */
if(flag & UI_SELECT) {
if(flag & UI_SELECT)
BIF_ThemeColorShade(TH_BUT_NUM, -5);
- else
+ else {
if(flag & UI_ACTIVE)
BIF_ThemeColorShade(TH_BUT_NUM, +35);
else
BIF_ThemeColorShade(TH_BUT_NUM, +25);
+ }
glRectf(x1, ymid-yc, x2, ymid+yc);
case TEX:
case IDPOIN:
case NUM:
+ case NUMABS:
ui_default_flat(type, colorid, aspect, x1, y1, x2, y2, flag);
break;
case ICONROW:
/* special type decorations */
switch(type) {
case NUM:
+ case NUMABS:
if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -60);
else BIF_ThemeColorShade(colorid, -30);
ui_default_num_arrows(x1, y1, x2, y2);
/* special type decorations */
switch(type) {
case NUM:
+ case NUMABS:
BIF_ThemeColorShade(colorid, curshade-60);
ui_default_num_arrows(x1, y1, x2, y2);
break;
/* special type decorations */
switch(type) {
case NUM:
+ case NUMABS:
if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -60);
else BIF_ThemeColorShade(colorid, -30);
ui_default_num_arrows(x1, y1, x2, y2);