[WIP] rFactor Import/Export Scripts for Blender

Discussion in 'Third Party Content' started by Traveller, Jun 17, 2015.

  1. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    866
    Likes Received:
    497
    Version 0.80 scripts uploaded on 5 December 2020. Use with Blender 2.79b.
    rFactor I/O v0.80 for Blender 2.79b 64-bit .

    Version 0.79 scripts uploaded on 14 October 2018. Use with Blender 2.79b.
    rFactor I/O v0.79 for Blender 2.79b 32-bit .
    rFactor I/O v0.79 for Blender 2.79b 64-bit .

    Version 0.79 scripts uploaded on 3 March 2018. Use with Blender 2.79a.
    rFactor I/O v0.79 for Blender 2.79a 32-bit .
    rFactor I/O v0.79 for Blender 2.79a 64-bit .

    Version 0.78 scripts uploaded on 13 October 2017. Use with Blender 2.79.
    rFactor I/O version 0.78 for 32-bit Blender 2.79
    rFactor I/O version 0.78 for 64-bit Blender 2.79

    Version 0.78 scripts uploaded on 9 December 2016. Use with Blender 2.78a.
    rFactor I/O version 0.78 for 32-bit Blender
    rFactor I/O version 0.78 for 64-bit Blender

    Version 0.78 release files for use with Blender 2.74.
    rFactor I/O version 0.78 for 32-bit Blender 2.74
    rFactor I/O version 0.78 for 64-bit Blender 2.74

    Version 0.75 release files for use with Blender 2.74.
    rFactor I/O version 0.75 for 32-bit Blender 2.74
    rFactor I/O version 0.75 for 64-bit Blender 2.74

    Version 0.75 documentation .
    0.75 Release Docs


    Please note the scripts are not complete, though they should be fairly functional.
     
    Last edited: Dec 6, 2020
  2. Emery

    Emery Registered

    Joined:
    Oct 24, 2010
    Messages:
    3,120
    Likes Received:
    1,814
    Whoa! Didn't see this coming today... many thanks for a public release!
     
  3. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    628
    Likes Received:
    492
    Wow! You made my day...nah...my week - to be honest! :D

    Great surprise and I'm really looking forward trying this out soon ;) Will try to support you with as much feedback as possible :D
     
  4. Kristoff Rand

    Kristoff Rand Registered

    Joined:
    Dec 23, 2011
    Messages:
    1,055
    Likes Received:
    10
    installing...
     
  5. lordpantsington

    lordpantsington Registered

    Joined:
    Oct 5, 2010
    Messages:
    849
    Likes Received:
    79
    Congrats and thanks!
     
  6. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    628
    Likes Received:
    492
    Imported my first models which works good so far BUT all models I import lose the normals setting - is this supposed to be!?
    Of course smoothing and edgesplit fixes the issue but it would better having the original normal setting :D

    [​IMG]
     
  7. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    866
    Likes Received:
    497
    Currently, normals are calculated on export based on the Output Normals property in the rFactor Mesh Settings properties panel. The choices are Vertex--smooth, Face, or Up. Vertex normal output can be locally modified in the mesh by setting edges to Sharp.

    The ability for Blender to import custom normals was introduced recently as part of Split Normals. I plan to investigate their use once Split Normals looks to be complete.
     
  8. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    628
    Likes Received:
    492
    OK so we are talking about different normal types or different ways of importing them in Blender? Because my current procedure is to open the GMT in 3DSimEd, export it as DAE and import it then to Blender. In most cases the normals are unchanged.
     
  9. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    866
    Likes Received:
    497
    When I started these scripts in early 2011, there was no way for a user to set the values of normals in Blender. Normals are calculated by Blender code. Since the purpose of these scripts is the export of rFactor data, I'm good with that situation. The scripts do not touch how a model is displayed with regard to normals upon import. I manually set the appearance of the models in Blender based upon what type of model I'm dealing with. I set it to smooth for vehicles, track surfaces and terrains, leaving the default face for everything else. I save the model as a .blend and move on.

    The situation with the import of normals changed earlier this year with the inclusion of the Split Normals code in Blender. I've not taken a look at their use with regard to these scripts because it has not been a priority. I plan to take a look at them sometime in the future, mainly for the purpose of not having to use Python code to calculate normals on export.
     
  10. Richard E Long

    Richard E Long Registered

    Joined:
    Apr 20, 2011
    Messages:
    17
    Likes Received:
    0
    FuNK!,

    I could be missing what you are talking about, however, I don't think the normals are missing. There is shadow & light on the model. Without normals there would be no shadowing at all.

    What I'm seeing is Blender's default flat shading. You are probably expecting smooth shading. Flat shading uses face normals. Smooth shading uses vertex normals.

    Not sure why the 3DSimEd -> DAE -> Blender pipeline is apparently using the vertex normals. I haven't had time to try that particular sequence.

    Have you exported the model and opened it in-sim? I have imported (via Traveller's scripts) lots of cars (from really old, lo-poly rF1 cars through to the most recent rF2 hi-poly cars) without losing any normals. They do appear (by default) in Blender as flat shaded, however, in-sim they are always smooth shaded.
     
  11. Leonardo1962

    Leonardo1962 Registered

    Joined:
    Feb 12, 2012
    Messages:
    249
    Likes Received:
    69
    Good work, Traveller

    Leonardo1962 (Peter) :)
     
  12. I3bullets

    I3bullets Registered

    Joined:
    Jun 8, 2013
    Messages:
    99
    Likes Received:
    0
    Against all odds!! Thank you so much for being perseverant!
     
  13. Euskotracks

    Euskotracks Registered

    Joined:
    Nov 29, 2013
    Messages:
    1,092
    Likes Received:
    191
    Can someone answer if blender is more or less user friendly compared to 3dsmax?

    Enviado desde mi GT-I9505 mediante Tapatalk
     
  14. I3bullets

    I3bullets Registered

    Joined:
    Jun 8, 2013
    Messages:
    99
    Likes Received:
    0
    You'll need some getting used to for either package. Best thing about Blender is that it is free - so you don't have any risk in trying it out!
     
  15. Emery

    Emery Registered

    Joined:
    Oct 24, 2010
    Messages:
    3,120
    Likes Received:
    1,814
    It's the new vocabularies for either piece of software that can drive you nuts. First you have the rF1 & rF2 vocabularies which you've already mastered, but then there's the whole new bit about drawing/lighting/UVunwrap/animation and either program is more difficult (and more powerful) than SketchUp. If you understand SketchUp, then you have the basics, yet figuring out how to do the same things in 3dsmax or Blender is difficult.

    Like racing well, practice and more practice is what will make you skilled. (and I'm barely skilled with SketchUp!)
     
  16. Richard E Long

    Richard E Long Registered

    Joined:
    Apr 20, 2011
    Messages:
    17
    Likes Received:
    0
    FuNK!,

    I spent some time looking at the 3DSimEd->DAE->Blender normals and compared them Traveller's import of the same GMT. There was only one difference I could find in the normals. It appears the DAE import has the equivilent of Edge Split applied on sharp edges resulting in additional normals. Applying an Edge Split on Traveller's script import results in the same additional normals being generated.

    The DAE import does default to smooth shading. Not sure how that is accomplished. I didn't see any of the smooth shading options activated in any of Blender's panels.

    During modeling, you can turn on Smooth shading in ObjectMode::Tools Shelf:Tools:Edit:Shading:Smooth. In addition, use Properties-Data:Normals to activate Auto Smooth and set the angle to something around 70 degrees (as a starting point). This will remove smoothing from edges which join surfaces at the set angle & greater.

    Remember on export, as Traveller said, the normals are recalculated. In the overall process, that would mean the imported normals may not be what get exported. To make sure the exported normals use the desired method (vertex, face or up), set the Output Normals to the suggested setting. Output Normal settings are found in the Properties-Data:rFactor Mesh Settings panel (bottom right of screen, all the way to the bottom). To get sharp edges on export, select the edge and use the EditMode::Mesh:Edges:Mark Sharp menu item.
     
  17. Nuno Lourenço

    Nuno Lourenço Registered

    Joined:
    Oct 19, 2010
    Messages:
    593
    Likes Received:
    65
    Thank you very much for your efforts Traveller :)
     
  18. StrawmanAndy

    StrawmanAndy Registered

    Joined:
    Jul 5, 2014
    Messages:
    278
    Likes Received:
    308
    Hey can someone please help me? I've been trying to convert this car from rF1 into rF2 and I've followed the instructions given and every time I do it I get this message in game
    "Wrong GMT version (or GMT version not allowed) for file XXXXX

    Can anyone help or know if this happens a lot?

    Thanks! :D
     
  19. wizzfactor2

    wizzfactor2 Registered

    Joined:
    Nov 6, 2012
    Messages:
    38
    Likes Received:
    0
    Error Message is giving you the clue, one of your gmts is possibly from rfactor 1.
    It also telling you which gmt it is file xxxxx.gmt.

    Have a closer look and you will find it.
    Remove the faulty gmt and re-export it again as rfactor2.

    Hope this help :)
     
  20. StrawmanAndy

    StrawmanAndy Registered

    Joined:
    Jul 5, 2014
    Messages:
    278
    Likes Received:
    308
    Got it working now :) Thanks a lot, dumb moment by me!
     

Share This Page