- Added correct Writing/Reading of the new Sweep sequence effect (Thanks Ton, where would I be without you)

- Sweep effect updates after you change the type of sweep now.
This commit is contained in:
2004-06-23 18:22:51 +00:00
parent 3bf5e671d0
commit 629e526b25
7 changed files with 733 additions and 721 deletions

View File

@@ -66,7 +66,7 @@ LIB32=link.exe -lib
# PROP Target_Dir ""
LINK32=link.exe -lib
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\imbuf" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"..\..\..\obj\windows\blender\render\debug/BRE_yafray.pch" /YX /Fo"..\..\..\obj\windows\blender\render\debug/" /Fd"..\..\..\obj\windows\blender\render\debug/" /J /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\..\lib\windows\guardedalloc\include" /I "..\..\..\source\blender\python" /I "..\..\..\source\blender\misc" /I "..\..\..\source\blender\renderconverter" /I "..\..\..\source\blender\include" /I "..\..\..\source\blender\blenkernel" /I "..\..\..\source\blender\makesdna" /I "..\..\..\source\blender\blenlib" /I "..\..\..\source\blender\render\extern\include" /I "..\..\..\source\blender\render\intern\include" /I "..\..\..\source\blender\imbuf" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"..\..\..\obj\windows\blender\render\debug/BRE_yafray.pch" /YX /Fo"..\..\..\obj\windows\blender\render\debug/" /Fd"..\..\..\obj\windows\blender\render\debug/" /J /FD /GZ /c
# ADD BASE RSC /l 0x413 /d "_DEBUG"
# ADD RSC /l 0x413 /d "_DEBUG"
BSC32=bscmake.exe

View File

@@ -2348,6 +2348,8 @@ static void direct_link_scene(FileData *fd, Scene *sce)
seq->plugin= newdataadr(fd, seq->plugin);
if(seq->plugin) open_plugin_seq(seq->plugin, seq->name+2);
seq->effectdata= newdataadr(fd, seq->effectdata);
seq->strip= newdataadr(fd, seq->strip);
if(seq->strip && seq->strip->done==0) {
seq->strip->done= 1;

View File

@@ -1040,6 +1040,13 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
/* write strip with 'done' at 0 because readfile */
if(seq->plugin) writestruct(wd, DATA, "PluginSeq", 1, seq->plugin);
if(seq->effectdata) {
switch(seq->type){
case SEQ_SWEEP:
writestruct(wd, DATA, "SweepVars", 1, seq->effectdata);
break;
}
}
strip= seq->strip;
writestruct(wd, DATA, "Strip", 1, strip);

View File

@@ -119,7 +119,7 @@ typedef struct Sequence {
int curpos; /* last sample position in audio_fill() */
int pad;
void *varstr; /* Struct pointer for effect settings */
void *effectdata; /* Struct pointer for effect settings */
} Sequence;
#

View File

@@ -603,7 +603,7 @@ static void draw_extra_seqinfo(void)
#define SEQ_BUT_PLUGIN 1
#define SEQ_BUT_MOVIE 2
#define SEQ_BUT_IMAGE 3
#define SEQ_BUT_EFFECT 3
void do_seqbuttons(short val)
{
@@ -623,7 +623,10 @@ void do_seqbuttons(short val)
se->ibuf= 0;
}
break;
case SEQ_BUT_IMAGE:
case SEQ_BUT_EFFECT:
new_stripdata(last_seq);
calc_sequence(last_seq);
allqueue(REDRAWSEQ, 0);
break;
}
@@ -705,12 +708,12 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
uiDefBut(block, TEX, 0, "Stripname: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, "");
if(last_seq->type==SEQ_SWEEP){
SweepVars *sweep = (SweepVars *)last_seq->varstr;
SweepVars *sweep = (SweepVars *)last_seq->effectdata;
char formatstring[1024];
strcpy(formatstring, "Select Sweep Type %t|Left to Right %x0|Right to Left %x1|Bottom to Top %x2|Top to Bottom %x3|Top left to Bottom right%x4|Bottom right to Top left %x5|Bottom left to Top right %x6|Top right to Bottom left %x7|Horizontal out %x8|Horizontal in %x9|Vertical out %x10|Vertical in %x11|Hor/Vert out %x12|Hor/Vert in %x13|Bottom left to Top right out %x14|Top left to Bottom right in %x15|Top left to Bottom right out %x16|Bottom left to Top right in %x17|Diagonal out %x18|Diagonal in %x19|Diagonal out 2 %x20|Diagonal in 2 %x21|");
uiDefButS(block, MENU,SEQ_BUT_MOVIE, formatstring, 10,90,220,22, &sweep->sweeptype, 0, 0, 0, 0, "What type of sweep should be performed");
uiDefButS(block, MENU,SEQ_BUT_EFFECT, formatstring, 10,90,220,22, &sweep->sweeptype, 0, 0, 0, 0, "What type of sweep should be performed");
}
}

View File

@@ -901,7 +901,7 @@ static int add_seq_effect(int type)
/* Allocate variable structs for effects with settings */
if(seq->type==SEQ_SWEEP){
seq->varstr = MEM_callocN(sizeof(struct SweepVars), "sweepvars");
seq->effectdata = MEM_callocN(sizeof(struct SweepVars), "sweepvars");
}
if(seq->type==SEQ_ALPHAUNDER || seq->type==SEQ_ALPHAOVER) {

View File

@@ -225,7 +225,7 @@ void free_sequence(Sequence *seq)
extern Sequence *last_seq;
if(seq->strip) free_strip(seq->strip);
if(seq->varstr) MEM_freeN(seq->varstr);
if(seq->effectdata) MEM_freeN(seq->effectdata);
if(seq->anim) IMB_free_anim(seq->anim);
@@ -962,7 +962,7 @@ int check_zone(int x, int y, int xo, int yo, Sequence *seq, float facf0) {
float posx, posy;
float halfx = xo/2;
float halfy = yo/2;
SweepVars *sweep = (SweepVars *)seq->varstr;
SweepVars *sweep = (SweepVars *)seq->effectdata;
//printf("facf0: %f xo: %d\n", facf0, x);
posx = facf0 * xo;