[Bf-blender-cvs] [6cb5340e013] blender2.8: RNA ID: forbid editing names of non-GMain IDs.

Bastien Montagne noreply at git.blender.org
Fri Nov 9 16:51:17 CET 2018


Commit: 6cb5340e013faac27bbb3dc944c9c6087fe63554
Author: Bastien Montagne
Date:   Fri Nov 9 16:49:08 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB6cb5340e013faac27bbb3dc944c9c6087fe63554

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).

===================================================================

M	source/blender/makesrna/intern/rna_ID.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list