Sub-Mesh
Intro
Meshes in Cavalry can contain a hierarchy of other Shapes within them. These meshes are referred to as ‘child-meshes’. This hierarchy is a tree structure much like the Scene Window, only it exists within a Shape's Mesh.
For example, a Text Shape consists of Lines, Words and Characters, a Duplicator creates a Mesh built of many Input Shapes and SVGs can have any number of layers within layers. The Sub-Mesh Behaviour provides a way to access and affect these individual child-meshes by specifying the level(s) within a hierarchy.
It's also possible to create mesh hierarchies that can be affected by a Sub-Mesh manually. For example:
Two Ellipses within a Pre-Comp:
- Pre-Comp
- Ellipse1
- Ellipse2
Two Ellipses within a Group which is then the Input Shape to a Custom Shape:
- Custom Shape
- Ellipse1
- Ellipse2
UI
- Shape
- Advanced
Position - Set the X and Y position. 0,0 is in the centre of the Composition.
Rotation - Set the rotation (in degrees).
Scale - Set the X and Y scale values.
Opacity - Set the opacity.
Visibility - Affect the visibility on a per child-mesh basis.
Time Offset - Offset the animation curve on a per child-mesh basis. Tip - connect a Stagger.
Centre Pivot - Centre the pivot to each child-meshes bounding box.
Deformers - A list of connected Deformers.
Filters - A list of connected Filters.
Level Mode - Choose which level(s) of a Mesh's hierarchy to affect.
- Custom... - Manually set a Custom Level Range.
- Text (Lines) - Used with a Text Shape, this will affect each line.
- Text (Words) - Used with a Text Shape, this will affect each word.
- Text (Characters) - Used with a Text Shape, this will affect each character.
- All - Affects all sub-meshes, regardless of level.
The Level Mode provides several settings designed to make working with Text easier. For example, the Text (Words) mode sets internal Custom Level Range values of 2, 2
. While these settings will affect any words in a Text Shape, the same settings can also be valid for an SVG Shape.
Custom Level Range - Set the level within the Mesh's hierarchy to affect. This can also be used to set a range of levels. For example, setting a range of 1, 2
might be used to override the color of an SVG for all the shapes on levels 1 and 2 but not on level 3.
As the Level value increases, the Sub-Mesh travels deeper into the Shape's hierarchy.
Flatten Mesh at Level - All child-meshes below this level will be merged and brought up to this one.
Index Mode - Determine how the indices are assigned to the child-meshes:
- Unique - Assign a unique index for each child-mesh. For example, when adding a Sub-Mesh to a Text Shape and then adding a Color Array to the Sub-Mesh, the colors will loop over each character.
- Child Index - Assign a unique index for each child-mesh within its parent. For example, a 'word' is the parent of a 'character' – when adding a Sub-Mesh to a Text Shape and then adding a Color Array to the Sub-Mesh, the colors will loop over each character but the indices will start from
0
on the first character of each word. This can be used to create repeating effects. The table below provides an example of how the indices are assigned for each option when used with a Text Shape and the stringHELLO WORLD
:
String | H | E | L | L | O | W | O | R | L | D | |
---|---|---|---|---|---|---|---|---|---|---|---|
Id (Unique) | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
Id (Child Index) | 0 | 1 | 2 | 3 | 4 | 0 | 1 | 2 | 3 | 4 |
Fill and Stroke
Sub-Mesh also has Fill and Stroke tabs. They are identical to those found on Shapes apart from two exceptions.
Replace Fill/Stroke - When checked the Sub-Mesh will overwrite any materials on the shapes it is connected to with the Color and/or Shaders set in this tab.
Replacement Mode - By default, all materials will be replaced but, by using this option, certain conditions can be targeted:
- Replace All - Sub-Mesh will replace the Fill/Stroke of all sub-meshes.
- Replace Missing - Sub-Mesh will only replace the Fill/Stroke of any sub-meshes that do not have Fill/Stroke enabled.
- Replace Existing - Sub-Mesh will only replace the Fill/Stroke of any sub-meshes that do have Fill/Stroke enabled.
Fill/Stroke Overrides - See Color Material Override and Alpha Material Override.
Use Index Context - When checked, the Sub-Mesh will pull Context. This can be used to control how Ids are assigned and so affect each child-mesh individually.
Levels for Text are as follows:
- Line.
- Word.
- Character.
- Create a Text Shape.
- Create a Sub-Mesh Behaviour.
- Connect subMesh.id→textShape.deformers
- Set Position Y on the Sub-Mesh to 30.
- Right click on the Falloff attribute and select 'Add Falloff'.
When the Falloff is animated over the text, each letter will move up 30px.