[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49530] trunk/blender/source/blender/ makesrna/intern/rna_vfont.c: font filepath wasn't editable from python.

Campbell Barton ideasman42 at gmail.com
Fri Aug 3 15:03:53 CEST 2012


Revision: 49530
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49530
Author:   campbellbarton
Date:     2012-08-03 13:03:53 +0000 (Fri, 03 Aug 2012)
Log Message:
-----------
font filepath wasn't editable from python.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_vfont.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_vfont.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_vfont.c	2012-08-03 11:39:34 UTC (rev 49529)
+++ trunk/blender/source/blender/makesrna/intern/rna_vfont.c	2012-08-03 13:03:53 UTC (rev 49530)
@@ -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 @@
 	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 @@
 }
 
 #endif
-




More information about the Bf-blender-cvs mailing list