Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to export with custom split normals #10

Open
Growl3D opened this issue Jun 12, 2023 · 7 comments
Open

Ability to export with custom split normals #10

Growl3D opened this issue Jun 12, 2023 · 7 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Growl3D
Copy link

Growl3D commented Jun 12, 2023

The problem

Currently the exporter doesn't support custom split normals. These are used when the bevel modifier has the "Harden Normals" setting checked, or when using the Weighted Normal modifier. The autosmooth setting, found in the object data properties, under the subheading, normals, is required for these settings to work correctly. This causes faces to maintain uniform and flat shading on the model, while maintaining smooth curvature, unlike the usual method of using the edge split modifier.

The current workflow

Currently I am turning off the specularity in the material settings, using the edge split method instead to avoid any odd shading, and making use of 'container loops'.

The solution

For support to be added for this feature if at all possible, I can provide a test file if necessary.

@Growl3D Growl3D added the enhancement New feature or request label Jun 12, 2023
@Road-hog123 Road-hog123 added bug Something isn't working and removed enhancement New feature or request labels Jun 13, 2023
@Road-hog123 Road-hog123 self-assigned this Jun 13, 2023
@Road-hog123
Copy link
Owner

Road-hog123 commented Jun 13, 2023

Blender's own Mesh.transform() and Mesh.flip_normals() functions destroy the custom normals, and I very much wish they didn't.

@Road-hog123
Copy link
Owner

@Growl3D Can you try this version and see if the export result is as you expect it to be? blender-omsi-exporter_split-normals.zip

@Growl3D
Copy link
Author

Growl3D commented Jun 23, 2023

Hi RoadHog, just writing to say I have got your message, I'm just doing a lot of overtime so no time for development atm. I'll test this the coming Monday.

@Growl3D
Copy link
Author

Growl3D commented Jun 26, 2023

Hi RoadHog, I've sent you a friend request on discord so I can send you some examples of the results now I've had a chance to test this new branch.

@Road-hog123
Copy link
Owner

There does appear to be at least some cases (e.g. #17) in which exported normals are not correct, so I'm reopening this until I have unit tests to prove the exporter is working as intended.

@Road-hog123
Copy link
Owner

(matrix @ me.vertices[vi].co).to_tuple(),
(matrix @ me.loops[li].normal).to_tuple(),

Yes, let's translate direction vectors, I'm sure that'll work just fine... 🙄

Experimental fixed versions:
blender-omsi-exporter_3.2.1-rc.0.zip for Blender 3.6 LTS & 3.3 LTS
blender-omsi-exporter_4.0.1-rc.0.zip for Blender 4.1 & 4.0

@irisnotaprogrammer
Copy link

irisnotaprogrammer commented Apr 20, 2024

This seems to have solved it. I used the version 3.2.1-rc.0.zip on 3.6.4.
The separate models are now appearing as they should.

(Small edit: These models are, at least)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants