API ReferenceGE ExtensionseditorvehicleEditorstaticEditor
Vehicle Editor - JBeam Modifier Leaking Visualizer
Analyzes and visualizes JBeam modifier leaking - when a modifier set in one part affects rows in a different part due to the cascading nature of JBeam table modifiers.
Analyzes and visualizes JBeam modifier leaking - when a modifier set in one part affects rows in a different part due to the cascading nature of JBeam table modifiers.
Module Exports
| Export | Type | Description |
|---|---|---|
M.menuEntry | string | "JBeam Modifier Leaking Visualizer" - menu label |
M.open | function | Opens the visualizer window |
M.onUpdate | hook | Renders ImGui analysis UI |
M.onSerialize | hook | Persists window state |
M.onDeserialized | hook | Restores window state |
Key Internals
| Variable | Type | Purpose |
|---|---|---|
windowOpen | BoolPtr | Window visibility |
useDefaultValuesForLeaking | BoolPtr | Ignore leaks that reset to defaults |
data | table | Analysis results: {sectionName => {partName => {modName => modData}}} |
sectionsWithLeakingMods | table | Set of sections that have leaking modifiers |
sectionViewing | number | Currently selected section tab index |
modifiersDefaultValues | table | Known default values per section per modifier |
How It Works
Analysis Pipeline
getParts()- Walks the part tree viajbeamIO.getPart()to get all active parts in load ordergetPartsWithASTData()- Reads JBeam files, parses AST, extracts raw Lua data and hierarchyinitAnalyzeModifiersLeaking()- Collects all modifier names per section, identifiesscale*modifiersanalyzeModifiersLeaking()- For each part/section/row:- Tracks current modifier state (cascading from dict rows)
- For data rows, checks if any active modifier originated from a different part
- If so, records it as "leaking" with source/target part info and AST node references
- Applies
scale*modifiers (e.g.,scalebeamSpring) as multipliers
Visualization
- Section tabs with red highlighting for sections containing leaks
- ImGui table with parts as rows and modifiers as columns
- Color-coded cells: leaked modifiers get colored borders/backgrounds by source part
- Clicking a cell selects the part and highlights AST nodes in the text view
- Right-clicking highlights affected data rows in the text view
Lua Code Example
-- Open modifier leak visualizer
extensions.editor_vehicleEditor_staticEditor_veJBeamModifierLeakVis.open()
-- Click "Start Analysis" to run the analysis
-- Toggle "Ignore Default Values" to skip leaks that reset to engine defaults
-- The analysis walks parts in JBeam load order:
-- local parts = getParts() -- returns ordered list of {part, jbeamFilename}
-- local partsWithASTData = getPartsWithASTData(parts)
-- Modifier tracking per section:
-- For each row in section:
-- if tableIsDict(rowData) -> updates current modifier state
-- else -> checks if any modifier's partPath != current part
-- if so -> records leaking modifier with source and affected AST nodes
-- Default values table covers all major sections:
-- modifiersDefaultValues.beams.beamSpring = {[4300000] = true, [""] = true, [false] = true}
-- modifiersDefaultValues.nodes.nodeWeight = 25
-- When useDefaultValuesForLeaking is on, leaks that match defaults are ignored
-- Scale modifiers (e.g., scalebeamSpring = 1.5):
-- modsScalers[mod].modVal is applied as multiplier to numeric values
-- These propagate across all sections
-- Visualization table columns: one per modifier name in the section
-- Cell content: modifier value with tooltip showing:
-- "Part: partName\nModifier: modName = value\nLeaking into parts:\n- part1\n- part2"
-- Clicking cells links to the AST text view:
-- vEditor.selectedASTNodeMap[nodeIdx] = true -- highlights AST nodes
-- vEditor.scrollToNode = true -- scrolls text viewSee Also
- Vehicle Editor - JBeam Beautifier - Related reference
- Vehicle Editor - JBeam Spellchecker - Related reference
- Vehicle Editor - JBeam Table Visualizer - Related reference
- World Editor Guide - Guide
Vehicle Editor - JBeam Beautifier
Reformats JBeam files by aligning table columns within selected sections (nodes, beams, triangles, etc.) using AST-level manipulation, with optional number rounding.
Vehicle Editor - JBeam Spellchecker
Validates JBeam modifier names across all vehicle files by checking them against a whitelist of known valid modifiers per section type.