Godot - Trenchbroom setup
This is my setup to work with Trenchbroom in Godot with func_godot .
At the moment though, it’s a bit tedious to add new 3D models.
I need to create a tool script to automate this part.
Here’s what I have to do to make a model available in Trenchbroom:
- Create the model in blender, with the materials
- Export the model as an glb to Godot
- Create a Godot scene, with the model in it, rotate it to face the correct direction
- Create an entity resource using the model
- Export the entities library
- Reload the entities in trenchbroom
For reference, here’s how I structure a project:
GodotGame/
├───raw_assets/ # .blend / .krita / .aseprite ...
├───src/ # The actual godot folder
│ ├───addons/
│ │ └───func_godot/
│ ├───entities/ # One folder per entity
│ │ ├───player/
| │ │ ├───player.gd # Godot script
| │ │ └───player.tscn # Godot scene file
│ │ ├───door_entity/
| │ | ├───door_entity.gd # Godot script
| │ | ├───door_entity.tres # FuncGodotFGDBaseClass Resource
| │ | └───door_entity.tscn # Godot scene file
│ │ └───fdg.tres # FuncGodotFGDFile Resource
| ├───maps/ # Trenchbroom & Godot Scene map files
│ │ ├───level1/
| │ │ ├───level1.tscn # Godot scene file
| │ │ ├───level1_map_settings.tres # Optional FuncGodotMapSettings Resource
| │ │ └───level1.map # Trenchbroom map file
│ │ └───func_godot_map_settings.tres # Global FuncGodotMapSettings Resource
│ ├───scripts/ # Non-entity scripts, like tools, managers, UI, ...
│ ├───models/ # Exported game models in .glb format
| │ └───props/ # <-- Folder from which all props entities will be generated
│ ├───textures/ # Textures
│ └───config.tres # TrenchBroomGameConfig Resource
└───trenchbroom/ # FuncGodot's "Map Editor Game Path"
└───models/ # FuncGodot exported models, added to .gitignore