WIP Beta released Blender Script to Export Nodes and Beams

Discussion in 'Utilities and programming' started by rmikebaker, Dec 30, 2013.

?

Would you find this script useful?

  1. Yes

    378 vote(s)
    96.4%
  2. Not really

    14 vote(s)
    3.6%
  1. ryakra

    ryakra
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    213
    Re: Beta v0.0.1 Released

    Sorry for not replying, I frogot about my post here
    So, im confused. what do you mean by a node and beam structure?
    Is it like another lower poly model over the car model?
    or is it something different?
     
  2. rmikebaker

    rmikebaker
    Expand Collapse

    Joined:
    Oct 27, 2013
    Messages:
    36
    Re: Beta v0.0.1 Released

    Yes. The former. Please take a look at the attached pic. That's the 3D model of the box truck frame (and wheels, etc.), along with the jbeam structure for the frame itself (in orange). A jbeam structure is typically MUCH less complex than the actual 3D mesh it represents.

    The idea of this export script is to manually create the (jbeam) frame you see in this pic, using your 3D model as a reference, inside Blender, and then export it to be incorporated into a .jbeam file.

    Taking the full mesh and exporting it will take awhile, and will also be TOO complex for use as a real node/beam structure in-game. Keep in mind, the physics engine inside of BeamNG has to perform processing related to all of the nodes and beams you create, so you want to have just enough to represent the physics of your vehicle, without overdoing it.
     

    Attached Files:

    • Frame-n-JBeam.PNG
  3. TomiL88

    TomiL88
    Expand Collapse

    Joined:
    Aug 6, 2013
    Messages:
    169
    Thank you for this! I´ve been looking this kind of plug-in since BeamNg came out :cool:
    It´s easy to make the n/b in Blender plus no need to type the n/ manually in text editor.

    Downloated, tested and it´s SWEET!
     
    #23 TomiL88, Jan 8, 2014
    Last edited: Jan 8, 2014
  4. Singh336

    Singh336
    Expand Collapse

    Joined:
    Sep 5, 2013
    Messages:
    208
    i installed blender today just for this

    it works but i can't always get it to launch the script when clicking the export jbeam thing, dont know why


    when it does launch, its awesome, really REALLY useful, seriously.

    - - - Updated - - -

    here is what im trying to export




    when i click the export jbeam script from the space bar widget nothing is happening, it worked once, when I had all those boxes you see in the picture as different objects. i decided to make it one mesh first and then try exporting again so all nodes and beams are in one jbeam file from the script


    but ya, nothing is coming up :S

    - - - Updated - - -

    OH MY ... god.

    Didn't realize it was exporting everytime, i thought it would ask me where to save /export to each time, only asked me once.

    Wish it would ask everytime because i didn't choose a good place the first time as i was just testing.

    - - - Updated - - -

    I think.. i love you

     
  5. rmikebaker

    rmikebaker
    Expand Collapse

    Joined:
    Oct 27, 2013
    Messages:
    36
    Glad you got it working. They key sentence from the usage info is really this one:


    • A separate file for each object (named "<objectname>.jbeam") will be created in the folder where your .blend file is saved.

    The script shouldn't ask you where to save anything. It will complain if you haven't saved your scene as a .blend file yet, as it uses that to know where to save the .jbeam files. If you want them in a different folder, just move the .jbeam, and open it in the new folder. Should just work...
     
  6. Singh336

    Singh336
    Expand Collapse

    Joined:
    Sep 5, 2013
    Messages:
    208
    OHHhhh didn't know it saves whereever the blender file is saved, very good then !



    I knew about it saving in different files for each model, thats useful too ! i wanted them all in one file so I combined my model and that worked too.



    One thing tho, i took the nodes and beams the script exported and DIRECTLY pasted the nodes and beams into my real jbeam file

    I got parsing errors in the game and the vehicle wouldn't completely load...


    I went to check the file it looked good, I noticed with notepad++ using jbeam syntax highlighter that some of the numbers were black when they should be pink, putting a space between the comma and the first number solved that , i wonder if that was the issue not sure but stil lgot an error.


    So what is weird is they import FINE into node editor like that, then node editor exports them and doesn't show error in game so must be something super small the game is complaining about i'll try to pin point it today
     
  7. rmikebaker

    rmikebaker
    Expand Collapse

    Joined:
    Oct 27, 2013
    Messages:
    36
    Yeah, let me know if you figure out what the issue is, so I can address it in the exporter if necessary. For some reason, I'm not getting email notifications from this site any more, so I'll just check in every now and then. Need to see if I can get the emails flowing again...

    Oh - one more thing. If you copy and past *everything* from the output file to your real jbeam file, including the comment line, that may have something to do with it. I've noticed very odd behavior with the comment parsing code from the game, so try not including that, if you are.
     
  8. Singh336

    Singh336
    Expand Collapse

    Joined:
    Sep 5, 2013
    Messages:
    208

    Sorry bud, i speak too fast and didn't look into it.

    what happened was when I pasted the nodes in the jbeam, i forgot the node names are different so my ref nodes were non existant anymore, that was pissing the game off LOL.


    Working on a final (hopefully) chassis jbeam structure and will try again, but yeah your script is working good enough , i just wish the damn thing was for max.

    i cannot stand blender, i do have essential lynda training for blender i guess i'll watch it. just don't like it because between all these 3d programs now im getting my mouse clicks all mixed up LOL
     
  9. rmikebaker

    rmikebaker
    Expand Collapse

    Joined:
    Oct 27, 2013
    Messages:
    36
    I hear ya ;) Used Max 5-6 years ago, but don't have a current copy. Maybe I could try to get a student copy or something, and do this with MaxScript also... just a thought...
     
  10. Singh336

    Singh336
    Expand Collapse

    Joined:
    Sep 5, 2013
    Messages:
    208
    add me on facebook.com/syntheticspark i might be able to help u out


    also i found an issue

    when u export as multiple jbeams the node names conflict


    (imported from here)



    This really sucks because i did one piece at a time and spend a lot of time connecting nodes in the editor and imported the next piece and it was all stuck together like a hair ball because of the node names
     
  11. rmikebaker

    rmikebaker
    Expand Collapse

    Joined:
    Oct 27, 2013
    Messages:
    36
    You can set the prefix used for each object/part, so that doesn't occur. Check my usage instructions in the first post... :D
     
  12. Singh336

    Singh336
    Expand Collapse

    Joined:
    Sep 5, 2013
    Messages:
    208

    yea that is true, for now what I did was find and replace and change the names before I pasted them in.



    Also, i can't find that in blender where to enter the info , im just such a fuckni n00b with it but whatever, im rolling now !
     
  13. Lurker

    Lurker
    Expand Collapse

    Joined:
    Sep 1, 2013
    Messages:
    101
    This is very useful, we may as well take down the mod page (JK)

    This is freaking mad though!:D
     
  14. DrowsySam

    DrowsySam
    Expand Collapse

    Joined:
    Jul 30, 2013
    Messages:
    996
    I find this tool very useful, I used it in my latest project a bit, the DSC Toy Car.


    (imported from here)

    It's very good for quick projects, but I avoid it when I am making something properly.

    When I make things, I have a certain pattern of node names I use, I do it like Gabe.
    Lets say I'm making a front bumper, my nodes would be fb1ll/fb1l/fb1/fb1r/fb1rr, it's much easier that way, if you exported it with this tool, it would be something like nr23/nr24/n25/nl26/nl27,

    That makes it impossible to build external parts and copy it over to the other side, by replacing "L" with "R".

    So if I had a request, that would be it :)
     
  15. V1P3Rs

    V1P3Rs
    Expand Collapse

    Joined:
    Feb 14, 2014
    Messages:
    10
    I am using blender 2.70 and the export script will not run
     
  16. rmikebaker

    rmikebaker
    Expand Collapse

    Joined:
    Oct 27, 2013
    Messages:
    36
    Were you successfully using it prior to 2.70? Just trying to understand if this is your first attempt at using it, or if something in 2.70 is acting funky. I'm currently using 2.70 myself...
     
  17. V1P3Rs

    V1P3Rs
    Expand Collapse

    Joined:
    Feb 14, 2014
    Messages:
    10
    This is my first time using the exporter
     
  18. rmikebaker

    rmikebaker
    Expand Collapse

    Joined:
    Oct 27, 2013
    Messages:
    36
    Is it not generating a file (or files) when you select the exporter? Keep in mind, it doesn't present a "Save" interface, it just exports the selected objects and saves them in the folder where your .blend file is located.
     
  19. Motovader72

    Motovader72
    Expand Collapse

    Joined:
    Feb 9, 2014
    Messages:
    351
    I don't see where to input the desired prefix.? :(
     
  20. IBsenoj

    IBsenoj
    Expand Collapse

    Joined:
    Sep 28, 2013
    Messages:
    819
    Ok I'm gonna sound super stupid about this, but this basically makes the jbeam for you?
     
  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