Page MenuHome

Cleanup: Simplify UV Packing API.
ClosedPublic

Authored by Chris Blackbourn (chrisbblend) on Oct 12 2022, 3:41 AM.

Details

Summary

Affects paint.add_simple_uvs

No user visible changes.

Diff Detail

Repository
rB Blender

Event Timeline

Chris Blackbourn (chrisbblend) requested review of this revision.Oct 12 2022, 3:41 AM
Chris Blackbourn (chrisbblend) created this revision.

Accepting with minor request for updated doc-strings, some minor renaming.

The patch body should also have a brief explanation of how this simplifies the code.

source/blender/editors/include/ED_uvedit.h
384

*picky* In general, prefer to keep array, array_len pairs grouped. Also mesh is often used for Mesh data so this could be called ... bmesh_override and placed after objects_len.

Passing in the meshes is a bit ugly, we could even split this into two functions, one that takes objects and another that takes a BMesh array - but the overhead of having too identical functions also isn't great, even so - it would be good to note why this is needed and if the objects are needed when mesh overrides are passed in.


Instead of inline comment, this should use more formal doxy:

Something like this:

/**
 * Pack islands of multiple objects.
 *
 * \param bmesh_override: BMesh array aligned with `objects`.
 * This is needed to UV perform packing on objects that aren't in edit-mode (on creation for e.g.).
 * Optional, when non-null this overrides objects edit-mode data.
 * 
 */
This revision is now accepted and ready to land.Oct 13 2022, 12:45 AM
This revision was automatically updated to reflect the committed changes.