Cleanup: Split 'transform_snap_object.c' into smaller files #108949

Merged
Germano Cavalcante merged 1 commits from mano-wii/blender:transform_cleanup into main 2023-06-14 20:08:14 +02:00

This commit splits the transform_snap_object.cc file into 4 files:

  • transform_snap_object.h
  • transform_snap_object.cc
  • transform_snap_object_editmesh.cc
  • transform_snap_object_mesh.cc

The transform_snap_object.h header, in addition to sharing common
types, allows functions defined in each of these files to be shared
between them.

This makes the code easier to read and simplifies maintenance.


The idea of splitting transform_snap_object.cc came about because this code is getting excessively large and a bit messy.

It's starting to get hard to identify where the functions for mesh and editmesh are.

Also the Snap To modes: Vert, Edge, Face, Edge Midpoint, Edge Perpendicular, Face Nearest are getting very spread out but still keep dependency on each other.

This dependency between modes causes problems for PR !108734, (Where individual mode filters were implemented, but Snap to Edge Midpoint and Snap to Edge Perpendicular do not work without Snap to Edge).

This PR for split doesn't solve the little mess, nor the strong dependency between Snap To modes, but it could be a step towards that.

This commit splits the `transform_snap_object.cc` file into 4 files: - `transform_snap_object.h` - `transform_snap_object.cc` - `transform_snap_object_editmesh.cc` - `transform_snap_object_mesh.cc` The `transform_snap_object.h` header, in addition to sharing common types, allows functions defined in each of these files to be shared between them. This makes the code easier to read and simplifies maintenance. --- The idea of splitting `transform_snap_object.cc` came about because this code is getting excessively large and a bit messy. It's starting to get hard to identify where the functions for mesh and editmesh are. Also the Snap To modes: Vert, Edge, Face, Edge Midpoint, Edge Perpendicular, Face Nearest are getting very spread out but still keep dependency on each other. This dependency between modes causes problems for PR !108734, (Where individual mode filters were implemented, but Snap to Edge Midpoint and Snap to Edge Perpendicular do not work without Snap to Edge). This PR for split doesn't solve the little mess, nor the strong dependency between Snap To modes, but it could be a step towards that.
Germano Cavalcante requested review from Campbell Barton 2023-06-13 20:10:39 +02:00
Germano Cavalcante force-pushed transform_cleanup from 4ed4f130cd to ca14cb257e 2023-06-14 14:26:11 +02:00 Compare
Germano Cavalcante force-pushed transform_cleanup from ca14cb257e to a8cbdcc2ac 2023-06-14 16:21:43 +02:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Germano Cavalcante force-pushed transform_cleanup from a8cbdcc2ac to b4378db914 2023-06-14 16:52:46 +02:00 Compare
Germano Cavalcante force-pushed transform_cleanup from b4378db914 to 75b90dc910 2023-06-14 20:06:55 +02:00 Compare
Germano Cavalcante merged commit 9265fa1eed into main 2023-06-14 20:08:14 +02:00
Germano Cavalcante deleted branch transform_cleanup 2023-06-14 20:08:15 +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
1 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#108949
No description provided.