Bugfix #21234: Autokey "insert only available" userpref inserts keys for all bones in an armature

-- 

Bugfix: When autokey is enabled, notifiers to refresh the animation editors *after* transforms finished for objects were missing.
While I understand the need to limit these to not doing this during transform, after transform, this lead to lag/inconsistent UI problems.

-- 

* Added 'Damped Track' Option to 'Make Track' Operator
* Improved the code of the 'Clear Track' operator to include other types of tracking constraint too
This commit is contained in:
2010-02-21 11:42:32 +00:00
parent 02b2c2f39d
commit ddc0c68a5c
4 changed files with 56 additions and 13 deletions

View File

@@ -873,16 +873,18 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
bConstraint *con, *pcon;
/* remove track-object for old track */
ob->track= NULL;
ob->recalc |= OB_RECALC;
/* also remove all Track To constraints
* TODO:
* - do we only want to do the last instance (use 1 as last arg instead)
* - also, what about other forms of tracking?
*/
remove_constraints_type(&ob->constraints, CONSTRAINT_TYPE_TRACKTO, 0);
/* also remove all tracking constraints */
for (con= ob->constraints.last; con; con= pcon) {
pcon= con->prev;
if (ELEM3(con->type, CONSTRAINT_TYPE_TRACKTO, CONSTRAINT_TYPE_LOCKTRACK, CONSTRAINT_TYPE_DAMPTRACK))
remove_constraint(&ob->constraints, con);
}
if(type == 1)
ED_object_apply_obmat(ob);
@@ -918,9 +920,10 @@ void OBJECT_OT_track_clear(wmOperatorType *ot)
/************************** Make Track Operator *****************************/
static EnumPropertyItem prop_make_track_types[] = {
{1, "TRACKTO", 0, "TrackTo Constraint", ""},
{2, "LOCKTRACK", 0, "LockTrack Constraint", ""},
{3, "OLDTRACK", 0, "Old Track", ""},
{1, "DAMPTRACK", 0, "Damped Track Constraint", ""},
{2, "TRACKTO", 0, "Track To Constraint", ""},
{3, "LOCKTRACK", 0, "Lock Track Constraint", ""},
{4, "OLDTRACK", 0, "Old Track", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -932,6 +935,25 @@ static int track_set_exec(bContext *C, wmOperator *op)
int type= RNA_enum_get(op->ptr, "type");
if(type == 1) {
bConstraint *con;
bDampTrackConstraint *data;
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
if(ob!=obact) {
con = add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_DAMPTRACK);
data = con->data;
data->tar = obact;
ob->recalc |= OB_RECALC;
/* Lamp and Camera track differently by default */
if (ob->type == OB_LAMP || ob->type == OB_CAMERA)
data->trackflag = TRACK_nZ;
}
}
CTX_DATA_END;
}
else if(type == 2) {
bConstraint *con;
bTrackToConstraint *data;
@@ -952,7 +974,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
}
else if(type == 2) {
else if(type == 3) {
bConstraint *con;
bLockTrackConstraint *data;