Experimental BeamNG Level Importer + BeamNG Modding Tools V2 for BeamNG 0.32

Discussion in 'Utilities and programming' started by Car_Killer, May 29, 2020.

  1. Car_Killer

    Car_Killer
    Expand Collapse
    QA / Mod Support
    BeamNG Team

    Joined:
    Sep 24, 2013
    Messages:
    1,652
    BeamNG Level Importer + BeamNG Modding Tools
    BeamNG Level Importer is a Blender addon that allows you to import BeamNG levels with all assets into a Blender scene with the correct location, rotation and scale. Imported assets will have all materials assigned with their texture maps.


    BeamNG Modding Tools is a lua extension for BeamNG that allows exporting your level files from game to make them more compatible with Blender
    importer as well as convert your material files from TorqueScript (CS) to JSON.


    Many features of BeamNG Modding Tools are now available in World Editor -> Window -> Resources Checker.

    Features
    BeamNG Level Importer
    • Default TOD settings as Nishita sky
    • Basic Terrain Materials v1.5 importing (WIP)
    • Materials V0 support
    • Materials v1.5 support
    • BeamNG mod zip content importing
    • TerrainBlock importing
    • WaterBlock importing as a cube
    • SpotLight and PointLight importing
    • WaterPane importing as flat pane
    • CameraBookmarks importing
    • SoundEmitters importing
    • GroundPane importing
    • SceneTree folders structure
    • ForestItems importing and placement
    BeamNG Modding Tools
    • World Editor integration
    • Standalone mode
    • Legacy TorqueScript (CS) materials converter to JSON
    • Cleaning up of TorqueScript (CS) materials
    • Batch converting
    • DDS to PNG exporter (opposite tool to Texture Cooker)
    • Game meshes to COLLADA exporter
    • Game meshes to Wavefront exporter
    • BeamNG to Blender Exporting (game side)
    • Soft Reloading of vehicle materials
    • Hard Reloading of vehicle materials
    • Removal of vehicle's temporary files

    • A complete rewrite of the tool
    • Added Exporter tab
    • Added ability to export meshes from the game as COLLADA and Wavefront formats
    • Added ability to export DDS textures to PNG to improve compatibility with graphics software and Blender
    • Added ability to export level data to improve compatibility with BeamNG Level Importer Addon
    • Added option to soft reload (quicker) and hard reload (slower) vehicle materials
    • Removed Resource Explorer features, those are now available as a part of the World Editor Resources Checker tool
    • Removed Material Verifier features, those are now available as a part of the World Editor Resources Checker tool
    • Improved UI
    • Updated for BeamNG 0.31+

    1.1.2 Changelog:
    • Added Vulkan check (for texture cooker)
    • Added Linux check
    • Added game version check
    • Added Force Reload Materials feature
    • Added Clear current vehicle cache feature
    • Added Experimental features
    • Improved UI
      • Added tool-tips
      • Added colored text to show errors
    • Added Bulk converters for vehicles and levels
    • Added Material Verifiers
      • Added verifier for cs / JSON materials, checks also for badly named json materials
      • Added verifier for V0 / PBR materials
      • Added duplicate materials verifier (wip)
    • Added Resource Explorer
      • Added checker for used TSStatics
      • Added checker for Forest Items
      • Added checker for unused TSStatics (wip)
      • Added checker for unused Forest Items (coming soon)
    • Improved overall stability
    • Changes to converter work back-end
      • Now there is no need to restart game to run converter again
      • Conversion job will repeat until materials table is empty
    • UI is now independent from World Editor
    • Added ability to run from console
    • Added ability to run using key binding, "=" for now
    • Added custom theme
    • Added ability to save files on disk with results of tests
    Changelog for V1.0
    • Removed garbage code
    • Improvements to level path button backend
      • Added compatibility with all levels types
      • Improved code
    • Added vehicle path button
      • Code checks which vehicle is seated by player 0
      • Theoretical compatibility with any vehicles that can load even from the earliest versions of game
    • Fixed console warnings
    • Added incorrect path warnings
    • Added checks so you won't be able to run a faulty job
    • Cleaned up logs

    Plans
    BeamNG Level Importer
    • Add full Terrain Materials v1.5 support
    • Add Terrain Materials v0 support
    • Implement assimp importer to import incompatible COLLADA meshes
    • TorqueScript levels and materials importing
    • Legacy JSON levels support
    • In Blender level editing and changes saving support
    • Particle emitters support
    • Decal data importing
    • River objects importing
    • Groundcover support
    • Decal road support
    • Mesh Road support
    • Lower level of detail meshes importing
    • More materials features support
    BeamNG Modding Tools
    • Possibly better mesh exporters from GameEngine

    Issues
    BeamNG Level Importer
    • Many legacy COLLADA files won't import due to issues with Blender COLLADA importer
    • Random TerrainBlock placement issues in some corner cases
    • Missing emissive textures in Blender 4.0+ due to shader changes
    • Probably a lot more issues that I don't know of
    BeamNG Modding Tools
    • Broken PNG exporting in Vulkan API mode
    • Crashes when removing old CS materials when loaded into a level
    • Unexpected results of COLLADA and Wavefront exports from GameEngine

    BeamNG Level Importer Requirements
    • OS: Windows or Linux
    • Blender: 3.0 or newer (3.6 LTS is targetted, includes a partial implementation for 4.0 and 4.1)

    BeamNG Modding Tools Requirements
    • OS: Windows or Linux or Wine/Proton
    • BeamNG.drive v0.31 or newer
    • Direct3D 11 mode (Vulkan API might be buggy when exporting textures)

    BeamNG Level Importer Installation
    • Make sure you met requirements above
    • Download addon from attachments. Make you download Blender addon not source code or BeamNG extension.
    • Open Blender to install addon.
    • Go to preferences, addons, and install addon from zip there.

    BeamNG Modding Tools Installation
    • Make sure you met requirements above
    • Download addon from attachments. Make you downloaded BeamNG extension not source code or Blender addon.
    • Copy downloaded zip into your BeamNG mods folder

    Usage
    BeamNG Level Importer
    Importing levels
    • Load BeamNG.drive
    • Load level you want to export
    • Open BeamNG Modding Tools by pressing =
    • Go to Exporter tab and press Export level to Blender and wait till the process finishes
    • Close BeamNG and launch Blender
    • In the Blender sidebar open BeamNG Level Importer
    • Select the level zip or folder you want to import, make sure to enable Use ZIP Level if you are importing zipped files
    • In Exporter terrain Path select your level export location which usually is your userfolder /temp/exported/levels/levelname
    • Press `Import Level Objects`

    BeamNG Modding Tools
    Generating new materials for old mods
    • Start the game
    • Insert a path to the folder of your mod that you want to convert
    • Press the Convert button
    • Copy the generated .json files from your userfolder back to your source files and remove all material.cs files, remove the cache of your mod.

    Exporting textures or meshes
    • Start the game
    • Insert a path to folder of your mod which you want to export
    • Go to the Exporter tab
    • Press the button you want to use
    • Your exports will be available in your userfolder /temp/exported/

    FAQ / Troubleshooting
    My game crashes when converting CS materials
    - Try converting your mod in main menu before you even load any level to avoid issues and leave more RAM space for conversion. Game may hang when converting.
    Many meshes from my level are not visible in Blender import, most of them are just empties
    - Some COLLADA meshes are unsupported by Blender. You can try converting them yourself in other software first to avoid issues.
    I cannot seem to be able to export textures from the game
    - Game might fail to export textures and levels when running in Vulkan API mode.

    Huge thanks to @thomatoes50 who helped me to clean code. In addition, I want to thanks for the original resource explorer code that was made to help me working on Polish Roads.
    Now instead of console, it works in imgui which is much easier for modders.

    Additional thanks for testing and giving ideas to: @AgentMooshroom5, @bob.blunderton, @DankMemeBunny, @falefee, @Nekkit.

    Github page is here https://github.com/PrzemekWolw/BeamNGLevelImporter

    If you like my work support me here!
     

    Attached Files:

    #1 Car_Killer, May 29, 2020
    Last edited: Jun 25, 2024
    • Like Like x 36
    • Staff Pick Staff Pick x 1
    • Agree Agree x 1
  2. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    3,459
    Very cool! Nice job!
     
    • Agree Agree x 2
    • Like Like x 1
  3. Ryo13silvia

    Ryo13silvia
    Expand Collapse

    Joined:
    Dec 24, 2019
    Messages:
    177
    Not the hero we deserved, but the hero we needed.
     
    • Like Like x 2
    • Agree Agree x 1
  4. TwoTwoNine

    TwoTwoNine
    Expand Collapse

    Joined:
    Jan 17, 2020
    Messages:
    239
    Car Killer and thomatoes50, this is awesome!
    I can finally convert over my old material codes and properties, so I can get things to look better in json so this will actually help in my Tipo.
    Thanks thomatoes50 and Car Killer, this certainly is a helpful tool.
     
    • Like Like x 1
    • Agree Agree x 1
  5. RadeS

    RadeS
    Expand Collapse

    Joined:
    Aug 6, 2019
    Messages:
    446
    I tried that,and failed...
    screenshot_2020-05-29_16-11-59.png
     

    Attached Files:

    • screenshot_2020-05-29_16-12-08.png
    • screenshot_2020-05-29_16-12-32.png
  6. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    3,029
    Does this take the materials and uv's and stuff you have in blender and convert them to beamng? I hope it does because that would save hours of work.
     
  7. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,696
    Wouldn't it be easier for everyone if you were to get the currently selected vehicle and use the .vehicleDirectory on it? Instead of requiring a text file
     
  8. Car_Killer

    Car_Killer
    Expand Collapse
    QA / Mod Support
    BeamNG Team

    Joined:
    Sep 24, 2013
    Messages:
    1,652
    You don't need to load car, just use that in menu :p
    You can't hot swap cs to json so it's pointless to wait for loading everything.
    I think it's fastest way to do it :)


    No. As I said in first post. It only converts your current materials.cs file to new material.json introduced in BeamNG 0.17.
     
  9. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    3,029
    Ah that's still pretty useful! Hopefully, eventually someone will make a blender plugin that just converts all materials in blender to beamng .json materials with all the proper different files.
     
  10. Ezo

    Ezo
    Expand Collapse

    Joined:
    Jan 11, 2016
    Messages:
    893
    Bluebuck Kitsune huh I wonder what is :rolleyes:

    On topic now, nice job bro, now we can have our stuff updated to an supported format finally
     
    • Agree Agree x 1
  11. TrackpadUser

    TrackpadUser
    Expand Collapse

    Joined:
    Aug 24, 2019
    Messages:
    504
    A basic guide to making materials with textures is defintively something I would find interesting, however considering there are new "best practices" being developed, as shown by Nadeox's cube in the dev media thread, I don't have an issue with waiting a little.

    If you want very basic materials to start (single color textures), hit me up on discord, I can show you how I did things for my mods. It's not the best looking materials ever, but it's a bunch of materials that show up in game :p
     
    • Like Like x 1
  12. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    3,029
    Yes please! I can't find anyone willing to texture my brand new supercar so I'm gonna need to learn by myself. add me (P_enta#4123)
     
  13. Car_Killer

    Car_Killer
    Expand Collapse
    QA / Mod Support
    BeamNG Team

    Joined:
    Sep 24, 2013
    Messages:
    1,652
    Most likely you did something different than in instructions. If you can't manage it to work hit me on DM here :)
     
  14. TrackpadUser

    TrackpadUser
    Expand Collapse

    Joined:
    Aug 24, 2019
    Messages:
    504
    For a big TL:DR, making materials =/= texturing.

    A material consists of multiple textures, and the ez/dodgy way to do things that can still work is to use something like 16x16 single color textures.

    Proper texturing has a lot of ressources online already, and a lot applies to beamNG.

    I'm also not very experienced with textures :D For now I've only figured out AO baking and the magic of using random noise for stuff.
     
  15. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    3,029
    Honestly, i just need someone to teach me how to assign a leather texture to a certain part of a door. And make it work in beamng.drive. OR i just need someone to texture the whole car for me

    The dumb thing about this community is that there's like 3 people willing to do either of those.
     
  16. TrackpadUser

    TrackpadUser
    Expand Collapse

    Joined:
    Aug 24, 2019
    Messages:
    504
    Yeah, it's something I've already talked about, there aren't that many people who have decent knowledge when it comes to making good textures, since it's one of the later things that people learn about when getting a hang of modeling.

    And people often have their own projects, which is why they might not have the time to help everyone with what is, at the end, quite a decent amount of work.
     
  17. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    3,029
    Yeah really. I don't know how to do beamng textures, No one is willing to do them for me, no one is willing to teach me, and I couldn't learn from the wiki it's just terrible. This is what i don't like about this community.
     
  18. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,696
    This is the basics of 3D modeling and any UV mapping and texturing tutorial should do.
     
    • Agree Agree x 1
  19. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    3,029
    I know how to texture in blender but i dont know how to transfer the textures into beamng.drive.

    And i can only texture the stuff as separate objects idk how to form all the textures i used into one file. that can be solved with a tutorial though.
     
  20. umustbeloggedintododat

    umustbeloggedintododat
    Expand Collapse

    Joined:
    Feb 16, 2019
    Messages:
    1,427
    Doesn't work, I get

    extension unavailable: "util_converchestelf" at location: "util/converchestelf"
    --- Post updated ---
    Nvm, my word filter was going apes**t.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice