MCPcopy Create free account
hub / github.com/assimp/assimp / FillAnimList

Method FillAnimList

tools/assimp_view/Display.cpp:119–147  ·  view source on GitHub ↗

------------------------------------------------------------------------------- Fill animation combo box

Source from the content-addressed store, hash-verified

117//-------------------------------------------------------------------------------
118// Fill animation combo box
119int CDisplay::FillAnimList(void) {
120 if (0 != g_pcAsset->pcScene->mNumAnimations)
121 {
122 // now fill in all animation names
123 for (unsigned int i = 0; i < g_pcAsset->pcScene->mNumAnimations; ++i)
124 {
125 std::string animationLabel(g_pcAsset->pcScene->mAnimations[i]->mName.data);
126 if (animationLabel.empty())
127 {
128 animationLabel = std::string("Animation ") + std::to_string(i) + " (UNNAMED)";
129 }
130
131 SendDlgItemMessage(g_hDlg,IDC_COMBO1,CB_ADDSTRING,0,
132 (LPARAM)animationLabel.c_str());
133 }
134
135 // also add a dummy - 'none'
136 SendDlgItemMessage(g_hDlg,IDC_COMBO1,CB_ADDSTRING,0,(LPARAM)"none");
137
138 // select first
139 SendDlgItemMessage(g_hDlg,IDC_COMBO1,CB_SETCURSEL,0,0);
140
141 EnableAnimTools(TRUE);
142 }
143 else // tools remain disabled
144 EnableAnimTools(FALSE);
145
146 return 1;
147}
148//-------------------------------------------------------------------------------
149// Clear the list of animations
150int CDisplay::ClearAnimList(void)

Callers 1

LoadAssetFunction · 0.80

Calls 2

to_stringFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected