Mesh: Move functions to C++ header #105416

Merged
Hans Goudey merged 18 commits from HooglyBoogly/blender:mesh-header-cleanup into main 2023-03-12 22:29:27 +01:00
Member

Refactoring mesh code, it has become clear that local cleanups and
simplifications are limited by the need to keep a C public API for
mesh functions. This change makes code more obvious and makes further
refactoring much easier.

  • Add a new BKE_mesh.hh header for a C++ only mesh API
  • Introduce a new blender::bke::mesh namespace, documented here:
    https://wiki.blender.org/wiki/Source/Objects/Mesh#Namespaces
  • Move some functions to the new namespace, cleaning up their arguments
  • Move code to Array and float3 where necessary to use the new API
  • Define existing inline mesh data access functions to the new header
  • Keep some C API functions where necessary because of RNA
  • Move all C++ files to use the new header, which includes the old one

In the future it may make sense to split up BKE_mesh.hh more, but for
now keeping the same name as the existing header keeps things simple.

Refactoring mesh code, it has become clear that local cleanups and simplifications are limited by the need to keep a C public API for mesh functions. This change makes code more obvious and makes further refactoring much easier. - Add a new `BKE_mesh.hh` header for a C++ only mesh API - Introduce a new `blender::bke::mesh` namespace, documented here: https://wiki.blender.org/wiki/Source/Objects/Mesh#Namespaces - Move some functions to the new namespace, cleaning up their arguments - Move code to `Array` and `float3` where necessary to use the new API - Define existing inline mesh data access functions to the new header - Keep some C API functions where necessary because of RNA - Move all C++ files to use the new header, which includes the old one In the future it may make sense to split up `BKE_mesh.hh` more, but for now keeping the same name as the existing header keeps things simple.
Hans Goudey added the
Module
Modeling
Interest
Nodes & Physics
labels 2023-03-03 22:25:55 +01:00
Hans Goudey added 6 commits 2023-03-03 22:26:08 +01:00
Hans Goudey added this to the Modeling project 2023-03-03 22:31:41 +01:00
Hans Goudey requested review from Campbell Barton 2023-03-03 22:32:10 +01:00
Hans Goudey requested review from Jacques Lucke 2023-03-03 22:32:10 +01:00
Hans Goudey added 1 commit 2023-03-03 22:36:32 +01:00
Author
Member

At this point I'm only looking for feedback on the big picture organization of the headers. There are other changes I'd clean up from the patch before more specific review.

At this point I'm only looking for feedback on the big picture organization of the headers. There are other changes I'd clean up from the patch before more specific review.
Member

Moving this stuff to a C++ header with the same name sounds like a good step to me. Think we could think about splitting it up more separately, but currently the header is not sooo large that it is absolutely necessary.

Moving this stuff to a C++ header with the same name sounds like a good step to me. Think we could think about splitting it up more separately, but currently the header is not sooo large that it is absolutely necessary.
Hans Goudey added 3 commits 2023-03-09 18:56:05 +01:00
Hans Goudey added 1 commit 2023-03-09 19:30:01 +01:00
Hans Goudey added 3 commits 2023-03-09 21:44:49 +01:00
Hans Goudey changed title from WIP: Mesh: Move functions to C++ header to Mesh: Move functions to C++ header 2023-03-09 21:48:05 +01:00
Hans Goudey added 1 commit 2023-03-10 14:36:15 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
cbf39ce5ed
Merge branch 'main' into mesh-header-cleanup
Member

@blender-bot build

@blender-bot build
Jacques Lucke approved these changes 2023-03-11 10:48:47 +01:00
@ -0,0 +37,4 @@
Span<float3> poly_normals,
MutableSpan<MLoopTri> looptris);
/** Calculate the average position of the vertices in the poligon. */
Member

typo (poligon)

typo (poligon)
HooglyBoogly marked this conversation as resolved
Hans Goudey added 2 commits 2023-03-12 22:14:40 +01:00
Hans Goudey added 1 commit 2023-03-12 22:17:38 +01:00
Author
Member

Since this is now straightforward on a design level (using existing namespace conventions, existing C++ types, etc), I think it's non-controversial enough to commit, so I'll do that.

Since this is now straightforward on a design level (using existing namespace conventions, existing C++ types, etc), I think it's non-controversial enough to commit, so I'll do that.
Hans Goudey merged commit 1dc57a89e9 into main 2023-03-12 22:29:27 +01:00
Hans Goudey deleted branch mesh-header-cleanup 2023-03-12 22:29:28 +01:00
Sign in to join this conversation.
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#105416
No description provided.