mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +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 (_model) {
|
||||
if (getModelURL() != _model->getURL().toString()) {
|
||||
qDebug() << "Updating model URL: " << getModelURL();
|
||||
_model->setURL(getModelURL());
|
||||
// check if the URL has changed
|
||||
auto& currentURL = getParsedModelURL();
|
||||
if (currentURL != _model->getURL()) {
|
||||
qDebug().noquote() << "Updating model URL: " << currentURL.toDisplayString();
|
||||
_model->setURL(currentURL);
|
||||
}
|
||||
|
||||
render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene();
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
|
||||
static const QString DEFAULT_MODEL_URL;
|
||||
const QString& getModelURL() const { return _modelURL; }
|
||||
const QUrl& getParsedModelURL() const { return _parsedModelURL; }
|
||||
|
||||
static const QString DEFAULT_COMPOUND_SHAPE_URL;
|
||||
const QString& getCompoundShapeURL() const { return _compoundShapeURL; }
|
||||
|
@ -75,7 +76,7 @@ public:
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
||||
|
||||
|
@ -134,6 +135,7 @@ protected:
|
|||
|
||||
rgbColor _color;
|
||||
QString _modelURL;
|
||||
QUrl _parsedModelURL;
|
||||
QString _compoundShapeURL;
|
||||
|
||||
AnimationPropertyGroup _animationProperties;
|
||||
|
|
Loading…
Reference in a new issue