include urls with texture names, make sure to wait till default textures loaded before setting new textures

This commit is contained in:
ZappoMan 2014-11-07 09:54:13 -08:00
parent 7b40a7cd89
commit fdc5aa1da5
5 changed files with 14 additions and 6 deletions

View file

@ -54,7 +54,7 @@ EntityPropertyDialogBox = (function () {
index++;
array.push({ label: "Textures:", value: properties.textures });
index++;
array.push({ label: "Texture Names:" + properties.textureNames, type: "header" });
array.push({ label: "Texture Names:\n" + properties.textureNames, type: "header" });
index++;
}
array.push({ label: "Position:", type: "header" });

View file

@ -62,10 +62,13 @@ void RenderableModelEntityItem::remapTextures() {
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) {
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
// and any textures in the recently mapped texture, that is not in our desired

View file

@ -742,15 +742,18 @@ QStringList NetworkGeometry::getTextureNames() const {
const NetworkMeshPart& part = mesh.parts[j];
if (!part.diffuseTextureName.isEmpty()) {
result << part.diffuseTextureName;
QString textureURL = part.diffuseTexture->getURL().toString();
result << part.diffuseTextureName + ":" + textureURL;
}
if (!part.normalTextureName.isEmpty()) {
result << part.normalTextureName;
QString textureURL = part.normalTexture->getURL().toString();
result << part.normalTextureName + ":" + textureURL;
}
if (!part.specularTextureName.isEmpty()) {
result << part.specularTextureName;
QString textureURL = part.specularTexture->getURL().toString();
result << part.specularTextureName + ":" + textureURL;
}
}
}

View file

@ -243,7 +243,7 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine) cons
boundingBox.setProperty("dimensions", boundingBoxDimensions);
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
return properties;

View file

@ -123,6 +123,8 @@ public:
void setCache(ResourceCache* cache) { _cache = cache; }
Q_INVOKABLE void allReferencesCleared();
const QUrl& getURL() const { return _url; }
signals: