mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 01:59:59 +02:00
Merge pull request #6471 from birarda/url-cmp
fix unnecessary model URL updating thanks to URL encoding
This commit is contained in:
commit
fd7a704753
2 changed files with 8 additions and 4 deletions
|
@ -219,9 +219,11 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
||||||
|
|
||||||
if (hasModel()) {
|
if (hasModel()) {
|
||||||
if (_model) {
|
if (_model) {
|
||||||
if (getModelURL() != _model->getURL().toString()) {
|
// check if the URL has changed
|
||||||
qDebug() << "Updating model URL: " << getModelURL();
|
auto& currentURL = getParsedModelURL();
|
||||||
_model->setURL(getModelURL());
|
if (currentURL != _model->getURL()) {
|
||||||
|
qDebug().noquote() << "Updating model URL: " << currentURL.toDisplayString();
|
||||||
|
_model->setURL(currentURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene();
|
render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene();
|
||||||
|
|
|
@ -63,6 +63,7 @@ public:
|
||||||
|
|
||||||
static const QString DEFAULT_MODEL_URL;
|
static const QString DEFAULT_MODEL_URL;
|
||||||
const QString& getModelURL() const { return _modelURL; }
|
const QString& getModelURL() const { return _modelURL; }
|
||||||
|
const QUrl& getParsedModelURL() const { return _parsedModelURL; }
|
||||||
|
|
||||||
static const QString DEFAULT_COMPOUND_SHAPE_URL;
|
static const QString DEFAULT_COMPOUND_SHAPE_URL;
|
||||||
const QString& getCompoundShapeURL() const { return _compoundShapeURL; }
|
const QString& getCompoundShapeURL() const { return _compoundShapeURL; }
|
||||||
|
@ -75,7 +76,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// model related properties
|
// model related properties
|
||||||
void setModelURL(const QString& url) { _modelURL = url; }
|
void setModelURL(const QString& url) { _modelURL = url; _parsedModelURL = QUrl(url); }
|
||||||
virtual void setCompoundShapeURL(const QString& url);
|
virtual void setCompoundShapeURL(const QString& url);
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,6 +135,7 @@ protected:
|
||||||
|
|
||||||
rgbColor _color;
|
rgbColor _color;
|
||||||
QString _modelURL;
|
QString _modelURL;
|
||||||
|
QUrl _parsedModelURL;
|
||||||
QString _compoundShapeURL;
|
QString _compoundShapeURL;
|
||||||
|
|
||||||
AnimationPropertyGroup _animationProperties;
|
AnimationPropertyGroup _animationProperties;
|
||||||
|
|
Loading…
Reference in a new issue