ssbucarlos / smash-ultimate-blender

Blender Plugin containing utilities for Smash Ultimate Models and Animations.
45 stars 9 forks source link

Smooth normals not preserved when splitting UVs #123

Closed CattailXC closed 2 years ago

CattailXC commented 2 years ago

Exporting from smush_blender broke the normals on all of my expression meshes I worked on today, as well as another modder's meshes last week or so. I was able to narrow down the issue to smush_blender after exporting as an FBX and assigning materials though Studio Smash Bros and having it yield no broken normals. Attached are images of screenshots of blender (image 1/2), crossmod/ssbh (with broken normals, image 3/4), and crossmod (after going through SSB with correct normals, image 5). I'm unsure why this only now broke, but I think it could have something to do with the data transfer modifiers used in the process of making them, seeing as none of my other meshes broke. image image image image image

ScanMountGoat commented 2 years ago

Do all of the meshes with inaccurate normals have a data transfer modifier? Was the modifier applied before exporting? This is going to be hard to debug without access to the Blender scene itself.

CattailXC commented 2 years ago

All of the modifiers were applied prior to exporting. I can send the Blender scene to you via Discord or a Google Drive link if needed.

ScanMountGoat commented 2 years ago

I think the effect of the data transfer modifier isn't being preserved when we create the temporary meshes for export. A Google Drive link would be helpful. This should hopefully be an easy fix on our end.

CattailXC commented 2 years ago

Sorry for the wait, here's the Blend: https://drive.google.com/file/d/1QcSFmL5dHi-d_F91XIh8121GJcj6Vk_6/view?usp=sharing

ScanMountGoat commented 2 years ago

Thanks. Splitting the faces for duplicate UVs is removing the smooth shading on some faces. You should be able to split the UVs manually and potentially reapply the data transfer modifier as a temporary workaround until this gets fixed. The addon doesn't change the faces at all if no vertices with duplicate UVs are detected.

ScanMountGoat commented 2 years ago

This is fixed on the latest commit. I don't think there's a perfect way to do this without substantial development effort. The results are much better than before. For the best results, split the mesh UVs manually in Blender. The image below is the new automated fix on export. image

CattailXC commented 2 years ago

Alright. Thank you very much for looking into it!