Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2004-07-07 12:49:33 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2004-07-07 12:49:33 +0400
commit6757a8159b7a64a4ac1444046f967bb2b88909ad (patch)
tree710d9ca648ea7ed5d98a211c03d9a98f136b02bb
parent2388cada013f66370d912c8a7039cfaf3cc1ff07 (diff)
* fixed bug in rainbow color for material and world ipoview
* removed 32 channel limit (can now have 50, or of you know what number to change, 999 ;) * added new IPOs: mirror fresnel and fac, transparency fresnel and fac, and glow factor transparent materials (add)
-rw-r--r--source/blender/blenkernel/intern/ipo.c37
-rw-r--r--source/blender/makesdna/DNA_ipo_types.h9
-rw-r--r--source/blender/src/drawipo.c2
-rw-r--r--source/blender/src/editipo.c52
-rw-r--r--source/blender/src/space.c2
5 files changed, 79 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 5487a2ad516..581877cf42e 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -107,6 +107,7 @@ int ma_ar[MA_TOTIPO]= {
MA_REF, MA_ALPHA, MA_EMIT, MA_AMB,
MA_SPEC, MA_HARD, MA_SPTR, MA_IOR,
MA_MODE, MA_HASIZE, MA_TRANSLU, MA_RAYM,
+ MA_FRESMIR, MA_FRESMIRI, MA_FRESTRA, MA_FRESTRAI, MA_ADD,
MA_MAP1+MAP_OFS_X, MA_MAP1+MAP_OFS_Y, MA_MAP1+MAP_OFS_Z,
MA_MAP1+MAP_SIZE_X, MA_MAP1+MAP_SIZE_Y, MA_MAP1+MAP_SIZE_Z,
@@ -1078,6 +1079,16 @@ void *get_ipo_poin(ID *id, IpoCurve *icu, int *type)
poin= &(ma->translucency); break;
case MA_RAYM:
poin= &(ma->ray_mirror); break;
+ case MA_FRESMIR:
+ poin= &(ma->fresnel_mir); break;
+ case MA_FRESMIRI:
+ poin= &(ma->fresnel_mir_i); break;
+ case MA_FRESTRA:
+ poin= &(ma->fresnel_tra); break;
+ case MA_FRESTRAI:
+ poin= &(ma->fresnel_tra_i); break;
+ case MA_ADD:
+ poin= &(ma->add); break;
}
if(poin==0) {
@@ -1272,12 +1283,28 @@ void set_icu_vars(IpoCurve *icu)
icu->ymax= 2.0; break;
case MA_MODE:
icu->ipo= IPO_CONST;
- icu->vartype= IPO_BITS;
- break;
-
+ icu->vartype= IPO_BITS; break;
+ case MA_RAYM:
+ icu->ymax= 1.0; break;
+ case MA_TRANSLU:
+ icu->ymax= 1.0; break;
+ case MA_IOR:
+ icu->ymin= 1.0;
+ icu->ymax= 3.0; break;
+ case MA_FRESMIR:
+ icu->ymax= 5.0; break;
+ case MA_FRESMIRI:
+ icu->ymin= 1.0;
+ icu->ymax= 5.0; break;
+ case MA_FRESTRA:
+ icu->ymax= 5.0; break;
+ case MA_FRESTRAI:
+ icu->ymin= 1.0;
+ icu->ymax= 5.0; break;
+ case MA_ADD:
+ icu->ymax= 1.0; break;
default:
- icu->ymax= 1.0;
- break;
+ icu->ymax= 1.0; break;
}
}
else {
diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h
index c9b3f2899f0..b18cacedb63 100644
--- a/source/blender/makesdna/DNA_ipo_types.h
+++ b/source/blender/makesdna/DNA_ipo_types.h
@@ -114,7 +114,7 @@ typedef short IPO_Channel;
/* ******************** */
-#define MA_TOTIPO 35
+#define MA_TOTIPO 40
#define MA_COL_R 1
#define MA_COL_G 2
@@ -137,6 +137,11 @@ typedef short IPO_Channel;
#define MA_HASIZE 19
#define MA_TRANSLU 20
#define MA_RAYM 21
+#define MA_FRESMIR 22
+#define MA_FRESMIRI 23
+#define MA_FRESTRA 24
+#define MA_FRESTRAI 25
+#define MA_ADD 26
#define MA_MAP1 0x20
#define MA_MAP2 0x40
@@ -310,5 +315,7 @@ typedef short IPO_Channel;
#define IPO_EDIT 4
#define IPO_LOCK 8
+#define IPO_IS_SELECTED 6 /* note, this is number of bit! */
+
#endif
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c
index 3b05e08e2f0..f0cd4ce13ca 100644
--- a/source/blender/src/drawipo.c
+++ b/source/blender/src/drawipo.c
@@ -807,7 +807,7 @@ static void draw_ipobuts(SpaceIpo *sipo)
y= area->winy-30+sipo->butofs;
for(a=0; a<sipo->totipo; a++, ei++, y-=IPOBUTY) {
- but= uiDefButI(block, TOG|BIT|a, a+1, ei->name, v2d->mask.xmax+18, y, IPOBUTX-15, IPOBUTY-1, &(sipo->rowbut), 0, 0, 0, 0, "");
+ but= uiDefButS(block, TOG|BIT|6, a+1, ei->name, v2d->mask.xmax+18, y, IPOBUTX-15, IPOBUTY-1, &(ei->flag), 0, 0, 0, 0, "");
// no hilite, its not visible, but most of all the winmatrix is not correct later on...
uiButSetFlag(but, UI_TEXT_LEFT|UI_NO_HILITE);
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c
index 183a46e46ce..0e620a534ee 100644
--- a/source/blender/src/editipo.c
+++ b/source/blender/src/editipo.c
@@ -339,6 +339,16 @@ void getname_mat_ei(int nr, char *str)
strcpy(str, "Translu"); break;
case MA_RAYM:
strcpy(str, "RayMir"); break;
+ case MA_FRESMIR:
+ strcpy(str, "FresMir"); break;
+ case MA_FRESMIRI:
+ strcpy(str, "FresMirI"); break;
+ case MA_FRESTRA:
+ strcpy(str, "FresTra"); break;
+ case MA_FRESTRAI:
+ strcpy(str, "FresTraI"); break;
+ case MA_ADD:
+ strcpy(str, "TraGlow"); break;
default:
str[0]= 0;
}
@@ -1002,7 +1012,7 @@ void make_mat_editipo(SpaceIpo *si)
if(ei->adrcode==MA_MODE) ei->disptype= IPO_DISPBITS;
}
- ei->col= ipo_rainbow(a, WO_TOTIPO);
+ ei->col= ipo_rainbow(a, MA_TOTIPO);
len= strlen(ei->name);
if(len) {
@@ -1043,7 +1053,7 @@ void make_world_editipo(SpaceIpo *si)
if(ei->adrcode==MA_MODE) ei->disptype= IPO_DISPBITS;
}
- ei->col= ipo_rainbow(a, MA_TOTIPO);
+ ei->col= ipo_rainbow(a, WO_TOTIPO);
len= strlen(ei->name);
if(len) {
@@ -1271,12 +1281,10 @@ void make_editipo()
if(G.sipo->editipo==0) return;
- /* rowbut for VISIBLE select */
- G.sipo->rowbut= 0;
ei= G.sipo->editipo;
for(a=0; a<G.sipo->totipo; a++, ei++) {
- if(ei->flag & IPO_VISIBLE) G.sipo->rowbut |= (1<<a);
+ if(ei->flag & IPO_VISIBLE) ei->flag |= (1<<IPO_IS_SELECTED);
if(ei->icu) ei->icu->flag= ei->flag;
}
@@ -1423,15 +1431,15 @@ void update_editipo_flags()
{
EditIpo *ei;
IpoKey *ik;
- unsigned int flag;
+ short flag;/*unsigned int flag;*/
int a;
ei= G.sipo->editipo;
if(ei) {
for(a=0; a<G.sipo->totipo; a++, ei++) {
ei->flag &= ~IPO_VISIBLE;
- flag= (1<<a);
- if( G.sipo->rowbut & flag ) ei->flag |= IPO_VISIBLE;
+ flag= (1<<IPO_IS_SELECTED);
+ if( ei->flag & flag ) ei->flag |= IPO_VISIBLE;
if(ei->icu) ei->icu->flag= ei->flag;
@@ -1590,14 +1598,13 @@ void swap_visible_editipo()
get_status_editipo();
- G.sipo->rowbut= 0;
ei= G.sipo->editipo;
for(a=0; a<G.sipo->totipo; a++) {
if(totipo_vis==0) {
if(ei->icu) {
ei->flag |= IPO_VISIBLE;
- G.sipo->rowbut |= (1<<a);
+ ei->flag |= (1<<IPO_IS_SELECTED);
}
}
else ei->flag &= ~IPO_VISIBLE;
@@ -1791,8 +1798,16 @@ void move_to_frame()
void do_ipowin_buts(short event)
{
+ EditIpo *ei = 0;
+ int a;
if((G.qual & LR_SHIFTKEY)==0) {
- G.sipo->rowbut= (1<<event);
+ if(event>G.sipo->totipo) return;
+ ei = G.sipo->editipo;
+ for(a=0; a<G.sipo->totipo; a++) {
+ if(a==event) ei->flag |= (1<<IPO_IS_SELECTED);
+ else ei->flag &= ~(1<<IPO_IS_SELECTED);
+ ei++;
+ }
}
scrarea_queue_winredraw(curarea);
@@ -1830,7 +1845,7 @@ void do_ipo_selectbuttons()
if(ei->icu) {
if((ei->flag & IPO_VISIBLE)==0) {
ei->flag |= IPO_VISIBLE;
- G.sipo->rowbut |= (1<<nr);
+ ei->flag |= (1<<IPO_IS_SELECTED);
}
if((G.qual & LR_SHIFTKEY)==0) {
@@ -3685,7 +3700,7 @@ void common_insertkey()
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|Ofs%x12|Size%x13|All Mapping%x11");
+ 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);
@@ -3715,7 +3730,14 @@ void common_insertkey()
insertkey(id, MA_HARD);
insertkey(id, MA_MODE);
insertkey(id, MA_TRANSLU);
+ insertkey(id, MA_ADD);
+ }
+ if(event==14) {
insertkey(id, MA_RAYM);
+ insertkey(id, MA_FRESMIR);
+ insertkey(id, MA_FRESMIRI);
+ insertkey(id, MA_FRESTRA);
+ insertkey(id, MA_FRESTRAI);
}
if(event==12 || event==11) {
insertkey(id, map+MAP_OFS_X);
@@ -3818,9 +3840,9 @@ void common_insertkey()
}
}
else if(G.buts->mainb==CONTEXT_OBJECT) {
- int tab= G.buts->tab[CONTEXT_OBJECT];
+ int tab= G.buts->tab[CONTEXT_OBJECT];
+ ob= OBACT;
if(tab==TAB_OBJECT_EFFECTS) {
- ob= OBACT;
if(ob && ob->type==OB_MESH) {
id= (ID *) (ob);
if(id) {
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index ac597264f4a..ca5e3ec1023 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -1591,7 +1591,7 @@ void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
switch(event) {
case UI_BUT_EVENT:
/* note: bad bad code, will be cleaned! is because event queues are all shattered */
- if(val>0 && val < 32) do_ipowin_buts(val-1);
+ if(val>0 && val < 51) do_ipowin_buts(val-1);
else do_ipobuts(val);
break;