mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 19:50:38 +02:00
include urls with texture names, make sure to wait till default textures loaded before setting new textures
This commit is contained in:
parent
7b40a7cd89
commit
fdc5aa1da5
5 changed files with 14 additions and 6 deletions
|
@ -54,7 +54,7 @@ EntityPropertyDialogBox = (function () {
|
||||||
index++;
|
index++;
|
||||||
array.push({ label: "Textures:", value: properties.textures });
|
array.push({ label: "Textures:", value: properties.textures });
|
||||||
index++;
|
index++;
|
||||||
array.push({ label: "Texture Names:" + properties.textureNames, type: "header" });
|
array.push({ label: "Texture Names:\n" + properties.textureNames, type: "header" });
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
array.push({ label: "Position:", type: "header" });
|
array.push({ label: "Position:", type: "header" });
|
||||||
|
|
|
@ -62,10 +62,13 @@ void RenderableModelEntityItem::remapTextures() {
|
||||||
return; // nothing to do if we don't have a model
|
return; // nothing to do if we don't have a model
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_model->isLoadedWithTextures()) {
|
||||||
|
return; // nothing to do if the model has not yet loaded it's default textures
|
||||||
|
}
|
||||||
|
|
||||||
if (_currentTextures == _textures) {
|
if (_currentTextures == _textures) {
|
||||||
return; // nothing to do if our recently mapped textures match our desired textures
|
return; // nothing to do if our recently mapped textures match our desired textures
|
||||||
}
|
}
|
||||||
qDebug() << "void RenderableModelEntityItem::remapTextures()....";
|
|
||||||
|
|
||||||
// since we're changing here, we need to run through our current texture map
|
// since we're changing here, we need to run through our current texture map
|
||||||
// and any textures in the recently mapped texture, that is not in our desired
|
// and any textures in the recently mapped texture, that is not in our desired
|
||||||
|
|
|
@ -742,15 +742,18 @@ QStringList NetworkGeometry::getTextureNames() const {
|
||||||
const NetworkMeshPart& part = mesh.parts[j];
|
const NetworkMeshPart& part = mesh.parts[j];
|
||||||
|
|
||||||
if (!part.diffuseTextureName.isEmpty()) {
|
if (!part.diffuseTextureName.isEmpty()) {
|
||||||
result << part.diffuseTextureName;
|
QString textureURL = part.diffuseTexture->getURL().toString();
|
||||||
|
result << part.diffuseTextureName + ":" + textureURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!part.normalTextureName.isEmpty()) {
|
if (!part.normalTextureName.isEmpty()) {
|
||||||
result << part.normalTextureName;
|
QString textureURL = part.normalTexture->getURL().toString();
|
||||||
|
result << part.normalTextureName + ":" + textureURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!part.specularTextureName.isEmpty()) {
|
if (!part.specularTextureName.isEmpty()) {
|
||||||
result << part.specularTextureName;
|
QString textureURL = part.specularTexture->getURL().toString();
|
||||||
|
result << part.specularTextureName + ":" + textureURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,7 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine) cons
|
||||||
boundingBox.setProperty("dimensions", boundingBoxDimensions);
|
boundingBox.setProperty("dimensions", boundingBoxDimensions);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(boundingBox, boundingBox); // gettable, but not settable
|
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(boundingBox, boundingBox); // gettable, but not settable
|
||||||
|
|
||||||
QString textureNamesList = _textureNames.join(",");
|
QString textureNamesList = _textureNames.join(",\n");
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(textureNames, textureNamesList); // gettable, but not settable
|
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(textureNames, textureNamesList); // gettable, but not settable
|
||||||
|
|
||||||
return properties;
|
return properties;
|
||||||
|
|
|
@ -124,6 +124,8 @@ public:
|
||||||
|
|
||||||
Q_INVOKABLE void allReferencesCleared();
|
Q_INVOKABLE void allReferencesCleared();
|
||||||
|
|
||||||
|
const QUrl& getURL() const { return _url; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
/// Fired when the resource has been loaded.
|
/// Fired when the resource has been loaded.
|
||||||
|
|
Loading…
Reference in a new issue