props/README.md

97 lines
3.0 KiB
Markdown
Raw Normal View History

2020-07-28 14:04:39 +02:00
# Props Module
This is a c++ engine module for the Godot Engine.
It gives you props, and editor utilities to convert scenes to props.
2021-02-06 11:54:57 +01:00
It supports both godot 3.2 and 4.0 (master [last tested commit](https://github.com/godotengine/godot/commit/b7e10141197fdd9b0dbc4cfa7890329510d36540)). Note that since 4.0 is still in very early stages I only
2020-07-28 14:04:39 +02:00
check whether it works from time to time.
# Pre-built binaries
2020-07-28 14:06:26 +02:00
You can grab a pre-built editor binary from the [Broken Seals](https://github.com/Relintai/broken_seals/releases)
2020-07-28 14:04:39 +02:00
repo, should you want to. It contains all my modules.
# Optional Dependencies
2020-07-28 14:07:24 +02:00
[Mesh Data Resource](https://github.com/Relintai/mesh_data_resource): Support for merged meshes, even in gles2.\
[Texture Packer](https://github.com/Relintai/texture_packer): Prop Instance will use this to merge textures.\
2020-07-28 14:04:39 +02:00
[Thread Pool](https://github.com/Relintai/thread_pool): Prop Instance will use this for multithreaded generation.
# PropData
Props are basicly 3D scenes in a simple format, so other things can easily process them without instancing.
For example if you create a building from MeshDataInstances, and then convert that scene to a prop, Voxelman
can spawn it, merge it's meshes, and create lods without any scene instancing.
PropData is the main class you'll use, it's main purpose it to store a list of PropDataEntries.
# PropDataEntries
These are the classes that actually store data.
They contain 4 methods for scene->prop conversion, namely:
```
//Whether or not this PropDataEntry can process the given Node.
virtual bool _processor_handles(Node *node);
//Save the given Node into the given prop_data any way you like, at tranform.
virtual void _processor_process(Ref<PropData> prop_data, Node *node, const Transform &transform);
//Turn PropDataEntry back into a Node
virtual Node *_processor_get_node_for(const Transform &transform);
//Whether the system should skip evaluating the children of a processes Node or not. See PropDataScene, or PropDataProp.
virtual bool _processor_evaluate_children();
```
# PropInstances
PropInstances are not yet finished.
They will be able to merge meshes, texture etc from a Prop, and also generate lods for it.
2020-07-28 14:09:09 +02:00
Essentially they will be a more advanced MeshInstance.
2020-07-28 14:04:39 +02:00
Voxelman implements all of this, just haven't finished porting it yet.
# PropUtils Singleton
The PropUtils singleton helps with scene->prop conversion.
You can register new PropDataEntries as processors, should you need to.
# Scene conversion
You can either click the new "To Prop" button on the menubar of the 3D scene for a quick conversion,
or look into Project->Tools.
# Building
1. Get the source code for the engine.
If you want Godot 3.2:
```git clone -b 3.2 https://github.com/godotengine/godot.git godot```
If you want Godot 4.0:
```git clone https://github.com/godotengine/godot.git godot```
2. Go into Godot's modules directory.
```
cd ./godot/modules/
```
3. Clone this repository
```
2020-07-28 14:09:09 +02:00
git clone https://github.com/Relintai/props props
2020-07-28 14:04:39 +02:00
```
4. Build Godot. [Tutorial](https://docs.godotengine.org/en/latest/development/compiling/index.html)