Cavalry for Canva Designs
This feature is being gradually rolled out so the Export for Canva... menu item may not appear in the File menu for all users.
Intro
A guide to creating animations in Cavalry that can be imported to designs.
Animations created in Cavalry can be exported to a .cvb file which can then be imported into a Canva design along with editable controls defined by the designer. Use all the power of Cavalry to create rich, crafted animations and share and distribute them within the easy to use environment of a Canva design.
Cavalry can be used to create everything from a fun, bespoke animated emoji to a fully responsive design system and deliver them in a way that colleagues or customers less familiar with professional design and animation software can interact with.
Exporting .cvb files and uploading them to Canva is free but a paid Canva account is required to edit the animations in Canva.
Getting Started
Note that a Project must be set in order to create a .cvb file.
In Cavalry
- Create a Polygon.
- Create
position.xkeyframes for:- Frame 0 =
-200 - Frame 99 =
200
- Frame 0 =
- Right click Sides and choose
Add to Control Centre. - Save the Scene.
- Go
File > Export for Canva... - Save the file to the file system.
In Canva
- Open Canva and create a new Presentation.
- Drag the
.cvbfile saved on step 6 from the file system and drop it into the Presentation's canvas. - Select the element that appears on the canvas.
- Click the
Editbutton in the header. - Change the Sides value that appears in the side panel.
Editing
The user interface that appears in Canva's side panel when clicking the Edit button in the top panel reflects the Attributes that have been added to Cavalry's Control Centre.
To add an attribute to the Control Centre, simply right click on one via the Attribute Editor and choose Add to Control Centre.
Custom Names for Attributes
Attributes can be renamed by right clicking one via the Attribute Editor or the Control Centre and choosing Rename.
This can be useful when, for example, promoting the Value attribute of a Value Behaviour which is then used to update a team's score. In this scenario, the Value attribute might be renamed to Team 1 Score so it's clear to the end user which part of the animation will update when the number is changed.
Attribute Order
Attributes will appear in Canva in the same order they appear in the Control Centre. Simply drag and drop Attributes to reposition them in the stack. Groups can also be added to the Control Centre and can be used as a way to categorise or separate certain attributes. A Group will appear as a header label in Canva followed by the contained Attributes and a dividing line to mark the end of the Group.
Custom Dropdown
Where a predefined list of options is required, for example, choosing from a list of icons, images or colors, a Custom Dropdown can be used. Once the Custom Dropdown is set up, promote the Selection Attribute to the Control Centre. This will then appear as a dropdown in the Canva side panel.
Checkbox
Where a simple switch is required, for example, show/hide or red/green, a checkbox can be used. There is no custom checkbox element but any checkbox from other Layers can be repurposed for this use case. A checkbox in Cavalry outputs a 0 (unchecked) or a 1 (checked) so can be connected to any other Attribute as a switch.
For example:
- Create a String Array.
- Use the to add a second index.
- Enter the strings
OffandOninto each index. - Create a Text Shape.
- Connect stringArray.id→textShape.string.
- Create an Animation Control.
- Connect animationControl.active→stringArray.index.
- Promote the Animation Control's Active Attribute to the Control Centre.
- Rename the Animation Control's Active index to Toggle.
Checking or unchecking the Toggle attribute updates the Text Shape to output 'On' or 'Off'.
Note that a checkbox will appear as a toggle in Canva.
Layers such as Logic and Comparison can also be used to create similar switch states.
Set Limits
It may be necessary to prevent numerical inputs from exceeding a range of values — for example, to keep Rotation between values of 0° and 359°. This can be achieved by right clicking an Attribute and choosing Edit Limits....
Any numerical limits set in Cavalry will be mirrored in Canva's user interface.
Colors
Note that any Color attributes added to the Control Centre will appear in Canva's top toolbar and not the side panel.
If adding color options to the side panel is required, a Color Array with a Custom Dropdown can be used to offer a predefined list of colors.
Connect a Color attribute (e.g. from a Color Shader) to a Gradient's color stop in order to add the ability to edit gradient colors in Canva.
The complexity of a design is open to the designer but a good rule of thumb is that fewer controls will result in a template that's easier to interact with.
Assets
In order to support assets used in a Cavalry Scene, a Project should be set.
Images
Images should be added to a Project directory and imported to the Assets Window as an Asset in Cavalry.
Any incompatible image assets will be flagged during Pre-Flight but consider optimising an image's resolution/file size to meet the needs of the design.
Fonts
In order to guarantee any fonts used in a Scene are rendered correctly in Canva they should be added to a Project directory and imported to the Assets Window as an Asset in Cavalry. Any incompatible fonts will be flagged during Pre-Flight.
Changing font is not directly supported in Canva but can be set up via a Typeface Array and a Custom Dropdown in Cavalry if required.
Note that fonts must be uploaded as individual weights rather than as font collections/families.
Third-Party Plugins
Any Third-Party Plugins used in a Scene are included with the .cvb file. Third-Party developers can optionally prevent the ability to edit them in Canva by adding //disable:canva_control_centre to the .sksl/.skslc file.
Note that all Third-Party Plugins are encoded when exported via the File > Export for Canva... menu.
Pre-Flight
There are some restrictions on the types and size of Assets, Attribute types and number of Attributes added to the Control Centre. When using the File > Export for Canva... menu item, a Pre-Flight window will appear as a guide to any issues that may need resolving before a Scene is export to a .cvb file.
Performance Check
The performance check is intended to ensure animations uploaded to Canva will perform well on a variety of devices. It is intentionally conservative in order to cater for low-power devices.
Common factors that may affect performances:
- Very large image/video assets. If a 2000x2000px image asset is being used with a rectangle that only appears in the design at 200x200px, try reducing the resolution of the source asset.
- Meshes with very high point counts, particularly in combination with the Duplicator.
Warnings can optionally be ignored but Errors must be resolved in order to continue with the export.
Playback
It's possible to predefine Canva's playback options by using the dropdown at the bottom of the Pre-Flight window.
- Static - This option will hide both the playback options in the side panel and the timeline overlay in the canvas.
- Play Once - When uploading a .cvb to Canva, Play on repeat will be disabled.
- Loop Playback - When uploading a .cvb to Canva, Play on repeat will be enabled.
Note that the duration of a Custom Animation is based on the Composition's Playback Range (not Frame Range).
Poster Frame
A poster frame can be defined via the Composition > Set Poster Frame menu item. This frame is used for thumbnails in Canva and as the frame that will be displayed when loading a Canva design. It is dynamic meaning it will update to reflect any changes made to the motion element in Canva.
Note that the poster frame may vary when simulations (Forge, Particles, Solvers etc.) are used.