renamed posebone.ik to hasIK, removed unused code, made the function name of Armatue...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 21 Feb 2007 23:14:01 +0000 (23:14 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 21 Feb 2007 23:14:01 +0000 (23:14 +0000)
source/blender/python/api2_2x/Armature.c
source/blender/python/api2_2x/Object.c
source/blender/python/api2_2x/Pose.c
source/blender/python/api2_2x/doc/Pose.py

index d255183e71ba937806d5c579bbacc046e358e18b..8c3ed7506c9c6565e878d0d00e912f9604fc3b9c 100644 (file)
@@ -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
index 8f3a55c201e1d55b73dc72778766f9c5174de82d..9f7d8f7502342f3050415a612b259764a8524fee 100644 (file)
@@ -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 );
index 93bc588d107722feb90799f36eeecb5b6ecbb70a..e7b3434a8a6a8a17d7e32a7d927ba213f8596a73 100644 (file)
@@ -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, 
index cefe0603a74e5e25a86a6b762a607b59cbc26c9b..5bbf29fe9e81fe186ed029c891bec7a2134877d8 100644 (file)
@@ -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]