diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-26 16:26:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-26 16:26:11 +0400 |
commit | e17fd46c71e0401fefecf22fa8975fc5826d8fe9 (patch) | |
tree | 7c8afe24927c1dfdb5cf14a8deeb61691e1ec0c3 /source/blender/python/intern/bpy_props.c | |
parent | f48fb385ea8dc6b12e12a6ec46a0c0b55d2dfcc4 (diff) |
formatting edits only to use more consisted style
Diffstat (limited to 'source/blender/python/intern/bpy_props.c')
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 443 |
1 files changed, 222 insertions, 221 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index d1408015089..9984e7f2fe0 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -56,13 +56,13 @@ extern BPy_StructRNA *bpy_context_module; -static EnumPropertyItem property_flag_items[]= { +static EnumPropertyItem property_flag_items[] = { {PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""}, {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""}, {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""}, {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem property_flag_enum_items[]= { +static EnumPropertyItem property_flag_enum_items[] = { {PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""}, {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""}, {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""}, @@ -70,7 +70,7 @@ static EnumPropertyItem property_flag_enum_items[]= { {0, NULL, 0, NULL, NULL}}; /* subtypes */ -static EnumPropertyItem property_subtype_string_items[]= { +static EnumPropertyItem property_subtype_string_items[] = { {PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""}, {PROP_DIRPATH, "DIR_PATH", 0, "Directory Path", ""}, {PROP_FILENAME, "FILENAME", 0, "Filename", ""}, @@ -80,7 +80,7 @@ static EnumPropertyItem property_subtype_string_items[]= { {PROP_NONE, "NONE", 0, "None", ""}, {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem property_subtype_number_items[]= { +static EnumPropertyItem property_subtype_number_items[] = { {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned", ""}, {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""}, {PROP_FACTOR, "FACTOR", 0, "Factor", ""}, @@ -91,7 +91,7 @@ static EnumPropertyItem property_subtype_number_items[]= { {PROP_NONE, "NONE", 0, "None", ""}, {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem property_subtype_array_items[]= { +static EnumPropertyItem property_subtype_array_items[] = { {PROP_COLOR, "COLOR", 0, "Color", ""}, {PROP_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, {PROP_DIRECTION, "DIRECTION", 0, "Direction", ""}, @@ -109,29 +109,29 @@ static EnumPropertyItem property_subtype_array_items[]= { {0, NULL, 0, NULL, NULL}}; /* PyObject's */ -static PyObject *pymeth_BoolProperty= NULL; -static PyObject *pymeth_BoolVectorProperty= NULL; -static PyObject *pymeth_IntProperty= NULL; -static PyObject *pymeth_IntVectorProperty= NULL; -static PyObject *pymeth_FloatProperty= NULL; -static PyObject *pymeth_FloatVectorProperty= NULL; -static PyObject *pymeth_StringProperty= NULL; -static PyObject *pymeth_EnumProperty= NULL; -static PyObject *pymeth_PointerProperty= NULL; -static PyObject *pymeth_CollectionProperty= NULL; -static PyObject *pymeth_RemoveProperty= NULL; +static PyObject *pymeth_BoolProperty = NULL; +static PyObject *pymeth_BoolVectorProperty = NULL; +static PyObject *pymeth_IntProperty = NULL; +static PyObject *pymeth_IntVectorProperty = NULL; +static PyObject *pymeth_FloatProperty = NULL; +static PyObject *pymeth_FloatVectorProperty = NULL; +static PyObject *pymeth_StringProperty = NULL; +static PyObject *pymeth_EnumProperty = NULL; +static PyObject *pymeth_PointerProperty = NULL; +static PyObject *pymeth_CollectionProperty = NULL; +static PyObject *pymeth_RemoveProperty = NULL; static PyObject *pyrna_struct_as_instance(PointerRNA *ptr) { - PyObject *self= NULL; + PyObject *self = NULL; /* first get self */ /* operators can store their own instance for later use */ if (ptr->data) { - void **instance= RNA_struct_instance(ptr); + void **instance = RNA_struct_instance(ptr); if (instance) { if (*instance) { - self= *instance; + self = *instance; Py_INCREF(self); } } @@ -139,7 +139,7 @@ static PyObject *pyrna_struct_as_instance(PointerRNA *ptr) /* in most cases this will run */ if (self == NULL) { - self= pyrna_struct_CreatePyObject(ptr); + self = pyrna_struct_CreatePyObject(ptr); } return self; @@ -149,7 +149,7 @@ static PyObject *pyrna_struct_as_instance(PointerRNA *ptr) static void printf_func_error(PyObject *py_func) { /* since we return to C code we can't leave the error */ - PyCodeObject *f_code= (PyCodeObject *)PyFunction_GET_CODE(py_func); + PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(py_func); PyErr_Print(); PyErr_Clear(); @@ -166,12 +166,12 @@ static void printf_func_error(PyObject *py_func) * the default args for that operator instance */ static PyObject *bpy_prop_deferred_return(PyObject *func, PyObject *kw) { - PyObject *ret= PyTuple_New(2); + PyObject *ret = PyTuple_New(2); PyTuple_SET_ITEM(ret, 0, func); Py_INCREF(func); - if (kw==NULL) - kw= PyDict_New(); + if (kw == NULL) + kw = PyDict_New(); else Py_INCREF(kw); @@ -184,12 +184,12 @@ static PyObject *bpy_prop_deferred_return(PyObject *func, PyObject *kw) static void bpy_prop_update_cb(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop) { PyGILState_STATE gilstate; - PyObject **py_data= (PyObject **)RNA_property_py_data_get(prop); + PyObject **py_data = (PyObject **)RNA_property_py_data_get(prop); PyObject *py_func; PyObject *args; PyObject *self; PyObject *ret; - const int is_write_ok= pyrna_write_check(); + const int is_write_ok = pyrna_write_check(); BLI_assert(py_data != NULL); @@ -199,16 +199,16 @@ static void bpy_prop_update_cb(struct bContext *C, struct PointerRNA *ptr, struc bpy_context_set(C, &gilstate); - py_func= py_data[BPY_DATA_CB_SLOT_UPDATE]; + py_func = py_data[BPY_DATA_CB_SLOT_UPDATE]; - args= PyTuple_New(2); - self= pyrna_struct_as_instance(ptr); + args = PyTuple_New(2); + self = pyrna_struct_as_instance(ptr); PyTuple_SET_ITEM(args, 0, self); PyTuple_SET_ITEM(args, 1, (PyObject *)bpy_context_module); Py_INCREF(bpy_context_module); - ret= PyObject_CallObject(py_func, args); + ret = PyObject_CallObject(py_func, args); Py_DECREF(args); @@ -241,7 +241,7 @@ static int bpy_prop_callback_check(PyObject *py_func, int argcount) return -1; } else { - PyCodeObject *f_code= (PyCodeObject *)PyFunction_GET_CODE(py_func); + PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(py_func); if (f_code->co_argcount != argcount) { PyErr_Format(PyExc_TypeError, "update keyword: expected a function taking %d arguments, not %d", @@ -259,9 +259,9 @@ static int bpy_prop_callback_assign(struct PropertyRNA *prop, PyObject *update_c { /* assume this is already checked for type and arg length */ if (update_cb) { - PyObject **py_data= MEM_callocN(sizeof(PyObject *) * BPY_DATA_CB_SLOT_SIZE, __func__); + PyObject **py_data = MEM_callocN(sizeof(PyObject *) * BPY_DATA_CB_SLOT_SIZE, __func__); RNA_def_property_update_runtime(prop, (void *)bpy_prop_update_cb); - py_data[BPY_DATA_CB_SLOT_UPDATE]= update_cb; + py_data[BPY_DATA_CB_SLOT_UPDATE] = update_cb; RNA_def_py_data(prop, py_data); RNA_def_property_flag(prop, PROP_CONTEXT_PROPERTY_UPDATE); @@ -274,7 +274,7 @@ static int bpy_prop_callback_assign(struct PropertyRNA *prop, PyObject *update_c static int py_long_as_int(PyObject *py_long, int *r_int) { if (PyLong_CheckExact(py_long)) { - *r_int= (int)PyLong_AS_LONG(py_long); + *r_int = (int)PyLong_AS_LONG(py_long); return 0; } else { @@ -287,9 +287,9 @@ static int py_long_as_int(PyObject *py_long, int *r_int) #define BPY_PROPDEF_HEAD(_func) \ if (PyTuple_GET_SIZE(args) == 1) { \ PyObject *ret; \ - self= PyTuple_GET_ITEM(args, 0); \ - args= PyTuple_New(0); \ - ret= BPy_##_func(self, args, kw); \ + self = PyTuple_GET_ITEM(args, 0); \ + args = PyTuple_New(0); \ + ret = BPy_##_func(self, args, kw); \ Py_DECREF(args); \ return ret; \ } \ @@ -297,8 +297,8 @@ static int py_long_as_int(PyObject *py_long, int *r_int) PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \ return NULL; \ } \ - srna= srna_from_self(self, #_func"(...):"); \ - if (srna==NULL) { \ + srna = srna_from_self(self, #_func"(...):"); \ + if (srna == NULL) { \ if (PyErr_Occurred()) \ return NULL; \ return bpy_prop_deferred_return(pymeth_##_func, kw); \ @@ -310,7 +310,7 @@ static int py_long_as_int(PyObject *py_long, int *r_int) if (id_len >= MAX_IDPROP_NAME) { \ PyErr_Format(PyExc_TypeError, \ #_func"(): '%.200s' too long, max length is %d", \ - id, MAX_IDPROP_NAME-1); \ + id, MAX_IDPROP_NAME - 1); \ return NULL; \ } \ if (RNA_def_property_free_identifier(srna, id) == -1) { \ @@ -322,7 +322,7 @@ static int py_long_as_int(PyObject *py_long, int *r_int) if (pyopts && pyrna_set_to_enum_bitfield(_property_flag_items, \ pyopts, \ &opts, \ - #_func"(options={...}):")) \ + #_func"(options={ ...}):")) \ { \ return NULL; \ } \ @@ -331,7 +331,7 @@ static int py_long_as_int(PyObject *py_long, int *r_int) BPY_PROPDEF_CHECK(_func, _property_flag_items) \ if (pysubtype && RNA_enum_value_from_id(_subtype, \ pysubtype, \ - &subtype)==0) \ + &subtype) == 0) \ { \ PyErr_Format(PyExc_TypeError, \ #_func"(subtype='%s'): invalid subtype", \ @@ -393,17 +393,17 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(BoolProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", + static const char *kwlist[] = {"attr", "name", "description", "default", "options", "subtype", "update", NULL}; - const char *id=NULL, *name="", *description=""; + const char *id = NULL, *name = "", *description = ""; int id_len; - int def=0; + int def = 0; PropertyRNA *prop; - PyObject *pyopts= NULL; - int opts=0; - char *pysubtype= NULL; - int subtype= PROP_NONE; - PyObject *update_cb= NULL; + PyObject *pyopts = NULL; + int opts = 0; + char *pysubtype = NULL; + int subtype = PROP_NONE; + PyObject *update_cb = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#|ssiO!sO:BoolProperty", @@ -421,13 +421,13 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - prop= RNA_def_property(srna, id, PROP_BOOLEAN, subtype); + prop = RNA_def_property(srna, id, PROP_BOOLEAN, subtype); RNA_def_property_boolean_default(prop, def); RNA_def_property_ui_text(prop, name, description); if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } bpy_prop_callback_assign(prop, update_cb); @@ -461,19 +461,19 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_HEAD(BoolVectorProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", + static const char *kwlist[] = {"attr", "name", "description", "default", "options", "subtype", "size", "update", NULL}; - const char *id=NULL, *name="", *description=""; + const char *id = NULL, *name = "", *description = ""; int id_len; - int def[PYRNA_STACK_ARRAY]={0}; - int size=3; + int def[PYRNA_STACK_ARRAY] = {0}; + int size = 3; PropertyRNA *prop; - PyObject *pydef= NULL; - PyObject *pyopts= NULL; - int opts=0; - char *pysubtype= NULL; - int subtype= PROP_NONE; - PyObject *update_cb= NULL; + PyObject *pydef = NULL; + PyObject *pyopts = NULL; + int opts = 0; + char *pysubtype = NULL; + int subtype = PROP_NONE; + PyObject *update_cb = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#|ssOO!siO:BoolVectorProperty", @@ -501,15 +501,15 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject return NULL; } - // prop= RNA_def_boolean_array(srna, id, size, pydef ? def:NULL, name, description); - prop= RNA_def_property(srna, id, PROP_BOOLEAN, subtype); + // prop = RNA_def_boolean_array(srna, id, size, pydef ? def:NULL, name, description); + prop = RNA_def_property(srna, id, PROP_BOOLEAN, subtype); RNA_def_property_array(prop, size); if (pydef) RNA_def_property_boolean_array_default(prop, def); RNA_def_property_ui_text(prop, name, description); if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } bpy_prop_callback_assign(prop, update_cb); @@ -539,17 +539,17 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(IntProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", + static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "update", NULL}; - const char *id=NULL, *name="", *description=""; + const char *id = NULL, *name = "", *description = ""; int id_len; - int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def=0; + int min = INT_MIN, max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX, step = 1, def = 0; PropertyRNA *prop; - PyObject *pyopts= NULL; - int opts=0; - char *pysubtype= NULL; - int subtype= PROP_NONE; - PyObject *update_cb= NULL; + PyObject *pyopts = NULL; + int opts = 0; + char *pysubtype = NULL; + int subtype = PROP_NONE; + PyObject *update_cb = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#|ssiiiiiiO!sO:IntProperty", @@ -568,7 +568,7 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - prop= RNA_def_property(srna, id, PROP_INT, subtype); + prop = RNA_def_property(srna, id, PROP_INT, subtype); RNA_def_property_int_default(prop, def); RNA_def_property_range(prop, min, max); RNA_def_property_ui_text(prop, name, description); @@ -576,7 +576,7 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } bpy_prop_callback_assign(prop, update_cb); @@ -609,20 +609,21 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_HEAD(IntVectorProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", + static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "size", "update", NULL}; - const char *id=NULL, *name="", *description=""; + const char *id = NULL, *name = "", *description = ""; int id_len; - int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def[PYRNA_STACK_ARRAY]={0}; - int size=3; + int min = INT_MIN, max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX, step = 1; + int def[PYRNA_STACK_ARRAY] = {0}; + int size = 3; PropertyRNA *prop; - PyObject *pydef= NULL; - PyObject *pyopts= NULL; - int opts=0; - char *pysubtype= NULL; - int subtype= PROP_NONE; - PyObject *update_cb= NULL; + PyObject *pydef = NULL; + PyObject *pyopts = NULL; + int opts = 0; + char *pysubtype = NULL; + int subtype = PROP_NONE; + PyObject *update_cb = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#|ssOiiiiiO!siO:IntVectorProperty", @@ -652,7 +653,7 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject return NULL; } - prop= RNA_def_property(srna, id, PROP_INT, subtype); + prop = RNA_def_property(srna, id, PROP_INT, subtype); RNA_def_property_array(prop, size); if (pydef) RNA_def_property_int_array_default(prop, def); RNA_def_property_range(prop, min, max); @@ -661,7 +662,7 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } bpy_prop_callback_assign(prop, update_cb); @@ -692,21 +693,21 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(FloatProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", + static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "unit", "update", NULL}; - const char *id=NULL, *name="", *description=""; + const char *id = NULL, *name = "", *description = ""; int id_len; - float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def=0.0f; - int precision= 2; + float min = -FLT_MAX, max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3, def = 0.0f; + int precision = 2; PropertyRNA *prop; - PyObject *pyopts= NULL; - int opts=0; - char *pysubtype= NULL; - int subtype= PROP_NONE; - char *pyunit= NULL; - int unit= PROP_UNIT_NONE; - PyObject *update_cb= NULL; + PyObject *pyopts = NULL; + int opts = 0; + char *pysubtype = NULL; + int subtype = PROP_NONE; + char *pyunit = NULL; + int unit = PROP_UNIT_NONE; + PyObject *update_cb = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#|ssffffffiO!ssO:FloatProperty", @@ -722,7 +723,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_SUBTYPE_CHECK(FloatProperty, property_flag_items, property_subtype_number_items) - if (pyunit && RNA_enum_value_from_id(property_unit_items, pyunit, &unit)==0) { + if (pyunit && RNA_enum_value_from_id(property_unit_items, pyunit, &unit) == 0) { PyErr_Format(PyExc_TypeError, "FloatProperty(unit='%s'): invalid unit", pyunit); return NULL; } @@ -731,7 +732,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - prop= RNA_def_property(srna, id, PROP_FLOAT, subtype | unit); + prop = RNA_def_property(srna, id, PROP_FLOAT, subtype | unit); RNA_def_property_float_default(prop, def); RNA_def_property_range(prop, min, max); RNA_def_property_ui_text(prop, name, description); @@ -739,7 +740,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } bpy_prop_callback_assign(prop, update_cb); @@ -773,22 +774,22 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec BPY_PROPDEF_HEAD(FloatVectorProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", + static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "unit", "size", "update", NULL}; - const char *id=NULL, *name="", *description=""; + const char *id = NULL, *name = "", *description = ""; int id_len; - float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def[PYRNA_STACK_ARRAY]={0.0f}; - int precision= 2, size=3; + float min = -FLT_MAX, max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3, def[PYRNA_STACK_ARRAY] = {0.0f}; + int precision = 2, size = 3; PropertyRNA *prop; - PyObject *pydef= NULL; - PyObject *pyopts= NULL; - int opts=0; - char *pysubtype= NULL; - int subtype= PROP_NONE; - char *pyunit= NULL; - int unit= PROP_UNIT_NONE; - PyObject *update_cb= NULL; + PyObject *pydef = NULL; + PyObject *pyopts = NULL; + int opts = 0; + char *pysubtype = NULL; + int subtype = PROP_NONE; + char *pyunit = NULL; + int unit = PROP_UNIT_NONE; + PyObject *update_cb = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#|ssOfffffiO!ssiO:FloatVectorProperty", @@ -804,7 +805,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec BPY_PROPDEF_SUBTYPE_CHECK(FloatVectorProperty, property_flag_items, property_subtype_array_items) - if (pyunit && RNA_enum_value_from_id(property_unit_items, pyunit, &unit)==0) { + if (pyunit && RNA_enum_value_from_id(property_unit_items, pyunit, &unit) == 0) { PyErr_Format(PyExc_TypeError, "FloatVectorProperty(unit='%s'): invalid unit", pyunit); return NULL; } @@ -823,7 +824,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec return NULL; } - prop= RNA_def_property(srna, id, PROP_FLOAT, subtype | unit); + prop = RNA_def_property(srna, id, PROP_FLOAT, subtype | unit); RNA_def_property_array(prop, size); if (pydef) RNA_def_property_float_array_default(prop, def); RNA_def_property_range(prop, min, max); @@ -832,7 +833,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } bpy_prop_callback_assign(prop, update_cb); @@ -861,17 +862,17 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw BPY_PROPDEF_HEAD(StringProperty) if (srna) { - static const char *kwlist[]= {"attr", "name", "description", "default", + static const char *kwlist[] = {"attr", "name", "description", "default", "maxlen", "options", "subtype", "update", NULL}; - const char *id=NULL, *name="", *description="", *def=""; + const char *id = NULL, *name = "", *description = "", *def = ""; int id_len; - int maxlen=0; + int maxlen = 0; PropertyRNA *prop; - PyObject *pyopts= NULL; - int opts=0; - char *pysubtype= NULL; - int subtype= PROP_NONE; - PyObject *update_cb= NULL; + PyObject *pyopts = NULL; + int opts = 0; + char *pysubtype = NULL; + int subtype = PROP_NONE; + PyObject *update_cb = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#|sssiO!sO:StringProperty", @@ -889,14 +890,14 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw return NULL; } - prop= RNA_def_property(srna, id, PROP_STRING, subtype); + prop = RNA_def_property(srna, id, PROP_STRING, subtype); if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen + 1); /* +1 since it includes null terminator */ if (def) RNA_def_property_string_default(prop, def); RNA_def_property_ui_text(prop, name, description); if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } bpy_prop_callback_assign(prop, update_cb); @@ -909,11 +910,11 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw /* copies orig to buf, then sets orig to buf, returns copy length */ static size_t strswapbufcpy(char *buf, const char **orig) { - const char *src= *orig; - char *dst= buf; - size_t i= 0; - *orig= buf; - while ((*dst= *src)) { dst++; src++; i++; } + const char *src = *orig; + char *dst = buf; + size_t i = 0; + *orig = buf; + while ((*dst = *src)) { dst++; src++; i++; } return i + 1; /* include '\0' */ } #endif @@ -922,11 +923,11 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i { EnumPropertyItem *items; PyObject *item; - const Py_ssize_t seq_len= PySequence_Fast_GET_SIZE(seq_fast); - Py_ssize_t totbuf= 0; + const Py_ssize_t seq_len = PySequence_Fast_GET_SIZE(seq_fast); + Py_ssize_t totbuf = 0; int i; - short def_used= 0; - const char *def_cmp= NULL; + short def_used = 0; + const char *def_cmp = NULL; if (is_enum_flag) { if (seq_len > RNA_ENUM_BITFLAG_SIZE) { @@ -946,8 +947,8 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i } else { if (def) { - def_cmp= _PyUnicode_AsString(def); - if (def_cmp==NULL) { + def_cmp = _PyUnicode_AsString(def); + if (def_cmp == NULL) { PyErr_Format(PyExc_TypeError, "EnumProperty(...): default option must be a 'str' " "type when ENUM_FLAG is disabled, not a '%.200s'", @@ -958,30 +959,30 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i } /* blank value */ - *defvalue= 0; + *defvalue = 0; - items= MEM_callocN(sizeof(EnumPropertyItem) * (seq_len + 1), "enum_items_from_py1"); + items = MEM_callocN(sizeof(EnumPropertyItem) * (seq_len + 1), "enum_items_from_py1"); - for (i=0; i<seq_len; i++) { - EnumPropertyItem tmp= {0, "", 0, "", ""}; + for (i = 0; i < seq_len; i++) { + EnumPropertyItem tmp = {0, "", 0, "", ""}; Py_ssize_t item_size; Py_ssize_t id_str_size; Py_ssize_t name_str_size; Py_ssize_t desc_str_size; - item= PySequence_Fast_GET_ITEM(seq_fast, i); + item = PySequence_Fast_GET_ITEM(seq_fast, i); if ( (PyTuple_CheckExact(item)) && - (item_size= PyTuple_GET_SIZE(item)) && + (item_size = PyTuple_GET_SIZE(item)) && (item_size == 3 || item_size == 4) && - (tmp.identifier= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) && - (tmp.name= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) && - (tmp.description= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) && + (tmp.identifier = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) && + (tmp.name = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) && + (tmp.description = _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) && (item_size < 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value) != -1)) /* TODO, number isnt ensured to be unique from the script author */ { if (is_enum_flag) { if (item_size < 4) { - tmp.value= 1<<i; + tmp.value = 1 << i; } if (def && PySet_Contains(def, PyTuple_GET_ITEM(item, 0))) { @@ -991,16 +992,16 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i } else { if (item_size < 4) { - tmp.value= i; + tmp.value = i; } - if (def && def_used == 0 && strcmp(def_cmp, tmp.identifier)==0) { - *defvalue= tmp.value; + if (def && def_used == 0 && strcmp(def_cmp, tmp.identifier) == 0) { + *defvalue = tmp.value; def_used++; /* only ever 1 */ } } - items[i]= tmp; + items[i] = tmp; /* calculate combine string length */ totbuf += id_str_size + name_str_size + desc_str_size + 3; /* 3 is for '\0's */ @@ -1046,18 +1047,18 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i * immediately after use, so we need to duplicate them, ugh. * annoying because it works most of the time without this. */ { - EnumPropertyItem *items_dup= MEM_mallocN((sizeof(EnumPropertyItem) * (seq_len + 1)) + (sizeof(char) * totbuf), + EnumPropertyItem *items_dup = MEM_mallocN((sizeof(EnumPropertyItem) * (seq_len + 1)) + (sizeof(char) * totbuf), "enum_items_from_py2"); - EnumPropertyItem *items_ptr= items_dup; - char *buf= ((char *)items_dup) + (sizeof(EnumPropertyItem) * (seq_len + 1)); + EnumPropertyItem *items_ptr = items_dup; + char *buf = ((char *)items_dup) + (sizeof(EnumPropertyItem) * (seq_len + 1)); memcpy(items_dup, items, sizeof(EnumPropertyItem) * (seq_len + 1)); - for (i=0; i<seq_len; i++, items_ptr++) { + for (i = 0; i < seq_len; i++, items_ptr++) { buf += strswapbufcpy(buf, &items_ptr->identifier); buf += strswapbufcpy(buf, &items_ptr->name); buf += strswapbufcpy(buf, &items_ptr->description); } MEM_freeN(items); - items=items_dup; + items = items_dup; } /* end string duplication */ #endif @@ -1069,47 +1070,47 @@ static EnumPropertyItem *bpy_props_enum_itemf(struct bContext *C, PointerRNA *pt { PyGILState_STATE gilstate; - PyObject *py_func= RNA_property_enum_py_data_get(prop); - PyObject *self= NULL; + PyObject *py_func = RNA_property_enum_py_data_get(prop); + PyObject *self = NULL; PyObject *args; PyObject *items; /* returned from the function call */ - EnumPropertyItem *eitems= NULL; - int err= 0; + EnumPropertyItem *eitems = NULL; + int err = 0; bpy_context_set(C, &gilstate); - args= PyTuple_New(2); - self= pyrna_struct_as_instance(ptr); + args = PyTuple_New(2); + self = pyrna_struct_as_instance(ptr); PyTuple_SET_ITEM(args, 0, self); /* now get the context */ PyTuple_SET_ITEM(args, 1, (PyObject *)bpy_context_module); Py_INCREF(bpy_context_module); - items= PyObject_CallObject(py_func, args); + items = PyObject_CallObject(py_func, args); Py_DECREF(args); - if (items==NULL) { - err= -1; + if (items == NULL) { + err = -1; } else { PyObject *items_fast; - int defvalue_dummy=0; + int defvalue_dummy = 0; - if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): " + if (!(items_fast = PySequence_Fast(items, "EnumProperty(...): " "return value from the callback was not a sequence"))) { - err= -1; + err = -1; } else { - eitems= enum_items_from_py(items_fast, NULL, &defvalue_dummy, (RNA_property_flag(prop) & PROP_ENUM_FLAG)!=0); + eitems = enum_items_from_py(items_fast, NULL, &defvalue_dummy, (RNA_property_flag(prop) & PROP_ENUM_FLAG) != 0); Py_DECREF(items_fast); if (!eitems) { - err= -1; + err = -1; } } @@ -1117,12 +1118,12 @@ static EnumPropertyItem *bpy_props_enum_itemf(struct bContext *C, PointerRNA *pt } if (err != -1) { /* worked */ - *free= 1; + *free = 1; } else { printf_func_error(py_func); - eitems= DummyRNA_NULL_items; + eitems = DummyRNA_NULL_items; } @@ -1160,19 +1161,19 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(EnumProperty) if (srna) { - static const char *kwlist[]= {"attr", "items", "name", "description", "default", + static const char *kwlist[] = {"attr", "items", "name", "description", "default", "options", "update", NULL}; - const char *id=NULL, *name="", *description=""; - PyObject *def= NULL; + const char *id = NULL, *name = "", *description = ""; + PyObject *def = NULL; int id_len; - int defvalue=0; + int defvalue = 0; PyObject *items, *items_fast; EnumPropertyItem *eitems; PropertyRNA *prop; - PyObject *pyopts= NULL; - int opts=0; - short is_itemf= FALSE; - PyObject *update_cb= NULL; + PyObject *pyopts = NULL; + int opts = 0; + short is_itemf = FALSE; + PyObject *update_cb = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#O|ssOO!O:EnumProperty", @@ -1192,7 +1193,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) /* items can be a list or a callable */ if (PyFunction_Check(items)) { /* dont use PyCallable_Check because we need the function code for errors */ - PyCodeObject *f_code= (PyCodeObject *)PyFunction_GET_CODE(items); + PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(items); if (f_code->co_argcount != 2) { PyErr_Format(PyExc_ValueError, "EnumProperty(...): expected 'items' function to take 2 arguments, not %d", @@ -1207,17 +1208,17 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - is_itemf= TRUE; - eitems= DummyRNA_NULL_items; + is_itemf = TRUE; + eitems = DummyRNA_NULL_items; } else { - if (!(items_fast= PySequence_Fast(items, "EnumProperty(...): " + if (!(items_fast = PySequence_Fast(items, "EnumProperty(...): " "expected a sequence of tuples for the enum items or a function"))) { return NULL; } - eitems= enum_items_from_py(items_fast, def, &defvalue, (opts & PROP_ENUM_FLAG)!=0); + eitems = enum_items_from_py(items_fast, def, &defvalue, (opts & PROP_ENUM_FLAG) != 0); Py_DECREF(items_fast); @@ -1226,8 +1227,8 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) } } - if (opts & PROP_ENUM_FLAG) prop= RNA_def_enum_flag(srna, id, eitems, defvalue, name, description); - else prop= RNA_def_enum(srna, id, eitems, defvalue, name, description); + if (opts & PROP_ENUM_FLAG) prop = RNA_def_enum_flag(srna, id, eitems, defvalue, name, description); + else prop = RNA_def_enum(srna, id, eitems, defvalue, name, description); if (is_itemf) { RNA_def_enum_funcs(prop, bpy_props_enum_itemf); @@ -1240,7 +1241,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } bpy_prop_callback_assign(prop, update_cb); @@ -1257,11 +1258,11 @@ static StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix { StructRNA *srna; - srna= srna_from_self(value, ""); + srna = srna_from_self(value, ""); if (!srna) { if (PyErr_Occurred()) { - PyObject *msg= PyC_ExceptionBuffer(); - const char *msg_char= _PyUnicode_AsString(msg); + PyObject *msg = PyC_ExceptionBuffer(); + const char *msg_char = _PyUnicode_AsString(msg); PyErr_Format(PyExc_TypeError, "%.200s expected an RNA type derived from PropertyGroup, failed with: %s", error_prefix, msg_char); @@ -1305,15 +1306,15 @@ static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *k BPY_PROPDEF_HEAD(PointerProperty) if (srna) { - static const char *kwlist[]= {"attr", "type", "name", "description", "options", "update", NULL}; - const char *id=NULL, *name="", *description=""; + static const char *kwlist[] = {"attr", "type", "name", "description", "options", "update", NULL}; + const char *id = NULL, *name = "", *description = ""; int id_len; PropertyRNA *prop; StructRNA *ptype; - PyObject *type= Py_None; - PyObject *pyopts= NULL; - int opts=0; - PyObject *update_cb= NULL; + PyObject *type = Py_None; + PyObject *pyopts = NULL; + int opts = 0; + PyObject *update_cb = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#O|ssO!O:PointerProperty", @@ -1327,7 +1328,7 @@ static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *k BPY_PROPDEF_CHECK(PointerProperty, property_flag_items) - ptype= pointer_type_from_py(type, "PointerProperty(...):"); + ptype = pointer_type_from_py(type, "PointerProperty(...):"); if (!ptype) return NULL; @@ -1335,10 +1336,10 @@ static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *k return NULL; } - prop= RNA_def_pointer_runtime(srna, id, ptype, name, description); + prop = RNA_def_pointer_runtime(srna, id, ptype, name, description); if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } bpy_prop_callback_assign(prop, update_cb); @@ -1366,14 +1367,14 @@ static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_HEAD(CollectionProperty) if (srna) { - static const char *kwlist[]= {"attr", "type", "name", "description", "options", NULL}; - const char *id=NULL, *name="", *description=""; + static const char *kwlist[] = {"attr", "type", "name", "description", "options", NULL}; + const char *id = NULL, *name = "", *description = ""; int id_len; PropertyRNA *prop; StructRNA *ptype; - PyObject *type= Py_None; - PyObject *pyopts= NULL; - int opts=0; + PyObject *type = Py_None; + PyObject *pyopts = NULL; + int opts = 0; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#O|ssO!:CollectionProperty", @@ -1386,14 +1387,14 @@ static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject BPY_PROPDEF_CHECK(CollectionProperty, property_flag_items) - ptype= pointer_type_from_py(type, "CollectionProperty(...):"); + ptype = pointer_type_from_py(type, "CollectionProperty(...):"); if (!ptype) return NULL; - prop= RNA_def_collection_runtime(srna, id, ptype, name, description); + prop = RNA_def_collection_runtime(srna, id, ptype, name, description); if (pyopts) { if (opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); - if ((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + if ((opts & PROP_ANIMATABLE) == 0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); if (opts & PROP_SKIP_SAVE) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } RNA_def_property_duplicate_pointers(srna, prop); @@ -1415,9 +1416,9 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw if (PyTuple_GET_SIZE(args) == 1) { PyObject *ret; - self= PyTuple_GET_ITEM(args, 0); - args= PyTuple_New(0); - ret= BPy_RemoveProperty(self, args, kw); + self = PyTuple_GET_ITEM(args, 0); + args = PyTuple_New(0); + ret = BPy_RemoveProperty(self, args, kw); Py_DECREF(args); return ret; } @@ -1426,18 +1427,18 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw return NULL; } - srna= srna_from_self(self, "RemoveProperty(...):"); - if (srna==NULL && PyErr_Occurred()) { + srna = srna_from_self(self, "RemoveProperty(...):"); + if (srna == NULL && PyErr_Occurred()) { return NULL; /* self's type was compatible but error getting the srna */ } - else if (srna==NULL) { + else if (srna == NULL) { PyErr_SetString(PyExc_TypeError, "RemoveProperty(): struct rna not available for this type"); return NULL; } else { - static const char *kwlist[]= {"attr", NULL}; + static const char *kwlist[] = {"attr", NULL}; - char *id=NULL; + char *id = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s:RemoveProperty", @@ -1454,7 +1455,7 @@ static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw Py_RETURN_NONE; } -static struct PyMethodDef props_methods[]= { +static struct PyMethodDef props_methods[] = { {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, BPy_BoolProperty_doc}, {"BoolVectorProperty", (PyCFunction)BPy_BoolVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_BoolVectorProperty_doc}, {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, BPy_IntProperty_doc}, @@ -1470,7 +1471,7 @@ static struct PyMethodDef props_methods[]= { {NULL, NULL, 0, NULL} }; -static struct PyModuleDef props_module= { +static struct PyModuleDef props_module = { PyModuleDef_HEAD_INIT, "bpy.props", "This module defines properties to extend blenders internal data, the result of these functions" @@ -1485,7 +1486,7 @@ PyObject *BPY_rna_props(void) PyObject *submodule; PyObject *submodule_dict; - submodule= PyModule_Create(&props_module); + submodule = PyModule_Create(&props_module); PyDict_SetItemString(PyImport_GetModuleDict(), props_module.m_name, submodule); /* INCREF since its its assumed that all these functions return the @@ -1494,9 +1495,9 @@ PyObject *BPY_rna_props(void) Py_INCREF(submodule); /* api needs the PyObjects internally */ - submodule_dict= PyModule_GetDict(submodule); + submodule_dict = PyModule_GetDict(submodule); -#define ASSIGN_STATIC(_name) pymeth_##_name= PyDict_GetItemString(submodule_dict, #_name) +#define ASSIGN_STATIC(_name) pymeth_##_name = PyDict_GetItemString(submodule_dict, #_name) ASSIGN_STATIC(BoolProperty); ASSIGN_STATIC(BoolVectorProperty); |