diff options
author | Ton Roosendaal <ton@blender.org> | 2005-10-10 22:05:30 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-10-10 22:05:30 +0400 |
commit | 4bd9775936c1b5a1656713d8c6a679b711b93d93 (patch) | |
tree | 7a4d0c39ffef76f3f34f5dea7ad85a02587414a1 /source/blender/python/api2_2x/Bone.c | |
parent | 9b8868532a9e0970f83eb68ef36144eaca9525a1 (diff) |
Stupid me! Committed in wrong console with wrong dir... here's the rest of
all files for the Ipo/Action/NLA makeover...
Diffstat (limited to 'source/blender/python/api2_2x/Bone.c')
-rw-r--r-- | source/blender/python/api2_2x/Bone.c | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/source/blender/python/api2_2x/Bone.c b/source/blender/python/api2_2x/Bone.c index 6a6980107a2..9fd751248aa 100644 --- a/source/blender/python/api2_2x/Bone.c +++ b/source/blender/python/api2_2x/Bone.c @@ -48,6 +48,7 @@ struct ScrArea; /*keep me up here */ #include "BKE_utildefines.h" #include "BIF_editaction.h" +#include "BSE_editipo.h" #include "NLA.h" @@ -1401,7 +1402,6 @@ static PyObject *Bone_setPose( BPy_Bone * self, PyObject * args ) Bone *root = NULL; bPoseChannel *chan = NULL; bPoseChannel *setChan = NULL; - bPoseChannel *test = NULL; Object *object = NULL; bArmature *arm = NULL; Bone *bone = NULL; @@ -1410,7 +1410,6 @@ static PyObject *Bone_setPose( BPy_Bone * self, PyObject * args ) BPy_Action *py_action = NULL; int x; int flagValue = 0; - int makeCurve = 1; if( !self->bone ) { //test to see if linked to armature //use python vars @@ -1502,43 +1501,26 @@ static PyObject *Bone_setPose( BPy_Bone * self, PyObject * args ) //create an action if one not already assigned to object if( !py_action && !object->action ) { - object->action = ( bAction * ) add_empty_action( ); - object->ipowin = ID_AC; - } else { - //test if posechannel is already in action - for( test = object->action->chanbase.first; test; - test = test->next ) { - if( test == setChan ) - makeCurve = 0; //already there - } + object->action = ( bAction * ) add_empty_action(ID_PO); + object->ipowin = ID_PO; } - //set action keys + //set action keys (note, new uniform API for Pose ipos (ton) if( setChan->flag & POSE_ROT ) { - set_action_key( object->action, setChan, AC_QUAT_X, - (short)makeCurve ); - set_action_key( object->action, setChan, AC_QUAT_Y, - (short)makeCurve ); - set_action_key( object->action, setChan, AC_QUAT_Z, - (short)makeCurve ); - set_action_key( object->action, setChan, AC_QUAT_W, - (short)makeCurve ); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_QUAT_X); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_QUAT_Y); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_QUAT_Z); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_QUAT_W); } if( setChan->flag & POSE_SIZE ) { - set_action_key( object->action, setChan, AC_SIZE_X, - (short)makeCurve ); - set_action_key( object->action, setChan, AC_SIZE_Y, - (short)makeCurve ); - set_action_key( object->action, setChan, AC_SIZE_Z, - (short)makeCurve ); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_SIZE_X); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_SIZE_Y); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_SIZE_Z); } if( setChan->flag & POSE_LOC ) { - set_action_key( object->action, setChan, AC_LOC_X, - (short)makeCurve ); - set_action_key( object->action, setChan, AC_LOC_Y, - (short)makeCurve ); - set_action_key( object->action, setChan, AC_LOC_Z, - (short)makeCurve ); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_LOC_X); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_LOC_Y); + insertkey(&object->id, ID_PO, setChan->name, NULL, AC_LOC_Z); } //rebuild ipos remake_action_ipos( object->action ); |