Depsgraph/Python: callbacks and properties to detect datablock changes
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 2 Nov 2011 20:56:52 +0000 (20:56 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 2 Nov 2011 20:56:52 +0000 (20:56 +0000)
commit723e129252f82cc81faa8834a68c79e4439ee8fa
tree9c1c1e2aa9265e33702007da68b28b3159766aac
parentac52c79cb19ac85e06651a7b9af2e54efcd45a97
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
14 files changed:
source/blender/blenkernel/BKE_depsgraph.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/scene.c
source/blender/blenlib/BLI_callbacks.h
source/blender/editors/object/object_add.c
source/blender/editors/object/object_edit.c
source/blender/makesdna/DNA_ID.h
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/python/intern/bpy_app_handlers.c
source/blender/windowmanager/intern/wm_event_system.c