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 obj importer changes to use ImporterMesh. #86365

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

fire
Copy link
Member

@fire fire commented Dec 20, 2023

Fixes: godotengine/godot-proposals#8600

Note: this switches the ImporterMesh round tripping to be on the common track and not on the niche track.

@fire
Copy link
Member Author

fire commented Jan 2, 2024

Instead of converting from ImporterMesh to ArrayMesh using get_mesh(). In my next revision I will use a boolean that defaults to off to swtich between ImporterMesh and ArrayMesh

@fire fire marked this pull request as ready for review January 2, 2024 22:32
@fire fire requested a review from a team as a code owner January 2, 2024 22:32
@fire fire force-pushed the obj-importer branch 5 times, most recently from 1ab4b7b to c0b1270 Compare January 3, 2024 06:14
@adamscott adamscott self-requested a review January 8, 2024 20:37
Copy link
Member

@adamscott adamscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me! I tested it and it works. Thanks @fire!

Copy link
Member

@reduz reduz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect!

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Jan 9, 2024
@akien-mga akien-mga merged commit be4273a into godotengine:master Jan 10, 2024
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@fire fire deleted the obj-importer branch January 10, 2024 21:35
@Calinou
Copy link
Member

Calinou commented Jan 10, 2024

When importing the same OBJ file 10 times, this seems to be slightly slower when comparing optimized builds together between master and this PR. This PR also doesn't resolve #84357.

The difference isn't dramatic so this is probably within acceptable bounds, especially if it helps resolve bugs and make code maintenance easier in the future.

Testing project: test_obj_import.zip (make 10 copies of octavus.obj within the project folder)

❯ hyperfine -iw1 -p "rm -rf ~/Documents/Godot/test_obj_import/.godot" "bin/godot.linuxbsd.editor.x86_64.master ~/Documents/Godot/test_obj_import/project.godot --quit-after 5" "bin/godot.linuxbsd.editor.x86_64 ~/Documents/Godot/test_obj_import/project.godot --quit-after 5"

Benchmark 1: bin/godot.linuxbsd.editor.x86_64.master ~/Documents/Godot/test_obj_import/project.godot --quit-after 5
  Time (mean ± σ):      7.464 s ±  0.233 s    [User: 6.866 s, System: 0.542 s]
  Range (min … max):    7.324 s …  7.905 s    10 runs

Benchmark 2: bin/godot.linuxbsd.editor.x86_64 ~/Documents/Godot/test_obj_import/project.godot --quit-after 5
  Time (mean ± σ):      7.648 s ±  0.342 s    [User: 6.874 s, System: 0.551 s]
  Range (min … max):    6.891 s …  7.943 s    10 runs
 
Summary
  bin/godot.linuxbsd.editor.x86_64.master ~/Documents/Godot/test_obj_import/project.godot --quit-after 5 ran
    1.02 ± 0.06 times faster than bin/godot.linuxbsd.editor.x86_64 ~/Documents/Godot/test_obj_import/project.godot --quit-after

@akien-mga akien-mga added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Mar 10, 2024
@akien-mga
Copy link
Member

Cherry-picked for 4.2.2.

@akien-mga akien-mga removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transition from ArrayMesh to ImporterMesh in OBJ Importer
6 participants