fix(gui): use Python API for viewDefaultOrientation in StdCmdNew
Some checks failed
Build and Test / build (push) Failing after 20m15s
Some checks failed
Build and Test / build (push) Failing after 20m15s
viewDefaultOrientation is a method on View3DInventorPy (Python wrapper), not on View3DInventorViewer (C++ viewer). Use doCommand with the Python API, matching the pattern used in StdCmdViewHome.
This commit is contained in:
@@ -674,14 +674,15 @@ void StdCmdNew::activated(int iMsg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default view orientation for the new document
|
// Set default view orientation for the new document
|
||||||
Gui::Document* guiDoc = Application::Instance->getDocument(doc);
|
auto hGrp = App::GetApplication().GetParameterGroupByPath(
|
||||||
if (guiDoc) {
|
"User parameter:BaseApp/Preferences/View"
|
||||||
auto views = guiDoc->getMDIViewsOfType(View3DInventor::getClassTypeId());
|
);
|
||||||
for (auto* view : views) {
|
std::string default_view = hGrp->GetASCII("NewDocumentCameraOrientation", "Top");
|
||||||
auto view3d = static_cast<View3DInventor*>(view);
|
doCommand(
|
||||||
view3d->getViewer()->viewDefaultOrientation();
|
Command::Gui,
|
||||||
}
|
"Gui.activeDocument().activeView().viewDefaultOrientation('%s',0)",
|
||||||
}
|
default_view.c_str()
|
||||||
|
);
|
||||||
|
|
||||||
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath(
|
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath(
|
||||||
"User parameter:BaseApp/Preferences/View"
|
"User parameter:BaseApp/Preferences/View"
|
||||||
|
|||||||
Reference in New Issue
Block a user