Datablock ID Properties
authorAlexander Romanov <a.romanov@blend4web.com>
Thu, 13 Apr 2017 09:30:03 +0000 (12:30 +0300)
committerAlexander Romanov <a.romanov@blend4web.com>
Thu, 13 Apr 2017 09:33:05 +0000 (12:33 +0300)
commita7b3047cefcbfae4d8b13e15026497fd5ae92730
treef026cb425cc41436047359d5e418042e65affa4b
parentf90a243d9c0fc53081744f8685aa8fbaddc9810c
Datablock ID Properties

The absence of datablock properties "will certainly be resolved soon as the need for them is becoming obvious" said the [[http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.67/Python_Nodes|Python Nodes release notes]]. So this patch allows Python scripts to create ID Properties which reference datablocks.
This functionality is implemented for `PointerProperty` and now such properties can be created with Python.

In addition to the standard update callback, `PointerProperty` can have a `poll` callback (standard RNA) which is useful for search menus. For details see the test included in this patch.

Original author: @artfunkel

Alexander (Blend4Web Team)

Reviewers: brecht, artfunkel, mont29, campbellbarton

Reviewed By: mont29, campbellbarton

Subscribers: jta, sergey, campbellbarton, wisaac, poseidon4o, mont29, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov, fjuhec, sharlybg, cardboard, duarteframos, blueprintrandom, a.romanov, BYOB, disnel, aditiapratama, bliblubli, dfelinto, lukastoenne

Maniphest Tasks: T37754

Differential Revision: https://developer.blender.org/D113
29 files changed:
source/blender/blenkernel/BKE_idprop.h
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/BKE_library_query.h
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/library_query.c
source/blender/blenkernel/intern/library_remap.c
source/blender/blenkernel/intern/node.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/object/object_relations.c
source/blender/makesdna/DNA_ID.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_define.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/python/generic/idprop_py_api.c
source/blender/python/intern/bpy_props.c
source/blender/python/intern/bpy_props.h
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna.h
source/blender/windowmanager/intern/wm.c
tests/python/CMakeLists.txt
tests/python/bl_pyapi_idprop_datablock.py [new file with mode: 0644]