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>2012-06-07 22:24:36 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-07 22:24:36 +0400
commitbdf9e023466756b6a75722cfa05ce75150e5ad75 (patch)
treeb40653194b5a1b9f2fa8e31720df4b15bd6dc0f6 /source/blender/makesrna/intern/rna_sequencer_api.c
parent32530c28274c9c0de0707b39a6be9e4bafe7b257 (diff)
new sequence strip type for masks.
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_sequencer_api.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c
index bbc772770ea..e20435a07cd 100644
--- a/source/blender/makesrna/intern/rna_sequencer_api.c
+++ b/source/blender/makesrna/intern/rna_sequencer_api.c
@@ -45,6 +45,7 @@ extern EnumPropertyItem blend_mode_items[];
#include "DNA_image_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
+#include "DNA_mask_types.h"
#include "DNA_sound_types.h"
#include "BLI_path_util.h" /* BLI_split_dirfile */
@@ -52,6 +53,7 @@ extern EnumPropertyItem blend_mode_items[];
#include "BKE_image.h"
#include "BKE_library.h" /* id_us_plus */
#include "BKE_movieclip.h"
+#include "BKE_mask.h"
#include "BKE_report.h"
#include "BKE_sequencer.h"
@@ -116,6 +118,25 @@ static Sequence *rna_Sequences_new_clip(ID *id, Editing *ed, ReportList *reports
return seq;
}
+static Sequence *rna_Sequences_new_mask(ID *id, Editing *ed, ReportList *reports,
+ const char *name, Mask *mask, int channel,
+ int start_frame)
+{
+ Scene *scene = (Scene *)id;
+ Sequence *seq;
+
+ seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_TYPE_MASK, mask->id.name);
+ seq->mask = mask;
+ seq->len = BKE_mask_get_duration(mask);
+ id_us_plus((ID *)mask);
+
+ calc_sequence_disp(scene, seq);
+
+ WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene);
+
+ return seq;
+}
+
static Sequence *rna_Sequences_new_scene(ID *id, Editing *ed, ReportList *reports,
const char *name, Scene *sce_seq, int channel,
int start_frame)
@@ -451,6 +472,23 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop)
parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence");
RNA_def_function_return(func, parm);
+ func = RNA_def_function(srna, "new_mask", "rna_Sequences_new_mask");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID);
+ RNA_def_function_ui_description(func, "Add a new movie clip sequence");
+ parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the sequence");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to add");
+ RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
+ parm = RNA_def_int(func, "channel", 0, 0, MAXSEQ - 1, "Channel",
+ "The channel for the new sequence", 0, MAXSEQ - 1);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm = RNA_def_int(func, "start_frame", 0, -MAXFRAME, MAXFRAME, "",
+ "The start frame for the new sequence", -MAXFRAME, MAXFRAME);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return type */
+ parm = RNA_def_pointer(func, "sequence", "Sequence", "", "New Sequence");
+ RNA_def_function_return(func, parm);
+
func = RNA_def_function(srna, "new_scene", "rna_Sequences_new_scene");
RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID);
RNA_def_function_ui_description(func, "Add a new scene sequence");