allow a texture change in ModelOverlay properties

This commit is contained in:
Stephen Birarda 2014-10-21 16:11:58 -07:00
parent cc28fe958e
commit fc39e82734

View file

@ -102,6 +102,16 @@ void ModelOverlay::setProperties(const QScriptValue &properties) {
}
_updateModel = true;
}
QScriptValue texturesValue = properties.property("textures");
if (texturesValue.isValid()) {
QVariantMap textureMap = texturesValue.toVariant().toMap();
foreach(const QString& key, textureMap.keys()) {
QUrl newTextureURL = textureMap[key].toUrl();
qDebug() << "Updating texture named" << key << "to texture at URL" << newTextureURL;
_model.setTextureWithNameToURL(key, newTextureURL);
}
}
if (properties.property("position").isValid()) {
_updateModel = true;