Rework library_query foreach looper - add optional recursivity.
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 24 Mar 2016 11:28:41 +0000 (12:28 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 24 Mar 2016 15:10:39 +0000 (16:10 +0100)
commitc08924bf94f2dffaae7b3ef2fad3c49cb8043c89
treeee01dfd8f137667c39be7e3ed894236a64464751
parent60cf62ff4b08e310208dca9e35bd75131833e1aa
Rework library_query foreach looper - add optional recursivity.

This commit:
* Fixes bad handling of 'stop iteration' (by adding a status flag, so that we can actually
  stop in helper functions too, and jumping to a finalize label instead of raw return, to
  allow propper clean up).
* Adds optional recursion into 'ID tree' - callback can also decide to exclude current id_pp
  from recursion. Note that this implies 'readonly', modifying IDs while recursing is not
  something we want to support!
* Changes callback signature/expected behavior: return behavior is now handled through flags,
  and 'parent' ID of id_pp is also passed (since it may not always be root id anymore).

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1869
source/blender/blenkernel/BKE_library_query.h
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/library_query.c
source/blender/editors/object/object_relations.c
source/blender/python/intern/bpy_rna_id_collection.c
source/blender/windowmanager/intern/wm_operators.c