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-08-03 17:03:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-03 17:03:53 +0400
commitca9f6870f626bbc3477a4dc1303ff471a693c213 (patch)
treed309a1e078836504ab976baf422a41ab5776f2ad /source/blender/makesrna/intern/rna_vfont.c
parent6374e3b49d6b0d3938b119cdc9f95811f4712578 (diff)
font filepath wasn't editable from python.
Diffstat (limited to 'source/blender/makesrna/intern/rna_vfont.c')
-rw-r--r--source/blender/makesrna/intern/rna_vfont.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_vfont.c b/source/blender/makesrna/intern/rna_vfont.c
index aca25252d2e..ad9c91b3623 100644
--- a/source/blender/makesrna/intern/rna_vfont.c
+++ b/source/blender/makesrna/intern/rna_vfont.c
@@ -24,7 +24,6 @@
* \ingroup RNA
*/
-
#include <stdlib.h>
#include "RNA_define.h"
@@ -35,6 +34,17 @@
#ifdef RNA_RUNTIME
+/* matching fnction in rna_ID.c */
+static int rna_VectorFont_filepath_editable(PointerRNA *ptr)
+{
+ VFont *vf = (VFont *)ptr->data;
+ if (strcmp(vf->name, FO_BUILTIN_NAME) == 0) {
+ return 0;
+ }
+
+ return 1;
+}
+
#else
void RNA_def_vfont(BlenderRNA *brna)
@@ -48,8 +58,8 @@ void RNA_def_vfont(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_FILE_FONT);
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_string_sdna(prop, NULL, "name");
+ RNA_def_property_editable_func(prop, "rna_VectorFont_filepath_editable");
RNA_def_property_ui_text(prop, "File Path", "");
prop = RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
@@ -58,4 +68,3 @@ void RNA_def_vfont(BlenderRNA *brna)
}
#endif
-