Assembly Spline Populate
Handles the placement of molecule instances (rigid + bridge meshes) along an assembly spline. Manages mesh pooling, spline sampling, rigid placement via attachment sequences, and bridge scaling/alignm
Handles the placement of molecule instances (rigid + bridge meshes) along an assembly spline. Manages mesh pooling, spline sampling, rigid placement via attachment sequences, and bridge scaling/alignment.
Public Functions
| Function | Description |
|---|---|
M.populateAssemblySpline(spline, splineIdx, molecule) | Place all molecules along the spline with rigid and bridge meshes |
M.tryRemove(spline) | Remove all placed meshes for the given spline |
Key Concepts
Placement Pipeline
- Spline sampling - Evenly-spaced positions extracted from subdivision points
- Distribution maps - Per-placement variation selection (round-robin or random)
- Mesh pooling - TSStatic objects reused across updates (create/delete only deltas)
- Root placement - Root rigid mesh aligned to spline tangent with jitter
- Attachment chaining - Non-root rigids placed by aligning attachment frames
- Bridge placement - Bridges scaled in X to span between molecule pairs, with roll alignment via nail axes
Normal Modes
| Mode | Value | Description |
|---|---|---|
| Local Up | 0 | Use spline Frenet normals |
| Global Up | 1 | Use world Z-axis |
| Terrain Up | 2 | Use terrain surface normal |
Usage Example
local pop = require('editor/assemblySpline/populate')
-- Place molecules along a fully-computed spline
pop.populateAssemblySpline(spline, 1, spline.moleculeDescription)
-- Remove all meshes when spline is deleted
pop.tryRemove(spline)Internal Details
- Uses
TSStaticobjects stored in SceneTreeSimGroupfolders - Mesh pools keyed by
(splineId, meshPath)for efficient reuse - Bridge sag applied via Z-axis scaling (
1.0 + spline.sag * 0.1) - Bridge roll computed as average of source/target nail axis alignment angles
- Random seed set from
spline.splineRandomSeedfor deterministic variation
See Also
- assemblySpline/molecule - Molecule structure and attachment parsing
- assemblySpline/splineMgr - Spline state management
Assembly Spline Molecule
Handles mesh assembly kit parsing, attachment point extraction, and molecule building for the assembly spline tool. A "molecule" is a group of rigid meshes joined via attachment anchor points, with op
Assembly Spline Manager
Central manager for the Assembly Spline tool. Handles spline CRUD operations, undo/redo, presets, serialization, splitting/joining, linking with the Master Spline tool, and dirty-state updates.