Skip to content

ReyeMe/ModelConverter-linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Model converter

Simple cross-platform model converter written in C# .NET with plugin support.

Base arguments

Base arguments

Argument Description
exp [name] Force export plugin regardless of file extension
imp [name] Force import plugin regardless of file extension
[paths] Path to the input file. (eg.: -i "work/models/test.obj") or multiple files (eg.: -i "work/models/test1.obj" "work/models/test2.obj")
[path] Path to the output file. (eg.: -o "work/result.tmf")
help, h Shows this helps screen. To show specific plugin help add plugin name after command.
plugins Show all available plugins.
order Keep = Keep meshes in same order as within files. (default)
ByName = Order all meshes alphabetically before exporting

Note: -i argument can take multiple paths, this allows the export plugins to create either vertex animated models or store multiple models in a single file.
Example: -i "MyFolder/model_01.obj" "MyFolder/model_02.obj"

Note: Paths specified for the -i argument can also use wildcards.
Example: -i "MyFolder/model_*.obj"

Argument usage example

Windows:

ModelConverter -i "./my models/model.obj" -o "./converted/MODEL.NYA"

Linux:

dotnet ./ModelConverter.dll -i "./my models/model.obj" -o "./converted/MODEL.NYA"

Plugins

Model converter supports both import and export plugins. Plugins can either be picked automatically or manually using cmd arguments.

To show help for each specific plugin, type -h [plugin name] as an argument for the model converter. To get the name of the available plugin -plugins argument can be used.

Pre-made plugins

Plugin Type Ext Description
NYA Export .NYA Export for sega Saturn game Utenyaa and SRL samples
TMF Export .TMF Export for sega Saturn game TankGame
Wavefront Import .obj Wavefront importer

Wavefront import plugin

Description

.obj import plugin reads .mtl file to decide what color (using kd attribute) or texture (using map_kd attribute).

Material name is also parsed for special flags. Characters after last _ symbol in material name are treated as special flags (see in table below).
Example of a material name with double sided and mesh transparency flag: MyMaterial_DM

Flag Description
M Mesh checkerboard transparency
D Face is double sided
H Half-transparent (50% VDP1 transparency)
F Force face to be flat shaded
N Force no light
B Half-bright (50% color brightness)
W Mesh face is rendered as outline wires (rendered as closed polyline)
C,L,-,+ C = Sort by center of quad (default if -sort not set)
L = Same sort as last rendered quad
- = Sort by closest point
+ = Sort by furthest point
If not specified, sorting by center point is used

Note: Support of these flags highly depends on the export plugins.

Plugin arguments
Argument Description
s, scale Scale the imported object by some multiplier
-s 1.5 = Scale 1.5x
z, sort Set default sort method
-z Far = Sort by furthest point
-z Near = Sort by closest point
-z Mid = Sort by center of quad (default)
-z Last = Same sort as last rendered quad

TMF export plugin

Description

Export for sega Saturn game TankGame. Format has support for multiple objects within a single file. Textures are not embedded inside a file, but referenced by a file name specified in the map_kd.

Note: See the plugin project folder in github repository for loader code for jo-engine.
Note: This plugin does not support UV mapping, and supports only D and M flags.

Nya export plugin

Description

Export for sega Saturn game Utenyaa and SRL samples.
This format supports UV mapping and smooth shading, also allows for multiple objects to be inside a single file making vertex animations possible as well.

Note: When exporting smooth type, vertex normal table is exported at the end of object mesh data.
Note: UV mapping generates a new sprite texture for each unique UV region.
Note: This plugin supports all of the face flags.

Plugin arguments
Argument Description
w, no-unwrap Disable UV mapping preprocessor
t, type Specify object type
-t NoLight = Not shaded
-t Flat = Flat shaded
-t Smooth = Smooth shaded model

Custom plugins

Custom plugins can be also written by referencing the ModelConverter.dll and implementing the interfaces within. Custom plugin dll with its dependencies can than be put inside /plugins/[plugin name]/ folder. Each custom plugin can also implement its own command line arguments.

About

Linux version of model conversion tool for sega saturn, runs in terminal

Resources

License

Stars

Watchers

Forks

Packages

No packages published