Mesh: Move edge crease out of MEdge

This is very similar to D14077. There are two differences though.
First is that vertex creases are already stored in a separate layer,
and second is that we can now completely remove use of `Mesh.cd_flag`,
since that information is now inherent to whether the layers exist.

There are two functional differences here:
 * Operators are used to add and remove layers instead of a property.
 * The "crease" attribute can be created and removed by geometry nodes.

The second change should make various geometry nodes slightly faster,
since the "crease" attribute was always processed before. Creases are
now interpolated generically in the CustomData API too, which should
help maintain the values across edits better.

Meshes get an `edge_creases` RNA property like the existing vertex
property, to provide more efficient access to the data in Cycles.

One test failure is expected, where different rounding between float
the old char storage means that 5 additional points are scattered in
a geometry nodes test.

Differential Revision: https://developer.blender.org/D15927
This commit is contained in:
2022-09-23 09:02:05 -05:00
parent b197cd5821
commit a8a454287a
50 changed files with 461 additions and 294 deletions

View File

@@ -503,11 +503,15 @@ class DATA_PT_customdata(MeshButtonsPanel, Panel):
else:
col.operator("mesh.customdata_bevel_weight_vertex_add", icon='ADD')
col = layout.column(heading="Store")
if me.has_crease_edge:
col.operator("mesh.customdata_crease_edge_clear", icon='X')
else:
col.operator("mesh.customdata_crease_edge_add", icon='ADD')
col.enabled = obj is not None and obj.mode != 'EDIT'
col.prop(me, "use_customdata_vertex_crease", text="Vertex Crease")
col.prop(me, "use_customdata_edge_crease", text="Edge Crease")
if me.has_crease_vertex:
col.operator("mesh.customdata_crease_vertex_clear", icon='X')
else:
col.operator("mesh.customdata_crease_vertex_add", icon='ADD')
class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, Panel):