Page MenuHome

blender_reverse_scene_movie_images_strips.txt

Authored By
Shaul Kedem (shul)
Nov 13 2013, 1:06 PM
Size
6 KB
Subscribers
None

blender_reverse_scene_movie_images_strips.txt

Index: source/blender/makesdna/DNA_sequence_types.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_sequence_types.h,v
retrieving revision 1.16
diff -u -b -B -r1.16 DNA_sequence_types.h
--- source/blender/makesdna/DNA_sequence_types.h 24 Mar 2005 09:37:06 -0000 1.16
+++ source/blender/makesdna/DNA_sequence_types.h 3 Sep 2005 14:30:11 -0000
@@ -82,7 +82,7 @@
void (*callback)(void);
} PluginSeq;
-
+/* The sequence structure is the basic struct used by any strip. each of the strips uses a different sequence structure.*/
/* WATCH IT: first part identical to ID (for use in ipo's) */
typedef struct Sequence {
@@ -91,14 +91,14 @@
void *lib;
char name[24];
- short flag, type;
- int len;
- int start, startofs, endofs;
+ short flag, type; /*flags bitmap (see below) and the type of sequence*/
+ int len; /*length of strip, including parts not rendered (because of resizing)*/
+ int start, startofs, endofs; /*startofs is the offset from the beginning of the scene, endofs is the offset of the frames from the end of the scene*/
int startstill, endstill;
int machine, depth;
- int startdisp, enddisp;
+ int startdisp, enddisp; /*starting and ending points in the sequence*/
float mul, handsize;
- int sfra;
+ int sfra; /* starting frame according to the timeline of the scene */
Strip *strip;
StripElem *curelem;
@@ -164,8 +164,9 @@
#define SEQ_FILTERY 16
#define SEQ_MUTE 32
#define SEQ_MAKE_PREMUL 64
+#define SEQ_REVERSE_FRAMES 128
-/* seq->type WATCH IT: BIT 3!!! */
+/* 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
#define SEQ_SCENE 2
Index: source/blender/src/drawseq.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/drawseq.c,v
retrieving revision 1.34
diff -u -b -B -r1.34 drawseq.c
--- source/blender/src/drawseq.c 3 Aug 2005 18:48:21 -0000 1.34
+++ source/blender/src/drawseq.c 3 Sep 2005 14:30:19 -0000
@@ -630,6 +630,23 @@
allqueue(REDRAWSEQ, 0);
}
+void reverse_image_strip( void *unused1, void*unused2)
+{
+ extern Sequence *last_seq;
+ char name[FILE_MAXFILE];
+ int a,curr_end;
+
+ curr_end = last_seq->strip->len-1; /* store the last frame */
+ /* reverse frames in image strip */
+ for(a=0;a!=(last_seq->strip->len/2);a++) {
+ strncpy(name, last_seq->strip->stripdata[a].name, FILE_MAXFILE-1);
+ strncpy(last_seq->strip->stripdata[a].name,last_seq->strip->stripdata[curr_end].name,FILE_MAXFILE-1);
+ strncpy(last_seq->strip->stripdata[curr_end].name,name, FILE_MAXFILE-1);
+
+ curr_end--;
+ }
+}
+
static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
{
extern Sequence *last_seq;
@@ -670,6 +687,8 @@
uiDefButBitS(block, TOG, SEQ_MAKE_PREMUL, SEQ_BUT_RELOAD, "Convert to Premul", 10,90,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Converts RGB values to become premultiplied with Alpha");
uiDefButBitS(block, TOG, SEQ_FILTERY, SEQ_BUT_RELOAD, "FilterY", 10,70,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "For video movies to remove fields");
uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Mul:", 10,50,150,19, &last_seq->mul, 0.001, 5.0, 100, 0, "Multiply colors");
+ uiBut *bt = uiDefButS(block, TOG|BIT|7, SEQ_BUT_RELOAD, "Reverse Frames", 10,30,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Reverse frame order");
+ uiButSetFunc(bt, reverse_image_strip, last_seq->name+2, NULL);
}
else if(last_seq->type==SEQ_META) {
@@ -681,7 +700,7 @@
uiDefBut(block, LABEL, 0, "Type: Scene", 10,140,150,20, 0, 0, 0, 0, 0, "");
uiDefBut(block, TEX, B_NOP, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, "");
-
+ uiDefButS(block, TOG|BIT|7, SEQ_BUT_RELOAD, "Reverse Frames", 10,90,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Reverse frame order");
}
else if(last_seq->type==SEQ_MOVIE) {
@@ -693,6 +712,9 @@
uiDefButBitS(block, TOG, SEQ_MAKE_PREMUL, SEQ_BUT_RELOAD, "Make Premul Alpha ", 10,90,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Converts RGB values to become premultiplied with Alpha");
uiDefButBitS(block, TOG, SEQ_FILTERY, SEQ_BUT_RELOAD, "FilterY ", 10,70,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "For video movies to remove fields");
uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Mul:", 10,50,150,19, &last_seq->mul, 0.001, 5.0, 100, 0, "Multiply colors");
+
+ uiDefButS(block, TOG|BIT|7, SEQ_BUT_RELOAD, "Reverse Frames", 10,30,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Reverse frame order");
+
}
else if(last_seq->type==SEQ_SOUND) {
Index: source/blender/src/editseq.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editseq.c,v
retrieving revision 1.28
diff -u -b -B -r1.28 editseq.c
Index: source/blender/src/sequence.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/sequence.c,v
retrieving revision 1.25
diff -u -b -B -r1.25 sequence.c
--- source/blender/src/sequence.c 14 Jul 2005 13:50:48 -0000 1.25
+++ source/blender/src/sequence.c 3 Sep 2005 14:31:03 -0000
@@ -1923,9 +1922,14 @@
seq->anim = openanim(name, IB_rect);
}
if(seq->anim) {
+ if(seq->flag&SEQ_REVERSE_FRAMES) { /*reverse frame in this movie sequence */
+ se->ibuf = IMB_anim_absolute(seq->anim, (seq->enddisp - seq->startdisp) - ( se->nr) + seq->startofs);
+ }else{
se->ibuf = IMB_anim_absolute(seq->anim, se->nr);
}
+ }
+
if(se->ibuf==0) se->ok= 0;
else {
if(seq->flag & SEQ_MAKE_PREMUL) {
@@ -1951,8 +1955,13 @@
doseq= G.scene->r.scemode & R_DOSEQ;
G.scene->r.scemode &= ~R_DOSEQ;
- /* store stuffies */
- oldcfra= CFRA; CFRA= seq->sfra + se->nr;
+ /* store Current FRAme */
+ oldcfra= CFRA;
+ if(seq->flag&SEQ_REVERSE_FRAMES) { /*reverse frame in this scene sequence */
+ CFRA= (seq->enddisp - seq->startdisp) - ( seq->sfra + se->nr) + 1 + seq->startofs;
+ } else {
+ CFRA= ( seq->sfra + se->nr );
+ }
waitcursor(1);
rectot= R.rectot; R.rectot= NULL;

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d4/91/7fdbe71bcda854bc62387c4185c8

Event Timeline