Skip to content

Add smooth_normals option to load_blender_scene#605

Open
BurntRanch wants to merge 4 commits intopokepetter:masterfrom
BurntRanch:patch-1
Open

Add smooth_normals option to load_blender_scene#605
BurntRanch wants to merge 4 commits intopokepetter:masterfrom
BurntRanch:patch-1

Conversation

@BurntRanch
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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