mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Load texture by convention with .obj
This commit is contained in:
parent
29516619ee
commit
3280894e29
1 changed files with 4 additions and 4 deletions
|
@ -217,7 +217,6 @@ void OBJReader::parseMaterialLibrary(QIODevice* device) {
|
|||
materials[matName] = currentMaterial;
|
||||
matName = tokenizer.getDatum();
|
||||
currentMaterial = materials[matName];
|
||||
currentMaterial.diffuseTextureFilename = "test";
|
||||
#ifdef WANT_DEBUG
|
||||
qCDebug(modelformat) << "OBJ Reader Starting new material definition " << matName;
|
||||
#endif
|
||||
|
@ -461,6 +460,9 @@ FBXGeometry* OBJReader::readOBJ(QByteArray& model, const QVariantHash& mapping,
|
|||
}
|
||||
|
||||
if (!textName.isEmpty()) {
|
||||
#ifdef WANT_DEBUG
|
||||
qCDebug(modelformat) << "OBJ Reader found a default texture: " << textName;
|
||||
#endif
|
||||
preDefinedMaterial.diffuseTextureFilename = textName;
|
||||
}
|
||||
materials[SMART_DEFAULT_MATERIAL_NAME] = preDefinedMaterial;
|
||||
|
@ -553,9 +555,7 @@ FBXGeometry* OBJReader::readOBJ(QByteArray& model, const QVariantHash& mapping,
|
|||
model::MaterialPointer modelMaterial = fbxMaterial._material;
|
||||
|
||||
if (!objMaterial.diffuseTextureFilename.isEmpty()) {
|
||||
FBXTexture texture;
|
||||
QUrl url = _url.resolved(QUrl(objMaterial.diffuseTextureFilename));
|
||||
// TODO -- something to get textures working again
|
||||
fbxMaterial.diffuseTexture.filename = objMaterial.diffuseTextureFilename;
|
||||
}
|
||||
|
||||
modelMaterial->setEmissive(fbxMaterial.emissiveColor);
|
||||
|
|
Loading…
Reference in a new issue