diff options
author | Joseph Gilbert <ascotan@gmail.com> | 2005-11-22 01:21:46 +0300 |
---|---|---|
committer | Joseph Gilbert <ascotan@gmail.com> | 2005-11-22 01:21:46 +0300 |
commit | 280375ab2cd316c776dee19b54b3028002b2305c (patch) | |
tree | 32878dafb902406f4d4999d7b856efef21230816 | |
parent | 838fb771598e987cd9fd08582c154fe91253dc98 (diff) |
- editng options for armature added to AramtureType
-rw-r--r-- | source/blender/python/api2_2x/Armature.c | 60 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Armature.py | 2 |
2 files changed, 62 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 diff --git a/source/blender/python/api2_2x/doc/Armature.py b/source/blender/python/api2_2x/doc/Armature.py index bcffca12a35..93fec9e96fb 100644 --- a/source/blender/python/api2_2x/doc/Armature.py +++ b/source/blender/python/api2_2x/doc/Armature.py @@ -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'): |