[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12998] trunk/blender/source/blender: == Sequencer (includes a little bit of Peach :) ==
Peter Schlaile
peter at schlaile.de
Tue Dec 25 16:31:36 CET 2007
Revision: 12998
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12998
Author: schlaile
Date: 2007-12-25 16:31:36 +0100 (Tue, 25 Dec 2007)
Log Message:
-----------
== Sequencer (includes a little bit of Peach :) ==
Reworked image / movie loading, to add the following features:
- Mute strip
- Lock strip (peach request :)
- Crop / Translate _before_ image rescaling
- N-keys editing of start, startofs, endofs, startstill, endstill
Added (currently disabled) data structures for
- proxy support
- strip blend modes (currently only "REPLACE" works, which always did :)
Planed:
- automatic FPS rescaling
- command keys to lock/mute a bunch of selected strips
(which would complete the peach request to lock tracks)
Caveats: now the N-keys dialog is four-tabbed. I think, we should move those
tabs into the panels dialog in the future...
Modified Paths:
--------------
trunk/blender/source/blender/blenloader/intern/readfile.c
trunk/blender/source/blender/blenloader/intern/writefile.c
trunk/blender/source/blender/makesdna/DNA_sequence_types.h
trunk/blender/source/blender/src/drawseq.c
trunk/blender/source/blender/src/editseq.c
trunk/blender/source/blender/src/sequence.c
Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c 2007-12-25 06:48:45 UTC (rev 12997)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c 2007-12-25 15:31:36 UTC (rev 12998)
@@ -3366,6 +3366,24 @@
} else {
seq->strip->stripdata = 0;
}
+ if (seq->flag & SEQ_USE_CROP) {
+ seq->strip->crop = newdataadr(
+ fd, seq->strip->crop);
+ } else {
+ seq->strip->crop = 0;
+ }
+ if (seq->flag & SEQ_USE_TRANSFORM) {
+ seq->strip->transform = newdataadr(
+ fd, seq->strip->transform);
+ } else {
+ seq->strip->transform = 0;
+ }
+ if (seq->flag & SEQ_USE_PROXY) {
+ seq->strip->proxy = newdataadr(
+ fd, seq->strip->proxy);
+ } else {
+ seq->strip->proxy = 0;
+ }
}
}
END_SEQ
Modified: trunk/blender/source/blender/blenloader/intern/writefile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/writefile.c 2007-12-25 06:48:45 UTC (rev 12997)
+++ trunk/blender/source/blender/blenloader/intern/writefile.c 2007-12-25 15:31:36 UTC (rev 12998)
@@ -1463,7 +1463,15 @@
strip= seq->strip;
writestruct(wd, DATA, "Strip", 1, strip);
-
+ if(seq->flag & SEQ_USE_CROP && strip->crop) {
+ writestruct(wd, DATA, "StripCrop", 1, strip->crop);
+ }
+ if(seq->flag & SEQ_USE_TRANSFORM && strip->transform) {
+ writestruct(wd, DATA, "StripTransform", 1, strip->transform);
+ }
+ if(seq->flag & SEQ_USE_PROXY && strip->proxy) {
+ writestruct(wd, DATA, "StripProxy", 1, strip->proxy);
+ }
if(seq->type==SEQ_IMAGE)
writestruct(wd, DATA, "StripElem", strip->len, strip->stripdata);
else if(seq->type==SEQ_MOVIE || seq->type==SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND)
Modified: trunk/blender/source/blender/makesdna/DNA_sequence_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_sequence_types.h 2007-12-25 06:48:45 UTC (rev 12997)
+++ trunk/blender/source/blender/makesdna/DNA_sequence_types.h 2007-12-25 15:31:36 UTC (rev 12998)
@@ -56,12 +56,34 @@
int nr;
} TStripElem;
+typedef struct StripCrop {
+ int top;
+ int bottom;
+ int left;
+ int right;
+} StripCrop;
+
+typedef struct StripTransform {
+ int xofs;
+ int yofs;
+} StripTransform;
+
+typedef struct StripProxy {
+ char dir[160];
+ int format;
+ int width;
+ int height;
+} StripProxy;
+
typedef struct Strip {
struct Strip *next, *prev;
int rt, len, us, done;
StripElem *stripdata;
char dir[160];
int orx, ory;
+ StripCrop *crop;
+ StripTransform *transform;
+ StripProxy *proxy;
TStripElem *tstripdata;
} Strip;
@@ -96,7 +118,8 @@
void *lib; /* needed (to be like ipo), else it will raise libdata warnings, this should never be used */
char name[24]; /* name, not set by default and dosnt need to be unique as with ID's */
- short flag, type; /*flags bitmap (see below) and the type of sequence*/
+ int flag, type; /*flags bitmap (see below) and the type of sequence*/
+ int pad;
int len; /* the length of the contense of this strip - before handles are applied */
int start, startofs, endofs;
int startstill, endstill;
@@ -129,7 +152,9 @@
void *effectdata; /* Struct pointer for effect settings */
int anim_preseek;
- int pad;
+ int blend_mode;
+ float blend_opacity;
+ int pad2;
} Sequence;
typedef struct MetaStack {
@@ -210,7 +235,13 @@
#define SEQ_FLAG_DELETE 1024
#define SEQ_FLIPX 2048
#define SEQ_FLIPY 4096
+#define SEQ_MAKE_FLOAT 8192
+#define SEQ_LOCK 16384
+#define SEQ_USE_PROXY 32768
+#define SEQ_USE_TRANSFORM 65536
+#define SEQ_USE_CROP 131072
+
/* seq->type WATCH IT: SEQ_EFFECT BIT is used to determine if this is an effect strip!!! */
#define SEQ_IMAGE 0
#define SEQ_META 1
@@ -240,5 +271,9 @@
#define STRIPELEM_OK 1
#define STRIPELEM_META 2
+#define SEQ_BLEND_REPLACE 0
+#define SEQ_BLEND_ALPHA_OVER 1
+
+
#endif
Modified: trunk/blender/source/blender/src/drawseq.c
===================================================================
--- trunk/blender/source/blender/src/drawseq.c 2007-12-25 06:48:45 UTC (rev 12997)
+++ trunk/blender/source/blender/src/drawseq.c 2007-12-25 15:31:36 UTC (rev 12998)
@@ -1056,6 +1056,7 @@
#define SEQ_BUT_RELOAD 2
#define SEQ_BUT_EFFECT 3
#define SEQ_BUT_RELOAD_ALL 4
+#define SEQ_BUT_TRANSFORM 5
void do_seqbuttons(short val)
{
@@ -1075,6 +1076,9 @@
free_imbuf_seq(); // frees all
break;
+ case SEQ_BUT_TRANSFORM:
+ calc_sequence(last_seq);
+ break;
}
if (val == SEQ_BUT_RELOAD_ALL) {
@@ -1084,27 +1088,293 @@
}
}
-static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
+#define SEQ_PANEL_EDITING 1
+#define SEQ_PANEL_INPUT 2
+#define SEQ_PANEL_FILTER 4
+#define SEQ_PANEL_EFFECT 8
+#define SEQ_PANEL_PROXY 16
+
+static char* seq_panal_blend_modes()
{
+ static char string[2048];
+ char formatstring[2048];
+
+ strcpy(formatstring, "Blend mode: %%t|%s %%x%d|%s %%x%d");
+ sprintf(string, formatstring,
+ "REPLACE", SEQ_BLEND_REPLACE,
+ "TODO: ALPHA OVER", SEQ_BLEND_ALPHA_OVER);
+ return string;
+
+}
+
+static void seq_panel_editing(short cntrl)
+{
Sequence *last_seq = get_last_seq();
+ char * seq_names[] = { "Image", "Meta", "Scene", "Movie",
+ "Snd RAM", "Snd HD",
+ "", "Effect" };
uiBlock *block;
+ block = uiNewBlock(&curarea->uiblocks, "seq_panel_editing",
+ UI_EMBOSS, UI_HELV, curarea->win);
- block= uiNewBlock(&curarea->uiblocks, "seq_panel_properties", UI_EMBOSS, UI_HELV, curarea->win);
uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
uiSetPanelHandler(SEQ_HANDLER_PROPERTIES); // for close and esc
- if(uiNewPanel(curarea, block, "Strip Properties", "Seq", 10, 230, 318, 204)==0) return;
+ if(uiNewPanel(curarea, block, "Edit", "Seq",
+ 10, 230, 318, 204) == 0) return;
- if(last_seq==NULL) return;
+ uiDefBut(block, LABEL,
+ 0, (last_seq->type >= SEQ_EFFECT) ?
+ "Effect" : seq_names[last_seq->type],
+ 10,140,60,19, 0,
+ 0, 0, 0, 0, "");
- if(last_seq->type==SEQ_PLUGIN) {
+ uiDefBut(block, TEX,
+ B_NOP, "Name: ",
+ 70,140,180,19, last_seq->name+2,
+ 0.0, 21.0, 100, 0, "");
+
+ uiDefButI(block, MENU, SEQ_BUT_RELOAD, seq_panal_blend_modes(),
+ 10, 120, 120, 19, &last_seq->blend_mode,
+ 0,0,0,0, "Strip Blend Mode");
+
+ if (last_seq->blend_mode > 0) {
+ uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Blend:",
+ 130, 120, 120, 19, &last_seq->blend_opacity,
+ 0.0, 100.0, 100.0, 0,
+ "Blend opacity");
+ }
+
+ uiDefButBitI(block, TOG, SEQ_MUTE,
+ SEQ_BUT_RELOAD_ALL, "Mute",
+ 10,100,60,19, &last_seq->flag,
+ 0.0, 1.0, 0, 0,
+ "Mute the current strip.");
+
+ uiDefButBitI(block, TOG, SEQ_LOCK,
+ B_NOP, "Lock",
+ 70,100,60,19, &last_seq->flag,
+ 0.0, 1.0, 0, 0,
+ "Lock strip, so that it can't be transformed.");
+
+ uiDefButBitI(block, TOG, SEQ_IPO_FRAME_LOCKED,
+ SEQ_BUT_RELOAD_ALL, "IPO Frame locked",
+ 130,100,120,19, &last_seq->flag,
+ 0.0, 1.0, 0, 0,
+ "Lock the IPO coordinates to the "
+ "global frame counter.");
+
+ if (!(last_seq->flag & SEQ_LOCK)) {
+ uiDefButI(block, NUM,
+ SEQ_BUT_TRANSFORM, "Start",
+ 10, 80, 120, 20, &last_seq->start,
+ 0.0, MAXFRAMEF, 0.0, 0.0, "Start of strip");
+ uiDefButI(block, NUM,
+ SEQ_BUT_TRANSFORM, "Chan",
+ 130, 80, 120, 20, &last_seq->machine,
+ 0.0, MAXSEQ, 0.0, 0.0, "Channel used (Y position)");
+
+ if (last_seq->type == SEQ_IMAGE) {
+ uiDefButI(block, NUM,
+ SEQ_BUT_TRANSFORM, "Start-Still",
+ 10, 60, 120, 20, &last_seq->startstill,
+ 0.0, MAXFRAMEF, 0.0, 0.0, "Start still");
+ uiDefButI(block, NUM,
+ SEQ_BUT_TRANSFORM, "End-Still",
+ 130, 60, 120, 19, &last_seq->endstill,
+ 0.0, MAXFRAMEF, 0.0, 0.0, "End still");
+ } else {
+ uiDefButI(block, NUM,
+ SEQ_BUT_TRANSFORM, "Start-Ofs",
+ 10, 60, 120, 20, &last_seq->startofs,
+ 0.0, last_seq->len, 0.0, 0.0, "Start offset");
+ uiDefButI(block, NUM,
+ SEQ_BUT_TRANSFORM, "End-Ofs",
+ 130, 60, 120, 19, &last_seq->endofs,
+ 0.0, last_seq->len, 0.0, 0.0, "End offset");
+ }
+ }
+}
+
+static void seq_panel_input(short cntrl)
+{
+ Sequence *last_seq = get_last_seq();
+ uiBlock *block;
+ block = uiNewBlock(&curarea->uiblocks, "seq_panel_input",
+ UI_EMBOSS, UI_HELV, curarea->win);
+
+ uiNewPanelTabbed("Edit", "Seq");
+ uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
+ uiSetPanelHandler(SEQ_HANDLER_PROPERTIES); // for close and esc
+ if(uiNewPanel(curarea, block, "Input", "Seq",
+ 10, 230, 318, 204) == 0) return;
+
+
+ uiDefButBitI(block, TOG, SEQ_USE_CROP,
+ SEQ_BUT_RELOAD, "Use Crop",
+ 10,100,240,19, &last_seq->flag,
+ 0.0, 1.0, 0, 0,
+ "Crop image before processing.");
+
+ if (last_seq->flag & SEQ_USE_CROP) {
+ if (!last_seq->strip->crop) {
+ last_seq->strip->crop =
+ MEM_callocN(sizeof(struct StripCrop),
+ "StripCrop");
+ }
+ uiDefButI(block, NUM,
+ SEQ_BUT_RELOAD, "Top",
+ 10, 80, 120, 20, &last_seq->strip->crop->top,
+ 0.0, 4096, 0.0, 0.0, "Top of source image");
+ uiDefButI(block, NUM,
+ SEQ_BUT_RELOAD, "Bottom",
+ 130, 80, 120, 20, &last_seq->strip->crop->bottom,
+ 0.0, 4096, 0.0, 0.0, "Bottom of source image");
+
+ uiDefButI(block, NUM,
+ SEQ_BUT_RELOAD, "Left",
+ 10, 60, 120, 20, &last_seq->strip->crop->left,
+ 0.0, 4096, 0.0, 0.0, "Left");
+ uiDefButI(block, NUM,
+ SEQ_BUT_RELOAD, "Right",
+ 130, 60, 120, 19, &last_seq->strip->crop->right,
+ 0.0, 4096, 0.0, 0.0, "Right");
+ }
+
+ uiDefButBitI(block, TOG, SEQ_USE_TRANSFORM,
+ SEQ_BUT_RELOAD, "Use Translate",
+ 10,40,240,19, &last_seq->flag,
+ 0.0, 1.0, 0, 0,
+ "Translate image before processing.");
+
+ if (last_seq->flag & SEQ_USE_TRANSFORM) {
+ if (!last_seq->strip->transform) {
+ last_seq->strip->transform =
+ MEM_callocN(sizeof(struct StripTransform),
+ "StripTransform");
+ }
+ uiDefButI(block, NUM,
+ SEQ_BUT_RELOAD, "X-Ofs",
+ 10, 20, 120, 20, &last_seq->strip->transform->xofs,
+ 0.0, 4096, 0.0, 0.0, "X Offset");
+ uiDefButI(block, NUM,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list