=== BPY ===
Adding Python counterparts to the Invert params for Copy Rot and Copy Loc. I had to align the constants being used, so if you had files using those options (introduced after 2.43), you'll have to modify the INVERT settings for ROTLIKE constraints (didn't feel like making a minor version bump for this, if people thing otherwise, please say so). Based on a patch by Juho Vepsäläinen (bebraw)
This commit is contained in:
@@ -252,14 +252,19 @@ typedef struct bRigidBodyJointConstraint{
|
||||
#define CONSTRAINT_CHANNEL_SELECT 0x01
|
||||
#define CONSTRAINT_CHANNEL_PROTECTED 0x02
|
||||
|
||||
/**
|
||||
* The flags for ROTLIKE, LOCLIKE and SIZELIKE should be kept identical
|
||||
* (that is, same effect, different name). It simplifies the Python API access a lot.
|
||||
*/
|
||||
|
||||
/* bRotateLikeConstraint.flag */
|
||||
#define ROTLIKE_X 0x01
|
||||
#define ROTLIKE_Y 0x02
|
||||
#define ROTLIKE_Z 0x04
|
||||
#define ROTLIKE_X_INVERT 0x08
|
||||
#define ROTLIKE_Y_INVERT 0x10
|
||||
#define ROTLIKE_Z_INVERT 0x20
|
||||
#define ROTLIKE_OFFSET 0x40
|
||||
#define ROTLIKE_X_INVERT 0x10
|
||||
#define ROTLIKE_Y_INVERT 0x20
|
||||
#define ROTLIKE_Z_INVERT 0x40
|
||||
#define ROTLIKE_OFFSET 0x80
|
||||
|
||||
/* bLocateLikeConstraint.flag */
|
||||
#define LOCLIKE_X 0x01
|
||||
@@ -275,7 +280,7 @@ typedef struct bRigidBodyJointConstraint{
|
||||
#define SIZELIKE_X 0x01
|
||||
#define SIZELIKE_Y 0x02
|
||||
#define SIZELIKE_Z 0x04
|
||||
#define SIZELIKE_OFFSET 0x08
|
||||
#define SIZELIKE_OFFSET 0x80
|
||||
|
||||
/* Axis flags */
|
||||
#define LOCK_X 0x00
|
||||
|
||||
@@ -876,7 +876,7 @@ static int locatelike_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' );
|
||||
0, LOCLIKE_X | LOCLIKE_Y | LOCLIKE_Z | LOCLIKE_X_INVERT | LOCLIKE_Y_INVERT | LOCLIKE_Z_INVERT, 'i' );
|
||||
case EXPP_CONSTR_LOCAL:
|
||||
if( !get_armature( con->tar ) )
|
||||
return EXPP_ReturnIntError( PyExc_RuntimeError,
|
||||
@@ -934,7 +934,7 @@ static int rotatelike_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' );
|
||||
0, LOCLIKE_X | LOCLIKE_Y | LOCLIKE_Z | LOCLIKE_X_INVERT | LOCLIKE_Y_INVERT | LOCLIKE_Z_INVERT, 'i' );
|
||||
case EXPP_CONSTR_LOCAL:
|
||||
if( !get_armature( con->tar ) )
|
||||
return EXPP_ReturnIntError( PyExc_RuntimeError,
|
||||
@@ -994,7 +994,7 @@ 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' );
|
||||
0, LOCLIKE_X | LOCLIKE_Y | LOCLIKE_Z | LOCLIKE_X_INVERT | LOCLIKE_Y_INVERT | LOCLIKE_Z_INVERT, 'i' );
|
||||
#if 0
|
||||
case EXPP_CONSTR_LOCAL:
|
||||
if( !get_armature( con->tar ) )
|
||||
@@ -1957,6 +1957,12 @@ static PyObject *M_Constraint_SettingsDict( void )
|
||||
PyInt_FromLong( LOCLIKE_Y ) );
|
||||
PyConstant_Insert( d, "COPYZ",
|
||||
PyInt_FromLong( LOCLIKE_Z ) );
|
||||
PyConstant_Insert( d, "COPYXINVERT",
|
||||
PyInt_FromLong( LOCLIKE_X_INVERT ) );
|
||||
PyConstant_Insert( d, "COPYYINVERT",
|
||||
PyInt_FromLong( LOCLIKE_Y_INVERT ) );
|
||||
PyConstant_Insert( d, "COPYZINVERT",
|
||||
PyInt_FromLong( LOCLIKE_Z_INVERT ) );
|
||||
|
||||
PyConstant_Insert( d, "TARGET",
|
||||
PyInt_FromLong( EXPP_CONSTR_TARGET ) );
|
||||
|
||||
@@ -82,7 +82,7 @@ Or to print all the constraints attached to each bone in a pose::
|
||||
- OFFSET (float): clamped to [-100.0,100.0]
|
||||
- STICKY (bool)
|
||||
- Used by Copy Location (COPYLOC) and Copy Rotation (COPYROT)
|
||||
- COPY (bitfield): any combination of COPYX, COPYY and COPYZ
|
||||
- COPY (bitfield): any combination of COPYX, COPYY and COPYZ with possible addition of COPYXINVERT, COPYYINVERT and COPYZINVERT to invert that particular input (if on).
|
||||
- LOCAL (bool): Only for constraints which Armature targets.
|
||||
- Used by Copy Size (COPYSIZE) constraint:
|
||||
- COPY (bitfield): any combination of COPYX, COPYY and COPYZ
|
||||
|
||||
Reference in New Issue
Block a user