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

Importer: Improve OBJ file loading performance #34

Open
ros-dorian opened this issue Sep 5, 2022 · 0 comments
Open

Importer: Improve OBJ file loading performance #34

ros-dorian opened this issue Sep 5, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ros-dorian
Copy link
Collaborator

Blender's built-in operators for OBJ file loading directly creates Blender objects, meshes and materials in the given scene. In the context of the add-on, the importer needs a function that returns a single mesh instance (multiple object from a single OBJ file is not currently supported).

The current implementation is based on Blender's own Python OBJ parser and makes the necessary adjustments to return a mesh instance. However, the newer Blender 3.2.2 version comes with a C++ implementation that promises more than 10x performance improvements and the current solution would not be able to leverage it.

Solution

One can record the state of the scene (objects, meshes, materials, etc...) before and after calling the built-in Blender operator and extract the required information from the difference.

This solution means that the add-on always uses Blender's own implementation which can benefit from performance improvements in future versions.

@ros-dorian ros-dorian added the enhancement New feature or request label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant