FBX Import: Speed up cycles decal workaround with numpy #104497

Merged
Bastien Montagne merged 1 commits from Mysteryem/blender-addons:fbx_import_cycles_workaround_np_pr into main 2023-04-03 14:43:06 +02:00
Member

Replace iteration with foreach_get/set and numpy vectorized operations

An issue introduced in Blender 3.3 makes the original code very slow:
blender/blender#105909
So this results in about a 1500 times speedup at 6000 vertices and 3500 times at 25000 vertices.

In Blender 3.2 the new code would run about 40-60 times faster for 1000-25000+ vertices.

Replace iteration with foreach_get/set and numpy vectorized operations An issue introduced in Blender 3.3 makes the original code very slow: https://projects.blender.org/blender/blender/issues/105909 So this results in about a 1500 times speedup at 6000 vertices and 3500 times at 25000 vertices. In Blender 3.2 the new code would run about 40-60 times faster for 1000-25000+ vertices.
Thomas Barlow requested review from Bastien Montagne 2023-03-20 04:10:23 +01:00
Bastien Montagne requested changes 2023-03-21 12:13:49 +01:00
Bastien Montagne left a comment
Owner

Patch look good.

Also think that the imports 'where it's used' can be ignored here, this is supposed to be a startup time optimization (to avoid blender's python to import everything when starting Blender), but in practice doubt this is giving any real improvements here, since numpy is also imported in fbx_utils etc.

Patch look good. Also think that the `import`s 'where it's used' can be ignored here, this is supposed to be a startup time optimization (to avoid blender's python to import everything when starting Blender), but in practice doubt this is giving any real improvements here, since numpy is also imported in `fbx_utils` etc.
Thomas Barlow force-pushed fbx_import_cycles_workaround_np_pr from 7a4e3a5da8 to e5e3363514 2023-03-22 05:37:09 +01:00 Compare
Author
Member

The imports and shared parray_as_ndarray utility function have been moved to a separate commit that has its own PR: #104499

The imports and shared `parray_as_ndarray` utility function have been moved to a separate commit that has its own PR: https://projects.blender.org/blender/blender-addons/issues/104499
Thomas Barlow requested review from Bastien Montagne 2023-03-22 07:11:28 +01:00
Bastien Montagne force-pushed fbx_import_cycles_workaround_np_pr from e5e3363514 to 5da3d41c27 2023-04-03 14:41:49 +02:00 Compare
Bastien Montagne approved these changes 2023-04-03 14:42:36 +02:00
Bastien Montagne merged commit 5da3d41c27 into main 2023-04-03 14:43:06 +02:00
Bastien Montagne deleted branch fbx_import_cycles_workaround_np_pr 2023-04-03 14:43:06 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#104497
No description provided.