[Bf-blender-cvs] [df57ea7f3b9] master: Fix panel-type re-registration with parents
Campbell Barton
noreply at git.blender.org
Tue Jun 11 08:10:33 CEST 2019
Commit: df57ea7f3b9d750ab322692bf50828bd4c10371c
Author: Campbell Barton
Date: Tue Jun 11 16:01:19 2019 +1000
Branches: master
https://developer.blender.org/rBdf57ea7f3b9d750ab322692bf50828bd4c10371c
Fix panel-type re-registration with parents
The order of panel types changes when re-registering existing types.
Fixes an error exposed by T65393.
===================================================================
M source/blender/makesrna/intern/rna_ui.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 82315605ee5..1e5f1dc20ec 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -279,12 +279,24 @@ static StructRNA *rna_Panel_register(Main *bmain,
/* check if we have registered this panel type before, and remove it */
for (pt = art->paneltypes.first; pt; pt = pt->next) {
if (STREQ(pt->idname, dummypt.idname)) {
+ PanelType *pt_next = pt->next;
if (pt->ext.srna) {
rna_Panel_unregister(bmain, pt->ext.srna);
}
else {
BLI_freelinkN(&art->paneltypes, pt);
}
+
+ /* The order of panel types will be altered on re-registration. */
+ if (dummypt.parent_id[0] && (parent == NULL)) {
+ for (pt = pt_next; pt; pt = pt->next) {
+ if (STREQ(pt->idname, dummypt.parent_id)) {
+ parent = pt;
+ break;
+ }
+ }
+ }
+
break;
}
@@ -292,6 +304,7 @@ static StructRNA *rna_Panel_register(Main *bmain,
parent = pt;
}
}
+
if (!RNA_struct_available_or_report(reports, dummypt.idname)) {
return NULL;
}
More information about the Bf-blender-cvs
mailing list