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

Add smooth_normals option to load_blender_scene #605

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

BurntRanch
Copy link

This'll run generate_normals() and when generating normals in _blender_scene_to_ursina.py if smooth_normals == True, If it isn't true, then the original algorithm will be used, That's the default behavior in order to not break old code.

@pokepetter
Copy link
Owner

I think it would be better if it uses the flat/smooth setting in blender to do this. Calling generate_normals() inside the importer doesn't really have any upsides compared to just calling it after it's been imported. It's also error prone, since it would automatically replace all the normals.

@BurntRanch
Copy link
Author

BurntRanch commented Oct 29, 2023

I think it would be better if it uses the flat/smooth setting in blender to do this. Calling generate_normals() inside the importer doesn't really have any upsides compared to just calling it after it's been imported. It's also error prone, since it would automatically replace all the normals.

Ursina doesn't actually care about the setting, From what I found setting smooth shading did nothing, But I might be able to look for a better solution that is less error prone when I get back to my computer, From what I tested this looks good enough on its own but might be, as you said, complicating for other blender scenes.

The normals array will always get converted to numpy and converted back to string, Which shouldn't affect the normals in any way.
@BurntRanch BurntRanch reopened this Oct 30, 2023
@BurntRanch
Copy link
Author

Didn't mean to close it, My bad, But I modified the code, including updating to the latest commit which did fix smoothing, but for me, made my textures completely messed up, This should smooth the normals instead of replacing them entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants