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

Multi thread import #19

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Multi thread import #19

wants to merge 9 commits into from

Conversation

aronwk-aaron
Copy link
Contributor

This should make importing faster, especially on large models, as it should take only as long as the longest import of a single LOD to execute

@aronwk-aaron aronwk-aaron requested a review from cdmpants April 27, 2022 01:20
@aronwk-aaron
Copy link
Contributor Author

@cdmpants could you tests these changes some when you have the time

@30350n
Copy link
Collaborator

30350n commented Apr 27, 2022

Just going to mention that bpy/Blender is not thread safe at all. If you're trying to "multi thread" any code that interacts with bpy, Blender will inevitably crash.

@aronwk-aaron
Copy link
Contributor Author

Just going to mention that bpy/Blender is not thread safe at all. If you're trying to "multi thread" any code that interacts with bpy, Blender will inevitably crash.

Definitely! I did a fair bit of research on that, and from what I found, I/O is one of the very few things that doesn't care as much as other stuff and ThreadPoolExecutor was the safest ways to handle it. And I had to move where it links the collection to the parent or because the parent did not like being worked on from multiple threads.

I tested this by importing few models and some crashed, but they also crashed before these changes(last time I tested importing most of these models was before we moved to 3.1). So I'm guessing my laptop is scuffed since I run Arch Linux btw, or 3.1 introduce since issues with importing. I'll need someone else to verify this though, so I'm just waiting lol

since it's not needed there anymore
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