Gui: Do not compute preview while restoring
This commit is contained in:
committed by
Benjamin Nauck
parent
c01f5e9aae
commit
51dd4c1869
@@ -34,6 +34,7 @@
|
||||
#include "ViewProviderPreviewExtension.h"
|
||||
#include "ViewProviderExt.h"
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Utilities.h>
|
||||
#include <Gui/Inventor/So3DAnnotation.h>
|
||||
#include <Mod/Part/App/Tools.h>
|
||||
@@ -141,7 +142,11 @@ void ViewProviderPreviewExtension::extensionAttach(App::DocumentObject* document
|
||||
pcPreviewShape = new SoPreviewShape;
|
||||
|
||||
attachPreview();
|
||||
updatePreview();
|
||||
|
||||
auto document = documentObject->getDocument();
|
||||
if (!document->testStatus(App::Document::Restoring)) {
|
||||
updatePreview();
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderPreviewExtension::extensionBeforeDelete()
|
||||
|
||||
@@ -101,6 +101,10 @@ void ViewProviderTransformed::attachPreview()
|
||||
|
||||
void ViewProviderTransformed::updatePreview()
|
||||
{
|
||||
if (pcObject->getDocument()->testStatus(App::Document::Restoring)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (auto feature = getObject<PartDesign::Transformed>()) {
|
||||
auto originals = feature->getOriginals();
|
||||
|
||||
Reference in New Issue
Block a user