GEM Importer
Quick Guide
GEM Importer converts input FBX, OBJ, glTF/GLB, and MDL files into a set of GEM/MDL output files.
The program can be launched in two ways:
Double-click
gem_import.exe. The program runs according to the settings in thegem_import.jsonconfiguration file.From the command line. This method allows you to pass parameters for a specific run without modifying the
gem_import.jsonconfiguration file.
First run
On the first run, GEM Importer creates a basic gem_import.json configuration file in the folder containing gem_import.exe and then exits.
To perform the first run, either double-click gem_import.exe or run the program from the command line without any parameters [gem_import].
No files are imported during the first run.
Configuration source precedence
The final import parameter values are determined from three sources. Each subsequent source has higher priority and overrides the corresponding values from the previous source:
Built-in default values;
Sections in
gem_import.json;Explicit CLI overrides.
Configuring gem_import.json
The gem_import.json file is the primary way to configure GEM Importer. After the first run, open the generated file in a text editor and specify the import parameters. On subsequent launches by double-clicking, the program uses the settings from this file.
gem_import.json key reference
app.debug
outLog
Path to the log folder
app.debug
verbose
File log verbosity level [0..2]
app.debug
htmlFormat
Write the import log in HTML format instead of TXT
app.debug
dryRun
Enables read and validation mode without writing the regular output
import.general
inputDir
Path to the source folder containing files to import.
Input folders used by --run-config
import.general
outDir
Path to the root import output folder
import.general
format
Specifies the target MDL format for the imported model.
Available values:
• MDL1 — for GEM1.
• MDL2 — for GEM2.
• MDL3 — for GEM RTS.
import.general
importUniformScale
Scale applied to imported models
import.content
volumes
When enabled, the importer preserves and exports detected volume/collision content to MDL and .cmesh
import.overwriteExisting
mesh,
texture,
animation,
material,
cmesh,
def,
mdl
Allows existing output files of the specified types to be overwritten
import.textures
searchPaths
Additional folders in which to search for source textures
import.textures
textureOutputSubdir
Relative subfolder inside outDir for exported textures. If the value is empty, textures are written next to the model
import.textures
useTexturesFromModel
true— use texture references from the source material;false— collect material textures from folders named after the materials
import.textures
fileNameConvention
Maps filename suffixes to .material fields when useTexturesFromModel=false
import.materials
classSimple, classStandard,
classStandardLightmap
classStandardEmissive
Classes of the generated MDL materials
import.materials
defaultNormal, defaultAo, defaultRoughness, defaultMetallic
Fallback textures for generated materials
Geometry processing
The importer automatically accounts for the coordinate systems used by the input formats and performs the transformations required for GEM/MDL output. For FBX and OBJ files, normals are generated only if they are missing from the source model.
Polygon sidedness cannot be configured through JSON.
For GLB/GLTF, the source material's
doubleSidedvalue is preserved.For FBX, the importer uses the material's two-sided setting and any
CullingOff/CullingOnvalue explicitly assigned to the node.A submesh with no assigned material is forced to use
twoSided=true.
Setting content.volumes=true does not generate volumes when none are present. This flag allows the importer to preserve and write volumes detected in the source model.
When set to
false, volume resources and.cmeshelements are removed before the output is written.Overwriting an existing
.cmeshis controlled independently byoverwriteExisting.cmesh.
The overwriteExisting flag
The overwriteExisting flags do not disable the export of new files. They protect only files that already exist. The following rules apply:
if the file does not exist, it is written;
if the file already exists, it is written only when
overwriteExisting.<type> = true.
This parameter prevents existing, configured .def and .mdl files from being overwritten when the model is imported again.
Texture processing
The searchPaths parameter specifies where the importer searches for source textures. It is also used to locate external images referenced by .gltf files.
The textureOutputSubdir parameter specifies the output subfolder for exported textures inside outDir.
The model is then written to <outDir>/<model_stem>/,
and its textures are written to <outDir>/textures/<model_stem>/.
If textureOutputSubdir is empty, the textures are written next to the model.
The useTexturesFromModel parameter
Standard mode (default setting):
The importer uses texture references from the source material: FBX material slots, OBJ .mtl, or glTF/GLB materials.
Alternative mode:
The importer ignores texture references embedded in the model and searches for material folders next to the source model and directly inside each folder listed in searchPaths.
Without searchPaths:
To add an extra textures level, specify it explicitly relative to the model folder:
The same structure is used for an absolute searchPaths value:
Example for the matid_1 material:
Texture type suffixes are configured in import.textures.fileNameConvention:
The key is a field or slot in the generated .material.
The key value is a list of accepted suffixes that follow the final underscore [ _ ] in the filename.
The name of the immediate parent folder must match the material name. Files in folders belonging to other materials are ignored.
Command-line parameters
Command-line parameters allow you to change settings for a specific GEM Importer run. The supplied values take precedence over the corresponding values in gem_import.json but do not modify the configuration file.
No parameters
Create the gem_import.json configuration file with the basic import settings and exit on the first run.
If gem_import.json already exists, import files according to the settings in the configuration file
-i, --input <file>
One input file.
Supported formats: .fbx, .obj, .gltf, .glb, .mdl
--input-dir <dirs>
One or more input folders. Separate paths with a semicolon [ ; ]
--run-config
Import from import.general.inputDir
-s, --settings <file>
Use the specified gem_import.json
-o, --out-dir <dir>
Root output folder. Overrides import.general.outDir
--verbose [0 | 1 | 2 ]
Set the log file verbosity level
--html
--no-html
Write an HTML log Write a TXT log
--dry-run
Read and validate only, without writing the regular output
--write-help
Write gem_import.md next to the executable
--version
Display the gem_import version and exit
-h, --help
Display command-line help
Running with a BAT file
For regular GEM Importer runs with the same parameters, you can create a BAT file. This eliminates the need to enter the command manually each time.
Create a text file in the folder containing gem_import.exe, add the launch command, and save the file with the .bat extension, for example, import_models.bat:
Double-click the BAT file to run the command. The pause command keeps the Command Prompt window open after the import is complete so that you can review the program messages.
Import output files
A typical import produces the following set of files:
Last updated