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