Removed the file where the directory is stripped off the RelativeFilename, and replace \ with /.

However this introduces a new problem with the current fbx files who do not have their textures in the original dir but moved it to the dir where the fbx file lives.

Suppose there should be some logic when the texture is not found to look if the texture lives in the dir above the RelativeFilename.
In any case it is not obvious when there is a texture missing on a model, it simply renders black.
This commit is contained in:
Marcel Verhagen 2015-07-14 15:31:56 +02:00
parent a24fd13665
commit fac497dadc

View file

@ -1781,9 +1781,8 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping,
TextureParam tex;
foreach (const FBXNode& subobject, object.children) {
if (subobject.name == "RelativeFilename") {
// trim off any path information
QByteArray filename = subobject.properties.at(0).toByteArray();
filename = filename.mid(qMax(filename.lastIndexOf('\\'), filename.lastIndexOf('/')) + 1);
filename = filename.replace('\\', '/');
textureFilenames.insert(getID(object.properties), filename);
} else if (subobject.name == "TextureName") {
// trim the name from the timestamp