/
CurveAnimation.yaml
74 lines (63 loc) · 3.28 KB
/
CurveAnimation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: CurveAnimation
type: class
category: Animation
memory_category: Instances
summary: |
Stores animation data in the form of curves for each individual channel to
animate.
description: |
CurveAnimation is a subtype of `Class.AnimationClip` consumed by Roblox's
animation system. It stores animation data for each animated channel in a Rig
as a separate, individual curve. For example, CurveAnimation stores the
Position channel for an articulated joint as `Class.Vector3Curve`, and it
might store the Rotation channel as an `Class.EulerRotationCurve` or a
`Class.RotationCurve`.
## CurveAnimation structure
CurveAnimation stores curves in a hierarchical manner, matching the hierarchy
of the structure of `Class.Motor6D|Motor6Ds` or `Class.Bone|Bones` in the
animated model. Under each CurveAnimation instance lies a hierarchy of
`Class.Folder` instances representing animated joints in the model. Under each
such folder instance, several possible instances may exist. An instance named
'Position' of type `Class.Vector3Curve` can drive the local translation of the
`Class.Motor6D` or `Class.Bone` on the animated model. Similarly, an instance
named 'Rotation', of type either `Class.EulerRotationCurve` or
`Class.RotationCurve` can drive the local rotation of the `Class.Motor6D` or
`Class.Bone` on the animated model.
## Partial matching of hierarchy
You can match partial hierarchies to a model when playing a CurveAnimation in
Roblox's animation system. This means that not all joints need to be present
in the hierarchy for the joints that are present to apply properly.
Furthermore, you can match hierarchies in a 'relative' manner. For example, a
CurveAnimation's first `Class.Folder` instance root can be `UpperTorso`, and
the animation system matches that to any existing sub-hierarchies in the
model.
## Animating miscellaneous channels
Curve Animations can also animate other numerical values in a model. For
example, you can animate FACS controls for facial animations by creating a
folder under the CurveAnimation instance named after an existing
`Class.FaceControls` instance in the model. Then, to animate individual facial
controllers, you can store individual `Class.FloatCurve` instances named after
the animated `Class.FaceControls` property.
## Using CurveAnimation when making animations
As for other AnimationClip types (such as `Class.KeyframeSequence`), you must
upload CurveAnimations to Roblox first before playing them. To do that, right
click on the CurveAnimation and click 'Save to Roblox'. Alternatively, use
`Class.Plugin:SaveSelectedToRoblox()` to bring up the animation upload window.
If you want to preview an Animation before uploading it to the Roblox site,
you can generate a temporary id using
`AnimationClipProviderProvider:RegisterAnimationClip`. This generates a hash
id that you can use for localized animation testing.
## Obtaining CurveAnimations
As for other `Class.AnimationClip` types (such as `Class.KeyframeSequence`),
if you want to download the CurveAnimation corresponding to an existing
uploaded Animation using Lua scripts, use
AnimationClipProvider:AnimationClipAsync.
code_samples:
inherits:
- AnimationClip
tags: []
deprecation_message: ''
properties: []
methods: []
events: []
callbacks: []