diff options
author | Stephen Swaney <sswaney@centurytel.net> | 2003-11-11 13:13:04 +0300 |
---|---|---|
committer | Stephen Swaney <sswaney@centurytel.net> | 2003-11-11 13:13:04 +0300 |
commit | 011203c45f7ce01e03ee90edd2b14ffcba627a97 (patch) | |
tree | e9e11fa03fb1f44e8f851380fb64d16e3dbd99b7 /source/blender/python/api2_2x/Armature.c | |
parent | 1018943b3d14e4bd30f0ea7416bdeeb4fc7cea83 (diff) |
fixed the bug Joseph Gilbert found in numerous python files.
newly created data objs had incorrect user counts.
Diffstat (limited to 'source/blender/python/api2_2x/Armature.c')
-rw-r--r-- | source/blender/python/api2_2x/Armature.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c index 03322d678db..ccbc9b93324 100644 --- a/source/blender/python/api2_2x/Armature.c +++ b/source/blender/python/api2_2x/Armature.c @@ -52,8 +52,12 @@ static PyObject *M_Armature_New(PyObject *self, PyObject *args, "expected string(s) or empty argument")); bl_armature = add_armature(); /* first create in Blender */ - if (bl_armature) /* now create the wrapper obj in Python */ + if (bl_armature){ + /* return user count to zero because add_armature() inc'd it */ + bl_armature->id.us = 0; + /* now create the wrapper obj in Python */ py_armature = (BPy_Armature *)PyObject_NEW(BPy_Armature, &Armature_Type); + } else return (EXPP_ReturnPyObjError (PyExc_RuntimeError, "couldn't create Armature Data in Blender")); |