FBX IO: Search for images on separate threads #105125

Open
Thomas Barlow wants to merge 2 commits from Mysteryem/blender-addons:fbx_import_image_search_threaded into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

2 Commits

Author SHA1 Message Date
Thomas Barlow f9f3507c6c Remove default `executor` argument for import_fbx.load()
Add-ons shouldn't be calling `import_fbx` functions directly and this
helps separate the `executor` argument from the operator properties
which are passed to `import_fbx.load()` as keyword-arguments.
2024-02-01 02:24:48 +00:00
Thomas Barlow 6518667f71 FBX IO: Search for images on separate threads
This offloads some IO work to find image files into separate threads.

Texture loading is moved to the start of FBX import so that the rest of
the fbx import can continue while searching for images runs in the
background.

This can significantly reduce import times when the Image Search option
of the importer is enabled (it is enabled by default) and an imported
file has images with paths that cause a search to begin in a directory
with many nested subdirectories, which can happen when a relative path
goes up many parent directories, the relative path starting with
"../../../" or similar.

While not as common, this can also significantly reduce import times
when an imported file references many images with file paths that start
with the same drive letter as a slower drive, such as a CD drive.

Aside from these cases, import times are expected to be the same or
slightly slower, likely due to the time spent starting threads or due to
each thread contending for the GIL for its parts that don't release the
GIL.
2024-02-01 01:19:09 +00:00