Mesh: Rename "polys" to "faces" #109819

Merged
Hans Goudey merged 10 commits from HooglyBoogly/blender:cleanup-mesh-face-rename into main 2023-07-24 22:07:03 +02:00
Member

Implements part of #101689.

The "poly" name was chosen to distinguish the MLoop + MPoly combination
from the MFace struct it replaced. Those two structures persisted
together for a long time, but nowadays MPoly is gone, and MFace
is only used in some legacy code like the particle system.

To avoid unnecessarily using a different term, increase consistency with
the UI and with BMesh, and generally make code a bit easier to read,
this commit replaces the poly term with poly. Most variables that
use the term are renamed too. Mesh.totface now has a _legacy
suffix to reduce confusion. In a next step, pdata can be renamed
to face_data as well.

Implements part of #101689. The "poly" name was chosen to distinguish the `MLoop` + `MPoly` combination from the `MFace` struct it replaced. Those two structures persisted together for a long time, but nowadays `MPoly` is gone, and `MFace` is only used in some legacy code like the particle system. To avoid unnecessarily using a different term, increase consistency with the UI and with BMesh, and generally make code a bit easier to read, this commit replaces the `poly` term with `poly`. Most variables that use the term are renamed too. `Mesh.totface` now has a `_legacy` suffix to reduce confusion. In a next step, `pdata` can be renamed to `face_data` as well.
Hans Goudey added 1 commit 2023-07-07 14:11:07 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
04adcaf195
Mesh: Rename "polys" to "faces"
Implements part of #101689.

The "poly" name was chosen to distinguish the `MLoop` + `MPoly` system
from the `MFace` system it replaced. Those two structures persisted
together for a long time, but nowadays `MPoly` is gone, and `MFace`
is only used in some legacy code like the particle system.

To avoid unnecessarily using a different term, increase consistency with
the UI and with BMesh, and generally make code a bit easier to read,
this commit replaces the `poly` term with `poly`. Most variables that
use the term are renamed too. `Mesh.fdata` and `Mesh.totface` now
have a `_legacy` suffix to reduce confusion. In a next step, `pdata`
can be renamed to `face_data` as well.
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey added this to the Modeling project 2023-07-07 14:12:52 +02:00
Hans Goudey requested review from Campbell Barton 2023-07-07 14:12:59 +02:00
Hans Goudey added 2 commits 2023-07-10 18:12:05 +02:00

My main concern with this patch is it leaves things in an inconstant state.

  • Anywhere p/poly is currently used as a prefix (primarily pdata / fdata). Having me->faces not refer to fdata seems highly error prone.
  • If it's necessary to apply these changes in steps, a short term solution could be to rename fdata -> fdata_legacy, then at least we avoid accidental f/p confusion.
  • It would be good to know how expansive this change will be - is this change also impacting public API's or are these exempt from the rename? Reserving breaking changes for 4.x is good but this is a fairly large breaking change without any near-term up-side beyond consistency. If that's the end goal, I'd like to run it by other core developers.
My main concern with this patch is it leaves things in an inconstant state. - Anywhere `p/poly` is currently used as a prefix (primarily `pdata` / `fdata`). Having `me->faces` not refer to `fdata` seems highly error prone. - If it's necessary to apply these changes in steps, a short term solution could be to rename `fdata` -> `fdata_legacy`, then at least we avoid accidental f/p confusion. - It would be good to know how expansive this change will be - is this change also impacting public API's or are these exempt from the rename? Reserving breaking changes for 4.x is good but this is a fairly large breaking change without any near-term up-side beyond consistency. If that's the end goal, I'd like to run it by other core developers.
Hans Goudey added 3 commits 2023-07-12 14:28:12 +02:00
Author
Member
  • I renamed fdata to fdata_legacy in this PR. But I would rather leave renaming pdata to face_data to a separate commit, so I can rename edata->edge_data and vdata->vert_data in the same commit.
  • Personally I don't have a strong opinion about whether to change RNA or not. I would rather do that in a separate PR though, to potentially group it with a "loop" to "corner" rename there too.
- I renamed `fdata` to `fdata_legacy` in this PR. But I would rather leave renaming `pdata` to `face_data` to a separate commit, so I can rename `edata->edge_data` and `vdata->vert_data` in the same commit. - Personally I don't have a strong opinion about whether to change RNA or not. I would rather do that in a separate PR though, to potentially group it with a "loop" to "corner" rename there too.
Hans Goudey added 1 commit 2023-07-14 14:03:30 +02:00

Since this doesn't touch public API's (RNA), it seems OK as is.

Although soon after this I it would be good to rename custom-data:

  • Mesh::vert_data
  • Mesh::edge_data
  • Mesh::loop_data
  • Mesh::face_data
  • Mesh::face_data_legacy (stays as-is).

Currently having pdata references faces fairly counter intuitive but if it's only for a short time I don't think it's an issue.

Since this doesn't touch public API's (RNA), it seems OK as is. Although soon after this I it would be good to rename custom-data: - `Mesh::vert_data` - `Mesh::edge_data` - `Mesh::loop_data` - `Mesh::face_data` - `Mesh::face_data_legacy` (stays as-is). Currently having `pdata` references faces fairly counter intuitive but if it's only for a short time I don't think it's an issue.
Campbell Barton approved these changes 2023-07-21 10:12:49 +02:00
Campbell Barton reviewed 2023-07-21 10:16:27 +02:00
@ -181,3 +181,3 @@
#define BLI_EDGEHASH_SIZE_GUESS_FROM_LOOPS(totloop) ((totloop) / 2)
#define BLI_EDGEHASH_SIZE_GUESS_FROM_POLYS(totpoly) ((totpoly)*2)
#define BLI_EDGEHASH_SIZE_GUESS_FROM_POLYS(faces_num) ((faces_num)*2)

BLI_EDGEHASH_SIZE_GUESS_FROM_POLYS -> BLI_EDGEHASH_SIZE_GUESS_FROM_FACES totloop can be renamed too.

`BLI_EDGEHASH_SIZE_GUESS_FROM_POLYS` -> `BLI_EDGEHASH_SIZE_GUESS_FROM_FACES` totloop can be renamed too.

Noticed some uppercase uses of POLY that could be renamed to FACE as part of this patch: DT_DATATYPE_IS_POLY DT_DATATYPE_IS_POLY MREMAP_MODE_VERT_POLY_NEAREST ME_POLY_TRI_TOT.

Noticed some uppercase uses of POLY that could be renamed to FACE as part of this patch: `DT_DATATYPE_IS_POLY DT_DATATYPE_IS_POLY MREMAP_MODE_VERT_POLY_NEAREST ME_POLY_TRI_TOT`.
Hans Goudey added 3 commits 2023-07-24 22:05:04 +02:00
Hans Goudey merged commit 5e9ea9243b into main 2023-07-24 22:07:03 +02:00
Hans Goudey deleted branch cleanup-mesh-face-rename 2023-07-24 22:07:05 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#109819
No description provided.