Skip to main content

Count Sub-Meshes

Intro

Count the number of sub-meshes within a Shape at a given level. See Sub-Mesh for more info on sub-meshes and levels. This is primarily intended for counting the number of lines that result from strings being wrapped within a Text Box.

UI

Input Shape - Connect a sub-mesh (Text/Duplicator/SVG etc) to count.

Level Mode - Choose which level within the sub-mesh to affect.

  • Custom... - Manually set a Custom Level.
  • 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.

Custom Level - Set the level within the Sub-Mesh's hierarchy to affect.

Count - An output to preview the resulting count.

Example
  1. Using the Text tool, draw a Text Box in the Viewport to create a Text Shape.
  2. Enter a String long enough to start to wrap within the Text Box.
  3. Create a Count Sub-Meshes Utility.
  4. Connect textShape.idcountSubMeshes.inputShape.
  5. Using the Text tool, resize the width of the Text Shape's Text Box.

As the text rewraps, the Count Sub-Meshes' Count will update to reflect the number of lines.

Ligatures

Ligatures are combinations of letters that use different glyph shapes to avoid features like i-dots and f-arcs clashing with each other. For example, fi and fl will join to become a single glyph in Cavalry's default font (Lato). As a ligature is treated as one mesh, the Count Sub-Meshes Utility will count any such ligature as one character.