Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-04-24 21:28:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-04-24 21:28:40 +0400
commit77f08ddc12870b90064273fa314d462ccdd473ba (patch)
tree2b5cb29c3e57deae521d30d384ddbbe622d7cdcb /source/blender/python/api2_2x/Bone.c
parent46545ac575e500d46aae3fabb05f6d46a7fb1797 (diff)
editface.c & buttons_logic.c & Draw.c & verse_session.c - added missing header
Bone.c - return an empty list rather then None for bone.children bone.getAllChildren() Draw.c - per button callbacks are now have (event, value) passed
Diffstat (limited to 'source/blender/python/api2_2x/Bone.c')
-rw-r--r--source/blender/python/api2_2x/Bone.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/source/blender/python/api2_2x/Bone.c b/source/blender/python/api2_2x/Bone.c
index 0d4c0983a67..cd2e3bea099 100644
--- a/source/blender/python/api2_2x/Bone.c
+++ b/source/blender/python/api2_2x/Bone.c
@@ -910,16 +910,12 @@ static PyObject *Bone_hasChildren(BPy_Bone *self)
//-------------------------Bone.getAllChildren()
static PyObject *Bone_getAllChildren(BPy_Bone *self)
{
- PyObject *list = NULL;
+ PyObject *list = PyList_New(0);
- if (self->bone->childbase.first){
- list = PyList_New(0);
+ if (self->bone->childbase.first)
if (!PyBone_ChildrenAsList(list, &self->bone->childbase))
return NULL;
- return EXPP_incr_ret(list);
- }else{
- return EXPP_incr_ret(Py_None);
- }
+ EXPP_incr_ret(list);
}
//------------------ATTRIBUTE IMPLEMENTATIONS-----------------------------
//------------------------Bone.name (get)
@@ -1077,12 +1073,11 @@ static int Bone_setParent(BPy_Bone *self, PyObject *value, void *closure)
//------------------------Bone.children (get)
static PyObject *Bone_getChildren(BPy_Bone *self, void *closure)
{
- PyObject *list = NULL;
+ PyObject *list = PyList_New(0);
Bone *bone = NULL;
PyObject *py_bone = NULL;
if (self->bone->childbase.first){
- list = PyList_New(0);
for (bone = self->bone->childbase.first; bone; bone = bone->next){
py_bone = PyBone_FromBone(bone);
if (py_bone == NULL)
@@ -1091,11 +1086,9 @@ static PyObject *Bone_getChildren(BPy_Bone *self, void *closure)
goto RuntimeError;
}
}
- return EXPP_incr_ret(list);
- }else{
- return EXPP_incr_ret(Py_None);
}
-
+ return EXPP_incr_ret(list);
+
RuntimeError:
return EXPP_objError(PyExc_RuntimeError, "%s%s",
sBoneError, "Internal error trying to wrap blender bones!");