== Action Editor - Copy and Paste Tools ==

Now it is possible to do Copy+Paste in the Action Editor, like in the IPO Editor. There are two new buttons in the Action Editor header for this, using the familiar icons.

* To copy...
Select the keyframes you wish to copy, and the channels that they occur in (except for ShapeKey mode, where it is not possible to select channels). Click copy button.
* To paste... 
Place the current frame where you want the first of the keyframes from the buffer is to be pasted. Select all channels you wish the keyframes to be pasted into. Click paste button. 

Currently, keyframes are only pasted into 'compatible' curves (i.e.  LocX keyframes can only go to LocX, and so on). This may change after user feedback, if this is found to be too restrictive.

== Code Changes ==
I've made a few changes which allow this code to be nicer. 
* renamed insert_vert_ipo to insert_vert_icu, as that represents its actual purpose better (and changed all occurrences I could find)
* created a new function, insert_bezt_icu, which does the actual inserting of provided BezTriple data to a given IpoCurve 
* recoded insert_vert_icu to use this new function, and also the IPO-Editor keyframe pasting (i.e.  pasting in Editmode)
This commit is contained in:
Joshua Leung
2007-09-17 11:41:12 +00:00
parent 023a929363
commit 52f551678b
16 changed files with 338 additions and 153 deletions

View File

@@ -431,9 +431,9 @@ static PyObject *Constraint_insertKey( BPy_Constraint * self, PyObject * value )
"cannot get a curve from this IPO, may be using libdata" );
if( ob->action )
insert_vert_ipo( icu, get_action_frame(ob, cfra), con->enforce);
insert_vert_icu( icu, get_action_frame(ob, cfra), con->enforce);
else
insert_vert_ipo( icu, cfra, con->enforce);
insert_vert_icu( icu, cfra, con->enforce);
Py_RETURN_NONE;
}

View File

@@ -1483,7 +1483,7 @@ static int Ipo_setIpoCurveByName( BPy_Ipo * self, PyObject * key,
icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ;
set_icu_vars( icu );
BLI_addtail( &(ipo->curve), icu);
insert_vert_ipo( icu, time, curval );
insert_vert_icu( icu, time, curval );
allspace( REMAKEIPO, 0 );
EXPP_allqueue( REDRAWIPO, 0 );

View File

@@ -531,7 +531,7 @@ static PyObject *IpoCurve_append( C_IpoCurve * self, PyObject * value )
Py_DECREF( xobj );
y = (float)PyFloat_AsDouble( yobj );
Py_DECREF( yobj );
insert_vert_ipo( icu, x, y);
insert_vert_icu( icu, x, y);
}
Py_RETURN_NONE;
@@ -745,7 +745,7 @@ static int IpoCurve_setCurval( C_IpoCurve * self, PyObject * key,
/* insert a key at the specified time */
insert_vert_ipo( self->ipocurve, time, curval );
insert_vert_icu( self->ipocurve, time, curval );
allspace(REMAKEIPO, 0);
return 0;
}

View File

@@ -2517,7 +2517,7 @@ static PyObject *Object_setConstraintInfluenceForBone( BPy_Object * self,
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"cannot get a curve from this IPO, may be using libdata" );
insert_vert_ipo(icu, (float)CFRA, influence);
insert_vert_icu(icu, (float)CFRA, influence);
self->object->recalc |= OB_RECALC_OB;
Py_RETURN_NONE;