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

Method Nodes

code/AssetLib/FBX/FBXAnimation.cpp:188–232  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

186
187// ------------------------------------------------------------------------------------------------
188AnimationCurveNodeList AnimationLayer::Nodes(const char *const *target_prop_whitelist /*= nullptr*/,
189 size_t whitelist_size /*= 0*/) const {
190 AnimationCurveNodeList nodes;
191
192 // resolve attached animation nodes
193 const std::vector<const Connection *> &conns = doc.GetConnectionsByDestinationSequenced(ID(), "AnimationCurveNode");
194 nodes.reserve(conns.size());
195
196 for (const Connection *con : conns) {
197
198 // link should not go to a property
199 if (con->PropertyName().length()) {
200 continue;
201 }
202
203 const Object *const ob = con->SourceObject();
204 if (!ob) {
205 DOMWarning("failed to read source object for AnimationCurveNode->AnimationLayer link, ignoring", &element);
206 continue;
207 }
208
209 const AnimationCurveNode *const anim = dynamic_cast<const AnimationCurveNode *>(ob);
210 if (!anim) {
211 DOMWarning("source object for ->AnimationLayer link is not an AnimationCurveNode", &element);
212 continue;
213 }
214
215 if (target_prop_whitelist) {
216 const char *s = anim->TargetProperty().c_str();
217 bool ok = false;
218 for (size_t i = 0; i < whitelist_size; ++i) {
219 if (!strcmp(s, target_prop_whitelist[i])) {
220 ok = true;
221 break;
222 }
223 }
224 if (!ok) {
225 continue;
226 }
227 }
228 nodes.push_back(anim);
229 }
230
231 return nodes; // pray for NRVO
232}
233
234// ------------------------------------------------------------------------------------------------
235AnimationStack::AnimationStack(uint64_t id, const Element &element, const std::string &name, const Document &doc) :

Callers 1

ConvertAnimationStackMethod · 0.80

Calls 7

IDClass · 0.85
DOMWarningFunction · 0.85
SourceObjectMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected