[WIP] rFactor2 export scripts for Blender 2.80+

Discussion in 'Third Party Content' started by Traveller, Dec 6, 2020.

  1. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    Blender rF2 export scrips WIP uploaded 11 July 2021.
    rFactor2 export scripts WIP .

    Unzip and place the folder in your Blender 2.93+ Addons folder. Activate addon in the Blender Edit/ Preferences/ Add-ons . It will appear in the Import/Export section.
     
    Last edited: Jul 12, 2021
  2. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    Scripts are for rFactor2 and are export only. Currently designed for use with the S397 rF2 materials editor. For example, export GMTs with the L2DIFFUSET0 material. Further edit in the material editor. Use of materials with normal maps not recommented-- the L2BUMPT0 and the special shader.

    rFactor2 menu appears as "rFactor2" adjacent to the Help menu header.

    rFactor2/ Export GMTs: Export selected GMT(s) to selected folder.

    rFactor2/ Initiate SCN/GEN: Initiate a SCN or GEN. Creates a SCN or GEN collection in outliner. SCN or GEN parent collection; with Lights, Cameras and GMTs child collections. GMTs collection started with default rF2 cube object.

    rFactor2/ Add Object: Adds a rF2 cube object.

    rFactor2/ Change Material: Change material of selected mesh object (solid triangle in outliner). Currently five basic materials are available.

    rFactor2/ Show/Hide smooth groups: Experimental feature.

    Note: Image files are chosen and set in the texture nodes.


    Existing blends can be loaded. Setting up the collections is to be done manually. There is currently no function to do such.
     
  3. Leonardo1962

    Leonardo1962 Registered

    Joined:
    Feb 12, 2012
    Messages:
    247
    Likes Received:
    69
    wow that's great, will test it soon
    thanks traveller :):)
     
  4. Leonardo1962

    Leonardo1962 Registered

    Joined:
    Feb 12, 2012
    Messages:
    247
    Likes Received:
    69
    first cube exportet as gmt from blender 2.91 and importet to 3DSimed and it worked :)
    great great job traveller
    thank you very much ..
    upload_2020-12-6_6-24-7.png
     
    haunetal1990 and McFlex like this.
  5. Mitch9

    Mitch9 Registered

    Joined:
    Jul 26, 2020
    Messages:
    256
    Likes Received:
    219
    Wow wasn´t really expecting this, thank you very much!
     
    mantasisg likes this.
  6. mantasisg

    mantasisg Registered

    Joined:
    Aug 17, 2016
    Messages:
    2,927
    Likes Received:
    3,879
    I too wasn't expecting this. It is so perfect in time for me, really goes along with my plans and needs. Amazing, huge thanks to you, Traveller !

    I am so looking forward to working on my projects further. You are automatically a part of them all, and deserve a lot of credit and love.
     
    Barnaudprod likes this.
  7. tuki

    tuki Registered

    Joined:
    Sep 27, 2019
    Messages:
    59
    Likes Received:
    95
    great work.
     
  8. evi

    evi Registered

    Joined:
    Dec 14, 2016
    Messages:
    44
    Likes Received:
    38
    This is absolutely excellent! Now, if only some enthusiast from S397 could chime in with required information on data formats. So, no reverse engineering is required. Maybe they are already doing this. Fingers crossed.

    PS.
    @Traveller. Just as an idea. Have you considered doing this as open source project? This way others may help a bit easier.
     
  9. Thaichang

    Thaichang Registered

    Joined:
    Jun 3, 2019
    Messages:
    24
    Likes Received:
    6
    THANK YOU, SIR!!!!!
     
  10. dxp_rlong

    dxp_rlong Registered

    Joined:
    Nov 5, 2018
    Messages:
    26
    Likes Received:
    24
    The add-on system provided by Blender allows multiple, smaller software tools to be created and grouped into workflows. I've done so with a number of small utilities for my own use. I've also recently refreshed my web site focused on Blender/Python/rFactor. There are some (older) samples of Python/rFactor scripts. Hopefully folks interested in adding more rF2 function to Blender will discuss what/how they want to expand the toolset. I'm willing to help folks in any area I understand, as well adding articles to my site.

    https://www.thepyfactor.awlabel.com

    As for an open source project, I'm not the one to make such a decision. To succeed an open source project definitely adds another level of infrastructure & maintenance. With Blender I don't see the need. I would go with Blender add-ons that work with the Travller script's rF2_Objects - which are regular Blender objects with additions using Blender's built-in custom parameters.
     
    Last edited: Jan 11, 2021
    Bjørn Lund and tuki like this.
  11. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
    Great tool because I love working in Blender above 3dsmax. I will post about it on my track making tutorials that are up soon.
     
  12. Frederick Alonso

    Frederick Alonso Registered

    Joined:
    May 29, 2020
    Messages:
    397
    Likes Received:
    2,648
  13. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    There are things that can be added to work with the scripts. I came up with a few in the S397 rF2 Discord mod channel sometime ago. From what I remember:

    1. Creation of a complete SCN or GEN file based on the scene in Blender. The data in Blender of the GMTs can be used to customize the entries in the SCN/GEN.
    2. dxp_rlong's site has the basics needed to handle writing the lights section.
    3. Camera files. Set the cameras in Blender to write to the camera file. Vehicles aren't too difficult, as they are fixed about the vehicle. Track cameras...Ambitious, and might not be worth the effort. The full vision is to have a centerline for the track, have an object travel along that centerline, then cameras set up and switched to as it travels and behave as they do in rF2-- fixed view or tracking view. So the editing can be done in Blender and WYSIWIG.


    Speaking of WYSIWIG....Anyone good with programming nodes and node trees?

     
    Frederick Alonso likes this.
  14. smbrm

    smbrm Registered

    Joined:
    Nov 11, 2010
    Messages:
    440
    Likes Received:
    50
    Just curious for clarification. Are these scripts described as for Blender 2.8+ supposed to work with Blender 2.91?
     
  15. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    They ought to. I develop using the latest Blender. I just downloaded 2.91.2.
     
    Bjørn Lund likes this.
  16. smbrm

    smbrm Registered

    Joined:
    Nov 11, 2010
    Messages:
    440
    Likes Received:
    50
    Thanks. I also downloaded 2.9.1. It will take some time to relearn ui navigation when coming from 2.78.
     
  17. Mitch9

    Mitch9 Registered

    Joined:
    Jul 26, 2020
    Messages:
    256
    Likes Received:
    219
    So it´s my first time trying out the script and I get this error:

    type.PNG

    I tried clicking a few things in the rf2 material/mesh options but no luck, any help? Tried exporting a few meshes, all the same.
     
  18. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    Did you have a parent object or a mesh selected in the Blender outliner? The check there is if a mesh is selected, the selection is bumped up a level (to the parent object). The check is then whether the selected object is an Empty (crude container for GMT data). A value of NoneType indicates nothing was selected. Will clean that bit up a bit to display a message window.
     
  19. Mitch9

    Mitch9 Registered

    Joined:
    Jul 26, 2020
    Messages:
    256
    Likes Received:
    219
    It works when exporting an rf2 cube, either by selecting the parent or the object itself. But when I try the same thing but replace the cube with another object, like the xsector in the image, gives me the same error.

    x.PNG
     
  20. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    I'll look at the code in that area.

    In the meantime, try renaming the parent container to XFINISH.

    Ideally there are only four collections: A SCN or GEN, in which there are Cameras, Lights, and GMTs. I don't know how your collections are set up. I see a custom one in the screen shot. Again, that will be looked at in the code.
     
    Last edited: May 9, 2021

Share This Page