diff options
Diffstat (limited to 'source/blender/python/bmesh/bmesh_py_types_customdata.c')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types_customdata.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c index 1f7f7290030..5d9c07269e8 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c @@ -361,10 +361,10 @@ static PyObject *bpy_bmlayercollection_get(BPy_BMLayerCollection *self, PyObject } static struct PyMethodDef bpy_bmelemseq_methods[] = { - {"keys", (PyCFunction)bpy_bmlayercollection_keys, METH_NOARGS, bpy_bmlayercollection_keys_doc}, - {"values", (PyCFunction)bpy_bmlayercollection_values, METH_NOARGS, bpy_bmlayercollection_values_doc}, - {"items", (PyCFunction)bpy_bmlayercollection_items, METH_NOARGS, bpy_bmlayercollection_items_doc}, - {"get", (PyCFunction)bpy_bmlayercollection_get, METH_VARARGS, bpy_bmlayercollection_get_doc}, + {"keys", (PyCFunction)bpy_bmlayercollection_keys, METH_NOARGS, bpy_bmlayercollection_keys_doc}, + {"values", (PyCFunction)bpy_bmlayercollection_values, METH_NOARGS, bpy_bmlayercollection_values_doc}, + {"items", (PyCFunction)bpy_bmlayercollection_items, METH_NOARGS, bpy_bmlayercollection_items_doc}, + {"get", (PyCFunction)bpy_bmlayercollection_get, METH_VARARGS, bpy_bmlayercollection_get_doc}, /* for later! */ #if 0 @@ -712,7 +712,7 @@ void BPy_BM_init_types_customdata(void) /** * helper function for get/set, NULL return means the error is set -*/ + */ static void *bpy_bmlayeritem_ptr_get(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer) { void *value; @@ -746,7 +746,7 @@ static void *bpy_bmlayeritem_ptr_get(BPy_BMElem *py_ele, BPy_BMLayerItem *py_lay if (UNLIKELY(value == NULL)) { /* this should be fairly unlikely but possible if layers move about after we get them */ PyErr_SetString(PyExc_KeyError, - "BMElem[key]: layer not found"); + "BMElem[key]: layer not found"); return NULL; } else { @@ -774,8 +774,7 @@ PyObject *BPy_BMLayerItem_GetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer) switch (py_layer->type) { case CD_MDEFORMVERT: { - ret = Py_NotImplemented; /* TODO */ - Py_INCREF(ret); + ret = BPy_BMDeformVert_CreatePyObject(value); break; } case CD_PROP_FLT: @@ -848,8 +847,7 @@ int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObj switch (py_layer->type) { case CD_MDEFORMVERT: { - PyErr_SetString(PyExc_AttributeError, "readonly"); /* could make this writeable later */ - ret = -1; + ret = BPy_BMDeformVert_AssignPyObject(value, py_value); break; } case CD_PROP_FLT: |