diff options
author | Diego Borghetti <bdiego@gmail.com> | 2008-08-19 18:39:11 +0400 |
---|---|---|
committer | Diego Borghetti <bdiego@gmail.com> | 2008-08-19 18:39:11 +0400 |
commit | b23f3f62c2f610644821ce104b8f64041d077a80 (patch) | |
tree | 70a2d73f4c721f6a184a8c60a13b0ab4e45eb9a5 /source | |
parent | 812583f1fa7a85406b55083ef3876ff506bebe7c (diff) |
Ipo Handle vertex have own color and size (Venom request).
Now the vertex of the ipo handle have own color and
size, can be change from Theme -> Ipo Curve Editor:
Handle Vertex - (Default Color)
Handle Vertex Select - (Selected Color)
Handle Size - (Point size, for vertex)
Add subverion so by default the handler have the same
settings that the ipo vertex options.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 2 | ||||
-rw-r--r-- | source/blender/include/BIF_resources.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 5 | ||||
-rw-r--r-- | source/blender/src/drawipo.c | 52 | ||||
-rw-r--r-- | source/blender/src/resources.c | 19 | ||||
-rw-r--r-- | source/blender/src/space.c | 3 | ||||
-rw-r--r-- | source/blender/src/usiblender.c | 10 |
7 files changed, 81 insertions, 14 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index e1eb6718a30..e403fc33e06 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,7 +41,7 @@ struct ListBase; struct MemFile; #define BLENDER_VERSION 247 -#define BLENDER_SUBVERSION 0 +#define BLENDER_SUBVERSION 1 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h index df514190270..0d27804dd1a 100644 --- a/source/blender/include/BIF_resources.h +++ b/source/blender/include/BIF_resources.h @@ -524,6 +524,10 @@ enum { TH_EDGE_SHARP, TH_EDITMESH_ACTIVE, + + TH_HANDLE_VERTEX, + TH_HANDLE_VERTEX_SELECT, + TH_HANDLE_VERTEX_SIZE, }; /* XXX WARNING: previous is saved in file, so do not change order! */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index cd1c047dac9..856324695a9 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -101,6 +101,11 @@ typedef struct ThemeSpace { 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]; + + char handle_vertex[4]; + char handle_vertex_select[4]; + char handle_vertex_size; + char hpad[7]; } ThemeSpace; diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index 0e7476bbe82..71854570c8c 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -1212,16 +1212,9 @@ static void draw_ipovertices(int sel) /*}*/ } else { /* normal non bit curves */ if(ei->flag & IPO_EDIT) { - if(ei->icu->ipo==IPO_BEZ) { - /* Draw the editmode hendels for a bezier curve */ - if( (bezt->f1 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/ - bglVertex3fv(bezt->vec[0]); - - if( (bezt->f3 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/ - bglVertex3fv(bezt->vec[2]); - - } - + /* Only the vertex of the line, the + * handler are draw below. + */ if( (bezt->f2 & SELECT) == sel) /* && G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/ bglVertex3fv(bezt->vec[1]); @@ -1237,6 +1230,45 @@ static void draw_ipovertices(int sel) bezt++; } bglEnd(); + + if (ei->flag & IPO_EDIT) { + /* Now draw the two vertex of the handler, + * need split it because we can't call glPointSize + * in the middle of a glBegin/glEnd also the + * bug comment before. + */ + a= ei->icu->totvert; + bezt= ei->icu->bezt; + + glPointSize(BIF_GetThemeValuef(TH_HANDLE_VERTEX_SIZE)); + + if(sel) BIF_ThemeColor(TH_HANDLE_VERTEX_SELECT); + else BIF_ThemeColor(TH_HANDLE_VERTEX); + + bglBegin(GL_POINTS); + + while(a--) { + if (ei->disptype!=IPO_DISPBITS) { + if(ei->flag & IPO_EDIT) { + if(ei->icu->ipo==IPO_BEZ) { + /* Draw the editmode hendels for a bezier curve */ + if( (bezt->f1 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/ + bglVertex3fv(bezt->vec[0]); + + if( (bezt->f3 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/ + bglVertex3fv(bezt->vec[2]); + } + } + } + bezt++; + } + bglEnd(); + + /* The color are always reset (see the while) + * but the point size not so we reset now. + */ + glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE)); + } } } diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c index f47f14a605c..acd14aae7a5 100644 --- a/source/blender/src/resources.c +++ b/source/blender/src/resources.c @@ -313,7 +313,15 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) cp= ts->transition; break; case TH_SEQ_META: cp= ts->meta; break; - + case TH_HANDLE_VERTEX: + cp= ts->handle_vertex; + break; + case TH_HANDLE_VERTEX_SELECT: + cp= ts->handle_vertex_select; + break; + case TH_HANDLE_VERTEX_SIZE: + cp= &ts->handle_vertex_size; + break; } } @@ -493,6 +501,10 @@ void BIF_InitTheme(void) SETCOL(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255); btheme->tipo.vertex_size= 3; + SETCOL(btheme->tipo.handle_vertex, 0xff, 0x70, 0xff, 255); + SETCOL(btheme->tipo.handle_vertex_select, 0xff, 0xff, 0x70, 255); + btheme->tipo.handle_vertex_size= 3; + /* space file */ /* to have something initialized */ btheme->tfile= btheme->tv3d; @@ -684,7 +696,10 @@ char *BIF_ThemeColorsPup(int spacetype) str += sprintf(str, "Vertex %%x%d|", TH_VERTEX); str += sprintf(str, "Vertex Selected %%x%d|", TH_VERTEX_SELECT); str += sprintf(str, "Vertex Size %%x%d|", TH_VERTEX_SIZE); - str += sprintf(str, "Current Frame %%x%d", TH_CFRAME); + str += sprintf(str, "Current Frame %%x%d|", TH_CFRAME); + str += sprintf(str, "Handle Vertex %%x%d|", TH_HANDLE_VERTEX); + str += sprintf(str, "Handle Vertex Selected %%x%d|", TH_HANDLE_VERTEX_SELECT); + str += sprintf(str, "Handle Vertex Size %%x%d", TH_HANDLE_VERTEX_SIZE); break; case SPACE_FILE: str += sprintf(str, "Selected file %%x%d", TH_HILITE); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index fb055216f7f..8787cf9efc4 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -3492,6 +3492,9 @@ static void info_user_themebuts(uiBlock *block, short y1, short y2, short y3, sh uiButSetFunc(but, set_userdef_iconfile_cb, &iconfileindex, NULL); } + else if(th_curcol==TH_HANDLE_VERTEX_SIZE) { + uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Handle size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, ""); + } else { uiBlockBeginAlign(block); if ELEM9(th_curcol, TH_PANEL, TH_LAMP, TH_FACE, TH_FACE_SELECT, TH_EDITMESH_ACTIVE, TH_MENU_BACK, TH_MENU_HILITE, TH_MENU_ITEM, TH_NODE) { diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 92e49ab29fa..15c2664a9d8 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -477,7 +477,15 @@ static void init_userdef_file(void) if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 16)) { U.flag |= USER_ADD_VIEWALIGNED|USER_ADD_EDITMODE; } - + if ((G.main->versionfile < 247) || (G.main->versionfile == 247 && G.main->subversionfile < 1)) { + bTheme *btheme; + for(btheme= U.themes.first; btheme; btheme= btheme->next) { + SETCOL(btheme->tipo.handle_vertex, 0xff, 0x70, 0xff, 255); + SETCOL(btheme->tipo.handle_vertex_select, 0xff, 0xff, 0x70, 255); + btheme->tipo.handle_vertex_size= 3; + } + } + /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { U.texcollectrate = 60; |