mathutils support for color arithmetic, also some minor whitespace edits.
This commit is contained in:
@@ -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);
|
||||
|
@@ -26,5 +26,5 @@
|
||||
*/
|
||||
|
||||
|
||||
void BPy_init_modules( void );
|
||||
void BPy_init_modules(void);
|
||||
extern PyObject *bpy_package_py;
|
||||
|
@@ -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
|
||||
|
@@ -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");
|
||||
|
@@ -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}
|
||||
};
|
||||
|
||||
|
@@ -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 */
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user