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:
authorCampbell Barton <ideasman42@gmail.com>2010-06-25 16:04:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-06-25 16:04:04 +0400
commit7b36b2ebbb5449cebd6264d707a43bcaf910b81c (patch)
treed1c12525e05fcd1c190cd5304c4db9067c7c4c96 /source/blender/editors/space_sequencer/sequencer_add.c
parent044a20821b290beef5b39a265a3527bc4ecf31fa (diff)
- duplicating a scene now duplicates its sequence strips too.
- bugfix for copying a scene with FFMPEG properties set (wasnt copying the ID properties, could crash blender) - relative path option for adding sequence strips and replaceing images.
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_add.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 2c7082ed3f6..1a56cb6d683 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -43,6 +43,7 @@
#include "DNA_scene_types.h"
+#include "DNA_userdef_types.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -313,6 +314,9 @@ static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent
return OPERATOR_CANCELLED;
}
+ if(!RNA_property_is_set(op->ptr, "relative_path"))
+ RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
+
sequencer_generic_invoke_xy__internal(C, op, event, 0);
return WM_operator_filesel(C, op, event);
//return sequencer_add_movie_strip_exec(C, op);
@@ -336,7 +340,7 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path
+ WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES);
RNA_def_boolean(ot->srna, "sound", TRUE, "Sound", "Load sound with the movie");
}
@@ -355,6 +359,9 @@ static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent
return OPERATOR_CANCELLED;
}
+ if(!RNA_property_is_set(op->ptr, "relative_path"))
+ RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
+
sequencer_generic_invoke_xy__internal(C, op, event, 0);
return WM_operator_filesel(C, op, event);
//return sequencer_add_sound_strip_exec(C, op);
@@ -378,7 +385,7 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path
+ WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES);
RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory.");
}
@@ -446,6 +453,9 @@ static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent
return OPERATOR_CANCELLED;
}
+ if(!RNA_property_is_set(op->ptr, "relative_path"))
+ RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
+
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME);
return WM_operator_filesel(C, op, event);
//return sequencer_add_image_strip_exec(C, op);
@@ -469,7 +479,7 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path
+ WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME|SEQPROP_FILES);
}
@@ -593,6 +603,10 @@ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEven
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_ENDFRAME);
if (RNA_property_is_set(op->ptr, "type") && RNA_enum_get(op->ptr, "type")==SEQ_PLUGIN) {
+
+ if(!RNA_property_is_set(op->ptr, "relative_path"))
+ RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
+
/* only plugins need the file selector */
return WM_operator_filesel(C, op, event);
}
@@ -617,7 +631,7 @@ void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path
+ WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME);
RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type");
RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", "Initialize the strip with this color (only used when type='COLOR')", 0.0f, 1.0f);