From ca9f6870f626bbc3477a4dc1303ff471a693c213 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Aug 2012 13:03:53 +0000 Subject: font filepath wasn't editable from python. --- source/blender/makesrna/intern/rna_vfont.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source/blender/makesrna/intern/rna_vfont.c') 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 #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 - -- cgit v1.2.3