User Data and Events

Updated: 07/06/2020

This page is for Cubism version 4.2 or earlier. Click here for the latest version.

This section describes how to set up user data and events.
User data and events can be used, for example, to trigger when a certain frame is reached in an application or animation.

For example, the following things can be done.

  • Triggering of additional visual expressions such as comic-specific symbols, visual effects, etc.
  • Triggering of sound effects and other audio expressions
  • Changing of collision detection such as invincibility state

Elements and Locations Where User Data and Events Can Be Set

The elements where user data can be set are on the ArtMesh (Model Workspace) and where events can be set are on the Timeline (Animation Workspace).

Note that user data and events have different meanings.

Set to ArtMesh:
Active triggers on the SDK => UserData

Set to timeline:
Passively triggered on the SDK => Event

ArtMesh

Set user data in the ArtMesh

Select the ArtMesh for which you want to set user data.
Browse to the [Inspector] palette and click on the [UserData] to open the entry field.

Enter user data.
Click the [Update] button to confirm your entries.
If you move on to other operations after entering user data, your input is also confirmed.

You can zoom in and out by dragging the arrow buttons up and down in the input field.

Delete user data set in ArtMesh

To delete user data set for an ArtMesh, refer to the [Inspector] palette and delete the contents of the [UserData] entry field.

Timeline

Set events on the timeline

Right click at any frame position on the track where you want to set the event.
Select [Add Event] from the menu that appears.

The Event Entry dialog box opens.
Enter the event details and click [OK].

Keyframes representing events are displayed on the model track.
The difference between event keyframes and animation keyframes is shown in the table below.

Differences in keyframe display
Event only Animation keyframes and events

Animation keyframes only
Point

Unlike animation keyframes, keyframes representing events cannot be moved or copied -and-pasted.
Only when moving the entire track with the arrow buttons to the left of the track, the event keyframes move simultaneously with the animation keyframes.



If an animation keyframe exists on the same keyframe, copying-and-pasting will copy and paste only the animation keyframe.

Check the events set in the timeline

There are two ways to check the events you have entered.

  • Hover the mouse over the event keyframe.
  • The event is displayed in a tooltip.
  • Double-click on the event keyframe displayed on the timeline.
    The Event Entry dialog box opens.

Delete an event set on the timeline

There are two ways to delete an entered event.

  • Right-click on the event keyframe displayed on the timeline.
    Select [Delete Event] from the menu that appears.
  • Double-click on the event keyframe displayed on the timeline.
    Deletes all events in the displayed dialog box.

Export of User Data and Events

When using events in the SDK, user data and events must be exported along with model and motion data.

Export of user data set for the ArtMesh

The user data set for the ArtMesh is stored in the model data, but a user data file (userdata3.json) must be exported separately from the moc3 data when embedding.
To export user data for an ArtMesh, select [File] menu -> [Export Embedded Data] -> [Export as moc3 file] to open the Export Settings dialog box.

Check the [Export user data file (userdata3.json)] checkbox.
Click [OK] to execute the export.

Point

User data cannot be used with moc data for version 2.1.

Export events set in the timeline

The events set in the timeline are written out in the motion data (.motion3.json).
To export events set in the timeline, select [File] menu -> [Export Embedded Data] -> [Export motion file] to open the Export Settings dialog box.

Check the [Export Events] checkbox.
Click [OK] to execute the export.

Point

Events cannot be used with mtn data for version 2.1.

Was this article helpful?
YesNo
Please let us know what you think about this article.