Using Animation Events with Alembic files | Alembic | 2.0.1-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Using Animation Events with Alembic files

    The Alembic package allows you set up an animation event callback for Alembic clips. For example, you could create a callback to change the Textures on an Alembic Mesh at runtime or instantiate Prefabs at a specific frame during playback.

    When importing an Alembic file, Unity automatically generates an animation clip that contains animation events for every frame of the clip.

    Animation Event Clip

    The naming convention of the animation clip is <modelName>_Frames.

    Setting up an Animation event

    To use this callback, add a script component to your Alembic GameObject with the AbcOnFrameChange() method. For example, this method below prints the current frame of the Alembic file to the Unity console:

    void AbcOnFrameChange (int frame) {
        Debug.Log(frame);
    }
    

    Note: The animation event clip does not contain any animation curves: only the per-frame animation events. As with any other Unity animation clip, you can blend and layer them in any Animator Controller.

    For general information about using animation, see Using Animation Events in the Unity manual.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023