put the parsed model URL in ModelEntityItem

This commit is contained in:
Stephen Birarda 2015-11-24 11:46:51 -06:00
parent 0d6b919448
commit 5a7b0dd1ad
3 changed files with 7 additions and 8 deletions

View file

@ -219,13 +219,11 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
if (hasModel()) {
if (_model) {
// convert the QString from getModelURL to a URL
_url = getModelURL();
// check if the URL has changed
if (_url != _model->getURL()) {
qDebug().noquote() << "Updating model URL: " << _url.toDisplayString();
_model->setURL(_url);
auto& currentURL = getParsedModelURL();
if (currentURL != _model->getURL()) {
qDebug().noquote() << "Updating model URL: " << currentURL.toDisplayString();
_model->setURL(currentURL);
}
render::ScenePointer scene = AbstractViewStateInterface::instance()->getMain3DScene();

View file

@ -79,7 +79,6 @@ private:
bool _originalTexturesRead = false;
QVector<QVector<glm::vec3>> _points;
bool _dimensionsInitialized = true;
QUrl _url;
render::ItemID _myMetaItem;

View file

@ -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;