mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-13 23:16:03 +02:00
24 lines
No EOL
714 B
JavaScript
24 lines
No EOL
714 B
JavaScript
getEntityTextures = function(id) {
|
|
var results = null;
|
|
var properties = Entities.getEntityProperties(id, "textures");
|
|
if (properties.textures) {
|
|
try {
|
|
results = JSON.parse(properties.textures);
|
|
} catch(err) {
|
|
logDebug(err);
|
|
logDebug(properties.textures);
|
|
}
|
|
}
|
|
return results ? results : {};
|
|
}
|
|
|
|
setEntityTextures = function(id, textureList) {
|
|
var json = JSON.stringify(textureList);
|
|
Entities.editEntity(id, {textures: json});
|
|
}
|
|
|
|
editEntityTextures = function(id, textureName, textureURL) {
|
|
var textureList = getEntityTextures(id);
|
|
textureList[textureName] = textureURL;
|
|
setEntityTextures(id, textureList);
|
|
} |