~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/Bone.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* 
2
 
 * $Id: Bone.c,v 1.50 2007/01/16 09:18:01 aligorith Exp $
 
2
 * $Id: Bone.c,v 1.52 2007/04/28 05:09:09 khughes Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
910
910
//-------------------------Bone.getAllChildren()
911
911
static PyObject *Bone_getAllChildren(BPy_Bone *self)
912
912
{
913
 
        PyObject *list = NULL;
 
913
        PyObject *list = PyList_New(0);
914
914
 
915
 
        if (self->bone->childbase.first){
916
 
                list = PyList_New(0);
 
915
        if (self->bone->childbase.first)
917
916
                if (!PyBone_ChildrenAsList(list, &self->bone->childbase))
918
917
                        return NULL;
919
 
                return EXPP_incr_ret(list);
920
 
        }else{
921
 
                return EXPP_incr_ret(Py_None);
922
 
        }
 
918
        return EXPP_incr_ret(list);
923
919
}
924
920
//------------------ATTRIBUTE IMPLEMENTATIONS-----------------------------
925
921
//------------------------Bone.name (get)
1077
1073
//------------------------Bone.children (get)
1078
1074
static PyObject *Bone_getChildren(BPy_Bone *self, void *closure)
1079
1075
{
1080
 
        PyObject *list = NULL;
 
1076
        PyObject *list = PyList_New(0);
1081
1077
        Bone *bone = NULL;
1082
1078
        PyObject *py_bone = NULL;
1083
1079
 
1084
1080
        if (self->bone->childbase.first){
1085
 
                list = PyList_New(0);
1086
1081
                for (bone = self->bone->childbase.first; bone; bone = bone->next){
1087
1082
                        py_bone = PyBone_FromBone(bone);
1088
1083
                        if (py_bone == NULL)
1091
1086
                                goto RuntimeError;
1092
1087
                        }
1093
1088
                }
1094
 
                return EXPP_incr_ret(list);
1095
 
        }else{
1096
 
                return EXPP_incr_ret(Py_None);
1097
1089
        }
1098
 
 
 
1090
        return EXPP_incr_ret(list);
 
1091
        
1099
1092
RuntimeError:
1100
1093
        return EXPP_objError(PyExc_RuntimeError, "%s%s", 
1101
1094
                sBoneError, "Internal error trying to wrap blender bones!");