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:
-rw-r--r--release/scripts/ui/space_sequencer.py4
-rw-r--r--source/blender/blenkernel/intern/object.c11
-rw-r--r--source/blender/blenkernel/intern/sequencer.c17
-rw-r--r--source/blender/blenloader/intern/readfile.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c65
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c6
7 files changed, 75 insertions, 32 deletions
diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py
index 1ca33a1d679..8badf741fac 100644
--- a/release/scripts/ui/space_sequencer.py
+++ b/release/scripts/ui/space_sequencer.py
@@ -617,6 +617,10 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel):
strip = act_strip(context)
layout.template_ID(strip, "scene")
+
+ layout.label(text="Camera Override")
+ layout.template_ID(strip, "scene_camera")
+
layout.prop(strip, "use_opengl")
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 7f04b20a901..336f45fc2e2 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -64,6 +64,7 @@
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
+#include "DNA_sequence_types.h"
#include "DNA_space_types.h"
#include "DNA_texture_types.h"
#include "DNA_userdef_types.h"
@@ -110,6 +111,7 @@
#include "BKE_sca.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
+#include "BKE_sequencer.h"
#include "BKE_softbody.h"
#include "LBM_fluidsim.h"
@@ -591,7 +593,16 @@ void unlink_object(Scene *scene, Object *ob)
}
}
#endif
+ if(sce->ed) {
+ Sequence *seq;
+ SEQ_BEGIN(sce->ed, seq)
+ if(seq->scene_camera==ob) {
+ seq->scene_camera= NULL;
+ }
+ SEQ_END
+ }
}
+
sce= sce->id.next;
}
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 3a85676e23b..481c1ef29cf 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -2136,6 +2136,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
else if (se->ibuf==NULL && sce_valid) {
int frame= seq->sfra + se->nr + seq->anim_startofs;
int oldcfra = seq->scene->r.cfra;
+ Object *oldcamera= seq->scene->camera;
/* Hack! This function can be called from do_render_seq(), in that case
the seq->scene can already have a Render initialized with same name,
@@ -2158,16 +2159,22 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
seq->scene->r.cfra= frame;
- if(sequencer_view3d_cb && (seq->flag & SEQ_USE_SCENE_OPENGL) && have_seq==0) {
+ if(sequencer_view3d_cb && (seq->flag & SEQ_USE_SCENE_OPENGL) && (seq->scene == scene || have_seq==0)) {
/* opengl offscreen render */
+ if(seq->scene_camera) seq->scene->camera= seq->scene_camera;
+ else scene_camera_switch_update(seq->scene);
- scene_camera_switch_update(seq->scene);
scene_update_for_newframe(seq->scene, seq->scene->lay);
se->ibuf= sequencer_view3d_cb(seq->scene, seqrectx, seqrecty);
}
else {
RenderResult rres;
+#ifdef DURIAN_CAMERA_SWITCH
+ /* stooping to new low's in hackyness :( */
+ scene_marker_tfm_translate(seq->scene, MAXFRAME*2, 0);
+#endif
+
if(rendering)
re= RE_NewRender(" do_build_seq_ibuf", RE_SLOT_DEFAULT);
else
@@ -2192,12 +2199,18 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
RE_ReleaseResultImage(re);
// BIF_end_render_callbacks();
+
+#ifdef DURIAN_CAMERA_SWITCH
+ /* stooping to new low's in hackyness :( */
+ scene_marker_tfm_translate(seq->scene, MAXFRAME*-2, 0);
+#endif
}
/* restore */
scene->r.scemode |= doseq;
seq->scene->r.cfra = oldcfra;
+ seq->scene->camera= oldcamera;
copy_to_ibuf_still(seq, se);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b80e3df717c..7ba8386e9cf 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4143,6 +4143,7 @@ static void lib_link_scene(FileData *fd, Main *main)
SEQ_BEGIN(sce->ed, seq) {
if(seq->ipo) seq->ipo= newlibadr_us(fd, sce->id.lib, seq->ipo);
if(seq->scene) seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
+ if(seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera);
if(seq->sound) {
seq->scene_sound = NULL;
if(seq->type == SEQ_HD_SOUND)
@@ -11572,6 +11573,7 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
SEQ_BEGIN(sce->ed, seq) {
if(seq->scene) expand_doit(fd, mainvar, seq->scene);
+ if(seq->scene_camera) expand_doit(fd, mainvar, seq->scene_camera);
if(seq->sound) expand_doit(fd, mainvar, seq->sound);
}
SEQ_END
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 13e2a9e6962..0d7239015c9 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -438,39 +438,46 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float
{
rctf rect;
char str[32 + FILE_MAXDIR+FILE_MAXFILE];
+ const char *name= seq->name+2;
- if(seq->name[2]) {
- sprintf(str, "%d | %s: %s", seq->len, give_seqname(seq), seq->name+2);
+ if(name[0]=='\0')
+ name= give_seqname(seq);
+
+ if(seq->type == SEQ_META) {
+ sprintf(str, "%d | %s", seq->len, name);
}
- else{
- if(seq->type == SEQ_META) {
- sprintf(str, "%d | %s", seq->len, give_seqname(seq));
- }
- else if(seq->type == SEQ_SCENE) {
- if(seq->scene) sprintf(str, "%d | %s: %s", seq->len, give_seqname(seq), seq->scene->id.name+2);
- else sprintf(str, "%d | %s", seq->len, give_seqname(seq));
-
- }
- else if(seq->type == SEQ_IMAGE) {
- sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name);
+ else if(seq->type == SEQ_SCENE) {
+ if(seq->scene) {
+ if(seq->scene_camera) {
+ sprintf(str, "%d | %s: %s (%s)", seq->len, name, seq->scene->id.name+2, ((ID *)seq->scene_camera)->name+2);
+ } else {
+ sprintf(str, "%d | %s: %s", seq->len, name, seq->scene->id.name+2);
+ }
}
- else if(seq->type & SEQ_EFFECT) {
- int can_float = (seq->type != SEQ_PLUGIN)
- || (seq->plugin && seq->plugin->version >= 4);
-
- if(seq->seq3!=seq->seq2 && seq->seq1!=seq->seq3)
- sprintf(str, "%d | %s: %d>%d (use %d)%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, can_float ? "" : " No float, upgrade plugin!");
- else if (seq->seq1 && seq->seq2)
- sprintf(str, "%d | %s: %d>%d%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, can_float ? "" : " No float, upgrade plugin!");
- else
- sprintf(str, "%d | %s", seq->len, give_seqname(seq));
- }
- else if (seq->type == SEQ_SOUND) {
- sprintf(str, "%d | %s", seq->len, seq->sound->name);
- }
- else if (seq->type == SEQ_MOVIE) {
- sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name);
+ else {
+ sprintf(str, "%d | %s", seq->len, name);
}
+
+ }
+ else if(seq->type == SEQ_IMAGE) {
+ sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name);
+ }
+ else if(seq->type & SEQ_EFFECT) {
+ int can_float = (seq->type != SEQ_PLUGIN)
+ || (seq->plugin && seq->plugin->version >= 4);
+
+ if(seq->seq3!=seq->seq2 && seq->seq1!=seq->seq3)
+ sprintf(str, "%d | %s: %d>%d (use %d)%s", seq->len, name, seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, can_float ? "" : " No float, upgrade plugin!");
+ else if (seq->seq1 && seq->seq2)
+ sprintf(str, "%d | %s: %d>%d%s", seq->len, name, seq->seq1->machine, seq->seq2->machine, can_float ? "" : " No float, upgrade plugin!");
+ else
+ sprintf(str, "%d | %s", seq->len, name);
+ }
+ else if (seq->type == SEQ_SOUND) {
+ sprintf(str, "%d | %s", seq->len, seq->sound->name);
+ }
+ else if (seq->type == SEQ_MOVIE) {
+ sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name);
}
if(seq->flag & SELECT){
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 14b121a4281..56d949e9d34 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -149,6 +149,8 @@ typedef struct Sequence {
struct Ipo *ipo; // xxx depreceated... old animation system
struct Scene *scene;
+ struct Object *scene_camera; /* override scene camera */
+
struct anim *anim;
float effect_fader;
float speed_fader;
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 14ccd79a28b..83295331d9a 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -920,7 +920,11 @@ static void rna_def_scene(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Scene", "Scene that this sequence uses");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
-
+
+ prop= RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera");
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "use_opengl", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_SCENE_OPENGL);