void selectConstraint(TransInfo *t)
{
	if (t->con.mode & CON_SELECT) {
		setNearestAxis(t);
		startConstraint(t);
	}
}
void setLocalConstraint(TransInfo *t, int mode, const char text[]) {
	if (t->flag & T_EDIT) {
		float obmat[3][3];
		copy_m3_m4(obmat, t->scene->obedit->obmat);
		normalize_m3(obmat);
		setConstraint(t, obmat, mode, text);
	}
	else {
		if (t->total == 1) {
			setConstraint(t, t->data->axismtx, mode, text);
		}
		else {
			strncpy(t->con.text + 1, text, 48);
			copy_m3_m3(t->con.mtx, t->data->axismtx);
			t->con.mode = mode;
			getConstraintMatrix(t);

			startConstraint(t);

			t->con.drawExtra = drawObjectConstraint;
			t->con.applyVec = applyObjectConstraintVec;
			t->con.applySize = applyObjectConstraintSize;
			t->con.applyRot = applyObjectConstraintRot;
			t->redraw = 1;
		}
	}
}
/* applies individual td->axismtx constraints */
void setAxisMatrixConstraint(TransInfo *t, int mode, const char text[])
{
	if (t->total == 1) {
		float axismtx[3][3];
		if (t->flag & T_EDIT) {
			mul_m3_m3m3(axismtx, t->obedit_mat, t->data->axismtx);
		}
		else {
			copy_m3_m3(axismtx, t->data->axismtx);
		}

		setConstraint(t, axismtx, mode, text);
	}
	else {
		BLI_strncpy(t->con.text + 1, text, sizeof(t->con.text) - 1);
		copy_m3_m3(t->con.mtx, t->data->axismtx);
		t->con.mode = mode;
		getConstraintMatrix(t);

		startConstraint(t);

		t->con.drawExtra = drawObjectConstraint;
		t->con.applyVec = applyObjectConstraintVec;
		t->con.applySize = applyObjectConstraintSize;
		t->con.applyRot = applyObjectConstraintRot;
		t->redraw = TREDRAW_HARD;
	}
}
void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]) {
	strncpy(t->con.text + 1, text, 48);
	copy_m3_m3(t->con.mtx, space);
	t->con.mode = mode;
	getConstraintMatrix(t);

	startConstraint(t);

	t->con.drawExtra = NULL;
	t->con.applyVec = applyAxisConstraintVec;
	t->con.applySize = applyAxisConstraintSize;
	t->con.applyRot = applyAxisConstraintRot;
	t->redraw = 1;
}
void postSelectConstraint(TransInfo *t)
{
	if (!(t->con.mode & CON_SELECT))
		return;

	t->con.mode &= ~CON_AXIS0;
	t->con.mode &= ~CON_AXIS1;
	t->con.mode &= ~CON_AXIS2;
	t->con.mode &= ~CON_SELECT;

	setNearestAxis(t);

	startConstraint(t);
	t->redraw = TREDRAW_HARD;
}