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 - Part Tree

Hierarchical tree view of JBeam part data with interactive 3D node/beam picking, selection, visibility toggling, and integration with the AST text view.

Hierarchical tree view of JBeam part data with interactive 3D node/beam picking, selection, visibility toggling, and integration with the AST text view.


Module Exports

ExportTypeDescription
M.menuEntrystring"Part Tree" - menu label
M.openfunctionShows the part tree window
M.onEditorGuihookRenders tree view and 3D picking overlay
M.onEditorInitializedhookRegisters the editor window
M.onFileChangedhookClears AST cache when source file changes

Key Internals

VariableTypePurpose
asttable/nilParsed AST data for current part's JBeam file
astFilenamestring/nilPath to current JBeam file
viewRawDataBoolPtrToggle between processed and raw AST data
brokenNodestableSet of node IDs not found in any part

Color Scheme

ElementColor
KeysYellow (0.95, 0.84, 0.06)
Values (labels)Blue (0.31, 0.73, 1)
Leaf elementsPink (0.85, 0.39, 0.63)
MetadataGray (0.7, 0.7, 0.7)

How It Works

Tree View (_renderNode)

  • Recursively renders the parsed JBeam data as an ImGui tree
  • Each node shows: expand/collapse, selection highlight, visibility toggle, edit button, and AST highlight button
  • Selection links to AST text view via vEditor.selectedASTNodeMap
  • Edit button sets vEditor.propertyTableEditTarget for the Part Property View
  • Hidden items are tracked via __hidden flag

3D Node/Beam Picking

Nodes (renderPickTransformNodes):

  • Draws spheres at node positions (magenta for regular, blue-transparent for virtual)
  • Raycasts from mouse to find intersecting node spheres
  • Click to select; Shift+click for multi-select
  • Selected nodes are transformed via nodeTransformer.transformNodes()

Beams (renderPickTransformBeams):

  • Draws lines between node pairs (green for regular, red for selected)
  • Uses closestLinePoints() for precise beam picking
  • Shows beam labels at center positions
  • Virtual nodes (from other parts) are auto-resolved via getNodefromAllParts()

Spawn Button

  • Respawns the vehicle with the selected part as mainPartName

Lua Code Example

-- Open part tree
extensions.editor_vehicleEditor_staticEditor_vePartTree.open()

-- Toggle "Raw Data" checkbox to see unprocessed JBeam data vs schema-processed

-- Tree rendering uses recursive _renderNode():
-- Each table entry gets: tree node, selection, visibility, edit, highlight buttons
-- Clicking selects and highlights corresponding AST nodes in text view

-- Node picking uses sphere intersection:
-- local dist, _ = intersectsRay_Sphere(rayStartPos, rayDir, nodePos, nodeCollisionRadius)
-- if dist and dist < 100 then
--   table.insert(hitNodes, {node, pos, keyInPickedNodes})
-- end

-- Beam picking uses closest line points:
-- local xnorm1, xnorm2 = closestLinePoints(rayStartPos, rayEndPos, p1, p2)
-- if xnorm2 >= 0 and xnorm2 <= 1 then
--   -- check perpendicular distance against beamCollisionRadius
-- end

-- Virtual nodes (referenced from other parts) are auto-loaded:
-- local node = getNodefromAllParts(nodeId)
-- node.__virtual = true  -- rendered with translucent color

-- Multi-selection with Shift key:
-- if editor.keyModifiers.shift then
--   table.insert(vEditor.selectedNodes, chosenNodeData.node)
--   _selectAndHighlightNode(chosenNodeData.node)
-- end

-- Spawning with selected part as main:
-- vehicleConfig.mainPartName = vEditor.selectedPart
-- veh.partConfig = serialize(vehicleConfig)
-- veh:spawnObjectWithPosRot(pos.x, pos.y, pos.z, 0,0,0,1, true)

-- AST is cached and cleared on file change:
-- M.onFileChanged = function(filename, type)
--   if filename == astFilename then ast = nil end
-- end

See Also

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

Vehicle Editor - Part Text View

Syntax-highlighted, scrollable text view of JBeam source files using AST rendering, with inline editing of string, number, and boolean values.

Vehicle Editor - Static Render View

Manages multiple independent render views for the static vehicle editor, with 3D/orthographic modes, axis gizmo navigation, grid overlays, and WASD camera control.

On this page

Module ExportsKey InternalsColor SchemeHow It WorksTree View (_renderNode)3D Node/Beam PickingSpawn ButtonLua Code ExampleSee Also