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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-11-09 18:49:08 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-11-09 18:51:09 +0300
commit6cb5340e013faac27bbb3dc944c9c6087fe63554 (patch)
tree3361bd712aac8757dd922435a2baa73e467842df /source/blender/makesrna/intern/rna_ID.c
parent3d0383d25932aab3091bf321b3a43e51329882fb (diff)
RNA ID: forbid editing names of non-GMain IDs.
We even had an assert about that in setter callback! That means that we do not allow editing names of evaluated IDs, nor non-data-block IDs (mainly root nodetrees and scene master collections).
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 20383d4dc23..b550b4043e3 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -169,7 +169,10 @@ static int rna_ID_name_editable(PointerRNA *ptr, const char **UNUSED(r_info))
if (GS(id->name) == ID_VF) {
VFont *vfont = (VFont *)id;
if (BKE_vfont_is_builtin(vfont))
- return false;
+ return 0;
+ }
+ else if (!BKE_id_is_in_global_main(id)) {
+ return 0;
}
return PROP_EDITABLE;