From c563eb71b74cd31eb42f4738fc8df053af9a13c5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 2 Apr 2012 11:28:26 +0000 Subject: [PATCH] wrap RNA's RNA_property_collection_clear from python. --- source/blender/python/intern/bpy_rna.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 7af53b489bd..53f9e46ba13 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -3869,6 +3869,13 @@ static PyObject *pyrna_prop_collection_idprop_remove(BPy_PropertyRNA *self, PyOb Py_RETURN_NONE; } +static PyObject *pyrna_prop_collection_idprop_clear(BPy_PropertyRNA *self) +{ + RNA_property_collection_clear(&self->ptr, self->prop); + + Py_RETURN_NONE; +} + static PyObject *pyrna_prop_collection_idprop_move(BPy_PropertyRNA *self, PyObject *args) { int key = 0, pos = 0; @@ -4580,6 +4587,7 @@ static struct PyMethodDef pyrna_prop_collection_methods[] = { static struct PyMethodDef pyrna_prop_collection_idprop_methods[] = { {"add", (PyCFunction)pyrna_prop_collection_idprop_add, METH_NOARGS, NULL}, {"remove", (PyCFunction)pyrna_prop_collection_idprop_remove, METH_O, NULL}, + {"clear", (PyCFunction)pyrna_prop_collection_idprop_clear, METH_NOARGS, NULL}, {"move", (PyCFunction)pyrna_prop_collection_idprop_move, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} };