From 35c2267aee84d086c00574496b52e9c0641e320d Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Thu, 20 Dec 2012 09:33:12 +0000 Subject: Support for actual class methods in the RNA/bpy. Previously all functions with FUNC_NO_SELF were treated as static methods, which is not sufficient for getting actual type information if the function can not be generated in advance in makesrna. Now the FUNC_USE_SELF_TYPE flag can be set in addition to FUNC_NO_SELF (if FUNC_NO_SELF is not set, FUNC_USE_SELF_TYPE has no effect). Such functions will be interpreted as class methods and must take a StructRNA pointer argument. This pointer is the same as the type member in PointerRNA, but can be passed without an actual data/id instance. --- source/blender/makesrna/RNA_types.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/makesrna/RNA_types.h') diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 87504dc6eb7..dacb2fee212 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -309,9 +309,10 @@ typedef struct ParameterDynAlloc { typedef enum FunctionFlag { FUNC_NO_SELF = 1, /* for static functions */ - FUNC_USE_MAIN = 2, - FUNC_USE_CONTEXT = 4, - FUNC_USE_REPORTS = 8, + FUNC_USE_SELF_TYPE = 2, /* for class methods, only used when FUNC_NO_SELF is set */ + FUNC_USE_MAIN = 4, + FUNC_USE_CONTEXT = 8, + FUNC_USE_REPORTS = 16, FUNC_USE_SELF_ID = 2048, FUNC_ALLOW_WRITE = 4096, -- cgit v1.2.3