in game Editorizer/RoREditor

only_a_ptr

Infamous Developer
Administrator
Developer
Joined
Jan 31, 2018
Messages
169
Location
Prague, CZ
Hello everyone.

Editorizer is a classic editor for vehicles, but AFAIK the source code was never public, so it cannot be updated: https://forum.rigsofrods.org/resources/editorizer.20/. However, replicating it's features directly within the game should not be a big deal. I already have some code to work with: https://github.com/RigsOfRods/rigs-of-rods/pull/1357

In this thread I'd like to gather and discuss suggestions.

Dohzer#3993 in Discord #modding:
I know a lot of people here use blender for N/B but I find the original RoREditor/Editorizer is the easiest still for Node work. In order to use it though I need a sacrificial truck file to just use for Node editing so having compatibility with all of the new sections would be a god send.
Some of the things I find really useful with this tool are:
-Snap to grid feature with a fine resolution .05 m
-Viewing all angles at the same time
-Find Beam
-Color Code Beam types
  • N/B display: I can reuse my old RigEditor code.
  • grid snapping is trivial, it's just comparing numbers
  • the split view is easily done by splitting the screen to multiple OGRE viewports, or rendering to textures and displaying them as UI panels. Neither is too much coding, I could make it toggleable.
  • Color coding beam types: Trivial, the N/B visualization mesh is done by specifying 2 positions and 2 colors.
 
I would like to have one feature from blender which is box select tool which will allow to easily adjust portion of N/B's like distance between front and back wheels
 
I won't have time to work on this until at least next spring, but one thing is sure - if there's ever an in-game editor, it will be a script. All the groundwork is actually already in master, the only missing piece is a daring adventurer who would like to try coding it themselves. This is the most promising approach:
  1. see https://forum.rigsofrods.org/threads/angelscript-scripting-quickstart-guide.3720/ for intro to scripting.
  2. Use the tokenizer to load the .truck file - see https://github.com/RigsOfRods/rigs-of-rods/pull/2953 for info and examples. Alternatively you can load the file as string via `game.loadTextResourceAsString()` and parse by hand.
  3. extract the node/beam info from the GenericDocument to your own data store, to be able to edit it - see step 2.
  4. Use the scripts in attachment to display the node/beam data. The 'gridviewer_prototype.as' can be #include-d as-is, the '*_TEST.as' script shows how to set it up - for the truck editor just replace the `game.getSubMeshVertPositions()` call with your code. Use 3 instances of the GridViewer (top/front/side view).
  5. Do any modifications to the vehicle data you want.
  6. Compose a new .truck document as string, and save it using `game.createTextResourceFromString()`. Parts of the document which weren't changed can be simply copied directly from the GenericDocument tokens, modified parts must be done manually - I assume that will be just nodes&beams for the start.
Sometime this week I'll open an GitHub PR with a minimal working version of this.
 

Attachments

  • grid_viewer.zip
    1.8 KB · Views: 82
Back
Top