diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-08-15 15:24:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-08-15 15:24:08 +0400 |
commit | 8e7095a464a4f35186a31069c7d02c5bf8748327 (patch) | |
tree | e3680a39c822c6181165683ca1890aaef9af4fd9 /source/blender/python/api2_2x/Armature.c | |
parent | 2fc1f4ac426a1cde79d6357c9ff21c6a57533ce5 (diff) |
Added __copy__ to armature, material, curve, group
Diffstat (limited to 'source/blender/python/api2_2x/Armature.c')
-rw-r--r-- | source/blender/python/api2_2x/Armature.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c index bae9b1b0db4..ff18c755956 100644 --- a/source/blender/python/api2_2x/Armature.c +++ b/source/blender/python/api2_2x/Armature.c @@ -474,6 +474,7 @@ AttributeError: return EXPP_objError(PyExc_AttributeError, "%s%s", sArmatureBadArgs, "The armature cannot be placed manually in editmode before you call makeEditable()!"); } + //------------------------Armature.update() //This is a bit ugly because you need an object link to do this static PyObject *Armature_update(BPy_Armature *self) @@ -500,6 +501,18 @@ AttributeError: return EXPP_objError(PyExc_AttributeError, "%s%s", sArmatureBadArgs, "The armature must be linked to an object before you can save changes!"); } + +//------------------------Armature.__copy__() +static PyObject *Armature_copy(BPy_Armature *self) +{ + PyObject *py_armature = NULL; + bArmature *bl_armature; + bl_armature= copy_armature(self->armature); + bl_armature->id.us= 0; + py_armature= PyArmature_FromArmature( bl_armature ); + return py_armature; +} + //------------------ATTRIBUTE IMPLEMENTATION--------------------------- //------------------------Armature.autoIK (getter) static PyObject *Armature_getAutoIK(BPy_Armature *self, void *closure) @@ -953,6 +966,8 @@ static PyMethodDef BPy_Armature_methods[] = { "() - Unlocks the ability to modify armature bones"}, {"update", (PyCFunction) Armature_update, METH_NOARGS, "() - Rebuilds the armature based on changes to bones since the last call to makeEditable"}, + {"__copy__", (PyCFunction) Armature_copy, METH_NOARGS, + "() - Return a copy of the armature."}, {NULL, NULL, 0, NULL} }; //------------------------tp_getset |