3 #include <Strings/components/utils/io/io.h>
4 #include <Strings/components/utils/string/string.h>
5 #include <Strings/components/utils/converters/converters.h>
6 #include <Strings/components/logger/logger.h>
8 #include <HEKGuerilla/components/tags/importers/render_model/render_model.h>
9 #include <HEKGuerilla/components/tags/tags.h>
10 #include <HEKGuerilla/components/settings/config/config.h>
12 #include "../ToolCommand.hpp"
13 #include "../console.h"
16 #ifdef TOOL_LIB_EXPORTS
17 #define TOOL_LIB_API __declspec(dllexport)
19 #define TOOL_LIB_API __declspec(dllimport)
31 std::vector<std::string> supported_formats =
33 "3D",
"3DS",
"3MF",
"AC",
"AC3D",
"ACC",
"AMJ",
"ASE",
"ASK",
"B3D",
"BVH",
"CSM",
"COB",
"DAE/Collada",
34 "DXF",
"ENFF",
"FBX",
"glTF 1.0 + GLB",
"glTF 2.0",
"HMB",
"IFC-STEP",
"IQM",
"IRR / IRRMESH",
"LWO",
35 "LWS",
"LXO",
"M3D",
"MD2",
"MD3",
"MD5",
"MDC",
"MDL",
"MESH / MESH.XML",
"MOT",
"MS3D",
"NDO",
"NFF",
36 "OBJ",
"OFF",
"OGEX",
"PLY",
"PMX",
"PRJ",
"Q3O",
"Q3S",
"RAW",
"SCN",
"SIB",
"SMD",
"STP",
"STL",
"TER",
37 "UC",
"USD",
"VTA",
"X",
"X3D",
"XGL",
"ZGL"
40 std::vector<std::string> supported_extensions =
42 "3D",
"3DS",
"3MF",
"AC",
"AC3D",
"ACC",
"AMJ",
"ASE",
"ASK",
"B3D",
"BVH",
"CSM",
"COB",
"DAE",
43 "DXF",
"ENFF",
"FBX",
"GLTF",
"HMB",
"IFCXML",
"IQM",
"IRR",
"IRRMESH",
"LWO",
44 "LWS",
"LXO",
"M3D",
"MD2",
"MD3",
"MD5",
"MDC",
"MDL",
"MESH",
"MESH.XML",
"MOT",
"MS3D",
"NDO",
"NFF",
45 "OBJ",
"OFF",
"OGEX",
"PLY",
"PMX",
"PRJ",
"Q3O",
"Q3S",
"RAW",
"SCN",
"SIB",
"SMD",
"STP",
"STL",
"TER",
46 "UC",
"USD",
"VTA",
"X",
"X3D",
"XGL",
"ZGL"
53 syntax =
"render-model <file>";
54 description =
"imports a model file as a render_model. will not create or update any [hlmt] model tag."
55 "supported formats: " + BlamStrings::Utils::String::BuildFromList(supported_formats);
58 int execute(std::vector<std::string> args)
63 std::string input_file =
"";
64 std::string output_directory =
"";
68 BlamStrings::Logger::LogEvent(
"no input file path was provided, cannot import model", BlamLogLevel::Warning);
74 BlamStrings::Logger::LogEvent(
"too many arguments specified - skipping import. check your input and try again. "
75 "for additional help, use 'tool.exe help render-model'.", BlamLogLevel::Warning);
79 input_file = import_base_dir + args[0];
80 output_directory = output_base_dir + BlamStrings::Utils::IO::GetContainingFolder(args[0],
false);
92 if (!Guerilla::Tags::Importers::RenderModel::ImportRenderModel(input_file, output_directory))
94 BlamStrings::Logger::LogEvent(
"failed to import render model '" + input_file +
"'", WSV_WARNING);
98 BlamStrings::Logger::LogEvent(
"successfully imported render model '" + input_file +
"' to directory '" + output_directory +
"'");
101 Guerilla::Tags::ReleasePlugins();
103 BlamStrings::Logger::LogEvent(
"finished.");