Page MenuHome

Mesh: Move edge crease out of MEdge
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Sep 10 2022, 12:59 AM.

Details

Summary

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 the layer instead of a property.
  • The "crease" attribute can be created and removed by geometry nodes.

The second thing should make various geometry nodes a bit faster,
since the "crease" attribute was always processed. Crease is now
interpolated generically in the CustomData API too, which should
help maintain the values across edits better.

Meshes get a 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.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Sep 10 2022, 12:59 AM
Hans Goudey (HooglyBoogly) created this revision.
Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)

@Campbell Barton (campbellbarton), the part you may be interested in is the cd_flag removal. The rest of the patch is basically the same as the bevel weight patch.

Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)

Noted some minor issues but they don't require an extra review, besides those LGTM.

source/blender/blenkernel/intern/mesh_debug.cc
35

Can be removed (unused).

source/blender/editors/transform/transform_convert_mesh_vert_cdata.c
93โ€“94

Should be CD_CREASE.

source/blender/makesrna/intern/rna_mesh.c
1472

Expected behavior when there is and me->edit_mesh clear, it's probably best to return NULL with a comment noting why it's not supported.

1476

The difference between the pointers may exceed an int's range, use intptr_t.

source/blender/modifiers/intern/MOD_solidify_extrude.c
1055

Shouldn't this be result_edge_crease ?

This revision is now accepted and ready to land.Sep 23 2022, 12:04 PM
Hans Goudey (HooglyBoogly) marked 3 inline comments as done.Sep 23 2022, 3:33 PM
Hans Goudey (HooglyBoogly) added inline comments.
source/blender/editors/transform/transform_convert_mesh_vert_cdata.c
93โ€“94

Thanks for catching that.

source/blender/makesrna/intern/rna_mesh.c
1472

This is a duplicate from the other functions above and below. I'll improve them all together in a separate commit.

1476

Same as above

This revision was automatically updated to reflect the committed changes.
Hans Goudey (HooglyBoogly) marked an inline comment as done.