﻿---
title: How the engine works
description: Deformable objects, the Deformable Scene, the tools, the start frame and the units, explained once for the plugins and the SDKs.
url: https://help.tangerina.io/deformable/v0.2.0/user-guides/engine/how-the-engine-works/
---

# How the engine works – Engine – Deformable v0.2.0

This page explains the ideas that the plugins and the C, Rust and Python SDKs share. Read it once
before you build your own scenes. The Engine guide names things as the plugins show them; each section ends with links
to where the idea lives in each plugin and each SDK.

## Deformable objects

A deformable object is a mesh that the simulation moves. It has three parts:

| Part | What it is |
|---|---|
| **Tetrahedral mesh** | The volume the simulation moves: a mesh of small tetrahedrons that fills the object. |
| **Prepared surface** | What you see and render: your mesh, attached to the tetrahedrons by the **Prepare** tool. It follows the tetrahedrons every frame and keeps its UVs, normals and materials. |
| **Material** | How the object behaves: stiffness, weight, toughness and more. See [Materials](https://help.tangerina.io/deformable/v0.2.0/user-guides/engine/materials/). |

![A Tetrahedral Mesh plus a Prepared Surface Mesh make a Deformable Object, with the surface inside the tetrahedrons.](https://help.tangerina.io/deformable/v0.2.0/images/how-the-engine-works-object-parts.svg)

The tetrahedrons come from your mesh through the mesh tools. A closed mesh is filled by **Tetrahedralize**. Its outer
shell, the *cage*, comes from **Triangulate** (your mesh, triangulated) or **Autocage** (a new closed cage around any
mesh). A thin object, such as a sheet or a floor, comes from **Extrude** or **Span Layers**. See
[Preparing meshes](https://help.tangerina.io/deformable/v0.2.0/user-guides/engine/preparing-meshes/).

An object with no prepared surface is a *bare* object. It shows its simulated tetrahedrons instead of a surface. Bare
objects are fine for floors, walls and quick tests.

The simulation starts from the object's shape at the start frame. So the tools read your mesh as it stands at the
start frame: an animated rig or deformer before them gives the object its start frame's shape, and play is never
slowed by the tools.

**See it in:** [Blender](https://help.tangerina.io/deformable/v0.2.0/user-guides/blender/how-the-plugin-works/#deformable-objects) · [Maya](https://help.tangerina.io/deformable/v0.2.0/user-guides/maya/how-the-plugin-works/#deformable-objects) · [C](https://help.tangerina.io/deformable/v0.2.0/user-guides/c/scene/#add-an-object) · [Rust](https://help.tangerina.io/deformable/v0.2.0/user-guides/rust/scene/#add-an-object) · [Python](https://help.tangerina.io/deformable/v0.2.0/user-guides/python/scene/#objects)

## The Deformable Scene

A **Deformable Scene** holds one simulation: its objects, gravity, units, substeps and glue. The first create action
adds one for you.

You need at least one Deformable Scene. Without one, nothing moves. Objects in different Deformable Scenes do not
collide. See [Simulation settings](https://help.tangerina.io/deformable/v0.2.0/user-guides/engine/simulation-settings/).

**See it in:** [Blender](https://help.tangerina.io/deformable/v0.2.0/user-guides/blender/how-the-plugin-works/#the-deformable-scene) · [Maya](https://help.tangerina.io/deformable/v0.2.0/user-guides/maya/how-the-plugin-works/#the-deformable-scene) · [C](https://help.tangerina.io/deformable/v0.2.0/user-guides/c/scene/#set-up-the-scene) · [Rust](https://help.tangerina.io/deformable/v0.2.0/user-guides/rust/scene/#create-a-scene) · [Python](https://help.tangerina.io/deformable/v0.2.0/user-guides/python/scene/#create-a-scene)

## The tools

Seven tools turn meshes into simulation input:

| Tool | What it does |
|---|---|
| Triangulate | Triangulates a polygon mesh into a cage of well-shaped triangles. |
| Tetrahedralize | Fills a closed triangle cage with tetrahedrons. |
| Extrude | Extrudes a triangle mesh into one layer of tetrahedrons. |
| Span Layers | Fills the space between two layers with the same triangles. |
| Autocage | Wraps any mesh in a closed triangle cage. |
| Prepare | Clips a render surface to the tetrahedrons and attaches it to them. |
| Splinter | Makes a splinter cage from a line drawing or from a mesh, for Prepare. |

A tool runs when one of its inputs changes, and the plugin stores its output in the scene file. When you reopen a
file, nothing computes again.

Triangulate, Tetrahedralize, Autocage and Prepare can take a while on a dense mesh, so they run in the background
and the program stays responsive. You can cancel them. A cancelled tool keeps its last output until one of its inputs
changes, or until you choose **Update Now**.

Every tool but Splinter has a **Run** setting:

- **Auto** computes on every change. This is the default.
- **Wait** keeps the last output until you ask for an update with **Update Now**.

Wait helps with a heavy mesh: change several settings, then compute once. **Wait on Update** and **Don't Wait on
Update** switch every tool of the selected objects at once.

A tool that fails shows its error, and its output is empty. Tools after it may show an error too: fix the first one in
the chain.

**See it in:** [Blender](https://help.tangerina.io/deformable/v0.2.0/user-guides/blender/how-the-plugin-works/#compute-nodes) · [Maya](https://help.tangerina.io/deformable/v0.2.0/user-guides/maya/how-the-plugin-works/#tool-nodes) · [C](https://help.tangerina.io/deformable/v0.2.0/user-guides/c/tools/#from-polygons-to-tetrahedrons) · [Rust](https://help.tangerina.io/deformable/v0.2.0/user-guides/rust/tools/#from-polygons-to-tetrahedrons) · [Python](https://help.tangerina.io/deformable/v0.2.0/user-guides/python/tools/#from-polygons-to-tetrahedrons)

## The start frame

The simulation starts at the start frame of its Deformable Scene.

- **At the start frame**, every deformable object shows its rest shape. Nothing simulates.
- **When you play from the start frame**, the plugin builds the simulation from the start frame and steps it once per
  frame.
- **Every frame is cached** as it plays. Scrubbing back replays the cache, and nothing simulates again. The start
  frame keeps the cache too, until you change something the simulation reads.
- **A baked scene plays its bake**, from the start frame too, and does not simulate.

![A row of frames: playing from the start frame caches each frame, and scrubbing back replays the cache.](https://help.tangerina.io/deformable/v0.2.0/images/how-the-engine-works-start-frame.svg)

So the rules are:

1. Play from the start frame. If you jump ahead without playing, the plugin says **Play from the start frame**.
2. After you change a setting, return to the start frame and play again. Until then, the plugin says **Return to the
   start frame to apply changes**.
3. Play every frame. A frame that playback skips to keep up is never simulated, so set the playback to play every
   frame. The create actions set it for you.

**See it in:** [Blender](https://help.tangerina.io/deformable/v0.2.0/user-guides/blender/how-the-plugin-works/#the-start-frame) · [Maya](https://help.tangerina.io/deformable/v0.2.0/user-guides/maya/how-the-plugin-works/#the-start-frame) · [C](https://help.tangerina.io/deformable/v0.2.0/user-guides/c/scene/#step) · [Rust](https://help.tangerina.io/deformable/v0.2.0/user-guides/rust/scene/#step-the-scene) · [Python](https://help.tangerina.io/deformable/v0.2.0/user-guides/python/scene/#stepping)

### When animated values are read

The simulation follows animated values: Kinematic objects, passive regions, driven vertices and keyed settings. When
it reads them depends on the interface:

- **In Blender**, the simulation reads animated values one frame late: frame 10 uses what frame 9 showed. See
  [Animated values are read one frame late](https://help.tangerina.io/deformable/v0.2.0/user-guides/blender/how-the-plugin-works/#animated-values-are-read-one-frame-late).
- **In Maya**, the simulation reads them at the frame it computes: frame 10 uses what frame 10 shows. See
  [Animated values are read at the frame](https://help.tangerina.io/deformable/v0.2.0/user-guides/maya/how-the-plugin-works/#animated-values-are-read-at-the-frame).
- **In the SDKs**, your program passes them before each step, and that step uses them. See Drive vertices in
  [C](https://help.tangerina.io/deformable/v0.2.0/user-guides/c/scene/#drive-vertices), [Rust](https://help.tangerina.io/deformable/v0.2.0/user-guides/rust/scene/#drive-vertices) and
  [Python](https://help.tangerina.io/deformable/v0.2.0/user-guides/python/scene/#drive-vertices-and-add-forces).

## Units and axes

By default, 1 scene unit is 1 simulation unit, and the simulation unit reads as 1 metre: gravity is 9.81 down the
scene's up axis. Material values, such as Young's modulus and density, are in simulation units. If your scene uses
another unit, change **Scale** on the Deformable Scene. See
[Scale](https://help.tangerina.io/deformable/v0.2.0/user-guides/engine/simulation-settings/#scale).

**See it in:** [Blender](https://help.tangerina.io/deformable/v0.2.0/user-guides/blender/how-the-plugin-works/#units-and-axes) · [Maya](https://help.tangerina.io/deformable/v0.2.0/user-guides/maya/how-the-plugin-works/#units-and-axes) · [C](https://help.tangerina.io/deformable/v0.2.0/user-guides/c/getting-started/#conventions) · [Rust](https://help.tangerina.io/deformable/v0.2.0/user-guides/rust/getting-started/#conventions) · [Python](https://help.tangerina.io/deformable/v0.2.0/user-guides/python/types-and-errors/#units)
