RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Editor AI TestsEditor AI VisualizationEditor – Assembly Spline ToolAsset BrowserAsset DeduplicatorAsset Management ToolSFX Previewer (Audio Events List)Audio Ribbon EditorAutoSaveBarriers EditorBiome ToolBuilding EditorBulk RenameCamera BookmarksCamera TransformCamera Path EditorCEF HelperCo-Simulation Signal EditorCrawl Data EditorCreate Object ToolDataBlock EditorDecal EditorDecal Spline EditorDocumentation HelperDrag Race EditorDrift Data EditorDrive Path EditorDynamic Decals Tool (Vehicle Livery Creator)Engine Audio DebugExtensions DebugExtensions EditorFFI Pointer Leak TestFile DialogFlowgraph EditorForest EditorForest ViewEditor Gizmo HelperEditor Ground Model Debug HelperEditor Headless Editor TestEditor Icon OverviewEditor ImGui C DemoEditor InspectorEditor Layout ManagerEditor Level SettingsEditor Level ValidatorEditor LoggerEditor Log HelperEditor MainEditor Main MenuEditor Main ToolbarEditor Main UpdateMap Sensor EditorMaster Spline EditorMaterial EditorMeasures Inspector HeaderMesh Editor (Base)Mesh Road EditorMesh Spline EditorMission EditorMission PlaybookMission Start Position EditorMulti Spawn Manager (Vehicle Groups)Navigation Mesh EditorEditor News MessageObject Tool (Object Select Edit Mode)Object To Spline EditorParticle EditorPerformance Profiler / Camera RecorderPhysics ReloaderPrefab Instance EditorEditor PreferencesRace / Path EditorRally EditorRaycast Test Editor ToolRenderer Components Editor ToolRender Test Editor ToolResource Checker Editor ToolRiver EditorRoad Architect EditorRoad DecorationsRoad Editor (Decal Road)Road Network ExporterRoad River Cache HandlerRoad River GUIRoad Spline EditorRoad Template EditorRoad UtilitiesScene TreeScene ViewScreenshot Creator BootstrapScript AI EditorScript AI ManagerSensor Configuration EditorSensor DebuggerShape EditorShortcut LegendSidewalk Spline EditorSites EditorSlot Traffic EditorSuspension Audio DebugTech Server ManagerTerraform ToolTerrain And Road ImporterTerrain EditorTerrain Materials EditorText EditorTool ManagerTool ShortcutsTraffic DebugTraffic ManagerTraffic Signals EditorUndo History ViewerVehicle Bridge TestVehicle Detail ViewerVehicle Editor MainEditor - VisualizationEditor Viz HelperEditor Water Object HelperEditor Windows Manager
Vehicle Editor - Toolbar
Vehicle Editor - JBeam BeautifierVehicle Editor - JBeam Modifier Leaking VisualizerVehicle Editor - JBeam SpellcheckerVehicle Editor - JBeam Table VisualizerVehicle Editor - JBeam Variables CheckerVehicle Editor - Part ListVehicle Editor - Part Property ViewVehicle Editor - Part Text ViewVehicle Editor - Part TreeVehicle Editor - Static Render View

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE ExtensionseditorvehicleEditorstaticEditor

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.

Reformats JBeam files by aligning table columns within selected sections (nodes, beams, triangles, etc.) using AST-level manipulation, with optional number rounding.


Module Exports

ExportTypeDescription
M.menuEntrystring"JBeam Beautifier" - menu label
M.openfunctionOpens the beautifier window
M.onUpdatehookRenders ImGui controls
M.onSerializehookPersists window state
M.onDeserializedhookRestores window state

Key Internals

VariableTypePurpose
windowOpenBoolPtrWindow visibility
sectionsToBeautifyTblPtrtableCheckboxes for which sections to format
alignHeaderEnabledPtrBoolPtrWhether to align header rows too
roundingEnabledPtrBoolPtrEnable number rounding
decimalPlacesPtrIntPtrNumber of decimal places for rounding
directoryToBeautifyPtrArrayCharPath to file or folder to beautify

How It Works

Phase 1: Column Width Analysis (getSectionsWidthPerColumn)

  1. Parses the JBeam file into an AST via jsonAST.parse()
  2. For each selected section in each part, measures per-column text widths
  3. Tracks maximum width per column across all rows
  4. Handles inline arrays/objects as single columns
  5. Optionally rounds numbers to specified decimal places

Phase 2: Column Alignment (beautifySections)

  1. Walks the AST nodes for each section row
  2. Removes existing spacing (spaces, tabs) between columns
  3. Inserts new array delimiters and calculated spacing
  4. Maintains AST offset tracking for node index stability

Phase 3: Write (beautifyJBeamFile)

  1. Reads original file, validates JSON, parses AST
  2. Runs column analysis and alignment
  3. Stringifies the modified AST back to text
  4. Writes the result to the file

Lua Code Example

-- Open beautifier
extensions.editor_vehicleEditor_staticEditor_veJBeamBeautifier.open()

-- Sections available for beautification:
-- beams, nodes, quads, slots, slots2, triangles
-- Each has a checkbox; nodes and triangles are enabled by default

-- Settings:
-- "Align JBeam Header Row" - also aligns the first row (column names)
-- "Round Numbers" + "Decimal Places" - rounds numeric values

-- File/folder selection via file dialog:
-- editor_fileDialog.openFile(callback, {{"JBeam files", ".jbeam"}}, isFolder, "/vehicles/")

-- Core beautification pipeline:
-- local astData = jsonAST.parse(origJBeamStr, true)
-- local widths, maxWidths = getSectionsWidthPerColumn(astData)
-- beautifySections(astData, widths, maxWidths)
-- local newJBeamStr = jsonAST.stringify(astData.ast)
-- writeFile(filePath, newJBeamStr)

-- Column width calculation per element:
-- For numbers: width adjusted by -1 for negative sign
-- For inline objects/arrays: entire subtree stringified as one column
-- Maximum width tracked per column index across all rows

-- Verification (optional, commented out):
-- local res = test(origJBeamStr, newJBeamStr)
-- Uses deepcompare() to verify data integrity after formatting

-- Batch processing:
-- beautifyJBeamFiles(path) processes all .jbeam files in a directory
-- Results logged per file: "Successfully beautified: path" or "Failed to beautify: path"

See Also

  • Vehicle Editor - JBeam Modifier Leaking Visualizer - Related reference
  • Vehicle Editor - JBeam Spellchecker - Related reference
  • Vehicle Editor - JBeam Table Visualizer - Related reference
  • World Editor Guide - Guide

Vehicle Editor - Scene View

Creates and manages multiple auxiliary scene views (render views) attached to the vehicle, supporting orthographic projections (left/right/front/back/top/bottom) and free 3D camera mode.

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.

On this page

Module ExportsKey InternalsHow It WorksPhase 1: Column Width Analysis (getSectionsWidthPerColumn)Phase 2: Column Alignment (beautifySections)Phase 3: Write (beautifyJBeamFile)Lua Code ExampleSee Also