Change region drawing callbacks to work much closer to how blender manages them internally.
- yes, this does break scripts, but the api is marked experimental. ED_region_draw_cb_activate() adds a callback to a region type whereas the api made it look like the callback was being added to the region instance. Use a class method on bpy.types.Space to manage region drawing, eg. was: self._handle = context.region.callback_add(draw_callback_px, args, 'POST_PIXEL') is now: self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, args, 'WINDOW', 'POST_PIXEL')
This commit is contained in:
		@@ -28,5 +28,10 @@
 | 
			
		||||
struct BPy_StructRNA;
 | 
			
		||||
struct PyObject;
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args);
 | 
			
		||||
PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
PyObject *pyrna_callback_classmethod_add(PyObject *cls, PyObject *args);
 | 
			
		||||
PyObject *pyrna_callback_classmethod_remove(PyObject *cls, PyObject *args);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user