I have been using this export script for months without issue, until now. My problem is I am trying to export a mesh with the compatibility for a normal map. I have switched the object to the "Legacy Special Shader, L2BUMPCMAPSPECMAPT0" pre-set so it populates the correct attributes to the object. This has worked for some of my meshes but not all. When I try to export, I get the following error message,
Python: Traceback (most recent call last):
File "D:\Blender Foundation\blender-2.93.0-windows64\2.93\scripts\addons\io_rf2_gmt_Source\rF2_Menu_Stuff.py", line 528, in execute
File "D:\Blender Foundation\blender-2.93.0-windows64\2.93\scripts\addons\io_rfactor2_gmt_WIP\rF2_GMT_Export.py", line 1805, in save_gmt_override
File "D:\Blender Foundation\blender-2.93.0-windows64\2.93\scripts\addons\io_rfactor2_gmt_WIP\rF2_GMT_Export.py", line 1753, in save_gmt
File "D:\Blender Foundation\blender-2.93.0-windows64\2.93\scripts\addons\io_rfactor2_gmt_WIP\rF2_GMT_Export.py", line 1735, in PutrF2GMT
File "D:\Blender Foundation\blender-2.93.0-windows64\2.93\scripts\addons\io_rfactor2_gmt_WIP\rF2_GMT_Export.py", line 1510, in PutMeshes_rF2
File "D:\Blender Foundation\blender-2.93.0-windows64\2.93\scripts\addons\io_rfactor2_gmt_WIP\rF2_GMT_Export.py", line 1387, in PutVertexData
File "D:\Blender Foundation\blender-2.93.0-windows64\2.93\scripts\addons\io_rfactor2_gmt_WIP\rF2_GMT_Export.py", line 58, in CalcBumpMapTangents
KeyError: 307
location: <unknown location>:-1
Sometimes it's a KeyError: 1753
If I change the Output Normals to Face or Up the object will export. What is strange is that some of the objects under the same parent will export fine with normals working in rF2 but some refuse to export out of blender. I have tried creating a new object using the "Add rFactor2 Object" tool and that will export with a material that has normals but not if I merge a troublesome mesh with it, that just throws the 1753 error.
If I change the material type back to "Legacy Diffuse Shaders, L2DIFFUSET0" or any of the other presets without normals it will export fine again.
Is this a known issue?
Is the mesh in question all triangles or all quadrangles?
Glad you got it working.
The scripts are undergoing what has turned into a rewrite. The biggest rewrite so far is in the mesh export routine. It is less than half the size it was, with over a thousand lines removed. It now has quadrangles output taking up less space, so a quad only mesh is advantageous. I'll see if that routine will work with these older scripts for an interim release.
@DiggerHawk , it is in the bump map support values calculation on export. I went with a faster routine with the newer scripts. I'll look into it.
In the meantime, making progress on getting the newer scripts working for me again. Some issues with the scripts, which I've corrected, and some with my models in Blender not brought up to the newer nodes standard. I modified by hand, but will investigate making a utility routine.
Below is a screenshot of my car model GEN in game. The wheels and tires are missing, as still have issues with them, but the car body is in. The car body is notable in that it uses a node setup in Blender for the IBL Standard material in rF2. It looks funky as the textures I currently use are placeholders just to meet requirements. The two spheres are a test export of the marked smooth and marked sharp values. Those work now, under the new export routine.
There is also a screenshot of the the scene in Blender. You can see where some rF2 items have been moved. Items you might access while working in 3D view are on the right edge of the 3D window. Materials are on the right edge of the nodes window. This way you don't have to move the cursor too much out of the way to access options.