From 723e129252f82cc81faa8834a68c79e4439ee8fa Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 2 Nov 2011 20:56:52 +0000 Subject: Depsgraph/Python: callbacks and properties to detect datablock changes * Adds two new python handlers: scene_update_pre() and scene_update_post() These run before and after Blender does a scene update on making modifications to the scene. * Datablocks now have an is_updated property. This will be set to true in the above callbacks if the datablock was tagged to be updated. This works for the most common datablocks used for rendering: object, material, world, lamsp, texture, mesh, curve. * Datablock collections also have an is_updated property. If this is set, it means one datablock of this type was added, removed or modified. It's also useful as a quick check to avoid looping over all datablocks. * RenderEngine.view_update() can also check these properties, for interactive viewport rendering. http://wiki.blender.org/index.php/Dev:2.6/Source/Render/UpdateAPI --- source/blender/python/intern/bpy_app_handlers.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/python/intern/bpy_app_handlers.c') diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index 7008aeda074..e7f74569f1a 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -47,6 +47,8 @@ static PyStructSequence_Field app_cb_info_fields[]= { {(char *)"load_post", NULL}, {(char *)"save_pre", NULL}, {(char *)"save_post", NULL}, + {(char *)"scene_update_pre", NULL}, + {(char *)"scene_update_post", NULL}, {NULL} }; -- cgit v1.2.3