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).
This commit is contained in:
Bastien Montagne 2018-11-09 16:49:08 +01:00
parent 3d0383d259
commit 6cb5340e01
1 changed files with 4 additions and 1 deletions

View File

@ -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;