- fbx: read Geometry -> Skin and Model -> Cluster connections. Improve logging, some refactoring.
This commit is contained in:
@@ -108,6 +108,50 @@ boost::shared_ptr<const PropertyTable> GetPropertyTable(const Document& doc,
|
||||
const Element &element,
|
||||
const Scope& sc);
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
inline const T* ProcessSimpleConnection(const Connection& con,
|
||||
bool is_object_property_conn,
|
||||
const char* name,
|
||||
const Element& element,
|
||||
const char** propNameOut = NULL)
|
||||
{
|
||||
if (is_object_property_conn && con.PropertyName().length()) {
|
||||
DOMWarning("expected incoming " + std::string(name) +
|
||||
" link to be an object-object connection, ignoring",
|
||||
&element
|
||||
);
|
||||
return NULL;
|
||||
}
|
||||
else if (!is_object_property_conn && !con.PropertyName().length()) {
|
||||
DOMWarning("expected incoming " + std::string(name) +
|
||||
" link to be an object-property connection, ignoring",
|
||||
&element
|
||||
);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(is_object_property_conn && propNameOut) {
|
||||
// note: this is ok, the return value of PropertyValue() is guaranteed to
|
||||
// remain valid and unchanged as long as the document exists.
|
||||
*propNameOut = con.PropertyName().c_str();
|
||||
}
|
||||
|
||||
const Object* const ob = con.SourceObject();
|
||||
if(!ob) {
|
||||
DOMWarning("failed to read source object for incoming" + std::string(name) +
|
||||
" link, ignoring",
|
||||
&element);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return dynamic_cast<const T*>(ob);
|
||||
}
|
||||
|
||||
|
||||
} //!Util
|
||||
} //!FBX
|
||||
} //!Assimp
|
||||
|
||||
Reference in New Issue
Block a user