diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-02-22 02:14:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-02-22 02:14:01 +0300 |
commit | a2ce2600d9ec1df8e12ddbb34290be6f7e18f08a (patch) | |
tree | e2583dd818a3ebebcd1a2c6efb7a94237bd59129 /source/blender/python/api2_2x | |
parent | f12d3122752a947d2b72a63a8b9146a962ccb77b (diff) |
renamed posebone.ik to hasIK, removed unused code, made the function name of Armatue's py object from Blender object consistant with others.
Diffstat (limited to 'source/blender/python/api2_2x')
-rw-r--r-- | source/blender/python/api2_2x/Armature.c | 14 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Pose.c | 16 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Pose.py | 4 |
4 files changed, 20 insertions, 16 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c index d255183e71b..8c3ed7506c9 100644 --- a/source/blender/python/api2_2x/Armature.c +++ b/source/blender/python/api2_2x/Armature.c @@ -511,7 +511,7 @@ static PyObject *Armature_copy(BPy_Armature *self) bArmature *bl_armature; bl_armature= copy_armature(self->armature); bl_armature->id.us= 0; - py_armature= PyArmature_FromArmature( bl_armature ); + py_armature= Armature_CreatePyObject( bl_armature ); return py_armature; } @@ -1225,7 +1225,7 @@ static PyObject *M_Armature_Get(PyObject * self, PyObject * args) if(size == 0){ //GET ALL ARMATURES data = G.main->armature.first; //get the first data ID from the armature library while (data){ - py_armature = PyArmature_FromArmature(data); //*new* + py_armature = Armature_CreatePyObject(data); //*new* sprintf(buffer, "%s", ((bArmature*)data)->id.name +2); if(PyDict_SetItemString(dict, buffer, py_armature) == -1){ //add to dictionary EXPP_decr3(seq, dict, py_armature); @@ -1242,7 +1242,7 @@ static PyObject *M_Armature_Get(PyObject * self, PyObject * args) Py_DECREF(item); data = find_id("AR", name); //get data from library if (data != NULL){ - py_armature = PyArmature_FromArmature(data); //*new* + py_armature = Armature_CreatePyObject(data); //*new* if(PyDict_SetItemString(dict, name, py_armature) == -1){ //add to dictionary EXPP_decr3(seq, dict, py_armature); goto RuntimeError; @@ -1270,7 +1270,7 @@ static PyObject *M_Armature_Get(PyObject * self, PyObject * args) Py_DECREF(seq); data = find_id("AR", name); //get data from library if (data != NULL){ - return PyArmature_FromArmature(data); //*new* + return Armature_CreatePyObject(data); //*new* }else{ char buffer[128]; PyOS_snprintf( buffer, sizeof(buffer), @@ -1304,7 +1304,7 @@ static PyObject *M_Armature_New(PyObject * self, PyObject * args) armature= add_armature(); armature->id.us = 0; - obj = (BPy_Armature *)PyArmature_FromArmature(armature); /*new*/ + obj = (BPy_Armature *)Armature_CreatePyObject(armature); /*new*/ if( !obj ) return EXPP_ReturnPyObjError( PyExc_RuntimeError, @@ -1345,7 +1345,7 @@ PyObject *Armature_RebuildBones(PyObject *pyarmature) } //-----------------(internal) //Converts a bArmature to a PyArmature -PyObject *PyArmature_FromArmature(struct bArmature *armature) +PyObject *Armature_CreatePyObject(struct bArmature *armature) { BPy_Armature *py_armature = NULL; PyObject *maindict = NULL, *weakref = NULL; @@ -1384,7 +1384,7 @@ PyObject *PyArmature_FromArmature(struct bArmature *armature) RuntimeError: return EXPP_objError(PyExc_RuntimeError, "%s%s%s", - sModuleError, "PyArmature_FromArmature: ", "Internal Error Ocurred"); + sModuleError, "Armature_CreatePyObject: ", "Internal Error Ocurred"); } //-----------------(internal) //Converts a PyArmature to a bArmature diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 8f3a55c201e..9f7d8f75023 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -4582,7 +4582,7 @@ static PyObject *get_obj_data( BPy_Object *self, int mesh ) switch ( object->type ) { case OB_ARMATURE: - data_object = PyArmature_FromArmature( object->data ); + data_object = Armature_CreatePyObject( object->data ); break; case OB_CAMERA: data_object = Camera_CreatePyObject( object->data ); diff --git a/source/blender/python/api2_2x/Pose.c b/source/blender/python/api2_2x/Pose.c index 93bc588d107..e7b3434a8a6 100644 --- a/source/blender/python/api2_2x/Pose.c +++ b/source/blender/python/api2_2x/Pose.c @@ -971,9 +971,9 @@ static int PoseBone_setDisplayObject(BPy_PoseBone *self, PyObject *value, void * return 0; } -//------------------------PoseBone.ik (getter) +//------------------------PoseBone.hasIK (getter) //Returns True/False if the bone has IK's -static PyObject *PoseBone_getIK(BPy_PoseBone *self, void *closure) +static PyObject *PoseBone_hasIK(BPy_PoseBone *self, void *closure) { Object *obj = NULL; @@ -1037,25 +1037,29 @@ static int PoseBone_setStiff(BPy_PoseBone *self, PyObject *value, void *axis) //------------------------PoseBone.* (getter) //Gets the pose bones flag +/* static PyObject *PoseBone_getFlag(BPy_PoseBone *self, void *flag) { - if (self->posechannel->ikflag & (int)flag) + if (self->posechannel->flag & (int)flag) Py_RETURN_TRUE; else Py_RETURN_FALSE; } +*/ //------------------------PoseBone.* (setter) //Gets the pose bones flag +/* static int PoseBone_setFlag(BPy_PoseBone *self, PyObject *value, void *flag) { if ( PyObject_IsTrue(value) ) - self->posechannel->ikflag |= (int)flag; + self->posechannel->flag |= (int)flag; else - self->posechannel->ikflag &= ~(int)flag; + self->posechannel->flag &= ~(int)flag; return 0; } +*/ //------------------------PoseBone.* (getter) //Gets the pose bones ikflag @@ -1113,7 +1117,7 @@ static PyGetSetDef BPy_PoseBone_getset[] = { {"displayObject", (getter)PoseBone_getDisplayObject, (setter)PoseBone_setDisplayObject, "The poseMode object to draw in place of this bone", NULL}, - {"ik", (getter)PoseBone_getIK, (setter)NULL, + {"hasIK", (getter)PoseBone_hasIK, (setter)NULL, "True if the pose bone has IK (readonly)", NULL }, {"stretch", (getter)PoseBone_getStretch, (setter)PoseBone_setStretch, diff --git a/source/blender/python/api2_2x/doc/Pose.py b/source/blender/python/api2_2x/doc/Pose.py index cefe0603a74..5bbf29fe9e8 100644 --- a/source/blender/python/api2_2x/doc/Pose.py +++ b/source/blender/python/api2_2x/doc/Pose.py @@ -189,8 +189,8 @@ class PoseBone: @type limitmax: 3-item sequence @ivar limitmax: The x,y,z maximum limits on rotation when part of an IK - @type ik: bool - @ivar ik: True if this pose bone is a part of an IK (readonly), when False, other IK related values have no affect. + @type hasIK: bool + @ivar hasIK: True if this pose bone is a part of an IK (readonly), when False, other IK related values have no affect. @type stretch: float @ivar stretch: The amount to stretch to the ik target when part of an IK [0.0 - 1.0] |