[Bf-blender-cvs] [51e743c7fa0] master: Fix T62199: Incorrect bpy.data.screens behavior

Campbell Barton noreply at git.blender.org
Tue Mar 5 03:00:38 CET 2019


Commit: 51e743c7fa0f0bddac45066bc162b5ca99586031
Author: Campbell Barton
Date:   Tue Mar 5 12:51:05 2019 +1100
Branches: master
https://developer.blender.org/rB51e743c7fa0f0bddac45066bc162b5ca99586031

Fix T62199: Incorrect bpy.data.screens behavior

The screen identifier was set to the "layout_name" which isn't
guaranteed to be unique or even exist.

This meant `bpy.data.screens.keys()` could have duplicate keys,
even when not duplicated, these keys couldn't be used for
`bpy.data.screen[key]` access because internally ID's use names for
collection look-ups.

Make screens match other ID's, using the ID.name as the identifier.

Note: this change was from the initial workspace commit 7f564d74f9edaaa
Since then the layout selector has been removed so this isn't needed.

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

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

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

diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 0f40c6adb51..095aab53c10 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -524,7 +524,6 @@ static void rna_def_screen(BlenderRNA *brna)
 	RNA_def_property_string_funcs(prop, "rna_Screen_layout_name_get", "rna_Screen_layout_name_length",
 	                              "rna_Screen_layout_name_set");
 	RNA_def_property_ui_text(prop, "Layout Name", "The name of the layout that refers to the screen");
-	RNA_def_struct_name_property(srna, prop);
 
 	/* collections */
 	prop = RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE);



More information about the Bf-blender-cvs mailing list