Skip to content

Commit

Permalink
Update to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JVerbruggen committed Aug 25, 2024
1 parent 3b70848 commit 8ba0d34
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 6 deletions.
47 changes: 47 additions & 0 deletions docs/advanced_coaster_yml/blender-as-trigger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Blender

Coasters can have blender animations along the track.

## Prerequisites
- Installed Blender version >2.80
- Downloaded a copy of the jrides Blender export tool `tools/jrides_blender_export_anim_plugin.py`

## How to

1. Create a Blender animations using object animations. (do not use rigging)
2. Name the animated object the same as your animation name, i.e. `main-animation`.
3. Select the object and export the Blender animation using the custom jrides export tool. (check the `tools` folder on GitHub: https://github.com/JVerbruggen/jrides)
1. `tools/jrides_blender_export_anim_plugin.py`
4. Name the file in the format of `<coaster_identifier>.<animation_name>.csv`, i.e. `mycoaster.main_animation.csv`.
5. Paste the file in the jrides folder `jrides/coasters/<coaster_identifier>/animations`.
6. Create a trigger file in `jrides/coasters/<coaster_identifier>/triggers/<my-trigger.yml>`
```yml
trigger:
type: blender-animation
location: [50.0, 10.0, 50.0] # [x, y, z]
animationName: my-cool-animation # Animation identifier
reuseEntity: my-coaster-my-cool-animation-entity # A unique identifier for an entity so that it can be used for multiple animations
preloadAnim: true # Whether to load the first frame of the animation when loading the plugin
item: # Item that is animated
material: YELLOW_WOOL
```
7. Use the trigger in either effect triggers for certain sections (i.e. the station section), or in the track trigger file. See [docs/triggers.md](../triggers.md).
1. *Your folder structure should now look something like this.*
```
plugins/
├─ jrides/
│ ├─ rides.yml
│ ├─ coasters/
│ │ ├─ mycoaster/
│ │ │ ├─ mycoaster.coaster.yml
│ │ │ ├─ mycoaster.default.trigger.yml
│ │ │ ├─ animations/
│ │ │ │ ├─ mycoaster.main_animation.csv
│ │ │ ├─ triggers/
│ │ │ │ ├─ my-trigger.yml
```

And you're done.
12 changes: 6 additions & 6 deletions docs/advanced_flatride_yml/blender.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Flat Rides can be programmed with blender animations.
## How to

1. Create a Blender animations using object animations. (do not use rigging)
2. Create a Flat Ride file with the same layout as your Blender animation objects.
3. Each object should have an equivalent jrides-configured Flat Ride bone.
4. Name all animated objects equal to the bone names. (Important! Jrides matches your Blender animation objects to its bones)
5. Export the Blender animation using the custom jrides export tool. (check the `tools` folder on GitHub: https://github.com/JVerbruggen/jrides)
2. Create a .flatride.yml file with the same layout as your Blender animation objects.
1. Each object should have an equivalent jrides-configured Flat Ride bone.
3. Name all animated objects equal to the bone names. (Important! Jrides matches your Blender animation objects to its bones)
4. Select all objects and export the Blender animation using the custom jrides export tool. (check the `tools` folder on GitHub: https://github.com/JVerbruggen/jrides)
1. `tools/jrides_blender_export_anim_plugin.py`
6. Name the file in the format of `<flatride_identifier>.<animation_name>.csv`, i.e. `teacups.main_animation.csv`.
7. Paste the file in the jrides folder `jrides/flatrides/<flatride_identifier/animations`.
5. Name the file in the format of `<flatride_identifier>.<animation_name>.csv`, i.e. `teacups.main_animation.csv`.
6. Paste the file in the jrides folder `jrides/flatrides/<flatride_identifier/animations`.
1. *Your folder structure should now look something like this.*

```
Expand Down
34 changes: 34 additions & 0 deletions docs/triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ Triggers can only exist when defined. Definitions can be found in multiple place
2. In the `<coaster_identifier>.coaster.yml` file ([link](./coaster_yml.md)), used for section types that support triggers, such as the `type: station` section type.
3. In another track's trigger file, other than the default track. Just like the `.default.trigger.yml` file, each registered track can have its own trigger file. The trigger file name should be called `<coaster_identifier>.<track_identifier>.trigger.yml`.

```
plugins/
├─ jrides/
│ ├─ rides.yml
│ ├─ coasters/
│ │ ├─ mycoaster/
│ │ │ ├─ mycoaster.coaster.yml # Triggers in section types
│ │ │ ├─ mycoaster.default.trigger.yml # Placing triggers alongside the default track
│ │ │ ├─ mycoaster.some-other-track.trigger.yml # Placing triggers alongside the 'some-other-track' track
│ │ │ ├─ triggers/
│ │ │ │ ├─ my-trigger.yml # Trigger definition
```

### File structure

As said, the file name of the general trigger.yml file is as follows: `<coaster_identifier>.<track_identifier>.trigger.yml`. The contents of this file is defined here.
Expand Down Expand Up @@ -67,6 +80,7 @@ The `trigger_type` can be either one of the following values:
* [type: command-for-player](#type-command-for-player)
* [type: command-as-player](#type-command-as-player)
* [type: external](#type-external-for-developers)
* [type: blender-animation]

<br/><br/>

Expand Down Expand Up @@ -216,4 +230,24 @@ trigger:
data:
<key>: <value>
<another_key>: <another_value>
```

---

### type: blender-animation

The external trigger allows you to run blender animations.

The animation should be exported with the jrides blender plugin, see [docs/advanced_coaster_yml/blender-as-trigger.md](../docs/advanced_coaster_yml/blender-as-trigger.md).

```yml
trigger:
type: blender-animation
location: [50.0, 10.0, 50.0] # [x, y, z]
animationName: my-cool-animation # Animation identifier
reuseEntity: my-coaster-my-cool-animation-entity # A unique identifier for an entity so that it can be used for multiple animations
preloadAnim: true # Whether to load the first frame of the animation when loading the plugin
item: # Item that is animated
material: YELLOW_WOOL
```

0 comments on commit 8ba0d34

Please sign in to comment.