diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/ipo.c | 28 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_ipo_types.h | 10 | ||||
-rw-r--r-- | source/blender/src/editipo.c | 136 | ||||
-rw-r--r-- | source/blender/src/editipo_lib.c | 4 |
4 files changed, 146 insertions, 32 deletions
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 0f73843b9fa..dcb8532b232 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -126,7 +126,9 @@ int te_ar[TE_TOTIPO] ={ TE_MG_TYP, TE_MGH, TE_MG_LAC, TE_MG_OCT, TE_MG_OFF, TE_MG_GAIN, - TE_N_BAS1, TE_N_BAS2 + TE_N_BAS1, TE_N_BAS2, + + TE_COL_R, TE_COL_G, TE_COL_B, TE_BRIGHT, TE_CONTRA }; int seq_ar[SEQ_TOTIPO]= { @@ -1068,6 +1070,17 @@ static void *give_tex_poin(Tex *tex, int adrcode, int *type ) poin= &(tex->noisebasis); *type= IPO_SHORT; break; case TE_N_BAS2: poin= &(tex->noisebasis2); *type= IPO_SHORT; break; + case TE_COL_R: + poin= &(tex->rfac); break; + case TE_COL_G: + poin= &(tex->gfac); break; + case TE_COL_B: + poin= &(tex->bfac); break; + case TE_BRIGHT: + poin= &(tex->bright); break; + case TE_CONTRA: + poin= &(tex->contrast); break; + } return poin; @@ -1576,7 +1589,7 @@ void set_icu_vars(IpoCurve *icu) case TE_MG_TYP: icu->vartype= IPO_SHORT; icu->ipo= IPO_CONST; - icu->ymax= 4.0; break; + icu->ymax= 6.0; break; case TE_MGH: icu->ymin= 0.0001; icu->ymax= 2.0; break; @@ -1591,6 +1604,17 @@ void set_icu_vars(IpoCurve *icu) icu->vartype= IPO_SHORT; icu->ipo= IPO_CONST; icu->ymax= 8.0; break; + case TE_COL_R: + icu->ymax= 0.0; break; + case TE_COL_G: + icu->ymax= 2.0; break; + case TE_COL_B: + icu->ymax= 2.0; break; + case TE_BRIGHT: + icu->ymax= 2.0; break; + case TE_CONTRA: + icu->ymax= 5.0; break; + } } else if(icu->blocktype==ID_SEQ) { diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h index b3cb0c81148..c05c27ede6b 100644 --- a/source/blender/makesdna/DNA_ipo_types.h +++ b/source/blender/makesdna/DNA_ipo_types.h @@ -171,8 +171,8 @@ typedef short IPO_Channel; /* ******************** */ -#define TE_TOTIPO 21 -#define TE_TOTNAM 21 +#define TE_TOTIPO 26 +#define TE_TOTNAM 26 #define TE_NSIZE 1 #define TE_NDEPTH 2 @@ -200,6 +200,12 @@ typedef short IPO_Channel; #define TE_N_BAS1 20 #define TE_N_BAS2 21 +#define TE_COL_R 22 +#define TE_COL_G 23 +#define TE_COL_B 24 +#define TE_BRIGHT 25 +#define TE_CONTRA 26 + /* ******************** */ #define SEQ_TOTIPO 1 diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index f604e424ec6..a7f7a24a515 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -587,7 +587,7 @@ static void make_mat_editipo(SpaceIpo *si) static void make_texture_editipo(SpaceIpo *si) { EditIpo *ei; - int a; + int a, len; char *name; if(si->from==0) return; @@ -602,7 +602,13 @@ static void make_texture_editipo(SpaceIpo *si) ei->adrcode= te_ar[a]; ei->col= ipo_rainbow(a, TE_TOTIPO); - + + len= strlen(ei->name); + if(len) { + if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF; + else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50; + else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050; + } ei->icu= find_ipocurve(si->ipo, ei->adrcode); if(ei->icu) { ei->flag= ei->icu->flag; @@ -2097,25 +2103,26 @@ void common_insertkey(void) IpoCurve *icu; World *wo; Lamp *la; + Tex *te; int tlay, map, event; char menustr[256]; - + if(curarea->spacetype==SPACE_IPO) { insertkey_editipo(); } else if(curarea->spacetype==SPACE_BUTS) { if(G.buts->mainb==CONTEXT_SHADING) { int tab= G.buts->tab[CONTEXT_SHADING]; - + if(tab==TAB_SHADING_MAT) { id= G.buts->lockpoin; ma= G.buts->lockpoin; if(id) { event= pupmenu("Insert Key %t|RGB%x0|Alpha%x1|Halo Size%x2|Mode %x3|All Color%x10|All Mirror%x14|Ofs%x12|Size%x13|All Mapping%x11"); if(event== -1) return; - + map= texchannel_to_adrcode(ma->texact); - + if(event==0 || event==10) { insertkey(id, ID_MA, NULL, NULL, MA_COL_R); insertkey(id, ID_MA, NULL, NULL, MA_COL_G); @@ -2178,9 +2185,9 @@ void common_insertkey(void) if(id) { event= pupmenu("Insert Key %t|Zenith RGB%x0|Horizon RGB%x1|Mist%x2|Stars %x3|Offset%x12|Size%x13"); if(event== -1) return; - + map= texchannel_to_adrcode(wo->texact); - + if(event==0) { insertkey(id, ID_WO, NULL, NULL, WO_ZEN_R); insertkey(id, ID_WO, NULL, NULL, WO_ZEN_G); @@ -2222,9 +2229,9 @@ void common_insertkey(void) if(id) { event= pupmenu("Insert Key %t|RGB%x0|Energy%x1|Spot Size%x2|Offset%x12|Size%x13"); if(event== -1) return; - + map= texchannel_to_adrcode(la->texact); - + if(event==0) { insertkey(id, ID_LA, NULL, NULL, LA_COL_R); insertkey(id, ID_LA, NULL, NULL, LA_COL_G); @@ -2249,6 +2256,85 @@ void common_insertkey(void) } } + else if(tab==TAB_SHADING_TEX) { + id= G.buts->lockpoin; + te= G.buts->lockpoin; + if(id) { + event= pupmenu("Insert Key %t|Cloud%x0|Mable%x1|Stucci%x2|Wood%x3|Magic%x4|Blend%x5|Musgrave%x6|Voronoi%x7|Distnoise%x8|ColourFilter%x9"); + if(event== -1) return; + + if(event==0) { + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); + insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH); + insertkey(id, ID_TE, NULL, NULL, TE_NTYPE); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1); + } + if(event==1) { + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); + insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH); + insertkey(id, ID_TE, NULL, NULL, TE_NTYPE); + insertkey(id, ID_TE, NULL, NULL, TE_TURB); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS2); + } + if(event==2) { + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); + insertkey(id, ID_TE, NULL, NULL, TE_NTYPE); + insertkey(id, ID_TE, NULL, NULL, TE_TURB); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1); + } + if(event==3) { + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); + insertkey(id, ID_TE, NULL, NULL, TE_NTYPE); + insertkey(id, ID_TE, NULL, NULL, TE_TURB); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS2); + } + if(event==4) { + insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH); + insertkey(id, ID_TE, NULL, NULL, TE_TURB); + } + if(event==5) { + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); + } + if(event==6) { + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); + insertkey(id, ID_TE, NULL, NULL, TE_MGH); + insertkey(id, ID_TE, NULL, NULL, TE_MG_LAC); + insertkey(id, ID_TE, NULL, NULL, TE_MG_OCT); + insertkey(id, ID_TE, NULL, NULL, TE_MG_OFF); + insertkey(id, ID_TE, NULL, NULL, TE_MG_GAIN); + } + if(event==7) { + insertkey(id, ID_TE, NULL, NULL, TE_VNW1); + insertkey(id, ID_TE, NULL, NULL, TE_VNW2); + insertkey(id, ID_TE, NULL, NULL, TE_VNW3); + insertkey(id, ID_TE, NULL, NULL, TE_VNW4); + insertkey(id, ID_TE, NULL, NULL, TE_VNMEXP); + insertkey(id, ID_TE, NULL, NULL, TE_VN_DISTM); + insertkey(id, ID_TE, NULL, NULL, TE_VN_COLT); + insertkey(id, ID_TE, NULL, NULL, TE_ISCA); + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); + } + if(event==8) { + insertkey(id, ID_TE, NULL, NULL, TE_MG_OCT); + insertkey(id, ID_TE, NULL, NULL, TE_MG_OFF); + insertkey(id, ID_TE, NULL, NULL, TE_MG_GAIN); + insertkey(id, ID_TE, NULL, NULL, TE_DISTA); + } + if(event==9) { + insertkey(id, ID_TE, NULL, NULL, TE_COL_R); + insertkey(id, ID_TE, NULL, NULL, TE_COL_G); + insertkey(id, ID_TE, NULL, NULL, TE_COL_B); + insertkey(id, ID_TE, NULL, NULL, TE_BRIGHT); + insertkey(id, ID_TE, NULL, NULL, TE_CONTRA); + } + } + } } else if(G.buts->mainb==CONTEXT_OBJECT) { ob= OBACT; @@ -2327,7 +2413,7 @@ void common_insertkey(void) } } } - + BIF_undo_push("Insert Key Buttons"); allqueue(REDRAWACTION, 0); @@ -2349,10 +2435,10 @@ void common_insertkey(void) base= base->next; } if(base==NULL) return; - + strcpy(menustr, "Insert Key%t|Loc%x0|Rot%x1|Size%x2|LocRot%x3|LocRotSize%x4|Layer%x5|Avail%x9"); } - + if(ob) { if(ob->type==OB_MESH) strcat(menustr, "| %x6|Mesh%x7"); else if(ob->type==OB_LATTICE) strcat(menustr, "| %x6|Lattice%x7"); @@ -2360,15 +2446,15 @@ void common_insertkey(void) else if(ob->type==OB_SURF) strcat(menustr, "| %x6|Surface%x7"); if(ob->flag & OB_FROMGROUP) strcat(menustr, "| %x6|Entire Group%x10"); } - + event= pupmenu(menustr); if(event== -1) return; - + if(event==7) { // ob != NULL insert_shapekey(ob); return; } - + if(event==10) { Group *group= find_group(ob); if(group) { @@ -2376,7 +2462,7 @@ void common_insertkey(void) allqueue(REDRAWBUTSOBJECT, 0); } } - + if (ob && (ob->flag & OB_POSEMODE)){ bPoseChannel *pchan; @@ -2384,7 +2470,7 @@ void common_insertkey(void) error ("Can't key libactions"); return; } - + set_pose_keys(ob); // sets pchan->flag to POSE_KEY if bone selected id= &ob->id; for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { @@ -2407,7 +2493,7 @@ void common_insertkey(void) } if (event==9 && ob->action) { bActionChannel *achan; - + for (achan = ob->action->chanbase.first; achan; achan=achan->next){ if (achan->ipo && !strcmp (achan->name, pchan->name)){ for (icu = achan->ipo->curve.first; icu; icu=icu->next){ @@ -2431,12 +2517,12 @@ void common_insertkey(void) while(base) { if TESTBASELIB(base) { char *actname= NULL; - + id= (ID *)(base->object); - + if(ob->ipoflag & OB_ACTION_OB) actname= "Object"; - + /* all curves in ipo deselect */ if(base->object->ipo) { icu= base->object->ipo->curve.first; @@ -2446,7 +2532,7 @@ void common_insertkey(void) icu= icu->next; } } - + if(event==0 || event==3 ||event==4) { insertkey(id, ID_OB, actname, NULL, OB_LOC_X); insertkey(id, ID_OB, actname, NULL, OB_LOC_Y); @@ -2489,7 +2575,7 @@ void common_insertkey(void) allqueue(REDRAWACTION, 0); allqueue(REDRAWNLA, 0); } - + } /* ****************************************************************************** */ @@ -4462,5 +4548,3 @@ void move_to_frame(void) } BIF_undo_push("Set frame to selected Ipo vertex"); } - - diff --git a/source/blender/src/editipo_lib.c b/source/blender/src/editipo_lib.c index c3c80c4e238..22587c2da3c 100644 --- a/source/blender/src/editipo_lib.c +++ b/source/blender/src/editipo_lib.c @@ -61,7 +61,7 @@ char *mtex_ic_names[TEX_TOTNAM] = { "OfsX", "OfsY", "OfsZ", "SizeX", "SizeY", "S char *tex_ic_names[TE_TOTNAM] = { "NSize", "NDepth", "NType", "Turb", "Vnw1", "Vnw2", "Vnw3", "Vnw4", "MinkMExp", "DistM", "ColT", "iScale", "DistA", "MgType", "MgH", "Lacu", "Oct", "MgOff", - "MgGain", "NBase1", "NBase2" }; + "MgGain", "NBase1", "NBase2", "ColR", "ColG", "ColB", "Bright", "Contras"}; char *ma_ic_names[MA_TOTNAM] = { "R", "G", "B", "SpecR", "SpecG", "SpecB", "MirR", "MirG", "MirB", "Ref", "Alpha", "Emit", "Amb", "Spec", "Hard", "SpTra", "Ior", "Mode", "HaSize", "Translu", @@ -133,7 +133,7 @@ char *getname_ob_ei(int nr, int colipo) char *getname_tex_ei(int nr) { - if(nr>=TE_NSIZE && nr<=TE_N_BAS2) return tex_ic_names[nr-1]; + if(nr>=TE_NSIZE && nr<=TE_CONTRA) return tex_ic_names[nr-1]; return ic_name_empty[0]; } |