- editng options for armature added to AramtureType
authorJoseph Gilbert <ascotan@gmail.com>
Mon, 21 Nov 2005 22:21:46 +0000 (22:21 +0000)
committerJoseph Gilbert <ascotan@gmail.com>
Mon, 21 Nov 2005 22:21:46 +0000 (22:21 +0000)
source/blender/python/api2_2x/Armature.c
source/blender/python/api2_2x/doc/Armature.py

index c5bfff7b3c4e2adcce6686afb2a500d8306eee21..6c13f903e105561937b69d6690c4c001d7175879 100644 (file)
@@ -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
index bcffca12a3533eedbe8b16c5cb96b15f1d5a6d4b..93fec9e96fb08cbea63d015663e10ca29f94ce20 100644 (file)
@@ -55,6 +55,8 @@ class ArmatureType:
       - Armature.STICK: bones drawn as sticks
       - Armature.BBONE: bones drawn as b-bones
       - Armature.ENVELOPE: bones drawn as sticks with envelopes
+  @ivar mirrorEdit: (bool) X-axis mirrored editing
+  @ivar autoIK: (bool)  Adds temporary IK chains while grabbing bones
   """
 
   def __init__(name = 'myArmature'):