mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Blender addon - render command
This commit is contained in:
parent
f4da046f81
commit
e98e375984
4 changed files with 47 additions and 10 deletions
|
@ -108,13 +108,28 @@ const lcCommand gCommands[] =
|
|||
QT_TRANSLATE_NOOP("Status", "Export the current model in Wavefront OBJ format"),
|
||||
""
|
||||
},
|
||||
// LC_FILE_RENDER
|
||||
// LC_FILE_RENDER_POVRAY
|
||||
{
|
||||
QT_TRANSLATE_NOOP("Action", "File.Render"),
|
||||
QT_TRANSLATE_NOOP("Menu", "&Render..."),
|
||||
QT_TRANSLATE_NOOP("Action", "File.Render.POVRay"),
|
||||
QT_TRANSLATE_NOOP("Menu", "&POV-Ray Render..."),
|
||||
QT_TRANSLATE_NOOP("Status", "Render the current model using POV-Ray"),
|
||||
""
|
||||
},
|
||||
// LC_FILE_RENDER_BLENDER
|
||||
{
|
||||
QT_TRANSLATE_NOOP("Action", "File.Render.Blender"),
|
||||
QT_TRANSLATE_NOOP("Menu", "&Bender Render..."),
|
||||
QT_TRANSLATE_NOOP("Status", "Render the current model using Blender"),
|
||||
""
|
||||
},
|
||||
|
||||
// LC_FILE_RENDER_OPEN_IN_BLENDER
|
||||
{
|
||||
QT_TRANSLATE_NOOP("Action", "File.Render.OpenInBlender"),
|
||||
QT_TRANSLATE_NOOP("Menu", "&Open In Blender..."),
|
||||
QT_TRANSLATE_NOOP("Status", "Open the current model in Blender"),
|
||||
""
|
||||
},
|
||||
// LC_FILE_INSTRUCTIONS
|
||||
{
|
||||
QT_TRANSLATE_NOOP("Action", "File.Instructions"),
|
||||
|
|
|
@ -17,7 +17,9 @@ enum lcCommandId
|
|||
LC_FILE_EXPORT_CSV,
|
||||
LC_FILE_EXPORT_POVRAY,
|
||||
LC_FILE_EXPORT_WAVEFRONT,
|
||||
LC_FILE_RENDER,
|
||||
LC_FILE_RENDER_POVRAY,
|
||||
LC_FILE_RENDER_BLENDER,
|
||||
LC_FILE_RENDER_OPEN_IN_BLENDER,
|
||||
LC_FILE_INSTRUCTIONS,
|
||||
LC_FILE_PRINT,
|
||||
LC_FILE_PRINT_PREVIEW,
|
||||
|
|
|
@ -251,6 +251,21 @@ void lcMainWindow::CreateActions()
|
|||
EditActionPanIcon.addFile(":/resources/action_pan_16.png");
|
||||
mActions[LC_EDIT_ACTION_PAN]->setIcon(EditActionPanIcon);
|
||||
|
||||
QIcon FileRenderPOVRayIcon;
|
||||
FileRenderPOVRayIcon.addFile(":/resources/file_render_povray.png");
|
||||
FileRenderPOVRayIcon.addFile(":/resources/file_render_povray_16.png");
|
||||
mActions[LC_FILE_RENDER_POVRAY]->setIcon(FileRenderPOVRayIcon);
|
||||
|
||||
QIcon FileRenderBlenderIcon;
|
||||
FileRenderBlenderIcon.addFile(":/resources/file_render_blender.png");
|
||||
FileRenderBlenderIcon.addFile(":/resources/file_render_blender_16.png");
|
||||
mActions[LC_FILE_RENDER_BLENDER]->setIcon(FileRenderBlenderIcon);
|
||||
|
||||
QIcon FileOpenInBlenderIcon;
|
||||
FileOpenInBlenderIcon.addFile(":/resources/file_render_open_in_blender.png");
|
||||
FileOpenInBlenderIcon.addFile(":/resources/file_render_open_in_blender_16.png");
|
||||
mActions[LC_FILE_RENDER_OPEN_IN_BLENDER]->setIcon(FileOpenInBlenderIcon);
|
||||
|
||||
mActions[LC_EDIT_ACTION_CAMERA]->setIcon(QIcon(":/resources/action_camera.png"));
|
||||
mActions[LC_EDIT_ACTION_ROTATE_VIEW]->setIcon(QIcon(":/resources/action_rotate_view.png"));
|
||||
mActions[LC_EDIT_ACTION_ROLL]->setIcon(QIcon(":/resources/action_roll.png"));
|
||||
|
@ -443,7 +458,10 @@ void lcMainWindow::CreateMenus()
|
|||
ExportMenu->addAction(mActions[LC_FILE_EXPORT_POVRAY]);
|
||||
ExportMenu->addAction(mActions[LC_FILE_EXPORT_WAVEFRONT]);
|
||||
FileMenu->addSeparator();
|
||||
FileMenu->addAction(mActions[LC_FILE_RENDER]);
|
||||
QMenu* RenderMenu = FileMenu->addMenu(tr("&Render"));
|
||||
RenderMenu->addAction(mActions[LC_FILE_RENDER_POVRAY]);
|
||||
RenderMenu->addAction(mActions[LC_FILE_RENDER_BLENDER]);
|
||||
RenderMenu->addAction(mActions[LC_FILE_RENDER_OPEN_IN_BLENDER]);
|
||||
FileMenu->addAction(mActions[LC_FILE_INSTRUCTIONS]);
|
||||
FileMenu->addAction(mActions[LC_FILE_PRINT]);
|
||||
FileMenu->addAction(mActions[LC_FILE_PRINT_PREVIEW]);
|
||||
|
@ -1264,9 +1282,9 @@ void lcMainWindow::ShowHTMLDialog()
|
|||
lcGetActiveProject()->ExportHTML(Options);
|
||||
}
|
||||
|
||||
void lcMainWindow::ShowRenderDialog()
|
||||
void lcMainWindow::ShowRenderDialog(int Command)
|
||||
{
|
||||
lcRenderDialog Dialog(this);
|
||||
lcRenderDialog Dialog(this, Command);
|
||||
Dialog.exec();
|
||||
}
|
||||
|
||||
|
@ -2603,8 +2621,10 @@ void lcMainWindow::HandleCommand(lcCommandId CommandId)
|
|||
lcGetActiveProject()->ExportWavefront(QString());
|
||||
break;
|
||||
|
||||
case LC_FILE_RENDER:
|
||||
ShowRenderDialog();
|
||||
case LC_FILE_RENDER_POVRAY:
|
||||
case LC_FILE_RENDER_BLENDER:
|
||||
case LC_FILE_RENDER_OPEN_IN_BLENDER:
|
||||
ShowRenderDialog(CommandId - LC_FILE_RENDER_POVRAY);
|
||||
break;
|
||||
|
||||
case LC_FILE_INSTRUCTIONS:
|
||||
|
|
|
@ -326,7 +326,7 @@ protected:
|
|||
void ShowUpdatesDialog();
|
||||
void ShowAboutDialog();
|
||||
void ShowHTMLDialog();
|
||||
void ShowRenderDialog();
|
||||
void ShowRenderDialog(int Command);
|
||||
void ShowInstructionsDialog();
|
||||
void ShowPrintDialog();
|
||||
void CreatePreviewWidget();
|
||||
|
|
Loading…
Reference in a new issue