From 06498355471227722dcf9be936776f6dcb5a1e04 Mon Sep 17 00:00:00 2001 From: Jere Tuliniemi Date: Thu, 22 Nov 2018 17:52:30 +0200 Subject: Fix undo and redo matdef saving Task-number: QT3DS-2706 Change-Id: I797d615df13029bf062b5437ac588dbc5c77324b Reviewed-by: Miikka Heikkinen --- src/Authoring/Client/Code/Core/Doc/Doc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Authoring/Client/Code/Core/Doc/Doc.cpp') diff --git a/src/Authoring/Client/Code/Core/Doc/Doc.cpp b/src/Authoring/Client/Code/Core/Doc/Doc.cpp index b632513d..3457d50a 100644 --- a/src/Authoring/Client/Code/Core/Doc/Doc.cpp +++ b/src/Authoring/Client/Code/Core/Doc/Doc.cpp @@ -1275,7 +1275,11 @@ void CDoc::onPropertyChanged(qt3dsdm::Qt3DSDMInstanceHandle inInstance, qt3dsdm::Qt3DSDMPropertyHandle inProperty) { using namespace qt3dsdm; - + // Save the material definition upon undo and redo + if (m_Core->GetCmdStack()->isUndoingOrRedoing() && + m_StudioSystem->GetClientDataModelBridge()->isInsideMaterialContainer(inInstance)) { + getSceneEditor()->saveIfMaterial(inInstance); + } // check if we changed datainput bindings if (inProperty == m_StudioSystem->GetPropertySystem() ->GetAggregateInstancePropertyByName(inInstance, L"controlledproperty")) { -- cgit v1.2.3