blender/release
Martijn Versteegh 6c774feba2 Mesh: Move UV layers to generic attributes
Currently the `MLoopUV` struct stores UV coordinates and flags related
to editing UV maps in the UV editor. This patch changes the coordinates
to use the generic 2D vector type, and moves the flags into three
separate boolean attributes. This follows the design in T95965, with
the ultimate intention of simplifying code and improving performance.

Importantly, the change allows exporters and renderers to use UVs
"touched" by geometry nodes, which only creates generic attributes.
It also allows geometry nodes to create "proper" UV maps from scratch,
though only with the Store Named Attribute node for now.

The new design considers any 2D vector attribute on the corner domain
to be a UV map. In the future, they might be distinguished from regular
2D vectors with attribute metadata, which may be helpful because they
are often interpolated differently.

Most of the code changes deal with passing around UV BMesh custom data
offsets and tracking the boolean "sublayers". The boolean layers are
use the following prefixes for attribute names: vert selection: `.vs.`,
edge selection: `.es.`, pinning: `.pn.`. Currently these are short to
avoid using up the maximum length of attribute names. To accommodate
for these 4 extra characters, the name length limit is enlarged to 68
bytes, while the maximum user settable name length is still 64 bytes.

Unfortunately Python/RNA API access to the UV flag data becomes slower.
Accessing the boolean layers directly is be better for performance in
general.

Like the other mesh SoA refactors, backward and forward compatibility
aren't affected, and won't be changed until 4.0. We pay for that by
making mesh reading and writing more expensive with conversions.

Resolves T85962

Differential Revision: https://developer.blender.org/D14365
2023-01-10 01:01:43 -05:00
..
bin Linux: Move Mesa software OpenGL libraries to sub-directory 2022-07-08 15:44:06 +02:00
darwin Info.plist: Bump LSMinimumSystemVersion to silence warning 2022-01-14 19:33:06 +05:30
datafiles Mesh: Move positions to a generic attribute 2023-01-10 00:10:43 -05:00
freedesktop Update freedesktop file with Blender 3.4 features. 2022-12-06 16:34:53 +01:00
license Update THIRD-PARTY-LICENSES.txt for Blender 3.4. 2022-12-02 00:38:23 -08:00
lts Cleanup: use autopep8 on release/lts 2022-04-20 16:18:42 +10:00
scripts Mesh: Move UV layers to generic attributes 2023-01-10 01:01:43 -05:00
text readme.html: replace IRC with blender.chat, fix typo 2022-02-15 11:09:40 +05:30
windows Build: library updates for Blender 3.5 2022-12-07 15:28:17 +01:00