diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-11 08:10:57 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-11 08:10:57 +0300 |
commit | e0dd3fe5872ba37ff188e292b80b46fcf8df413c (patch) | |
tree | e19ba24ad589b30160a663e26a6ac00068c5a4f2 /source/blender/makesrna/intern/rna_ID.c | |
parent | 9d67c720d5328f1918cc01d86a326c0aca3e0d06 (diff) |
* Restored font selection functionality with open font and unlink font operators,
so you can change the font of 3D text objects.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index e931f08c3a3..ac354366c25 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -93,6 +93,18 @@ void rna_ID_name_set(PointerRNA *ptr, const char *value) test_idbutton(id->name+2); } +static int rna_ID_name_editable(PointerRNA *ptr) +{ + ID *id= (ID*)ptr->data; + + if (GS(id->name) == ID_VF) { + if (strcmp(id->name+2, "<builtin>")==0) + return 0; + } + + return 1; +} + short RNA_type_to_ID_code(StructRNA *type) { if(RNA_struct_is_a(type, &RNA_Action)) return ID_AC; @@ -365,6 +377,7 @@ static void rna_def_ID(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name."); RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set"); RNA_def_property_string_maxlength(prop, sizeof(((ID*)NULL)->name)-2); + RNA_def_property_editable_func(prop, "rna_ID_name_editable"); RNA_def_property_update(prop, NC_ID|NA_RENAME, NULL); RNA_def_struct_name_property(srna, prop); |