Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6013: Refactor ExportSelectedAsModel command signature, adjust dialo…
…g to pass the correct set of arguments
- Loading branch information
1 parent
f8a1de2
commit c080c53
Showing
9 changed files
with
193 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#pragma once | ||
|
||
#include <stdexcept> | ||
#include <string> | ||
#include "math/Vector3.h" | ||
|
||
namespace model | ||
{ | ||
|
||
enum class ModelExportOrigin | ||
{ | ||
MapOrigin, | ||
SelectionCenter, | ||
EntityOrigin, | ||
CustomOrigin, | ||
}; | ||
|
||
struct ModelExportOptions | ||
{ | ||
std::string outputFilename; // full export path | ||
std::string outputFormat; // model exporter extension | ||
bool skipCaulk; // whether to skip caulk | ||
ModelExportOrigin exportOrigin; // where to center objects | ||
bool replaceSelectionWithModel; // delete the selection and put the exported model in its place | ||
std::string entityName; // when EntityOrigin is chosen, this defines the entity to pick | ||
bool exportLightsAsObjects; // will export lights as small octahedrons | ||
Vector3 customExportOrigin; // used when exportOrigin == ModelExportOrigin::CustomOrigin | ||
}; | ||
|
||
inline std::string getExportOriginString(ModelExportOrigin option) | ||
{ | ||
switch (option) | ||
{ | ||
case ModelExportOrigin::MapOrigin: return "MapOrigin"; | ||
case ModelExportOrigin::SelectionCenter: return "SelectionCenter"; | ||
case ModelExportOrigin::EntityOrigin: return "EntityOrigin"; | ||
case ModelExportOrigin::CustomOrigin: return "CustomOrigin"; | ||
default: throw std::invalid_argument("Unknown model export option"); | ||
} | ||
} | ||
|
||
inline ModelExportOrigin getExportOriginFromString(const std::string& optionString) | ||
{ | ||
if (optionString == "MapOrigin") return ModelExportOrigin::MapOrigin; | ||
if (optionString == "SelectionCenter") return ModelExportOrigin::SelectionCenter; | ||
if (optionString == "EntityOrigin") return ModelExportOrigin::EntityOrigin; | ||
if (optionString == "CustomOrigin") return ModelExportOrigin::CustomOrigin; | ||
|
||
return ModelExportOrigin::MapOrigin; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.