Hans Goudey
dfacaf4f40
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
2023-02-13 20:52:02 +01:00
..
2022-07-14 10:24:32 +02:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2022-05-03 09:47:40 +02:00
2023-02-12 14:56:05 +11:00
2023-02-03 12:41:01 +11:00
2023-01-09 14:52:06 +01:00
2023-02-09 11:33:48 +11:00
2023-01-12 12:46:22 +02:00
2023-02-12 14:56:05 +11:00
2022-11-02 15:42:23 +01:00
2022-11-14 12:46:34 +01:00
2022-12-02 19:09:52 +01:00
2023-01-10 01:01:43 -05:00
2023-01-19 15:37:36 -06:00
2022-12-02 14:44:54 -06:00
2023-01-31 18:45:55 +01:00
2022-09-14 21:30:56 +02:00
2023-01-23 00:33:55 +01:00
2022-10-07 22:55:03 +11:00
2022-11-02 10:18:19 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2022-12-13 12:35:53 +11:00
2022-12-26 16:31:25 +09:00
2023-02-07 21:56:45 +01:00
2023-01-10 00:10:43 -05:00
2023-01-26 18:08:45 -05:00
2023-02-12 14:56:05 +11:00
2022-10-02 11:17:40 -05:00
2023-02-06 12:50:34 +11:00
2023-01-10 00:10:43 -05:00
2023-02-01 14:41:40 +11:00
2023-01-10 00:10:43 -05:00
2023-02-12 14:56:05 +11:00
2022-11-17 22:00:17 +01:00
2022-12-29 20:46:05 +01:00
2023-02-12 14:56:05 +11:00
2023-01-03 10:19:27 +11:00
2023-01-05 14:05:30 +01:00
2023-02-12 14:56:05 +11:00
2022-10-03 17:38:16 -05:00
2022-10-07 22:55:03 +11:00
2023-02-08 20:29:52 -05:00
2023-02-08 20:29:52 -05:00
2022-11-01 10:48:18 +01:00
2023-01-31 18:45:55 +01:00
2022-08-03 10:18:02 -05:00
2022-12-08 23:41:38 +01:00
2023-02-13 09:03:00 +01:00
2023-02-12 14:56:05 +11:00
2023-01-19 17:10:42 +11:00
2022-07-05 17:50:59 -05:00
2023-02-06 21:25:45 +01:00
2023-01-23 14:43:04 -06:00
2023-02-06 21:25:45 +01:00
2022-09-26 11:33:22 +10:00
2023-02-13 20:52:02 +01:00
2023-01-13 14:52:04 -06:00
2023-01-19 09:24:52 +01:00
2023-01-23 17:31:46 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-07 17:34:20 +11:00
2022-09-26 11:33:22 +10:00
2022-11-15 13:48:00 -06:00
2023-01-10 01:01:43 -05:00
2022-10-12 20:55:57 -05:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-10 11:27:30 +11:00
2022-11-08 12:01:01 +01:00
2023-01-19 13:48:20 -06:00
2023-01-31 18:45:55 +01:00
2023-02-06 21:25:45 +01:00
2023-01-14 19:13:51 +01:00
2022-11-15 13:48:00 -06:00
2023-01-31 18:45:55 +01:00
2023-02-06 21:25:45 +01:00
2023-01-31 18:45:55 +01:00
2023-01-19 17:10:42 +11:00
2023-01-16 12:07:15 +01:00
2022-11-02 10:18:19 +11:00
2023-02-10 12:55:06 +01:00
2023-02-09 11:33:48 +11:00
2022-11-02 10:18:19 +11:00
2023-01-20 17:36:47 -06:00
2022-10-03 17:38:16 -05:00
2023-01-13 12:31:27 -06:00
2023-02-09 11:33:48 +11:00
2022-07-13 16:11:59 +02:00
2022-10-21 20:10:17 -06:00
2022-09-26 11:33:22 +10:00
2023-01-25 11:18:33 +11:00
2023-01-22 02:03:44 +01:00
2022-11-14 17:14:11 +01:00
2022-07-29 23:17:41 -07:00
2023-02-12 14:56:05 +11:00
2023-01-05 14:05:30 +01:00
2022-11-02 10:18:19 +11:00
2022-09-26 14:23:52 +10:00
2023-02-12 14:56:05 +11:00
2022-11-11 13:49:12 -07:00
2022-11-01 10:48:18 +01:00
2022-11-01 10:48:18 +01:00
2023-01-10 01:01:43 -05:00
2023-02-12 14:56:05 +11:00
2022-11-17 11:55:38 +01:00
2022-08-26 18:08:46 +02:00
2023-02-06 19:29:21 +01:00
2022-07-27 15:33:29 +02:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-09 11:33:48 +11:00
2022-09-08 16:34:31 +02:00
2022-09-08 16:34:31 +02:00
2023-01-16 13:27:35 +11:00
2023-02-03 12:41:01 +11:00
2023-02-06 19:29:21 +01:00
2023-02-06 19:36:36 +01:00
2022-09-26 11:33:22 +10:00
2022-11-01 12:24:58 +11:00
2022-11-22 11:49:56 +01:00
2023-02-12 14:56:05 +11:00
2023-01-10 00:10:43 -05:00
2023-02-09 11:33:48 +11:00
2023-02-06 21:25:45 +01:00
2023-02-12 14:56:05 +11:00
2023-02-09 15:56:05 +01:00
2022-10-12 20:55:57 -05:00
2023-02-12 14:56:05 +11:00
2023-01-10 00:10:43 -05:00
2023-02-06 14:13:53 -05:00
2023-02-12 14:56:05 +11:00
2023-02-10 08:37:50 -05:00
2023-02-09 11:33:48 +11:00
2023-01-10 00:10:43 -05:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-01-10 00:10:43 -05:00
2023-02-09 15:56:05 +01:00
2023-01-10 00:10:43 -05:00
2023-02-09 11:33:48 +11:00
2023-01-10 00:10:43 -05:00
2023-02-09 15:56:05 +01:00
2023-02-11 14:04:35 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-01-05 12:40:34 +01:00
2023-02-03 08:48:00 -05:00
2023-02-12 14:56:05 +11:00
2023-02-03 08:48:00 -05:00
2023-02-03 08:48:00 -05:00
2023-02-07 17:34:20 +11:00
2023-02-03 08:48:00 -05:00
2023-02-03 08:48:00 -05:00
2023-02-03 08:48:00 -05:00
2023-01-20 09:20:56 -06:00
2023-02-03 08:48:00 -05:00
2023-02-03 08:48:00 -05:00
2023-02-03 08:48:00 -05:00
2023-02-13 18:10:13 +01:00
2023-02-13 18:10:13 +01:00
2023-01-09 23:29:58 -05:00
2023-01-08 15:17:09 +01:00
2023-02-12 14:56:05 +11:00
2023-01-17 12:50:06 -06:00
2023-02-12 14:56:05 +11:00
2022-09-26 11:33:22 +10:00
2023-02-12 14:56:05 +11:00
2023-01-13 17:22:07 -06:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-11 14:04:35 +11:00
2022-10-05 13:48:01 -05:00
2023-02-12 14:56:05 +11:00
2023-01-10 01:01:43 -05:00
2023-02-12 14:56:05 +11:00
2022-11-01 10:48:18 +01:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-02-05 17:36:47 -05:00
2023-02-05 17:36:47 -05:00
2023-02-06 12:35:51 +11:00
2023-02-11 14:04:35 +11:00
2023-02-06 21:25:45 +01:00
2023-02-12 14:56:05 +11:00
2023-02-11 14:04:35 +11:00
2023-02-06 15:40:15 +01:00
2023-01-02 16:39:51 +01:00
2022-10-17 11:16:41 +11:00
2022-09-14 14:06:44 +10:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-01-24 18:15:06 +01:00
2022-08-12 10:48:15 +10:00
2023-01-10 00:10:43 -05:00
2023-01-16 13:27:35 +11:00
2023-01-31 14:22:23 +11:00
2023-02-12 14:56:05 +11:00
2022-09-08 16:34:31 +02:00
2022-12-08 23:31:05 +01:00
2023-01-19 22:25:04 -06:00
2023-01-19 22:25:04 -06:00
2022-10-12 20:55:57 -05:00
2023-02-06 12:50:34 +11:00
2023-01-19 22:25:04 -06:00
2023-01-20 09:20:56 -06:00
2023-01-19 22:25:04 -06:00
2023-01-19 22:25:04 -06:00
2023-01-19 22:25:04 -06:00
2023-01-19 22:25:04 -06:00
2023-01-23 17:31:46 +11:00
2023-02-09 15:56:05 +01:00
2023-02-08 10:27:22 +01:00
2023-01-19 22:25:04 -06:00
2023-01-19 22:25:04 -06:00
2023-01-19 22:25:04 -06:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-01-16 13:27:35 +11:00
2022-11-22 11:49:56 +01:00
2022-09-26 11:33:22 +10:00
2022-05-05 10:44:25 +10:00
2022-09-25 18:26:27 +10:00
2022-11-22 11:49:56 +01:00
2022-11-22 11:49:56 +01:00
2023-01-06 20:09:51 +01:00
2023-02-13 18:49:45 +01:00
2022-12-01 10:59:59 +01:00
2023-01-07 17:32:28 +01:00
2023-02-12 14:56:05 +11:00
2022-11-02 10:18:19 +11:00
2023-02-12 14:56:05 +11:00
2022-10-07 16:44:13 +11:00
2022-12-01 15:08:12 -06:00
2023-01-06 20:09:51 +01:00
2023-02-12 14:56:05 +11:00
2023-02-06 21:25:45 +01:00
2023-01-24 18:15:06 +01:00
2022-09-08 16:34:31 +02:00
2022-10-21 20:10:17 -06:00
2023-02-12 14:56:05 +11:00