@@ -39,7 +39,8 @@ static void KernelCacheFillProgressHandler(const size_t step, const size_t count
39
39
enum fileBrowserType { open , save, save_directory };
40
40
41
41
bool fileBrowser (
42
- string &fileName,
42
+ std::string &fileNamePath,
43
+ std::string &filePath,
43
44
const std::string &prompt,
44
45
const std::vector<std::string> &filterList,
45
46
fileBrowserType type
@@ -87,11 +88,13 @@ bool fileBrowser(
87
88
{
88
89
if (type != fileBrowserType::save_directory)
89
90
{
90
- fileName = fd->GetFilePathName ();
91
+ fileNamePath = fd->GetFilePathName ();
92
+ filePath = fd->GetCurrentPath ();
91
93
}
92
94
else
93
95
{
94
- fileName = fd->GetCurrentPath ();
96
+ fileNamePath = fd->GetCurrentPath ();
97
+ filePath = fd->GetCurrentPath ();
95
98
}
96
99
}
97
100
@@ -553,6 +556,7 @@ void LuxCoreApp::MainMenuBar() {
553
556
// File Dialogs
554
557
if (showLoadFileDialog) {
555
558
std::string fileToLoad;
559
+ std::string fileToLoad_path;
556
560
static const std::vector<std::string> filterLoad = {
557
561
" LuxCore scenes (.cfg,.bcf,.lxs){.cfg,.bcf,.lxs}" ,
558
562
" LuxCore scene - text (.cfg){.cfg}" ,
@@ -562,21 +566,24 @@ void LuxCoreApp::MainMenuBar() {
562
566
563
567
if (fileBrowser (
564
568
fileToLoad,
569
+ fileToLoad_path,
565
570
" Select File to Load" ,
566
571
filterLoad,
567
572
fileBrowserType::open ))
568
573
{
569
574
showLoadFileDialog = false ;
570
- LoadRenderConfig (fileToLoad);
575
+ LoadRenderConfig (fileToLoad, fileToLoad_path );
571
576
}
572
577
}
573
578
574
579
if (showExportFileDialog) {
575
580
std::string fileToExport;
581
+ std::string fileToExport_path;
576
582
static const std::vector<std::string> filterExport = {" All (.*){.*}" };
577
583
578
584
if (fileBrowser (
579
585
fileToExport,
586
+ fileToExport_path,
580
587
" Select Directory to Export" ,
581
588
filterExport,
582
589
fileBrowserType::save_directory))
@@ -605,12 +612,14 @@ void LuxCoreApp::MainMenuBar() {
605
612
if (showExportBinaryFileDialog)
606
613
{
607
614
std::string fileToExport;
615
+ std::string fileToExport_path;
608
616
static const std::vector<std::string> filterExport = {
609
617
" LuxCore exported scene (.bcf){.bcf}"
610
618
};
611
619
612
620
if (fileBrowser (
613
621
fileToExport,
622
+ fileToExport_path,
614
623
" Select File to Export" ,
615
624
filterExport,
616
625
fileBrowserType::save))
@@ -624,13 +633,15 @@ void LuxCoreApp::MainMenuBar() {
624
633
if (showExportGltfFileDialog)
625
634
{
626
635
std::string fileToExport;
636
+ std::string fileToExport_path;
627
637
static const std::vector<std::string> filterExport = {
628
638
" glTF files (.glTF,.gltf){.glTF,.gltf}" ,
629
639
" All files (.*){.*}" ,
630
640
};
631
641
632
642
if (fileBrowser (
633
643
fileToExport,
644
+ fileToExport_path,
634
645
" Select File to Export" ,
635
646
filterExport,
636
647
fileBrowserType::save))
@@ -644,13 +655,15 @@ void LuxCoreApp::MainMenuBar() {
644
655
if (showSaveRenderingFileDialog)
645
656
{
646
657
std::string fileToExport;
658
+ std::string fileToExport_path;
647
659
static const std::vector<std::string> filterExport = {
648
660
" LuxCore resume files (.rsm){.rsm}" ,
649
661
" All files (.*){.*}" ,
650
662
};
651
663
652
664
if (fileBrowser (
653
665
fileToExport,
666
+ fileToExport_path,
654
667
" Select File to Save" ,
655
668
filterExport,
656
669
fileBrowserType::save))
@@ -672,19 +685,21 @@ void LuxCoreApp::MainMenuBar() {
672
685
if (showResumeRenderingFileDialog)
673
686
{
674
687
std::string fileToLoad;
688
+ std::string fileToLoad_path;
675
689
static const std::vector<std::string> filterExport = {
676
690
" LuxCore resume files (.rsm){.rsm}" ,
677
691
" All files (.*){.*}" ,
678
692
};
679
693
680
694
if (fileBrowser (
681
695
fileToLoad,
696
+ fileToLoad_path,
682
697
" Select File to Load" ,
683
698
filterExport,
684
699
fileBrowserType::open ))
685
700
{
686
701
showResumeRenderingFileDialog = false ;
687
- LoadRenderConfig (fileToLoad);
702
+ LoadRenderConfig (fileToLoad, fileToLoad_path );
688
703
}
689
704
} // Resume Rendering
690
705
0 commit comments