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:
authorAndrea Weikert <elubie@gmx.net>2010-02-28 14:17:55 +0300
committerAndrea Weikert <elubie@gmx.net>2010-02-28 14:17:55 +0300
commitf9d24eab559b2252c8840498b5bdc66170375f29 (patch)
tree1249e75b4b6010b19c44d2a4ba5f919ea86ca5ba /source/blender/makesrna/intern/rna_sequencer.c
parent1a2ceea38155091bdd9bf8cb6f25cfeef54c3c89 (diff)
Partial Fix: [#21085] Sequencer file selector for movies is strange
* joined filename and directory to single rna entry for movie and sound sequence * PROP_FILENAME was missing in makesrna * made seq->strip->data->name PROP_FILENAME rather than PROP_FILEPATH for the complete path * also made seq->strip->data->name read only Missing still: update of sequence length, start end frame etc..
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer.c')
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c49
1 files changed, 29 insertions, 20 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 17dbbbf9d05..771751277c8 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -303,7 +303,7 @@ static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *
return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
}
-static void rna_MovieSequence_filename_set(PointerRNA *ptr, const char *value)
+static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
{
Sequence *seq= (Sequence*)(ptr->data);
char dir[FILE_MAX], name[FILE_MAX];
@@ -313,6 +313,24 @@ static void rna_MovieSequence_filename_set(PointerRNA *ptr, const char *value)
BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
}
+static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+ char path[FILE_MAX];
+
+ BLI_join_dirfile(path, seq->strip->dir, seq->strip->stripdata->name);
+ BLI_strncpy(value, path, strlen(path)+1);
+}
+
+static int rna_Sequence_filepath_length(PointerRNA *ptr)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+ char path[FILE_MAX];
+
+ BLI_join_dirfile(path, seq->strip->dir, seq->strip->stripdata->name);
+ return strlen(path)+1;
+}
+
static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
{
Sequence *seq= (Sequence*)(ptr->data);
@@ -369,8 +387,9 @@ static void rna_def_strip_element(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame");
RNA_def_struct_sdna(srna, "StripElem");
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filename", "");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
@@ -911,15 +930,10 @@ static void rna_def_movie(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
- RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
- RNA_def_property_ui_text(prop, "Filename", "");
- RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MovieSequence_filename_set");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
-
- prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
- RNA_def_property_string_sdna(prop, NULL, "strip->dir");
- RNA_def_property_ui_text(prop, "Directory", "");
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_ui_text(prop, "File", "");
+ RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
+ "rna_Sequence_filepath_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
rna_def_filter_video(srna);
@@ -947,15 +961,10 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
- RNA_def_property_string_sdna(prop, NULL, "strip->stripdata->name");
- RNA_def_property_ui_text(prop, "Filename", "");
- RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoundSequence_filename_set");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
-
- prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
- RNA_def_property_string_sdna(prop, NULL, "strip->dir");
- RNA_def_property_ui_text(prop, "Directory", "");
+ prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_ui_text(prop, "File", "");
+ RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
+ "rna_Sequence_filepath_set");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
rna_def_input(srna);