diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-06 21:50:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-06 21:50:20 +0400 |
commit | 8cee3285460b82a5f64901a8610b07b63bd95701 (patch) | |
tree | 755e2eb20837a6a015168ddd5b6df77e64885137 /source/blender/makesrna/RNA_types.h | |
parent | 0c1298f9727a2de61dd0d28944f4af5873a65668 (diff) |
Support for update callbacks in python defined RNA properties as discussed last meeting.
This means script authors can perform actions using these callbacks rather then on drawing which puts blender in a readonly state.
Simple example:
import bpy
def up_func(self, context):
print("test")
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=up_func)
bpy.context.scene.testprop = 11
# prints -> test
Diffstat (limited to 'source/blender/makesrna/RNA_types.h')
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index b3f2ae01c99..090b87e9e39 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -190,6 +190,7 @@ typedef enum PropertyFlag { /* need context for update function */ PROP_CONTEXT_UPDATE = 1<<22, + PROP_CONTEXT_PROPERTY_UPDATE = (1<<22)|(1<<27), /* Use for arrays or for any data that should not have a referene kept * most common case is functions that return arrays where the array */ |