This project currently renders spacecraft from OBJ plus MTL assets that live under assets/spacecraft/imported/. That is the runtime contract to satisfy if you want a new ship to appear in movies or become drivable.
For a precise end-to-end walkthrough, including menu behavior and exact file edits, use Add new spacecraft tutorial.
Each imported spacecraft should end up as:
assets/spacecraft/imported/<pack>/<ship>/
model.obj
model.mtl
textures...
README.md
Important rules:
- keep texture paths relative
- do not depend on absolute host paths
- keep one ship per folder
- record source and conversion notes in
README.md
See also:
- Add new spacecraft tutorial
../../assets/spacecraft/README.md../../assets/spacecraft/imported/README.md
The usual flow is:
assets/spacecraft/sources/... -> raw downloads or source bundles
scripts/convert_spacecraft_* -> normalize and export runtime OBJ
assets/spacecraft/imported/... -> engine-ready runtime asset
src/spacecraft/spacecraft_catalog.f90 -> drivable catalog entry
../../scripts/convert_spacecraft_glb.py../../scripts/convert_spacecraft_obj.py../../scripts/convert_spacecraft_3ds.py
These Blender batch scripts:
- import the source mesh
- optionally decimate it
- triangulate it
- center and normalize scale
- export runtime OBJ plus MTL
GLB or glTF source:
blender -b -P scripts/convert_spacecraft_glb.py -- \
--input assets/spacecraft/sources/real/new_probe/source.glb \
--output assets/spacecraft/imported/real/new_probe/model.obj \
--target-extent 2.0 \
--decimate-ratio 0.35OBJ source:
blender -b -P scripts/convert_spacecraft_obj.py -- \
--input assets/spacecraft/sources/trek/new_ship/source.obj \
--output assets/spacecraft/imported/trek/new_ship/model.obj \
--target-extent 2.03DS source:
blender -b -P scripts/convert_spacecraft_3ds.py -- \
--input assets/spacecraft/sources/trek/new_ship/source.3ds \
--output assets/spacecraft/imported/trek/new_ship/model.obj \
--target-extent 2.0Each imported asset should include:
- source URL
- author or origin
- license direction
- conversion tool and settings
- scale notes
- orientation notes
You can use ../../assets/spacecraft/imported/real/voyager1/README.md as a model.
To make a ship drivable and selectable, add it to ../../src/spacecraft/spacecraft_catalog.f90.
You will usually need to:
- increase
SPACECRAFT_CATALOG_COUNT - add a
spacecraft_catalog_init_entry(...)call - tune visual scale and follow-camera offsets
- tune
model_pitchandmodel_yawuntil the ship reads nose-first
Example pattern:
call spacecraft_catalog_init_entry(entries(4), "new_ship", "New Ship", "Custom", &
"starship", "assets/spacecraft/imported/custom/new_ship/model.obj", &
"assets/spacecraft/imported/custom/new_ship/README.md", &
"earth", 2.10_real32, 0.18_real32, 0.04_real32, &
-1.570796_real32, 0.6_real32)The practical reality is that imported meshes do not share one universal front/up axis.
Use these fields for first-pass correction:
visual_scalefollow_distancefollow_heightmodel_pitchmodel_yaw
See also:
If a ship still looks wrong in motion:
- render a single smoke clip
- check whether thrust looks nose-first
- adjust
model_pitchandmodel_yaw - repeat before using the ship in a batch reel
After import:
- build the app
- select the new ship in the catalog
- spawn near Earth
- verify the mesh loads without missing local texture paths
- check follow camera readability
- record one short shot before adding it to a larger manifest
Useful commands:
cmake --build build -j 4
bash movies/render_one.sh earth_convoy movies/output/smokeFor a new ship, swap the selected catalog entry first, then use follow camera or a dedicated smoke shot.
The runtime can render more assets than the current drivable catalog exposes. Imported folders alone do not make a ship selectable. The catalog is the gate between "asset exists" and "pilot can spawn it".
