void OrientConstRotation::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next )
{
	if(editCont!=NULL)
	{
		editCont = NULL;
		IParamMap2* pmap = pblock->GetMap();
		if (pmap != NULL)
		{
			if (next && next->ClassID() == ClassID() && ((OrientConstRotation*)next)->pblock&&((OrientConstRotation*)next)->GetLocked()==false)
			{
				pmap->SetParamBlock(((OrientConstRotation*)next)->pblock);
				ip->ClearPickMode();
			}
			else
				orientCD.EndEditParams(ip, this, flags | END_EDIT_REMOVEUI, next);
		}
		else
		{
			int index = aprops.FindProperty(PROPID_INTERPUI);
			if (index>=0) {
				InterpCtrlUI *ui = (InterpCtrlUI*)aprops[index];
				if (ui->hParams) {
					ip->UnRegisterDlgWnd(ui->hParams);
					ip->DeleteRollupPage(ui->hParams);			
					}
				index = aprops.FindProperty(PROPID_INTERPUI);
				if (index>=0) {
					delete aprops[index];
					aprops.Delete(index,1);
					}
				}	
		}
			ip->UnRegisterTimeChangeCallback(&orientConstTimeChangeCallback);
			ip->ClearPickMode(); // need this, otherwise will crash on undo, while pickmode is active.
			this->ip = NULL;
			hWnd = NULL;
	}
}