diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-02 12:29:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-02 12:29:16 +0400 |
commit | d46da5a09d972926e6b4ab5d9fde49ffad16a48f (patch) | |
tree | 3b97cd8a4972247362b0d0ae6ae696d0055a4988 /source/blender/python/intern | |
parent | 211cd99cbc0d894c2e586bd08ae723bf18b3cdd3 (diff) |
mathutils support for color arithmetic, also some minor whitespace edits.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy.c | 12 | ||||
-rw-r--r-- | source/blender/python/intern/bpy.h | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app.h | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_driver.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 3 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_library.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.h | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.h | 16 |
10 files changed, 25 insertions, 22 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 450151ee870..cb11b53c83c 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -231,7 +231,7 @@ static PyObject *bpy_import_test(const char *modname) /***************************************************************************** * Description: Creates the bpy module and adds it to sys.modules for importing *****************************************************************************/ -void BPy_init_modules( void ) +void BPy_init_modules(void) { extern BPy_StructRNA *bpy_context_module; extern int bpy_lib_init(PyObject *); @@ -262,17 +262,17 @@ void BPy_init_modules( void ) /* run first, initializes rna types */ BPY_rna_init(); - PyModule_AddObject( mod, "types", BPY_rna_types() ); /* needs to be first so bpy_types can run */ + PyModule_AddObject(mod, "types", BPY_rna_types()); /* needs to be first so bpy_types can run */ PyModule_AddObject(mod, "StructMetaPropGroup", (PyObject *)&pyrna_struct_meta_idprop_Type); /* metaclass for idprop types, bpy_types.py needs access */ bpy_lib_init(mod); /* adds '_bpy._library_load', must be called before 'bpy_types' which uses it */ bpy_import_test("bpy_types"); - PyModule_AddObject( mod, "data", BPY_rna_module() ); /* imports bpy_types by running this */ + PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */ bpy_import_test("bpy_types"); - PyModule_AddObject( mod, "props", BPY_rna_props() ); - PyModule_AddObject( mod, "ops", BPY_operator_module() ); /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ - PyModule_AddObject( mod, "app", BPY_app_struct() ); + PyModule_AddObject(mod, "props", BPY_rna_props()); + PyModule_AddObject(mod, "ops", BPY_operator_module()); /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ + PyModule_AddObject(mod, "app", BPY_app_struct()); /* bpy context */ RNA_pointer_create(NULL, &RNA_Context, (void *)BPy_GetContext(), &ctx_ptr); diff --git a/source/blender/python/intern/bpy.h b/source/blender/python/intern/bpy.h index 0f298c1daf1..0ebc6bb2438 100644 --- a/source/blender/python/intern/bpy.h +++ b/source/blender/python/intern/bpy.h @@ -26,5 +26,5 @@ */ -void BPy_init_modules( void ); +void BPy_init_modules(void); extern PyObject *bpy_package_py; diff --git a/source/blender/python/intern/bpy_app.h b/source/blender/python/intern/bpy_app.h index d57e4688f46..fbc5696875a 100644 --- a/source/blender/python/intern/bpy_app.h +++ b/source/blender/python/intern/bpy_app.h @@ -29,6 +29,6 @@ #ifndef BPY_APP_H #define BPY_APP_H -PyObject *BPY_app_struct( void ); +PyObject *BPY_app_struct(void); #endif // BPY_APP_H diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index df31fab6bde..6f124d959cb 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -60,7 +60,7 @@ int bpy_pydriver_create_dict(void) else bpy_pydriver_Dict= d; - /* import some modules: builtins, bpy, math, (Blender.noise )*/ + /* import some modules: builtins, bpy, math, (Blender.noise)*/ PyDict_SetItemString(d, "__builtins__", PyEval_GetBuiltins()); mod= PyImport_ImportModule("math"); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index e6f4c5713a1..089c9b37788 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -171,6 +171,8 @@ void BPY_context_set(bContext *C) /* defined in AUD_C-API.cpp */ extern PyObject *AUD_initPython(void); +/* defined in gpu_python.c */ +extern PyObject *GPU_initPython(void); static struct _inittab bpy_internal_modules[]= { {(char *)"noise", BPyInit_noise}, @@ -179,6 +181,7 @@ static struct _inittab bpy_internal_modules[]= { {(char *)"bgl", BPyInit_bgl}, {(char *)"blf", BPyInit_blf}, {(char *)"aud", AUD_initPython}, + {(char *)"gpu", GPU_initPython}, {NULL, NULL} }; diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c index 10e97573447..85bffb5a8cc 100644 --- a/source/blender/python/intern/bpy_library.c +++ b/source/blender/python/intern/bpy_library.c @@ -213,7 +213,7 @@ static PyObject *_bpy_names(BPy_Library *self, int blocktype) int counter= 0; list= PyList_New(totnames); for(l= names; l; l= l->next) { - PyList_SET_ITEM(list, counter, PyUnicode_FromString((char * )l->link)); + PyList_SET_ITEM(list, counter, PyUnicode_FromString((char *)l->link)); counter++; } BLI_linklist_free(names, free); /* free linklist *and* each node's data */ diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 0ee9d7e5bd5..352f7408961 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -1156,7 +1156,7 @@ static struct PyModuleDef props_module= { NULL, NULL, NULL, NULL }; -PyObject *BPY_rna_props( void ) +PyObject *BPY_rna_props(void) { PyObject *submodule; PyObject *submodule_dict; diff --git a/source/blender/python/intern/bpy_props.h b/source/blender/python/intern/bpy_props.h index f306d6898d1..8b64d04e092 100644 --- a/source/blender/python/intern/bpy_props.h +++ b/source/blender/python/intern/bpy_props.h @@ -30,7 +30,7 @@ #ifndef BPY_PROPS_H #define BPY_PROPS_H -PyObject *BPY_rna_props( void ); +PyObject *BPY_rna_props(void); #define PYRNA_STACK_ARRAY 32 diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 72d391fed32..4fe13bc6818 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1200,7 +1200,7 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val) return ret; } -PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) +PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) { PyObject *ret; int type= RNA_property_type(prop); @@ -1334,7 +1334,7 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const cha return error_val; } -static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw); +static PyObject *pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw); static PyObject *pyrna_func_to_py(BPy_DummyPointerRNA *pyrna, FunctionRNA *func) { diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index ea8af61c9bf..dbb5fc2feb7 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -148,18 +148,18 @@ typedef struct { StructRNA *srna_from_self(PyObject *self, const char *error_prefix); StructRNA *pyrna_struct_as_srna(PyObject *self, int parent, const char *error_prefix); -void BPY_rna_init( void ); -PyObject *BPY_rna_module( void ); -void BPY_update_rna_module( void ); -/*PyObject *BPY_rna_doc( void );*/ -PyObject *BPY_rna_types( void ); +void BPY_rna_init(void); +PyObject *BPY_rna_module(void); +void BPY_update_rna_module(void); +/*PyObject *BPY_rna_doc(void);*/ +PyObject *BPY_rna_types(void); -PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ); -PyObject *pyrna_prop_CreatePyObject( PointerRNA *ptr, PropertyRNA *prop ); +PyObject *pyrna_struct_CreatePyObject(PointerRNA *ptr); +PyObject *pyrna_prop_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop); /* operators also need this to set args */ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const char *error_prefix); -PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop); +PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop); PyObject *pyrna_enum_bitfield_to_py(struct EnumPropertyItem *items, int value); int pyrna_set_to_enum_bitfield(EnumPropertyItem *items, PyObject *value, int *r_value, const char *error_prefix); |