cherry-pick #21: use Python API for viewDefaultOrientation (2f594dac0a)
This commit is contained in:
@@ -674,14 +674,15 @@ void StdCmdNew::activated(int iMsg)
|
||||
}
|
||||
|
||||
// Set default view orientation for the new document
|
||||
Gui::Document* guiDoc = Application::Instance->getDocument(doc);
|
||||
if (guiDoc) {
|
||||
auto views = guiDoc->getMDIViewsOfType(View3DInventor::getClassTypeId());
|
||||
for (auto* view : views) {
|
||||
auto view3d = static_cast<View3DInventor*>(view);
|
||||
view3d->getViewer()->viewDefaultOrientation();
|
||||
}
|
||||
}
|
||||
auto hGrp = App::GetApplication().GetParameterGroupByPath(
|
||||
"User parameter:BaseApp/Preferences/View"
|
||||
);
|
||||
std::string default_view = hGrp->GetASCII("NewDocumentCameraOrientation", "Top");
|
||||
doCommand(
|
||||
Command::Gui,
|
||||
"Gui.activeDocument().activeView().viewDefaultOrientation('%s',0)",
|
||||
default_view.c_str()
|
||||
);
|
||||
|
||||
ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath(
|
||||
"User parameter:BaseApp/Preferences/View"
|
||||
|
||||
Reference in New Issue
Block a user