mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 18:56:55 +02:00
Cache renderable model orig texs as QVariantMap
This commit is contained in:
parent
0903e14b06
commit
0e9d696859
2 changed files with 3 additions and 1 deletions
|
@ -103,7 +103,7 @@ int RenderableModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned c
|
||||||
QVariantMap RenderableModelEntityItem::parseTexturesToMap(QString textures) {
|
QVariantMap RenderableModelEntityItem::parseTexturesToMap(QString textures) {
|
||||||
// If textures are unset, revert to original textures
|
// If textures are unset, revert to original textures
|
||||||
if (textures == "") {
|
if (textures == "") {
|
||||||
return parseTexturesToMap(_originalTextures.join(",\n"));
|
return _originalTexturesMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString jsonTextures = "{\"" + textures.replace(":\"", "\":\"").replace(",\n", ",\"") + "}";
|
QString jsonTextures = "{\"" + textures.replace(":\"", "\":\"").replace(",\n", ",\"") + "}";
|
||||||
|
@ -129,6 +129,7 @@ void RenderableModelEntityItem::remapTextures() {
|
||||||
const QSharedPointer<NetworkGeometry>& networkGeometry = _model->getGeometry();
|
const QSharedPointer<NetworkGeometry>& networkGeometry = _model->getGeometry();
|
||||||
if (networkGeometry) {
|
if (networkGeometry) {
|
||||||
_originalTextures = networkGeometry->getTextureNames();
|
_originalTextures = networkGeometry->getTextureNames();
|
||||||
|
_originalTexturesMap = parseTexturesToMap(_originalTextures.join(",\n"));
|
||||||
_originalTexturesRead = true;
|
_originalTexturesRead = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,7 @@ private:
|
||||||
EntityTreeRenderer* _myRenderer = nullptr;
|
EntityTreeRenderer* _myRenderer = nullptr;
|
||||||
QString _currentTextures;
|
QString _currentTextures;
|
||||||
QStringList _originalTextures;
|
QStringList _originalTextures;
|
||||||
|
QVariantMap _originalTexturesMap;
|
||||||
bool _originalTexturesRead = false;
|
bool _originalTexturesRead = false;
|
||||||
QVector<QVector<glm::vec3>> _points;
|
QVector<QVector<glm::vec3>> _points;
|
||||||
bool _dimensionsInitialized = true;
|
bool _dimensionsInitialized = true;
|
||||||
|
|
Loading…
Reference in a new issue