Skip to content

Commit 3163342

Browse files
authored
🔀 Merge ✨ feat/new-helper-functions (#9)
2 parents edfabbc + 18a939e commit 3163342

File tree

9 files changed

+236
-201
lines changed

9 files changed

+236
-201
lines changed

‎.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
run: corepack enable
2121

2222
- name: Install Dependencies
23-
run: yarn install
23+
run: yarn install --frozen-lockfile
2424

2525
- name: Build
2626
run: yarn build

‎src/routes/docs/[...4]rigs/[...2]summoning-a-new-rig-instance/+page.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ function animated_java:<export_namespace>/summon {args: {}}
1414
However, you may want to specify the position and rotation of the Rig Instance. To do this, you can change the execution context of the `summon` function:
1515

1616
```rust title=Summoning a Rig Instance at a specific position and rotation | copy
17-
execute positioned <x> <y> <z> rotated <rx> <ry> run function animated_java:<export_namespace>/summon {args: {}}
17+
execute positioned <x> <y> <z> rotated <rx> <ry> run \
18+
function animated_java:<export_namespace>/summon {args: {}}
1819
```
1920

2021
## Arguments

‎src/routes/docs/[...4]rigs/[...3]controlling-a-rig-instance/+page.md

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -38,92 +38,6 @@ execute as @e[type=item_display,tag=aj.<export_namespace>.root] at @s run \
3838
tp @s ~ ~5 ~ ~90 ~
3939
```
4040

41-
## Controlling Animation Playback
42-
43-
Animation playback is controlled using functions. Each animation has a set of functions that can be called to control it. Animation functions _must_ be ran as the root entity of the Rig Instance.
44-
45-
### Play Function
46-
47-
Starts playing the animation from the beginning.
48-
49-
```rust title=Play the walk animation | copy
50-
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
51-
function animated_java:<export_namespace>/animations/walk/play
52-
```
53-
54-
### Pause Function
55-
56-
Pauses the animation at the current frame.
57-
58-
```rust title=Pause the walk animation | copy
59-
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
60-
function animated_java:<export_namespace>/animations/walk/pause
61-
```
62-
63-
### Resume Function
64-
65-
Resumes the animation from the current frame.
66-
67-
```rust title=Resume the walk animation | copy
68-
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
69-
function animated_java:<export_namespace>/animations/walk/resume
70-
```
71-
72-
### Stop Function
73-
74-
Stops the animation and resets it to the beginning.
75-
76-
```rust title=Stop the walk animation | copy
77-
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
78-
function animated_java:<export_namespace>/animations/walk/stop
79-
```
80-
81-
### Apply Frame Function
82-
83-
Sets the animation to a specific frame with interpolation.
84-
85-
#### Arguments
86-
87-
| Name | Type | Description |
88-
| ------- | ------- | ---------------------------------- |
89-
| `frame` | Integer | The frame to set the animation to. |
90-
91-
```rust title=Set the walk animation to frame 10 with interpolation | copy
92-
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
93-
function animated_java:<export_namespace>/animations/walk/apply_frame {frame: 10}
94-
```
95-
96-
### Set Frame Function
97-
98-
Sets the animation to a specific frame instantly without interpolation.
99-
100-
#### Arguments
101-
102-
| Name | Type | Description |
103-
| ------- | ------- | ---------------------------------- |
104-
| `frame` | Integer | The frame to set the animation to. |
105-
106-
```rust title=Set the walk animation to frame 10 | copy
107-
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
108-
function animated_java:<export_namespace>/animations/walk/set_frame {frame: 10}
109-
```
110-
111-
#### Tween Function
112-
113-
Pauses all currently playing animations, and smoothly transitions to the target frame of this animation over the duration, then resumes the animation from the target frame.
114-
115-
#### Arguments
116-
117-
| Name | Type | Description |
118-
| ---------- | ------- | ---------------------------------------- |
119-
| `to_frame` | Integer | The frame of this animation to tween to. |
120-
| `duration` | Integer | The duration of the tween in ticks. |
121-
122-
```rust title=Smoothly transition the walk animation to frame 10 over a second | copy
123-
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
124-
function animated_java:<export_namespace>/animations/walk/tween {to_frame: 10, duration: 20}
125-
```
126-
12741
## Applying Variants
12842

12943
Variants can be applied to the Rig Instance using the desired Variant's `apply` function.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: Controlling Animation Playback
3+
description: Learn how to control the playback of Animations.
4+
---
5+
6+
# { $frontmatter.title }
7+
8+
{ $frontmatter.description }
9+
10+
Animation playback is controlled using functions. Each animation has a set of functions that can be called to control it. Animation functions _must_ be ran [as the root entity](/docs/rigs/controlling-a-rig-instance#selecting-the-rig-instance) of the Rig Instance.
11+
12+
### Play Function
13+
14+
Starts playing the animation from the beginning.
15+
16+
```rust title=Play the walk animation | copy
17+
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
18+
function animated_java:<export_namespace>/animations/<animation_name>/play
19+
```
20+
21+
### Pause Function
22+
23+
Pauses the animation at the current frame.
24+
25+
```rust title=Pause the walk animation | copy
26+
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
27+
function animated_java:<export_namespace>/animations/<animation_name>/pause
28+
```
29+
30+
### Resume Function
31+
32+
Resumes the animation from the current frame.
33+
34+
```rust title=Resume the walk animation | copy
35+
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
36+
function animated_java:<export_namespace>/animations/<animation_name>/resume
37+
```
38+
39+
### Stop Function
40+
41+
Stops the animation and resets it to the beginning.
42+
43+
```rust title=Stop the walk animation | copy
44+
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
45+
function animated_java:<export_namespace>/animations/<animation_name>/stop
46+
```
47+
48+
### Apply Frame Function
49+
50+
Sets the animation to a specific frame with interpolation.
51+
52+
#### Arguments
53+
54+
| Name | Type | Description |
55+
| ------- | ------- | ---------------------------------- |
56+
| `frame` | Integer | The frame to set the animation to. |
57+
58+
```rust title=Set the walk animation to frame 10 with interpolation | copy
59+
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
60+
function animated_java:<export_namespace>/animations/<animation_name>/apply_frame {frame: 10}
61+
```
62+
63+
### Set Frame Function
64+
65+
Sets the animation to a specific frame instantly without interpolation.
66+
67+
#### Arguments
68+
69+
| Name | Type | Description |
70+
| ------- | ------- | ---------------------------------- |
71+
| `frame` | Integer | The frame to set the animation to. |
72+
73+
```rust title=Set the walk animation to frame 10 | copy
74+
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
75+
function animated_java:<export_namespace>/animations/<animation_name>/set_frame {frame: 10}
76+
```
77+
78+
#### Tween Function
79+
80+
Pauses all currently playing animations, and smoothly transitions to the target frame of this animation over the duration, then resumes the animation from the target frame.
81+
82+
#### Arguments
83+
84+
| Name | Type | Description |
85+
| ---------- | ------- | ---------------------------------------- |
86+
| `to_frame` | Integer | The frame of this animation to tween to. |
87+
| `duration` | Integer | The duration of the tween in ticks. |
88+
89+
```rust title=Smoothly transition the walk animation to frame 10 over a second | copy
90+
execute as @e[type=item_display,tag=aj.<export_namespace>.root] run \
91+
function animated_java:<export_namespace>/animations/<animation_name>/tween {to_frame: 10, duration: 20}
92+
```

‎src/routes/docs/[...4]rigs/[...4]locators/+page.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

‎src/routes/docs/[...4]rigs/[...5]cameras/+page.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)