Format
This commit is contained in:
+16
-16
@@ -27,15 +27,15 @@ function args_parse() {
|
||||
// Process each arg
|
||||
let current_arg: string = krom_get_arg(i);
|
||||
|
||||
if (Path.is_project(current_arg)) {
|
||||
Project.filepath = current_arg;
|
||||
if (path_is_project(current_arg)) {
|
||||
project_filepath = current_arg;
|
||||
}
|
||||
else if (current_arg == "--b" || current_arg == "--background") {
|
||||
args_background = true;
|
||||
}
|
||||
|
||||
///if (is_paint || is_lab)
|
||||
else if (Path.is_texture(current_arg)) {
|
||||
else if (path_is_texture(current_arg)) {
|
||||
args_asset_path = current_arg;
|
||||
}
|
||||
else if (current_arg == "--export-textures" && (i + 3) <= krom_get_arg_count()) {
|
||||
@@ -58,7 +58,7 @@ function args_parse() {
|
||||
++i;
|
||||
args_export_mesh_path = krom_get_arg(i);
|
||||
}
|
||||
else if (Path.is_mesh(current_arg) || (i > 1 && !current_arg.startsWith("-") && Path.is_folder(current_arg))) {
|
||||
else if (path_is_mesh(current_arg) || (i > 1 && !current_arg.startsWith("-") && path_is_folder(current_arg))) {
|
||||
args_asset_path = current_arg;
|
||||
}
|
||||
///end
|
||||
@@ -79,20 +79,20 @@ function args_parse() {
|
||||
function args_run() {
|
||||
if (args_use) {
|
||||
app_notify_on_init(() => {
|
||||
if (Project.filepath != "") {
|
||||
ImportArm.run_project(Project.filepath);
|
||||
if (project_filepath != "") {
|
||||
ImportArm.run_project(project_filepath);
|
||||
}
|
||||
else if (args_asset_path != "") {
|
||||
ImportAsset.run(args_asset_path, -1, -1, false);
|
||||
///if is_paint
|
||||
if (Path.is_texture(args_asset_path)) {
|
||||
if (path_is_texture(args_asset_path)) {
|
||||
UIBase.show_2d_view(view_2d_type_t.ASSET);
|
||||
}
|
||||
///end
|
||||
}
|
||||
///if (is_paint || is_sculpt)
|
||||
else if (args_reimport_mesh) {
|
||||
Project.reimport_mesh();
|
||||
project_reimport_mesh();
|
||||
}
|
||||
///end
|
||||
|
||||
@@ -102,19 +102,19 @@ function args_run() {
|
||||
args_export_textures_type == "jpg" ||
|
||||
args_export_textures_type == "exr16" ||
|
||||
args_export_textures_type == "exr32") {
|
||||
if (Path.is_folder(args_export_textures_path)) {
|
||||
if (path_is_folder(args_export_textures_path)) {
|
||||
// Applying the correct format type from args
|
||||
if (args_export_textures_type == "png") {
|
||||
///if is_paint
|
||||
base_bits_handle.position = texture_bits_t.BITS8;
|
||||
///end
|
||||
Context.raw.format_type = texture_ldr_format_t.PNG;
|
||||
context_raw.format_type = texture_ldr_format_t.PNG;
|
||||
}
|
||||
else if (args_export_textures_type == "jpg") {
|
||||
///if is_paint
|
||||
base_bits_handle.position = texture_bits_t.BITS8;
|
||||
///end
|
||||
Context.raw.format_type = texture_ldr_format_t.JPG;
|
||||
context_raw.format_type = texture_ldr_format_t.JPG;
|
||||
}
|
||||
else if (args_export_textures_type == "exr16") {
|
||||
///if is_paint
|
||||
@@ -128,11 +128,11 @@ function args_run() {
|
||||
}
|
||||
|
||||
///if is_paint
|
||||
Context.raw.layers_export = export_mode_t.VISIBLE;
|
||||
context_raw.layers_export = export_mode_t.VISIBLE;
|
||||
///end
|
||||
|
||||
// Get export preset and apply the correct one from args
|
||||
BoxExport.files = File.read_directory(Path.data() + Path.sep + "export_presets");
|
||||
BoxExport.files = file_read_directory(path_data() + path_sep + "export_presets");
|
||||
for (let i: i32 = 0; i < BoxExport.files.length; ++i) {
|
||||
BoxExport.files[i] = BoxExport.files[i].substr(0, BoxExport.files[i].length - 5); // Strip .json
|
||||
}
|
||||
@@ -163,10 +163,10 @@ function args_run() {
|
||||
|
||||
///if (is_paint || is_sculpt)
|
||||
else if (args_export_mesh) {
|
||||
if (Path.is_folder(args_export_mesh_path)) {
|
||||
if (path_is_folder(args_export_mesh_path)) {
|
||||
let f: string = UIFiles.filename;
|
||||
if (f == "") f = tr("untitled");
|
||||
ExportMesh.run(args_export_mesh_path + Path.sep + f, null, false);
|
||||
ExportMesh.run(args_export_mesh_path + path_sep + f, null, false);
|
||||
}
|
||||
else {
|
||||
krom_log(tr("Invalid export directory"));
|
||||
@@ -176,7 +176,7 @@ function args_run() {
|
||||
|
||||
///if is_paint
|
||||
else if (args_export_material) {
|
||||
Context.raw.write_icon_on_export = true;
|
||||
context_raw.write_icon_on_export = true;
|
||||
ExportArm.run_material(args_export_material_path);
|
||||
}
|
||||
///end
|
||||
|
||||
Reference in New Issue
Block a user