diff options
author | Joseph Eagar <joeedh@gmail.com> | 2006-11-17 10:50:24 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2006-11-17 10:50:24 +0300 |
commit | 80f7ea96c83d8ae442b961906dc838ec03f06f00 (patch) | |
tree | d96650d534f3a30385507319d4600ebdb442582d /source/blender/python/api2_2x/Blender.c | |
parent | 885d40c30dee999d94f9472e493f6a240df94e8c (diff) |
=ID Properties Small Python Update=
This commit adds a new constant dict to the top Blender module
called PropertyTypes. This dict represents all the ID Property
constants: STRING, INT, FLOAT, ARRAY and GROUP.
Further python work, including epydocs, are forthcoming.
Diffstat (limited to 'source/blender/python/api2_2x/Blender.c')
-rw-r--r-- | source/blender/python/api2_2x/Blender.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c index 41c41e787bb..8bd0f08469d 100644 --- a/source/blender/python/api2_2x/Blender.c +++ b/source/blender/python/api2_2x/Blender.c @@ -910,7 +910,7 @@ static PyObject *Blender_UnpackModesDict( void ) void M_Blender_Init(void) { PyObject *module; - PyObject *dict, *smode, *SpaceHandlers, *UnpackModes; + PyObject *dict, *smode, *SpaceHandlers, *UnpackModes, *PropertyTypes; /* G.scene should only aver be NULL if blender is executed in background mode, not loading a blend file and executing a python script eg. @@ -943,6 +943,18 @@ void M_Blender_Init(void) PyModule_AddObject(module, "SpaceHandlers", SpaceHandlers); } + PropertyTypes = PyConstant_New(); + if (PropertyTypes) { + BPy_constant *d = (BPy_constant*)PropertyTypes; + PyConstant_Insert(d,"STRING",PyInt_FromLong(IDP_STRING)); + PyConstant_Insert(d,"INT",PyInt_FromLong(IDP_INT)); + PyConstant_Insert(d,"FLOAT",PyInt_FromLong(IDP_FLOAT)); + PyConstant_Insert(d,"ARRAY",PyInt_FromLong(IDP_ARRAY)); + PyConstant_Insert(d,"GROUP",PyInt_FromLong(IDP_GROUP)); + + PyModule_AddObject(module, "PropertyTypes", PropertyTypes); + } + if (G.background) smode = PyString_FromString("background"); else |