[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23394] trunk/blender/source/blender: Fix #19418: file browse button for strip filename did not work,
Brecht Van Lommel
brecht at blender.org
Mon Sep 21 15:23:49 CEST 2009
Revision: 23394
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23394
Author: blendix
Date: 2009-09-21 15:23:47 +0200 (Mon, 21 Sep 2009)
Log Message:
-----------
Fix #19418: file browse button for strip filename did not work,
sequence RNA now also splits up directory and filename automatic.
Modified Paths:
--------------
trunk/blender/source/blender/editors/interface/interface_layout.c
trunk/blender/source/blender/makesrna/intern/rna_sequence.c
Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_layout.c 2009-09-21 12:29:53 UTC (rev 23393)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c 2009-09-21 13:23:47 UTC (rev 23394)
@@ -533,7 +533,7 @@
prevbut= but->prev;
/* find the button before the active one */
- if((but->flag & UI_BUT_LAST_ACTIVE) && prevbut && prevbut->rnapoin.id.data) {
+ if((but->flag & UI_BUT_LAST_ACTIVE) && prevbut && prevbut->rnapoin.data) {
if(RNA_property_type(prevbut->rnaprop) == PROP_STRING) {
*ptr= prevbut->rnapoin;
*prop= prevbut->rnaprop;
Modified: trunk/blender/source/blender/makesrna/intern/rna_sequence.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sequence.c 2009-09-21 12:29:53 UTC (rev 23393)
+++ trunk/blender/source/blender/makesrna/intern/rna_sequence.c 2009-09-21 13:23:47 UTC (rev 23394)
@@ -239,6 +239,35 @@
return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
}
+static void rna_MovieSequence_filename_set(PointerRNA *ptr, const char *value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+ char dir[FILE_MAX], name[FILE_MAX];
+
+ BLI_split_dirfile_basic(value, dir, name);
+ BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
+ BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
+}
+
+static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value)
+{
+ Sequence *seq= (Sequence*)(ptr->data);
+ char dir[FILE_MAX], name[FILE_MAX];
+
+ BLI_split_dirfile_basic(value, dir, name);
+ BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
+ BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));
+}
+
+static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value)
+{
+ StripElem *elem= (StripElem*)(ptr->data);
+ char name[FILE_MAX];
+
+ BLI_split_dirfile_basic(value, NULL, name);
+ BLI_strncpy(elem->name, name, sizeof(elem->name));
+}
+
#else
static void rna_def_strip_element(BlenderRNA *brna)
@@ -253,6 +282,7 @@
prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Filename", "");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set");
}
static void rna_def_strip_crop(BlenderRNA *brna)
@@ -736,6 +766,7 @@
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");
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
@@ -762,6 +793,7 @@
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");
prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "strip->dir");
More information about the Bf-blender-cvs
mailing list