| 58 | // CTVCharacterKeyDialog message handlers |
| 59 | |
| 60 | void CTVCharacterKeyDialog::SetKey( IAnimNode *node,IAnimTrack *track,int nkey ) |
| 61 | { |
| 62 | m_node = node; |
| 63 | m_track = track; |
| 64 | m_key = nkey; |
| 65 | |
| 66 | if (m_key < 0 || m_key >= m_track->GetNumKeys()) |
| 67 | return; |
| 68 | |
| 69 | if (track->GetType() != ATRACK_CHARACTER) |
| 70 | return; |
| 71 | |
| 72 | m_animation.ResetContent(); |
| 73 | |
| 74 | // Find editor object who owns this node. |
| 75 | IEntity *entity = node->GetEntity(); |
| 76 | if (entity) |
| 77 | { |
| 78 | // Add available animations. |
| 79 | ICryCharInstance *pCharacter = entity->GetCharInterface()->GetCharacter(0); |
| 80 | if (pCharacter) |
| 81 | { |
| 82 | IAnimationSet* pAnimations = pCharacter->GetModel()->GetAnimationSet(); |
| 83 | assert (pAnimations); |
| 84 | int numAnimations = pAnimations->Count(); |
| 85 | m_animation.AddString(""); |
| 86 | for (int i = 0; i < numAnimations; i++) |
| 87 | { |
| 88 | m_animation.AddString ( pAnimations->GetName(i)); |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | ICharacterKey key; |
| 94 | m_track->GetKey( m_key,&key ); |
| 95 | |
| 96 | m_animation.SelectString( -1,key.animation ); |
| 97 | m_blendTime.SetValue( key.blendTime ); |
| 98 | m_startTime.SetValue( key.startTime ); |
| 99 | m_timeScale.SetValue( key.speed ); |
| 100 | m_startTime.SetValue( key.startTime ); |
| 101 | //m_hide.SetCheck( (key.hidden)?BST_CHECKED:BST_UNCHECKED ); |
| 102 | m_loopBtn.SetCheck( (key.bLoop)?BST_CHECKED:BST_UNCHECKED ); |
| 103 | m_unloadBtn.SetCheck(key.bUnload ? BST_CHECKED : BST_UNCHECKED); |
| 104 | } |
| 105 | |
| 106 | ////////////////////////////////////////////////////////////////////////// |
| 107 | BOOL CTVCharacterKeyDialog::OnInitDialog() |
no test coverage detected