-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Incorrect BMesh to Mesh attribute copying
The existing logic to copy `BMesh` custom data layers to `Mesh` attribute arrays was quite complicated, and incorrect in some cases when the source and destinations didn't have the same layers. The functions leave a lot to be desired in general, since they have a lot of redundant complexity that ends up doing the same thing for every element. The problem in #104154 was that the "rest_position" attribute overwrote the mesh positions since it has the same type and the positions weren't copied. This same problem has shown up in boolean attribute conversion in the past. Other changes fixed some specific cases but I think a larger change is the only proper solution. This patch adds preprocessing before looping over all elements to find the basic information for copying the relevant layers, taking layer names into account. The preprocessing makes the hot loops simpler. In a simple file with a 1 million vertex grid, I observed a 6% improvement animation playback framerate in edit mode with a simple geometry nodes modifier, from 5 to 5.3 FPS. Fixes #104154, #104348 Pull Request #104421
- Loading branch information
Hans Goudey
committed
Feb 13, 2023
1 parent
0dfc102
commit dfacaf4
Showing
3 changed files
with
162 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.