[Bf-blender-cvs] [d4c06d6505f] custom-manipulators: PyAPI: postpone initializing widget-group

Campbell Barton noreply at git.blender.org
Mon Jun 5 15:34:23 CEST 2017


Commit: d4c06d6505fe2cfeb3851fcff1dd5b076792678f
Author: Campbell Barton
Date:   Mon Jun 5 22:59:43 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBd4c06d6505fe2cfeb3851fcff1dd5b076792678f

PyAPI: postpone initializing widget-group

Py callbacks don't work when class is in middle of registration.

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

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

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

diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index c59dd72b27d..4becec87882 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -1711,7 +1711,6 @@ static StructRNA *rna_WidgetGroup_register(
 	{
 		wmManipulatorGroupType *wgrouptype = WM_manipulatorgrouptype_find(wmaptype, dummywgt.idname);
 		if (wgrouptype && wgrouptype->ext.srna) {
-			printf("Unregister!\n");
 			WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
 			WM_manipulatorgrouptype_unregister(NULL, bmain, wgrouptype);
 		}
@@ -1730,7 +1729,9 @@ static StructRNA *rna_WidgetGroup_register(
 	dummywgt.keymap_init = (have_function[1]) ? widgetgroup_keymap_init : NULL;
 	dummywgt.init = (have_function[2]) ? widgetgroup_draw : NULL;
 
-	WM_manipulatorgrouptype_append_ptr_runtime(bmain, wmaptype, widgetgroup_wrapper, (void *)&dummywgt);
+	WM_manipulatorgrouptype_append_ptr(wmaptype, widgetgroup_wrapper, (void *)&dummywgt);
+
+	/* TODO: WM_manipulatorgrouptype_init_runtime */
 
 	RNA_def_struct_duplicate_pointers(dummywgt.ext.srna);




More information about the Bf-blender-cvs mailing list