MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / MenuRendering

Method MenuRendering

samples/luxcoreui/uimenu.cpp:41–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39#endif
40
41void LuxCoreApp::MenuRendering() {
42 if (ImGui::MenuItem("Load")) {
43 nfdchar_t *fileFileName = NULL;
44 nfdresult_t result = NFD_OpenDialog("cfg,bcf,lxs;cfg;bcf;lxs", NULL, &fileFileName);
45
46 if (result == NFD_OKAY) {
47 LoadRenderConfig(fileFileName);
48 free(fileFileName);
49 }
50 }
51
52 if (session && ImGui::MenuItem("Export")) {
53 nfdchar_t *outPath = NULL;
54 nfdresult_t result = NFD_SaveDialog(NULL, NULL, &outPath);
55
56 if (result == NFD_OKAY) {
57 LA_LOG("Export current scene to directory in text format: " << outPath);
58
59 boost::filesystem::path dir(outPath);
60 boost::filesystem::create_directories(dir);
61
62 // Save the current render engine
63 const string renderEngine = config->GetProperty("renderengine.type").Get<string>();
64
65 // Set the render engine to FILESAVER
66 RenderConfigParse(Properties() <<
67 Property("renderengine.type")("FILESAVER") <<
68 Property("filesaver.format")("TXT") <<
69 Property("filesaver.directory")(outPath) <<
70 Property("filesaver.renderengine.type")(renderEngine));
71
72 // Restore the render engine setting
73 RenderConfigParse(Properties() <<
74 Property("renderengine.type")(renderEngine));
75 }
76 }
77
78 if (session && ImGui::MenuItem("Export (binary)")) {
79 nfdchar_t *fileName = NULL;
80 nfdresult_t result = NFD_SaveDialog("bcf", NULL, &fileName);
81
82 if (result == NFD_OKAY) {
83 LA_LOG("Export current scene to file in binary format: " << fileName);
84 config->Save(fileName);
85 }
86 }
87
88 ImGui::Separator();
89
90 if (session && ImGui::MenuItem("Save rendering")) {
91 nfdchar_t *fileName = NULL;
92 nfdresult_t result = NFD_SaveDialog("rsm", NULL, &fileName);
93
94 if (result == NFD_OKAY) {
95 // Pause the current rendering
96 session->Pause();
97
98 // Save the session

Callers

nothing calls this directly

Calls 12

glfwSetWindowShouldCloseFunction · 0.85
Get<string>Method · 0.80
NFD_OpenDialogFunction · 0.50
NFD_SaveDialogFunction · 0.50
GetPropertyMethod · 0.45
SaveMethod · 0.45
PauseMethod · 0.45
SaveResumeFileMethod · 0.45
ResumeMethod · 0.45
IsInPauseMethod · 0.45
StopMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected