diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index d6a9d950015..13e13fbc3ff 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1002,7 +1002,7 @@ static float dtar_get_prop_val (ChannelDriver *driver, DriverTarget *dtar) /* get property to read from, and get value as appropriate */ if (RNA_path_resolve_full(&id_ptr, dtar->rna_path, &ptr, &prop, &index)) { - if(RNA_property_array_check(&ptr, prop)) { + if(RNA_property_array_check(prop)) { /* array */ if (index < RNA_property_array_length(&ptr, prop)) { switch (RNA_property_type(prop)) { diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 13469e0b58b..5f1a6c911bc 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3243,7 +3243,7 @@ static int node_animation_properties(bNodeTree *ntree, bNode *node) int driven, len=1, index; prop = (PropertyRNA *)link; - if (RNA_property_array_check(&ptr, prop)) + if (RNA_property_array_check(prop)) len = RNA_property_array_length(&ptr, prop); for (index=0; indexrna_path, &ptr, &prop)) { - if (RNA_property_array_check(&ptr, prop)) { + if (RNA_property_array_check(prop)) { /* array */ if (fcu->array_index < RNA_property_array_length(&ptr, prop)) { found= TRUE; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index a8e0ca39c58..e6df6a07d52 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -976,7 +976,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index /* retrieve info */ type= RNA_property_type(prop); - is_array= RNA_property_array_check(ptr, prop); + is_array= RNA_property_array_check(prop); len= (is_array) ? RNA_property_array_length(ptr, prop) : 0; /* set name and icon */ diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index f660dbb9edd..a3f56192cb5 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -143,7 +143,7 @@ int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr, int (*check_prop)(Proper if(label_align != '\0') { PropertyType type = RNA_property_type(prop); - int is_boolean = (type == PROP_BOOLEAN && !RNA_property_array_check(ptr, prop)); + int is_boolean = (type == PROP_BOOLEAN && !RNA_property_array_check(prop)); name= RNA_property_ui_name(prop); diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 0033a1ff437..81deb0c2796 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -654,7 +654,7 @@ int RNA_property_flag(PropertyRNA *prop); void *RNA_property_py_data_get(PropertyRNA *prop); int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_array_check(PointerRNA *ptr, PropertyRNA *prop); +int RNA_property_array_check(PropertyRNA *prop); int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dimension); int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[]); char RNA_property_array_item_char(PropertyRNA *prop, int index); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index f1056c86a4c..f100ebd6129 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -288,7 +288,7 @@ static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop) } } -static int rna_ensure_property_array_check(PointerRNA *UNUSED(ptr), PropertyRNA *prop) +static int rna_ensure_property_array_check(PropertyRNA *prop) { if(prop->magic == RNA_MAGIC) { return (prop->getlength || prop->totarraylength) ? 1:0; @@ -765,9 +765,9 @@ int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop) return rna_ensure_property_array_length(ptr, prop); } -int RNA_property_array_check(PointerRNA *ptr, PropertyRNA *prop) +int RNA_property_array_check(PropertyRNA *prop) { - return rna_ensure_property_array_check(ptr, prop); + return rna_ensure_property_array_check(prop); } /* used by BPY to make an array from the python object */ @@ -1399,6 +1399,7 @@ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) == 0); if((idprop=rna_idproperty_check(&prop, ptr))) return IDP_Int(idprop); @@ -1414,6 +1415,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) == 0); /* just incase other values are passed */ if(value) value= 1; @@ -1440,6 +1442,7 @@ void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *val IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -1463,6 +1466,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); @@ -1486,6 +1490,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -1519,6 +1524,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); @@ -1541,6 +1547,7 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) == 0); return bprop->defaultvalue; } @@ -1550,6 +1557,7 @@ void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if(prop->arraydimension == 0) values[0]= bprop->defaultvalue; @@ -1565,6 +1573,7 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_default_array(ptr, prop, tmp); @@ -1588,6 +1597,7 @@ int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) == 0); if((idprop=rna_idproperty_check(&prop, ptr))) return IDP_Int(idprop); @@ -1603,6 +1613,7 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) == 0); /* useful to check on bad values but set function should clamp */ /* BLI_assert(RNA_property_int_clamp(ptr, prop, &value) == 0); */ @@ -1628,6 +1639,7 @@ void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -1688,6 +1700,7 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_array(ptr, prop, tmp); @@ -1711,6 +1724,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -1744,6 +1758,7 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_array(ptr, prop, tmp); @@ -1772,6 +1787,7 @@ void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *pr IntPropertyRNA *iprop= (IntPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_INT); + BLI_assert(RNA_property_array_check(prop) != 0); if(prop->arraydimension == 0) values[0]= iprop->defaultvalue; @@ -1808,6 +1824,7 @@ float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) == 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(idprop->type == IDP_FLOAT) @@ -1827,6 +1844,7 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value) IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) == 0); /* useful to check on bad values but set function should clamp */ /* BLI_assert(RNA_property_float_clamp(ptr, prop, &value) == 0); */ @@ -1858,6 +1876,7 @@ void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *val int i; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) @@ -1923,6 +1942,7 @@ float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_array(ptr, prop, tmp); @@ -1948,6 +1968,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa int i; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if((idprop=rna_idproperty_check(&prop, ptr))) { if(prop->arraydimension == 0) { @@ -1991,6 +2012,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_array(ptr, prop, tmp); @@ -2013,6 +2035,7 @@ float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) == 0); return fprop->defaultvalue; } @@ -2022,6 +2045,7 @@ void RNA_property_float_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA * FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if(prop->arraydimension == 0) values[0]= fprop->defaultvalue; @@ -2037,6 +2061,7 @@ float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i int len= rna_ensure_property_array_length(ptr, prop); BLI_assert(RNA_property_type(prop) == PROP_FLOAT); + BLI_assert(RNA_property_array_check(prop) != 0); if(len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_default_array(ptr, prop, tmp); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 4447a0476f4..ba8145c2773 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -856,7 +856,7 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self) if(type==PROP_COLLECTION) { len= pyrna_prop_collection_length(self); } - else if (RNA_property_array_check(&self->ptr, self->prop)) { + else if (RNA_property_array_check(self->prop)) { len= pyrna_prop_array_length((BPy_PropertyArrayRNA *)self); } @@ -1224,7 +1224,7 @@ PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) PyObject *ret; int type= RNA_property_type(prop); - if (RNA_property_array_check(ptr, prop)) { + if (RNA_property_array_check(prop)) { return pyrna_py_from_array(ptr, prop); } @@ -1369,7 +1369,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb int type= RNA_property_type(prop); - if (RNA_property_array_check(ptr, prop)) { + if (RNA_property_array_check(prop)) { /* done getting the length */ if(pyrna_py_to_array(ptr, prop, data, value, error_prefix) == -1) { return -1; @@ -4088,7 +4088,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat int type= RNA_property_type(prop); int flag= RNA_property_flag(prop); - if(RNA_property_array_check(ptr, prop)) { + if(RNA_property_array_check(prop)) { int a, len; if (flag & PROP_DYNAMIC) { @@ -5519,7 +5519,7 @@ PyObject *pyrna_prop_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop) { BPy_PropertyRNA *pyrna; - if (RNA_property_array_check(ptr, prop) == 0) { + if (RNA_property_array_check(prop) == 0) { PyTypeObject *type; if (RNA_property_type(prop) != PROP_COLLECTION) { diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 30d83e196ba..8bde1db96ca 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -107,7 +107,7 @@ static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefi return -1; } - if(RNA_property_array_check(&r_ptr, prop) == 0) { + if(RNA_property_array_check(prop) == 0) { if((*index) == -1) { *index= 0; }