diff options
3 files changed, 11 insertions, 1 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp index 56fb7a88..c4d49ade 100644 --- a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp +++ b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp @@ -1839,6 +1839,14 @@ public: if (!img) img = CreateImageInstanceForMaterialOrLayer(instance, prop); + // When a matdef is first created the source path is not set properly + // when setting a subpresentation so we set it here manually + // TODO: Replace this with an actual fix + if (m_Bridge.isInsideMaterialContainer(instance)) { + SetInstancePropertyValue(img, m_Bridge.GetSourcePathProperty(), + std::make_shared<qt3dsdm::CDataStr>(src.c_str())); + } + SetInstancePropertyValueAsRenderable(img, isSubp ? m_Bridge.getSubpresentationProperty() : m_Bridge.GetSourcePathProperty(), src); } diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h index a284bcce..1045b329 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h @@ -128,6 +128,7 @@ public: void updateFontValues(InspectorControlBase *element) const; void refreshRenderables(); void refresh(); + void saveIfMaterial(qt3dsdm::Qt3DSDMInstanceHandle instance); QVariant getPropertyValue(long instance, int handle); @@ -211,7 +212,6 @@ private: void notifyInstancePropertyValue(qt3dsdm::Qt3DSDMInstanceHandle, qt3dsdm::Qt3DSDMPropertyHandle inProperty); void updateAnimateToggleState(InspectorControlBase *inItem); void updateControlledToggleState(InspectorControlBase *inItem) const; - void saveIfMaterial(qt3dsdm::Qt3DSDMInstanceHandle instance); std::shared_ptr<qt3dsdm::ISignalConnection> m_notifier; std::shared_ptr<qt3dsdm::ISignalConnection> m_slideNotifier; diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp index 070c8b3b..06d3d1e7 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.cpp @@ -435,6 +435,8 @@ QObject *InspectorControlView::showImageChooser(int handle, int instance, const QObject::tr("Set Property")) ->setInstanceImagePropertyValue( instance, handle, Q3DStudio::CString::fromQString(renderableId)); + if (m_inspectorControlModel) + m_inspectorControlModel->saveIfMaterial(instance); } } }); |