Skip to main content

Prefab Editor

The Prefab Editor is where you build a prefab: place actors, give them collision and render geometry, decide what collides with what, then press Space and watch it behave. This page covers what a prefab can hold, which panel edits which part of it, and how to arrange actors with ease.

The SuperDex Studio window with the nist_task_board_1 prefab open: the task board in the viewport with a transform gizmo on a selected bolt, the Prefab Hierarchy listing its parts on the right, and Details below showing the selected nut.

What Is a Prefab?​

A prefab is a scene of physics actors saved as one reusable asset, written as JSON. Prefabs are the blocks you compose environments from: a tabletop, a fixture, a bin of parts, a task board. A prefab can hold another prefab by reference, so you can build small, combine, and reuse.

What you author here is the simulated scene, including the render mesh for visuals and collision mesh for physics. The camera, the transform gizmo, and the playback transport are app-wide and are covered in User Interface.

Anatomy of a Prefab​

A prefab is a flat list of actors of four kinds. Pick the kind by what the part has to do, then author it in Details, which changes its sections to match whatever you have selected. Constraints then tie actors or joints together with springs and limits.

KindUse it when
RigidThe part does not deform and currently is the most used type.
SoftThe part is compliant and hence squashes, bends, and conforms.
ArticulatedThe part has moving pieces joined by constraints: prismatic, revolute, spherical, or hard (e.g., hinged lid, drawer, vise).
Nested PrefabYou include an existing prefab inside another.
The Prefab Hierarchy panel on its Actors tab, with + Actor and + Constraint buttons, a settings cog at the top right, and Name and Type columns: Articulated1 expanded into root, new_link, and new_link_1 as Articulated Links, followed by Nested1 as a Nested Prefab, Rigid1 as Rigid, and Soft1 as Soft.
One prefab holding all four actor kinds, with the articulated actor expanded.

Feature Support​

Those four kinds are what a prefab can hold today. The prefab format can express more than this editor can currently author, so here is where the line falls.

Supported

  • Rigid, soft, and articulated actors, and nested prefabs, as described above.
  • Collision and render models per actor, each with its own scale and offset.
  • Inertial properties, either derived from the collision geometry or given outright.
  • Joints within one articulated actor: prismatic, revolute, spherical, and hard, plus an optional skin.
  • Constraints: joint springs and ranges, joints between rigid actors, pivots, and deformable node attachments.
  • Contact filtering by actor pair or by layer.
  • Scene settings: gravity and solver, on a scene prefab.
Not Yet Supported
  • Pose controllers for articulated actors.
  • Soft-skinned actors, which are neither listed in the hierarchy nor drawn in the viewport.
  • Closed-loop articulations and initial joint velocities.
  • Rods, which the prefab format supports but this editor does not yet author or display.
  • Tendons and shells (cloth), which the prefab format itself cannot express yet, so those need format work before Studio can author them.

These already simulate in SuperDex Physics. Pose controllers already present in a file survive a save and still simulate; you just cannot see or edit them here. Closed-loop articulations are the exception: adding, deleting, or reparenting a link drops that actor's cycles and joint velocities.

Editor Windows​

The Prefab Editor adds four windows to the Studio frame. Three are open by default; the Contact Filter is not, and you open it from the Window menu.

WindowWhat you do there
Prefab HierarchyCreate, select, duplicate, and delete actors and constraints. Sortable by name or type.
Prefab DetailsSettings for the prefab as a whole. See Scene Settings.
DetailsEverything about the selected actor or constraint. Its sections change with what is selected.
Contact FilterWhich actors and layers are allowed to collide. Hidden by default.

There is no separate simulation window. You can use the play button at the top of the viewport, described in User Interface.

Scene Settings​

Prefab Details currently only contain a Scene Prefab toggle. Turning it on attaches a block of scene settings to the prefab, covering gravity and solver configuration. Turning it off strips them again.

The Prefab Details panel for nist_task_board_1 with the Scene Prefab box checked, and a Scene Settings group below it holding rows for _comment, Description, Gravity, and Solver, each with its own enable box left unchecked and its value field grayed out.
Prefab Details for a scene prefab. The settings appear once the toggle is on, and each one is left to its default until you enable it.

Scene settings only apply to the prefab at the top of the tree. Nest a scene prefab inside another prefab and its gravity and solver settings are ignored in favor of the outer one's. Turn the toggle on for a prefab that is the environment, and leave it off for one meant to be dropped into something larger.

note

By convention these are saved as .mochi_scene and .superdex_prefab (older prefabs use .mochi_prefab) respectively, but that is only a naming habit. Both open in the Prefab Editor, and the Scene Prefab toggle converts one into the other.

Rigid Actors​

A rigid actor is a single body that does not deform, and currently it is likely most of what you will author. It includes two model slots that are essential:

  • The collision model (.mochi.h5) is what the solver actually simulates.
  • The render model (.glb) is what you see, and it has no effect on physics.

The two carry independent scale and offset, and the editor cross-wires them so adjusting one keeps the other aligned. A rigid actor also carries a Static flag for geometry that should not move, such as a table or a wall, and a Layer name used by the Contact Filter.

Details for the rigid actor Bar12, scrolling from General with its Type, Name, and Layer fields and its Static and Has Gravity toggles, through Transform, Inertial Properties set to Default, a collision model slot and a render model slot each with their own translation, rotation, and scale, and finally the Collision / Contact parameters.
Details for a rigid actor. One long panel. Scroll inside the frame to run through it.

*The collision model slot is still labeled Mochi Model in the app. That string is being renamed.

Contact and material parameters sit at the bottom of the panel. They mean the same thing here as anywhere else in the physics engine, so the full property reference lives in Authoring Prefabs rather than being repeated here.

Inertial Properties​

Mass, center of mass, and the inertia tensor decide how a body responds to force. You rarely want to type all of them (especially if you know mass or density of your simulated objects). The Setup dropdown picks how much you specify and how much Studio derives from the collision geometry.

SetupYou provideDerived from geometry
DefaultNothingMass, center of mass, and inertia, using a default density
Density OnlyDensityMass, center of mass, and inertia
Mass OnlyMassCenter of mass and inertia
Mass, COM, MOIAll three, explicitlyNothing
Density, COM, MOIDensity, center of mass, and inertiaMass

Soft Actors​

Soft bodies settling under gravity. What you see is the simulated surface, not a render model.

A soft actor deforms. It takes the same collision model slot as a rigid, but Studio rebuilds deforming meshes from it, which is why changing the shape or its scale is a heavier edit than moving a rigid around. The model must be a tetrahedral mesh; make one in the Model Editor with the Tetrahedralize modifier followed by Export Collision Model, for example via the STEP to Soft Mochi Model preset.

What you see is the simulated model, drawn with the mesh a renderer would use: its visual mesh when that mesh has a deformation embedding, otherwise its contact skin, otherwise the surface of its tetrahedral mesh. Rendered As in Details says which. The Collision Only view (2) shows what the actor collides with: its contact skin when it has one and Use Contact Skin is on, otherwise its surface. The Model Editor's Embed modifiers make a contact skin and a visual mesh.

Like a rigid, a soft actor has a Render Model slot, whose transform is linked to the collision model's. A render model is drawn, deformed with its own materials and textures, only when it is the collision model's visual mesh: the same vertices in the GLB's vertex order and the same indexed triangles, placed where the visual mesh is. Otherwise Details says why it is not drawn, and the solid mesh above stands in. Author the visual mesh with the Model Editor's Embed Visual Mesh modifier, using Source from Render Model as its upstream surface. A render model moved, scaled, or edited after authoring is reported until the visual mesh is regenerated. The render model must be a binary GLB with embedded buffers, containing one mesh node with one triangle-list primitive. Skins, morph targets, GPU instancing, material variants, animation of the mesh hierarchy, and texture-coordinate sets other than TEXCOORD_0 are not supported; Details names the reason.

Soft actors also carry their own material, separate from the contact parameters, and three behavior toggles worth knowing: Has Gravity, Has Inertia, and Has Stress.

Soft bodies cost considerably more to simulate than rigid ones. Use one when the deformation is the point, and a rigid everywhere else. The material models and their parameters are documented in Authoring Prefabs.

Articulated Actors​

An articulated actor is a hierarchical tree of links joined by joints, authored as a single actor. Use one for anything with moving parts that stay attached: a hinged lid, a drawer, a vise, a door.

Its row in the Prefab Hierarchy expands into the link tree, and selecting a link inside it fills Details with that link's joint and body properties. The constraints on a link's joint are listed under the link. Beyond structure, an articulated actor carries an optional Skin, a render model deformed by the links underneath it.

note

This page covers creation of articulations for simple objects without controller. The field-by-field reference for joint limits, dynamics, and drives lives in the Bot Editor Guide, which is the same editing model.

Nested Prefabs​

A nested prefab is another prefab placed by reference, with its own transform. It is not a copy: the nested asset stays a separate file, and the reference is what gets saved. Build simpler Prefabs once and nest it wherever it is needed. Fixes in the original Prefab will be picked up by its nested versions.

Contact Filter​

By default every actor can collide with every other actor. The Contact Filter is where you define a collision matrix, and it is a good place to look when two parts interpenetrate at rest or a mechanism jams on itself. A prefab has no contact filter until you add one. Open Contact Filter from the Window menu and press Add Contact Filter. The window then offers two ways to express a rule:

TabScopeUse it for
ActorsOne named actor against anotherYou want to define the contact matrix for a specific pair only
LayersOne layer against anotherA whole class of parts at once
The Contact Filter window on the Actors tab, with one row pairing Board with Bar12. Its Type dropdown is open on Asymmetric, with Symmetric listed below, and the row carries an Enable check and a delete button.
ActorsOne named pair, excused from colliding with each other.
The Contact Filter window on the Layers tab, with one row pairing Layer_1 with Layer_2. Its Type dropdown is open on Asymmetric, with Symmetric listed below, and the row carries an Enable check and a delete button.
LayersOne rule, covering every actor on either layer.

Layers are the scalable half. Every rigid and soft actor has a Layer field in Details, directly under Name; type the same layer name on a group of actors and one layer rule then covers all of them. That is the difference between one rule and forty.

Rules come in two directions. A symmetric rule means both sides respond to each other, which is what you usually want. An asymmetric rule is one-way: the first side is affected by the second, but not the reverse. New rows are created asymmetric, so if a pair is behaving oddly in only one direction, check that first.

Constraints​

A constraint ties a joint, an actor, or a pair of actors to a target with a spring of its own stiffness and damping: a key that springs back up, a slider that stops at its ends, a lid pinned to its box. The Prefab Hierarchy lists them on its Constraints tab, named by what they attach to (cabinet/drawer_joint, lid & box). The Actors tab lists each one again under what it constrains: a joint constraint under its joint's link, any other under each actor it names, and a constraint on an actor inside a nested prefab under that nested prefab; turn that off with Show Constraints Under Actors under the cog at the top right. Every row selects the same constraint, and Details then shows its fields.

The Prefab Hierarchy on its Actors tab for the midi keyboard: the midi articulated actor expanded into housing and its keys, each key link with a Joint Target constraint row under it.
ActorsEach key's spring under the key's link.
The Prefab Hierarchy on its Constraints tab for the midi keyboard, with a + Constraint button and one row per constraint, such as midi/button_1_joint and midi/key_a3_joint as Joint Target and midi/joystick_joint as Joint Rotation Target.
ConstraintsEvery constraint in the prefab, named by what it attaches to.
GroupConstraintsAttach to
Articulated JointJoint Target, Joint Range, Joint Rotation Target, Joint Rotation RangeOne joint of an articulated actor. Target and Range move one degree of freedom of a revolute, prismatic, or free joint; the rotation versions take a spherical or free joint.
Between Two Rigid ActorsSpherical Joint, Prismatic Joint, Relative Rotation Target, Relative Rotation RangeActor A and actor B.
Rigid Actor to WorldPivot Position, Pivot Target Pose, Pivot RotationA point or frame on one rigid actor.
DeformableNode Position, Node to Rigid, Node to NodeNodes of soft actors.

Each name links to its definition in SuperDex Physics, with the exact equation and frame behind every field.

Create one with + Constraint at the top of either tab, or from the Right-click menu of a row: Add Constraint on a link offers the joint constraints for that link's joint, and on a rigid or soft actor the ones that fit it. A new constraint attaches to the selected actors or link when they fit and to the first suitable actors otherwise, and starts where it changes nothing: a Joint Range copies the joint's limits, a Spherical Joint anchors where actor B rests, and pivot targets sit at the actor's current pose. Details picks actors and joints by name and shows values in the units of what they constrain: degrees for an angle, meters for a distance. Its Spring section holds the stiffness, damping, and saturation every constraint shares.

Details for a Joint Target: General with its type and a one-line description; Joint with the midi actor, key_a3_joint (Revolute) and its Rotation DoF picked from lists; Target at -10.3 degrees with the current angle at 0 degrees below it; and Spring with Stiffness in N·m/rad, Damping in N·m·s/rad, and Saturation switched off.
Details for the spring that holds a key up.

A constraint Studio can tell is broken, because it names an actor that is gone, a joint it does not fit, or a minimum above its maximum, shows red in the hierarchy and explains why in Details. Playing the prefab skips it with a warning in the Log Console instead of failing the whole prefab. Studio does not check node indices against the mesh or the kind of an actor inside a nested prefab; a mistake there still fails the prefab when it plays. Renaming an actor renames it in its constraints once the new name is entered; deleting an actor or a link deletes the constraints on it.

The viewport draws the selected constraint and the one under the mouse in the hierarchy: ranges as wedges or bars, targets as an orange marker with a spring back to the current value, and anchors as dots joined by a red line when they pull apart. Show > Constraints (C) draws every constraint at once.

The midi keyboard in the viewport with Show > Constraints on: a grey hinge axis runs under the keys, each key has an orange target needle beside a white needle at its current angle, the buttons show their travel axis with a target marker, and the joystick shows its rotation axes.
Every constraint drawn at once: orange targets, white current values.

Placing, Duplicating, and Snapping​

+ Actor at the top of the Prefab Hierarchy's Actors tab, or Right-click on empty space in it, creates an actor: Create Rigid, Create Soft, Create Articulated, or Create Nested Prefab. Right-click an existing row to copy, duplicate, or delete it.

The Prefab Editor is the only editor with multi-selection. Ctrl-click to add or remove one actor, Shift-click to take a range, then move the whole selection with the transform gizmo.

ActionHow
Duplicate in placeRight-click the row, then Duplicate
Duplicate while draggingHold Alt and drag the selection with the gizmo
DeleteDelete, or the Right-click menu
Add to the selectionCtrl + Left-click
Select a rangeShift + Left-click

Snapping to the Grid​

The transform gizmo can snap to fixed increments, set from the grid button in the viewport toolbar. Each gizmo mode keeps its own increment, so translate can snap to 0.01 m while rotate snaps to 15°. Holding Ctrl mid-drag inverts whatever the setting is, which is the fastest way to place one actor off-grid without turning snapping off and back on.

Snapping is what makes a regular array of parts quick: set an increment, then Alt-drag a copy and it lands exactly one step over.

Copy and Paste Between Prefabs​

Copy and paste go through the system clipboard rather than an internal buffer, so they work between two prefab tabs, and between two Studio windows. Copy an actor in one prefab, switch tabs, and paste it into another.

An actor carries its geometry references, transform, and physics settings with it. It does not carry anything outside itself, so a pasted actor lands without the contact filter rules that used to apply to it.

See Also​

  • User Interface: the viewport camera, the gizmo, and the playback transport.
  • Bot Editor Guide: the field-by-field joint and link reference.
  • Model Editor Guide: building the collision models a prefab binds.
  • Prefabs: the concept, as the physics engine defines it.
  • Constraints: every constraint type, its equation, and its parameters.
  • Authoring Prefabs: the full property reference for actors, materials, contacts, and scene settings.