forked from bartvdbraak/blender
== Sequencer ==
Made custom proxy files a lot more sensible to select (upgraded to filepath get/setters) Changed semantics, since custom files don't make much sense without custom directories...
This commit is contained in:
parent
a6b8ac5452
commit
978609aa44
@ -727,9 +727,12 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel):
|
|||||||
|
|
||||||
flow = layout.column_flow()
|
flow = layout.column_flow()
|
||||||
flow.prop(strip, "proxy_custom_directory")
|
flow.prop(strip, "proxy_custom_directory")
|
||||||
|
flow.prop(strip, "proxy_custom_file")
|
||||||
if strip.proxy: # TODO - need to add this somehow
|
if strip.proxy: # TODO - need to add this somehow
|
||||||
|
if strip.proxy_custom_directory and not strip.proxy_custom_file:
|
||||||
flow.prop(strip.proxy, "directory")
|
flow.prop(strip.proxy, "directory")
|
||||||
flow.prop(strip.proxy, "file")
|
if strip.proxy_custom_file:
|
||||||
|
flow.prop(strip.proxy, "filepath")
|
||||||
|
|
||||||
|
|
||||||
class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
|
class SEQUENCER_PT_view(SequencerButtonsPanel_Output):
|
||||||
|
@ -1231,7 +1231,8 @@ static int seq_proxy_get_fname(Scene *scene, Sequence * seq, int cfra, char * na
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) {
|
if ((seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)
|
||||||
|
|| (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)) {
|
||||||
strcpy(dir, seq->strip->proxy->dir);
|
strcpy(dir, seq->strip->proxy->dir);
|
||||||
} else {
|
} else {
|
||||||
if (seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE) {
|
if (seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE) {
|
||||||
|
@ -9646,6 +9646,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||||||
BLI_path_abs(str, G.sce);
|
BLI_path_abs(str, G.sce);
|
||||||
seq->sound = sound_new_file(main, str);
|
seq->sound = sound_new_file(main, str);
|
||||||
}
|
}
|
||||||
|
/* don't know, if anybody used that
|
||||||
|
this way, but just in case, upgrade
|
||||||
|
to new way... */
|
||||||
|
if((seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) &&
|
||||||
|
!(seq->flag & SEQ_USE_PROXY_CUSTOM_DIR))
|
||||||
|
{
|
||||||
|
|
||||||
|
snprintf(seq->strip->proxy->dir,
|
||||||
|
FILE_MAXDIR, "%s/BL_proxy",
|
||||||
|
seq->strip->dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -341,6 +341,35 @@ static int rna_Sequence_filepath_length(PointerRNA *ptr)
|
|||||||
return strlen(path)+1;
|
return strlen(path)+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
|
||||||
|
{
|
||||||
|
StripProxy *proxy= (StripProxy*)(ptr->data);
|
||||||
|
char dir[FILE_MAX], name[FILE_MAX];
|
||||||
|
|
||||||
|
BLI_split_dirfile(value, dir, name);
|
||||||
|
BLI_strncpy(proxy->dir, dir, sizeof(proxy->dir));
|
||||||
|
BLI_strncpy(proxy->file, name, sizeof(proxy->file));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
|
||||||
|
{
|
||||||
|
StripProxy *proxy= (StripProxy*)(ptr->data);
|
||||||
|
char path[FILE_MAX];
|
||||||
|
|
||||||
|
BLI_join_dirfile(path, proxy->dir, proxy->file);
|
||||||
|
BLI_strncpy(value, path, strlen(path)+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
|
||||||
|
{
|
||||||
|
StripProxy *proxy= (StripProxy*)(ptr->data);
|
||||||
|
char path[FILE_MAX];
|
||||||
|
|
||||||
|
BLI_join_dirfile(path, proxy->dir, proxy->file);
|
||||||
|
return strlen(path)+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
|
/*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
|
||||||
{
|
{
|
||||||
Sequence *seq= (Sequence*)(ptr->data);
|
Sequence *seq= (Sequence*)(ptr->data);
|
||||||
@ -468,12 +497,13 @@ static void rna_def_strip_proxy(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
|
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
|
||||||
RNA_def_property_string_sdna(prop, NULL, "dir");
|
RNA_def_property_string_sdna(prop, NULL, "dir");
|
||||||
RNA_def_property_ui_text(prop, "Directory", "Location to story the proxy file");
|
RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
|
||||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "file", PROP_STRING, PROP_DIRPATH);
|
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
|
||||||
RNA_def_property_string_sdna(prop, NULL, "file");
|
RNA_def_property_ui_text(prop, "Path", "Location of custom proxy file");
|
||||||
RNA_def_property_ui_text(prop, "File", "Proxy file name");
|
RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length", "rna_Sequence_proxy_filepath_set");
|
||||||
|
|
||||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,6 +874,11 @@ static void rna_def_proxy(StructRNA *srna)
|
|||||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_DIR);
|
||||||
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
|
RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Use a custom directory to store data");
|
||||||
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
|
||||||
|
prop= RNA_def_property(srna, "proxy_custom_file", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY_CUSTOM_FILE);
|
||||||
|
RNA_def_property_ui_text(prop, "Proxy Custom File", "Use a custom file to read proxy data from");
|
||||||
|
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_def_input(StructRNA *srna)
|
static void rna_def_input(StructRNA *srna)
|
||||||
|
Loading…
Reference in New Issue
Block a user