[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:
    864
    Likes Received:
    490
    Uploaded version 0.76 of the scripts. See the link in the first post of the thread.

    This version of the scripts is a result of a two week long saga I had recently while generating transparent GMT's. Material and Texture transparency settings are the focus of these scripts, as well as the rFactor Material Blend sub-panel in the Materials Properties. "Transparency" replaced "Blend" in the Materials bit flags settings. Transparency settings in the Blender material are now adjusted by the scripts based upon the rFactor transparency settings.
     
  2. Kristoff Rand

    Kristoff Rand Registered

    Joined:
    Dec 23, 2011
    Messages:
    1,055
    Likes Received:
    10
    Thanks Traveller...
     
  3. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    626
    Likes Received:
    491
    Thank you very much for your efforts!

    Hopefully I'm able to test your addon in-depth at this weekend :D
     
  4. Leonardo1962

    Leonardo1962 Registered

    Joined:
    Feb 12, 2012
    Messages:
    247
    Likes Received:
    69
    thanks, for this great tool, it works fine for me.

    Leonardo (Peter)
     
  5. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    I have two items to work on as a start for V0.77.

    The first, and simplest, will be to give normals the same treatment I gave transparency for V0.76. That is, when you select Face or Vertex normals for the rFactor data, it will set the Blender display normal variable to either facet or smooth. I can also have this set automagically for the import of GMT's created with the scripts. I might take a look at importing custom normals, as well.

    The second is to track down an editing issue that has been brought to my attention. Then try to come up with a fix for it.

    I'm still interested in any information that can be provided. It's essentially the stuff I've asked about over the years. If anyone has anything, please pass it on.
     
  6. Kristoff Rand

    Kristoff Rand Registered

    Joined:
    Dec 23, 2011
    Messages:
    1,055
    Likes Received:
    10
    SO what can we provide you with to help?
     
  7. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    Basically firm up values in the GMT's: Bit flag values and meanings; texture animation values; bone length, or how to derive bone length. I think I left rigged GMT import in the scripts, but excluded their export. If you open up such a GMT, you'll see why. Peruse the two threads I linked to in my previous posts.
     
  8. gripkeeper

    gripkeeper Registered

    Joined:
    Sep 5, 2015
    Messages:
    3
    Likes Received:
    0
    first of all ,thank you for your Blenderaddon

    I have modeld a car form scratch in Blender,and now im at the point where i want to export the model,the goal is to get this car into GTR2,so i have used the make rFactor1 material, from your addon to get a car object mesh,from my car to export (the emty with basic rFactormaterial) and exported this
    in 3d simed i have imported this exported file,the mesh shows up,but i have strange results

    i have showed this result to a friend, who have build a own car from scratch allready,but with 3dsmax an the isi-gmt-plugin.He told me this result causes ,that i have to seperate the objects to elements, like he did in 3dsmax
    without the elements, the meshnormals are calculated uniform

    my question is how should a Blender user work(modeld a car from scratch in Blender),to overcome this problem?afaik in Blender is not such a funktion ,to make a object to elements, and keep it one object

    here a screenshot from my friend 3dsmax,as you can see he used the elementsfunktion on the left object,but not on the middle an right objects,to shows me the different
    sorry english is not my naitive language

    [​IMG]
     
    Last edited by a moderator: Sep 11, 2015
  9. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    By "elements" do you mean the materials? Each sub-mesh of an object in Blender can have its own material. That is how the objects in my scripts are set up. Each sub-mesh can have different types of normals applied-- face (faceted) or vertex (smooth). The V0.77 version of the scripts due out Real Soon Now handle normals a little bit better than earlier versions.
     
  10. gripkeeper

    gripkeeper Registered

    Joined:
    Sep 5, 2015
    Messages:
    3
    Likes Received:
    0
    Thanks for responce Traveller,

    No not materials.

    I mean the normals/vertex

    As you can see the pic in my last posting,the middle cube is a basic primitive without any changes at all,that have 8 vertex

    the cube on the left, has all 6 sides splited to elements.so you have 6 single sides with 4 vertex for each side (6x4 vs 8 if im not wrong).
    thats result in better shading/reflections

    i can do this in blender by pressing P to seperate mesh to new objects,for sure.but this gives you undisred extra objects you dont want.
    in 3dsmax you can select a side form a cube for example,and press element funktion,that splits the normals/vertex without create a new object.

    how ever.i have a solution found my self.since Blender support now custom normals.I have found a very useful addon

    http://www.blenderartists.org/forum/showthread.php?372785-Addon-Weighted-Normals-Calculator

    that addon calculad/correcting the normals automaticly with one click.only some support loops for sharper edges im put in if needed.
    the addon sets the object data to auto smooth,and gives me very good shading results.

    for bug info,i have tryed your rFactor 1 export -> 3dsimed 2.68 rFactor 1 import,that shows no object/mesh

    one question,do you have plans to implementing a GTR2 export function ? im asking that it woult be good ,to no need simed or other programs in the export pipline.
     
  11. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    626
    Likes Received:
    491
    Sorry for high-jacking this thread but what do you think of this:
    [​IMG]
    [​IMG]

    Description: A complete Blender package with IO scripts included, documentation included, maybe sample-files and other modding helps to represent a complete open-source rFactor SDK (not free like free-beer though, I guess)!?
     
  12. frank888

    frank888 Registered

    Joined:
    Mar 8, 2016
    Messages:
    5
    Likes Received:
    0
    Hi,
    I've tryed to import and export a gmt file without any modification but I get some issues. I can figure out some of them but I cannot find a solution for one: I cannot save/enable the cube map option (car_cube_dx9.dds) into the gmt file.
    Is there a solution for this issue?

    Tested with Blender 2.76b and latest i/o script.
     
  13. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    Whoops. I lost track of this thread for four months. Oh, how my mind wanders sometimes.

    Gripkeeper, I've started investigating custom normals and these scripts. This is an offshoot of trying to figure out what the unknown (to me) value in the faces datablock is all about. Again, if anyone as any ideas, let me know. Also, these scripts are rFactor only, biased toward rF2 as time goes by. I've no interest in other racing sims. I've stopped playing rF1. I'll look into the bug you posted, though.

    FuNK!, I don't foresee something like that. Not from me, at least. My scripts, the docs provided, and the pyFactor site is what there is.

    frank888, can you provide more info?
     
  14. frank888

    frank888 Registered

    Joined:
    Mar 8, 2016
    Messages:
    5
    Likes Received:
    0
    The simlest way is to look into the ISI's rFToolsPublic package version 1 for rFactor 1: there is a simple gmt file called Box01.gmt inside the SampleCarMats\Mas subfolder; just import that file into Blender and save it; then open the saved gmt file.
    There are at least two issues.
    The first: the "cube map" textures (CAR_CUBE.DDS) is listed in the Texture tab in Blender but not used/enabled. This issue happened also with other gmt files I imported in Blender.
    The second: some faces are transparent.
     
    Last edited by a moderator: Apr 3, 2016
  15. frank888

    frank888 Registered

    Joined:
    Mar 8, 2016
    Messages:
    5
    Likes Received:
    0
    Another thing: I don't know how to smooth the rfactor mesh, I get always a flat mesh.
     
  16. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    Do you mean the car cube texture does not have any effect in the Blender scene? If so, that is a true statement. The scripts are not to a point where the shaders used appear in Blender. I'd like to get to that point, and I think I can with pynodes, but that is a distant goal. I can get to a close approximation using settings in Blender internal, but that only goes so far-- and cube textures is not part of that deal.

    You set smooth (vertex) normals for export in the mesh properties tab as shown in the screenshot below.
    Image1_cropped.jpg
     
  17. FuNK!

    FuNK! Registered

    Joined:
    May 26, 2013
    Messages:
    626
    Likes Received:
    491
    My post was meant to be more of a general question to the wide audience than a request to you personally. And I really did not expect you to put up this package either. I already started it - just for fun actually - and was wondering if the general modding audience would have interest in such a "complete" SDK package:
    • Blender - in its latest Version
    • modified splashscreen
    • maybe: adapted UI settings with a standard enabled Quad-View (Front, Back, Side, 3D/Cam)
    • enabled and included some "modding essential" add-ons like
      • rFIO Script
      • FBX import/export
      • Images as planes import
      • Material Utils
      • maybe: Sketchup import
      • maybe: Blendermada Client
    • a material template file or database *.BLEND with Blender-enabled (Cycles and/or Blender Internal) materials
      • ready to use with rF-type textures
      • just append the materials to your file
      • apply them to your mesh
      • and replace the texture
      • --> click render or
      • --> just export to *.GMT, *.FBX, etc. for further editing
    • all stock ISI vehicles as "ready to render" scenes for skinning purpose (needs clarification with ISI)
    • one or two ISI tracks as samples for track-editing (needs clarification with ISI too)
    • all current ISI 3D template files for 3DSMax converted to Blender (currently without animations but maybe later if supported, of course needs clarification with ISI too!)
    • modding documentation from ISI but for Blender usage
    • modding documentation for rF IO
    • further tutorials or FAQ ("From Blender to rF1/rF2", "Rendering your rF2 Skin with Blender [Cycles]", "Rendering your rF2 Skin with Blender [Internal]", etc.pp.)

    But this idea is really depending on the general acceptance and need of the modding audience :cool:
     
  18. frank888

    frank888 Registered

    Joined:
    Mar 8, 2016
    Messages:
    5
    Likes Received:
    0
    I've rendered the Box01.gmt directly in rFactor both the original and the saved one. rFactor renders the cube_map texture whereas others programs don't (and the relative option is not setted/checked), but the converted gmt file looks differently. Here is a simple image:

    View attachment 19575

    up is the original gmt and down is the converted one.

    I cannot save the meshes with the output normals option setted to vertex otherwise rFactor don't load it, it freezes, I have to set it to face. So I cannot investigate about how to smooth the mesh.
     
  19. Traveller

    Traveller Member

    Joined:
    Oct 7, 2010
    Messages:
    864
    Likes Received:
    490
    I was going to hop in RF1 to see for myself. Unfortunately, my credentials must have expired, as the program won't run at all. I get a really dark orange screen with a cursor, and nothing else.
     
  20. frank888

    frank888 Registered

    Joined:
    Mar 8, 2016
    Messages:
    5
    Likes Received:
    0
    It's a pity. What about to distribute the source code of your work freely? rFactor 1 grew also with the work of people who freely made (and still make) tracks and mods for everyone, although ISI never released a software to help modders except for some plugins which need commercial software. I think this should be a nice gift to the community.
     

Share This Page