- fbx: resolve target node for node animations.

This commit is contained in:
Alexander Gessler
2012-07-21 17:12:04 +02:00
parent ae3007b42b
commit 378bc93593
3 changed files with 83 additions and 5 deletions

View File

@@ -390,6 +390,7 @@ LazyObject::LazyObject(uint64_t id, const Element& element, const Document& doc)
: doc(doc)
, element(element)
, id(id)
, being_constructed()
{
}
@@ -425,7 +426,8 @@ const Object* LazyObject::Get()
DOMError(err,&element);
}
// XXX prevent recursive calls
// prevent recursive calls
being_constructed = true;
// this needs to be relatively fast since it happens a lot,
// so avoid constructing strings all the time.
@@ -462,6 +464,7 @@ const Object* LazyObject::Get()
//DOMError("failed to convert element to DOM object, class: " + classtag + ", name: " + name,&element);
}
being_constructed = false;
return object.get();
}
@@ -697,6 +700,7 @@ void Document::ReadConnections()
}
}
// ------------------------------------------------------------------------------------------------
const std::vector<const AnimationStack*>& Document::AnimationStacks() const
{
@@ -718,6 +722,7 @@ const std::vector<const AnimationStack*>& Document::AnimationStacks() const
return animationStacksResolved;
}
// ------------------------------------------------------------------------------------------------
LazyObject* Document::GetObject(uint64_t id) const
{
@@ -725,6 +730,7 @@ LazyObject* Document::GetObject(uint64_t id) const
return it == objects.end() ? NULL : (*it).second;
}
// ------------------------------------------------------------------------------------------------
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t source) const
{
@@ -762,6 +768,7 @@ std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(ui
return temp; // NRVO should handle this
}
// ------------------------------------------------------------------------------------------------
Connection::Connection(uint64_t insertionOrder, uint64_t src, uint64_t dest, const std::string& prop, const Document& doc)
: insertionOrder(insertionOrder)
@@ -783,6 +790,24 @@ Connection::~Connection()
}
// ------------------------------------------------------------------------------------------------
LazyObject& Connection::LazySourceObject() const
{
LazyObject* const lazy = doc.GetObject(src);
ai_assert(lazy);
return *lazy;
}
// ------------------------------------------------------------------------------------------------
LazyObject& Connection::LazyDestinationObject() const
{
LazyObject* const lazy = doc.GetObject(dest);
ai_assert(lazy);
return *lazy;
}
// ------------------------------------------------------------------------------------------------
const Object* Connection::SourceObject() const
{
@@ -791,6 +816,7 @@ const Object* Connection::SourceObject() const
return lazy->Get();
}
// ------------------------------------------------------------------------------------------------
const Object* Connection::DestinationObject() const
{