Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-06-06 21:50:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-06 21:50:20 +0400
commit8cee3285460b82a5f64901a8610b07b63bd95701 (patch)
tree755e2eb20837a6a015168ddd5b6df77e64885137 /source/blender/makesrna/intern/rna_internal_types.h
parent0c1298f9727a2de61dd0d28944f4af5873a65668 (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/intern/rna_internal_types.h')
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 771d2afcd96..6ff7bc20b05 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -62,6 +62,7 @@ struct Scene;
/* Function Callbacks */
typedef void (*UpdateFunc)(struct Main *main, struct Scene *scene, struct PointerRNA *ptr);
+typedef void (*ContextPropUpdateFunc)(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop);
typedef void (*ContextUpdateFunc)(struct bContext *C, struct PointerRNA *ptr);
typedef int (*EditableFunc)(struct PointerRNA *ptr);
typedef int (*ItemEditableFunc)(struct PointerRNA *ptr, int index);
@@ -177,6 +178,9 @@ struct PropertyRNA {
* any property can have this but should only be used for collections and arrays
* since python will convert int/bool/pointer's */
struct StructRNA *srna; /* attributes attached directly to this collection */
+
+ /* python handle to hold all callbacks in a tuple */
+ void *py_data;
};
/* Property Types */