mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 10:33:10 +02:00
allow a texture change in ModelOverlay properties
This commit is contained in:
parent
cc28fe958e
commit
fc39e82734
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue