NSACloud / RE-Mesh-Editor

Blender addon for importing and exporting RE Engine mesh and mdf2 files natively in Blender. No Noesis required.
GNU General Public License v3.0
41 stars 2 forks source link

Scripting usage #8

Open 09williamsad opened 4 hours ago

09williamsad commented 4 hours ago

Blender importers can usually be run from the command/script window. This is good for operations like batch conversion of multiple files.

However, I have not been able to get this working for re-mesh.

With most importers, the below should trigger the importer to load a file. "import bpy import os bpy.ops.re_mesh.importfile(filepath="C:/Users/adamw/Downloads/MHWs/natives/stm/art/model/character/ch00/000/0000/ch00_000_0000.mesh.240820143")"

With RE Mesh it is accepting the filepath argument, but no action occurs after that and no mesh is imported. "RE Mesh Editor V0.34 Blender Version 4.2.1 https://github.com/NSACloud/RE-Mesh-Editor Info: Imported RE Mesh file."

I have not been able to figure out why. Additionally I am still trying to call the texture importer in a way that is not using drag and drop.

NSACloud commented 4 hours ago

The filepath argument isn't used, it uses the files and directory argument. Add an info window and import a file, it'll show you the arguments. It's that way to allow for multi file imports.

09williamsad commented 3 hours ago

Thank you for the information. I did not think the directory and file arguments had to be specified seperately. "import bpy import os bpy.ops.re_mesh.importfile(directory="C:/Users/adamw/Downloads/MHWs/natives/stm/art/model/character/ch00/000/0000/", files=[{"name":"ch00_000_0000.mesh.240820143"}])"

Do you have any pointers for the texture conversion by script instead of drag and drop? I have not found a way to call it yet.

NSACloud commented 3 hours ago

It should be the same as mesh import except with bpy.ops.re_tex.convert_tex_dds_files()