ursina icon indicating copy to clipboard operation
ursina copied to clipboard

Add smooth_normals option to load_blender_scene

Open BurntRanch opened this issue 1 year ago • 3 comments

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.

BurntRanch avatar Oct 29 '23 07:10 BurntRanch

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.

pokepetter avatar Oct 29 '23 12:10 pokepetter

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.

BurntRanch avatar Oct 29 '23 18:10 BurntRanch

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.

BurntRanch avatar Oct 30 '23 10:10 BurntRanch