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:
authorKen Hughes <khughes@pacific.edu>2006-05-07 18:57:58 +0400
committerKen Hughes <khughes@pacific.edu>2006-05-07 18:57:58 +0400
commitcd3af13a1b1aaada000322373394c02cc6b773fb (patch)
treec03c4422ae0c652e4a98c83e0e7e5c8a55b90a0d /source/blender/python/api2_2x/Pose.c
parent8255bdce574283df7f04ccb24c607c1e45d956e9 (diff)
===Python API===
New Constraint API. Constraints are accessible through a "constraints" attribute in poses and objects. Would be REALLY NICE for armature users to pound on this code.
Diffstat (limited to 'source/blender/python/api2_2x/Pose.c')
-rw-r--r--source/blender/python/api2_2x/Pose.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/source/blender/python/api2_2x/Pose.c b/source/blender/python/api2_2x/Pose.c
index f19e7b366c6..4a78208046c 100644
--- a/source/blender/python/api2_2x/Pose.c
+++ b/source/blender/python/api2_2x/Pose.c
@@ -49,6 +49,7 @@
#include "BLI_arithb.h"
#include "Mathutils.h"
#include "Object.h"
+#include "Constraint.h"
#include "NLA.h"
#include "gen_utils.h"
@@ -705,30 +706,12 @@ static int PoseBone_setPoseMatrix(BPy_PoseBone *self, PyObject *value, void *clo
return EXPP_intError(PyExc_AttributeError, "%s%s%s",
sPoseBoneError, ".poseMatrix: ", "not able to set this property");
}
-////------------------------PoseBone.constraints (getter)
-////Gets the constraints list
-//static PyObject *PoseBone_getConstraints(BPy_PoseBone *self, void *closure)
-//{
-// PyObject *list = NULL, *py_constraint = NULL;
-// bConstraint *constraint = NULL;
-//
-// list = PyList_New(0);
-// for (constraint = self->posechannel->constraints.first; constraint; constraint = constraint->next){
-// py_constraint = PyConstraint_FromConstraint(constraint);
-// if (!py_constraint)
-// return NULL;
-// if (PyList_Append(list, py_constraint) == -1){
-// Py_DECREF(py_constraint);
-// goto RuntimeError;
-// }
-// Py_DECREF(py_constraint);
-// }
-// return list;
-//
-//RuntimeError:
-// return EXPP_objError(PyExc_RuntimeError, "%s%s%s",
-// sPoseBoneError, ".constraints: ", "unable to build constraint list");
-//}
+//------------------------PoseBone.constraints (getter)
+//Gets the constraints sequence
+static PyObject *PoseBone_getConstraints(BPy_PoseBone *self, void *closure)
+{
+ return PoseConstraintSeq_CreatePyObject( self->posechannel );
+}
////------------------------PoseBone.constraints (setter)
////Sets the constraints list
//static int PoseBone_setConstraints(BPy_PoseBone *self, PyObject *value, void *closure)
@@ -782,8 +765,8 @@ static PyGetSetDef BPy_PoseBone_getset[] = {
"The pose bone's head positon", NULL},
{"tail", (getter)PoseBone_getTail, (setter)PoseBone_setTail,
"The pose bone's tail positon", NULL},
- //{"constraints", (getter)PoseBone_getConstraints, (setter)PoseBone_setConstraints,
- // "The list of contraints that pertain to this pose bone", NULL},
+ {"constraints", (getter)PoseBone_getConstraints, (setter)NULL,
+ "The list of contraints that pertain to this pose bone", NULL},
{NULL, NULL, NULL, NULL, NULL}
};
//------------------------tp_dealloc