DragonFF icon indicating copy to clipboard operation
DragonFF copied to clipboard

[Bug] The problem of exporting normals on vehicle materials

Open Calvin-rgb opened this issue 4 years ago • 11 comments

There is a BMW e39 model, the model is displayed normally. I decided to change the model, imported the model into the editor, exported it to the game after the changes and saw a strange display of the door panes:

And after importing this model back, I decided to make sure the grid was correct:

This is how the glass looks before importing the model into the blender:

I understand that the problem is in the addon, since there were no such problems before importing the model.

Calvin-rgb avatar Nov 05 '21 17:11 Calvin-rgb

I also tested the model with the Read material split flag, the problem remained

Calvin-rgb avatar Nov 05 '21 17:11 Calvin-rgb

I found a solution to this problem, as I found out the problem is in the wrong normals of polygons. You need to select the inverted polygons, make a flip, after which strange shadows will appear on the grid, then make a Set From Faces. *After correcting the incorrect normals, the glass model looks good in the game. изображение

But the question still remains open, can you fix it?

Calvin-rgb avatar Nov 05 '21 20:11 Calvin-rgb

I thought that this problem concerns only one model, but for the experiment I opened another model of the Nissan S15, and I again saw the inverted normals of polygons on the glass material: *Incorrect normals are highlighted in red. изображение

By the way: the texture superimposed on the material on these two models is absolutely the same, the texture is a resolution of 1x1 pixels. Drenched in black. BUT I think that this is not a problem because of the material that is superimposed on the mesh, but still the addon cannot correctly read the normals of polygons? @Parik27

Calvin-rgb avatar Nov 05 '21 21:11 Calvin-rgb

Could you send me a model that has this issue so I could test it?

Parik27 avatar Nov 05 '21 23:11 Parik27

Of course, I attached two archives at the bottom:

  1. s15_no_bug - the original model, which was not changed with the help of DragonFF
  2. s15_bug_normals - the model after exporting via DragonFF

Note: in order to better see the inverted normals, it is better not to unpack the archive with textures. s15_bug_normals.zip s15_no_bug.zip

@Parik27

Calvin-rgb avatar Nov 06 '21 07:11 Calvin-rgb

Can I also add some kind of notification when the model is successfully exported? It's just that my program freezes and I'm waiting for it to stop freezing, and even when it stops freezing, I don't see any notifications about the successful export of the model and I can continue to sit and wait like this🤦‍♂️

Calvin-rgb avatar Nov 06 '21 07:11 Calvin-rgb

CC @Calvin-rgb @ThePortuguesePlayer

If you could check the next version in development here it'd be very helpful: https://github.com/Parik27/DragonFF/tree/new-export

I've changed the way the exporter generates the vertices/normals/etc., and it intends to fix custom normal and other geometry related issues. If you could check if the add-on produces correct results for models now, it'd be very helpful.

I tested it with a cube, the results seem pretty promising, however we still need to make sure that anything else hasn't broken and large models export properly.

Comparison: (Left is exported with previous version, right is exported with the latest one on the new-export branch)

I also have pushed a fix for the SAMP 0.3.DL issue with skins getting deleted.

Parik27 avatar Dec 18 '21 08:12 Parik27

I apologize for my long disappearance, I checked this branch of the add-on with that car model for GTA SA. And yet it seems to me that this problem lies precisely in this model, and not because of the script. Perhaps this bug occurred when exporting this machine model to 3ds max.

Calvin-rgb avatar Apr 12 '22 13:04 Calvin-rgb

But the work with the export was done well, why can't it be introduced into the standard development branch? @Parik27

Calvin-rgb avatar Apr 12 '22 14:04 Calvin-rgb

I can merge it in the main branch, but it is about twice as slow as the previous method to export a model so I wasn't sure.

Parik27 avatar Apr 12 '22 19:04 Parik27

Yes, I think it won't matter how long it takes to export

Calvin-rgb avatar Apr 14 '22 13:04 Calvin-rgb