CHORUS - CREW-Brussels/EXP GitHub Wiki
CHORUS
Full Sub-module here
The CHORUS Animation Subsystem is a set of tools that help bridge the gap between performers and a variety of animation possibilities. Whether the performers want to duplicate themselves, record and play an animation on an avatar, or incorporate any avatar, the possibilities are endless.
As an analogy, imagine you are recording a video (using a recorder): you record and then it creates a track (a file) composed of multiple frames (numbers). A precise frame is called a cue point and acts as a bookmark. Once this video is recorded, you can open a video player to read and watch this track. You are then using a player. That is basically what we are doing using Chorus Subsystem.
Prerequesites:
-
Your project must contain a Skeletal Mesh Actor, or you have a skinned FBX character to import into Unreal Engine. If you don't have any, you can always use our Skeletal Mesh SKM_Manu in our XR utilities template (link coming) or create one using Blender and a Plugin such as Auto-Rig Pro. Documentation on this topic is available online!
-
Download CHORUS Plugin and put it in the Unreal Plugins Folder of your project (Don't forget to activate it in the plugins section)
Good to know
- If you want to use any node related to Chorus, you need to first look for the node CHORUSSUBSYSTEM.
- Cue point: A cue point is a defined position marker that belongs to a track.
Example 1: Record and Replay any animation
In this first example, we are going to replay and record an animation from one avatar to the other. Here, the right character is the one being recorded, and left one is the one replaying the animation.
1. Create two animation blueprints:
An Animation Blueprint in Unreal Engine is a visual scripting system that manages character animation logic.
→ ABP_ChorusRecorder is the animation blueprint we are recording data from. Here, we are using the Skeleton SKM_Manu_Skeleton, which is the same Skeleton as our Skeletal Mesh, SKM_Manu.
It's composed of a sequence player (or live link if you're using MOCAP) and Chorus Recorder. The sequence player here will be the one being recorded.
For the example, we are using a run animation. But any animation file, live or not, can be used
→ ABP_ChorusPlayer is the animation blueprint that will playback the data from the recorder. Here, we are using the Skeleton SKM_Manu_Skeleton, which is the same Skeleton as our Skeletal Mesh, SKM_Manu.
For the example, we are using an idle animation. But any animation file, live or not, can be used
2. Create two actor blueprints
→ BP_ChorusRecorder
- Import your skeleton mesh in the blueprint
- Use the APB_ChorusRecorder we previously created
→ BP_ChorusPlayer
- Import your skeleton mesh in the blueprint
- Use the APB_ChorusPlayer we previously created
3. Edit BP_ChorusPlayer
in the Event Graph
As part of the example, we've decided here to add inputs + and - from keyboard and from the gamepad controller to modify the speed. We are using an Inputs Mapping Context and Input Actions. You should then first enable inputs in the event graph. If you need to know more about inputs, you can find more in Unreal's documentation.
First, create a float variable called "Speed". You should drag and drop it in your event graph, and Set Speed. We use the nodes Add and Substract to modify faster or slower the player's speed. We use the node Set Player Speed from ChorusSubsystem to modify the speed of the replay, but it can also modified on some of the nodes themselves if "speed" is mentionned.
4. Edit BP_ChorusRecorder
in the Event Graph
As part of the example, we've decided here to add debug key o to start and stop/play the recordings. You should then first enable inputs in the event graph.
BP_ChorusRecorder is used to start and stop the recording. It then creates the link with the BP_Chorus Player.
Cue points from start and stop recording nodes should be promoted as variables
( imagine them being brackets in the track [ ] )
On Start Recording Node, Track should set at 0 by default, it will then never overwrite a used track.
After the Stop recording node, with the node Get Actor of Class, chose Actor Class BP_ChorusPlayer that we created earlier. It will allow replaying the recorded animation in the player. We are also using the Speed variable created earlier in BP_Chorus Player. From the node Get Actor of Glass, we're going to search as return value "get Speed", in order to use the Speed variable controllable with the - and + inputs or from the gamepad.
The system is now ready! :-) Drag and drop the two blueprints in the scene. You can now, in play mode and with your inputs, Start and Stop the recording of an animation, and display it on an other avatar once it's stopped!
Example 2: Echoes
In this example, we are creating iterations of an animation.
-> We are using the same steps as the previous example. We need to add a few different nodes. The difference between this example and the last is that the Echoes are not targeted to a player skeleton mesh directly present in the scene.
- Additional note: We are using here an additional blueprint from the plugin called EchoManager. EchoManager will create, depending on the echo count, a pool with all of the echoes before they appear. They are basically present already but invisible. Using that, all of the echoes are able to be recorded and replayed using our CIRCA tool for example.
- In the BP_ChorusRecorder like created earlier, create these nodes:
- The node Get Actor Of Class is linked to BP_EchoManager from the CHORUS Plugin.
- Here, we are using the On Start node, which means that the iteration will appear when the Game Mode starts. However this can be unlinked, and used with an input or an other event.
- Drop the BP_EchoManager from the CHORUS Plugin in your scene.
- In the Blueprint details, The EchoClass should be BP_ChorusPlayer. Chose the Count (number of iterations), delay (time between the iterations).
In this case, because we are using a hovering animation (the character is runing but not moving forward), we can add these aditional nodes in the BP_ChorusRecorder:
Add EditBonePosition in the ABP_ChorusRecorder:
As a parameter of this node, chose the bone Pelvis
Index
Here is the detailed list of all of the nodes:
- Add Cue Point
- Control Player
- Control Recorder
- Delete Cue Point
- DeleteTrack
- Get Clip Length
- Get New Owner
- Get New Track
- Get Player Status
- Get Recorder Status
- List Cue Points
- List Tracks
- Pause Player
- Play from Cue Point for Duration
- Resume Player
- Set Player Looping
- Set Player Speed
- Start Recording
- Stop Recording
- Trigger End of Track Event
And events:
- OnEndOfTrackEvent
- OnStartOfTrackEvent
- OnLoopEvent