diff --git a/__init__.py b/__init__.py index 981a14c..c31b33e 100644 --- a/__init__.py +++ b/__init__.py @@ -104,6 +104,10 @@ def INPUT_TYPES(s): return { "required": { "mesh": ("MESH",) + }, + "optional": { + "outputName": ("STRING", {"default": "meshsave"}), + "overrideFilename": ("BOOLEAN", {"default": True}), } } @@ -112,14 +116,16 @@ def INPUT_TYPES(s): FUNCTION = "display" CATEGORY = "Flowty TripoSR" - def display(self, mesh): + def display(self, mesh, outputName="meshsave", overrideFilename=True): saved = list() - full_output_folder, filename, counter, subfolder, filename_prefix = get_save_image_path("meshsave", - get_output_directory()) + full_output_folder, filename, counter, subfolder, filename_prefix = get_save_image_path(outputName, get_output_directory()) for (batch_number, single_mesh) in enumerate(mesh): - filename_with_batch_num = filename.replace("%batch_num%", str(batch_number)) - file = f"{filename_with_batch_num}_{counter:05}_.obj" + if overrideFilename: + file = outputName+".obj" + else: + filename_with_batch_num = filename.replace("%batch_num%", str(batch_number)) + file = f"{filename_with_batch_num}_{counter:05}_.obj" single_mesh.apply_transform(np.array([[1, 0, 0, 0], [0, 0, 1, 0], [0, -1, 0, 0], [0, 0, 0, 1]])) single_mesh.export(path.join(full_output_folder, file)) saved.append({