diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/BPY_extern.h | 1 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_idprop.c | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index 8561f9d1b55..296eb6296a7 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -49,6 +49,7 @@ struct bConstraintOb; /* DNA_constraint_types.h */ struct bConstraintTarget; /* DNA_constraint_types.h*/ struct Script; /* DNA_screen_types.h */ struct BPyMenu; +struct bContext; #ifdef __cplusplus extern "C" { #endif diff --git a/source/blender/python/intern/bpy_idprop.c b/source/blender/python/intern/bpy_idprop.c index e7e8a5fd8b5..a5fca06d402 100644 --- a/source/blender/python/intern/bpy_idprop.c +++ b/source/blender/python/intern/bpy_idprop.c @@ -60,8 +60,8 @@ static char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, } else if (PyLong_Check(ob)) { val.i = (int) PyLong_AsLong(ob); prop = IDP_New(IDP_INT, val, name); - } else if (PyUnicode_Check(ob)) { - val.str = _PyUnicode_AsString(ob); + } else if (/*PyUnicode_Check(ob)*/0) { + //val.str = _PyUnicode_AsString(ob); prop = IDP_New(IDP_STRING, val, name); } else if (PySequence_Check(ob)) { PyObject *item; @@ -105,7 +105,7 @@ static char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, for (i=0; i<len; i++) { key = PySequence_GetItem(keys, i); pval = PySequence_GetItem(vals, i); - if (!PyUnicode_Check(key)) { + if (/*!PyUnicode_Check(key)*/1) { IDP_FreeProperty(prop); MEM_freeN(prop); Py_XDECREF(keys); @@ -114,7 +114,7 @@ static char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, Py_XDECREF(pval); return "invalid element in subgroup dict template!"; } - if (BPy_IDProperty_Map_ValidateAndCreate(_PyUnicode_AsString(key), prop, pval)) { + if (/*BPy_IDProperty_Map_ValidateAndCreate(PyUnicode_AsString(key), prop, pval)*/0) { IDP_FreeProperty(prop); MEM_freeN(prop); Py_XDECREF(keys); @@ -143,12 +143,12 @@ static int BPy_IDGroup_Map_SetItem(IDProperty *prop, PyObject *key, PyObject *va return EXPP_ReturnIntError( PyExc_TypeError, "unsubscriptable object"); - if (!PyUnicode_Check(key)) + if (/*!PyUnicode_Check(key)*/1) return EXPP_ReturnIntError( PyExc_TypeError, "only strings are allowed as subgroup keys" ); if (val == NULL) { - IDProperty *pkey = IDP_GetPropertyFromGroup(prop, _PyUnicode_AsString(key)); + IDProperty *pkey = 0;//IDP_GetPropertyFromGroup(prop, PyUnicode_AsString(key)); if (pkey) { IDP_RemFromGroup(prop, pkey); IDP_FreeProperty(pkey); @@ -157,7 +157,7 @@ static int BPy_IDGroup_Map_SetItem(IDProperty *prop, PyObject *key, PyObject *va } else return EXPP_ReturnIntError( PyExc_RuntimeError, "property not found in group" ); } - err = BPy_IDProperty_Map_ValidateAndCreate(_PyUnicode_AsString(key), prop, val); + //err = BPy_IDProperty_Map_ValidateAndCreate(_PyUnicode_AsString(key), prop, val); if (err) return EXPP_ReturnIntError( PyExc_RuntimeError, err ); return 0; |