===Python API===
authorKen Hughes <khughes@pacific.edu>
Fri, 12 May 2006 13:10:55 +0000 (13:10 +0000)
committerKen Hughes <khughes@pacific.edu>
Fri, 12 May 2006 13:10:55 +0000 (13:10 +0000)
* use CONSTRAINT_LOCAL instead of SELECT in "Copy Rotate" constraint
* remove "LOCAL" key for now from "Copy Size" constraint; not supported
  right now in Blender UI

source/blender/python/api2_2x/Constraint.c
source/blender/python/api2_2x/doc/Constraint.py

index 8fcb155c9d6688a0b19709a7bc10025c684f88ea..082fdf7cce7a391ab981163f160a4fb99a73b260 100644 (file)
@@ -829,7 +829,8 @@ static PyObject *locatelike_getter( BPy_Constraint * self, int type )
                return PyInt_FromLong( (long)con->flag );
        case EXPP_CONSTR_LOCAL:
                if( get_armature( con->tar ) )
-                       return PyBool_FromLong( (long)( self->con->flag & CONSTRAINT_LOCAL ) ) ;
+                       return PyBool_FromLong( (long)
+                                       ( self->con->flag & CONSTRAINT_LOCAL ) ) ;
                Py_RETURN_NONE;
        default:
                return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
@@ -886,7 +887,8 @@ static PyObject *rotatelike_getter( BPy_Constraint * self, int type )
                return PyInt_FromLong( (long)con->flag );
        case EXPP_CONSTR_LOCAL:
                if( get_armature( con->tar ) )
-                       return PyBool_FromLong( (long)( self->con->flag & SELECT ) ) ;
+                       return PyBool_FromLong( (long)
+                                       ( self->con->flag & CONSTRAINT_LOCAL ) ) ;
                Py_RETURN_NONE;
        default:
                return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
@@ -923,7 +925,8 @@ static int rotatelike_setter( BPy_Constraint *self, int type, PyObject *value )
                if( !get_armature( con->tar ) )
                        return EXPP_ReturnIntError( PyExc_RuntimeError,
                                        "only armature targets have LOCAL key" );
-               return EXPP_setBitfield( value, &self->con->flag, SELECT, 'h' );
+               return EXPP_setBitfield( value, &self->con->flag,
+                               CONSTRAINT_LOCAL, 'h' );
        default:
                return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
        }
@@ -940,10 +943,13 @@ static PyObject *sizelike_getter( BPy_Constraint * self, int type )
                return PyString_FromString( con->subtarget );
        case EXPP_CONSTR_COPY:
                return PyInt_FromLong( (long)con->flag );
+#if 0
        case EXPP_CONSTR_LOCAL:
                if( get_armature( con->tar ) )
-                       return PyBool_FromLong( (long)( self->con->flag & SELECT ) ) ;
+                       return PyBool_FromLong( (long)
+                                       ( self->con->flag & CONSTRAINT_LOCAL ) ) ;
                Py_RETURN_NONE;
+#endif
        default:
                return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" );
        }
@@ -975,11 +981,14 @@ static int sizelike_setter( BPy_Constraint *self, int type, PyObject *value )
        case EXPP_CONSTR_COPY:
                return EXPP_setIValueRange( value, &con->flag,
                                0, LOCLIKE_X | LOCLIKE_Y | LOCLIKE_Z, 'i' );
+#if 0
        case EXPP_CONSTR_LOCAL:
                if( !get_armature( con->tar ) )
                        return EXPP_ReturnIntError( PyExc_RuntimeError,
                                        "only armature targets have LOCAL key" );
-               return EXPP_setBitfield( value, &self->con->flag, SELECT, 'h' );
+               return EXPP_setBitfield( value, &self->con->flag,
+                               CONSTRAINT_LOCAL, 'h' );
+#endif
        default:
                return EXPP_ReturnIntError( PyExc_KeyError, "key not found" );
        }
index be42bd7e2b195e796e49ac8e940e1f124c50826b..c14c850a80786436113c80dd34baf95be1309e0b 100644 (file)
@@ -79,10 +79,11 @@ Or to print all the constraints attached to each bone in a pose::
     - MINMAX (int): values are MINX, MINY, MINZ, MAXX, MAXY, MAXZ
     - OFFSET (float): clamped to [-100.0,100.0]
     - STICKY (bool)
-  - Used by Copy Location (COPYLOC), Copy Rotation (COPYROT), and Copy Size
-  (COPYSIZE) constraint:
+  - Used by Copy Location (COPYLOC) and Copy Rotation (COPYROT)
     - COPY (bitfield): any combination of COPYX, COPYY and COPYZ
     - LOCAL (bool): Only for constraints which Armature targets.
+  - Used by Copy Size (COPYSIZE) constraint:
+    - COPY (bitfield): any combination of COPYX, COPYY and COPYZ
 
 """