|
@@ -93,7 +93,7 @@ void ExportScenePbrt(const char *pFile, IOSystem *pIOSystem, const aiScene *pSce
|
|
|
const ExportProperties *) {
|
|
|
std::string path = DefaultIOSystem::absolutePath(std::string(pFile));
|
|
|
std::string file = DefaultIOSystem::completeBaseName(std::string(pFile));
|
|
|
- path = path + file + ".pbrt";
|
|
|
+
|
|
|
// initialize the exporter
|
|
|
PbrtExporter exporter(pScene, pIOSystem, path, file);
|
|
|
}
|
|
@@ -174,7 +174,13 @@ PbrtExporter::PbrtExporter(
|
|
|
WriteWorldDefinition();
|
|
|
|
|
|
// And write the file to disk...
|
|
|
- std::unique_ptr<IOStream> outfile(mIOSystem->Open(mPath,"wt"));
|
|
|
+ std::string outputFilePath = mPath;
|
|
|
+ if (!outputFilePath.empty()) {
|
|
|
+ outputFilePath = outputFilePath + mIOSystem->getOsSeparator();
|
|
|
+ }
|
|
|
+ outputFilePath = outputFilePath + mFile +".pbrt";
|
|
|
+
|
|
|
+ std::unique_ptr<IOStream> outfile(mIOSystem->Open(outputFilePath,"wt"));
|
|
|
if (!outfile) {
|
|
|
throw DeadlyExportError("could not open output .pbrt file: " + std::string(mFile));
|
|
|
}
|