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:
authorJoseph Gilbert <ascotan@gmail.com>2005-11-22 01:21:46 +0300
committerJoseph Gilbert <ascotan@gmail.com>2005-11-22 01:21:46 +0300
commit280375ab2cd316c776dee19b54b3028002b2305c (patch)
tree32878dafb902406f4d4999d7b856efef21230816 /source/blender/python/api2_2x/Armature.c
parent838fb771598e987cd9fd08582c154fe91253dc98 (diff)
- editng options for armature added to AramtureType
Diffstat (limited to 'source/blender/python/api2_2x/Armature.c')
-rw-r--r--source/blender/python/api2_2x/Armature.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c
index c5bfff7b3c4..6c13f903e10 100644
--- a/source/blender/python/api2_2x/Armature.c
+++ b/source/blender/python/api2_2x/Armature.c
@@ -519,6 +519,62 @@ static PyObject *Armature_saveChanges(BPy_Armature *self)
return EXPP_incr_ret(Py_None);
}
//------------------ATTRIBUTE IMPLEMENTATION---------------------------
+//------------------------Armature.autoIK (getter)
+static PyObject *Armature_getAutoIK(BPy_Armature *self, void *closure)
+{
+ if (self->armature->flag & ARM_AUTO_IK)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+//------------------------Armature.autoIK (setter)
+static int Armature_setAutoIK(BPy_Armature *self, PyObject *value, void *closure)
+{
+ if(value){
+ if(PyBool_Check(value)){
+ if (value == Py_True){
+ self->armature->flag |= ARM_AUTO_IK;
+ return 0;
+ }else if (value == Py_False){
+ self->armature->flag &= ~ARM_AUTO_IK;
+ return 0;
+ }
+ }
+ }
+ goto AttributeError;
+
+AttributeError:
+ return EXPP_intError(PyExc_AttributeError, "%s%s",
+ sArmatureBadArgs, "Expects True or False");
+}
+//------------------------Armature.mirrorEdit (getter)
+static PyObject *Armature_getMirrorEdit(BPy_Armature *self, void *closure)
+{
+ if (self->armature->flag & ARM_MIRROR_EDIT)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+//------------------------Armature.mirrorEdit (setter)
+static int Armature_setMirrorEdit(BPy_Armature *self, PyObject *value, void *closure)
+{
+ if(value){
+ if(PyBool_Check(value)){
+ if (value == Py_True){
+ self->armature->flag |= ARM_MIRROR_EDIT;
+ return 0;
+ }else if (value == Py_False){
+ self->armature->flag &= ~ARM_MIRROR_EDIT;
+ return 0;
+ }
+ }
+ }
+ goto AttributeError;
+
+AttributeError:
+ return EXPP_intError(PyExc_AttributeError, "%s%s",
+ sArmatureBadArgs, "Expects True or False");
+}
//------------------------Armature.drawType (getter)
static PyObject *Armature_getDrawType(BPy_Armature *self, void *closure)
{
@@ -879,6 +935,10 @@ static PyGetSetDef BPy_Armature_getset[] = {
"The number of frames between ghost instances", NULL},
{"drawType", (getter)Armature_getDrawType, (setter)Armature_setDrawType,
"The type of drawing currently applied to the armature", NULL},
+ {"mirrorEdit", (getter)Armature_getMirrorEdit, (setter)Armature_setMirrorEdit,
+ "Enable/Disable X-axis mirrored editing", NULL},
+ {"autoIK", (getter)Armature_getAutoIK, (setter)Armature_setAutoIK,
+ "Adds temporal IK chains while grabbing bones", NULL},
{NULL}
};
//------------------------tp_new