From 998712ba2eeb81135cc2b809e7a2eecb30226dff Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Wed, 7 Aug 2024 19:08:57 +0200 Subject: [PATCH] Cleanup: Sculpt: Move SculptBoundary struct Moves SculptBoundary out of BKE_paint.hh and into sculpt_intern.hh Like other cached data, this ideally should not be this exposed, but reducing its inclusion in any other file that uses BKE_paint.hh is a good start. Pull Request: https://projects.blender.org/blender/blender/pulls/126010 --- source/blender/blenkernel/BKE_paint.hh | 59 ------------------- .../editors/sculpt_paint/sculpt_intern.hh | 59 +++++++++++++++++++ 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/source/blender/blenkernel/BKE_paint.hh b/source/blender/blenkernel/BKE_paint.hh index 19a216a8973..92266649dff 100644 --- a/source/blender/blenkernel/BKE_paint.hh +++ b/source/blender/blenkernel/BKE_paint.hh @@ -326,65 +326,6 @@ struct SculptBoundaryPreview { blender::float3 initial_vert_position; }; -struct SculptBoundary { - /* Vertex indices of the active boundary. */ - blender::Vector verts; - - /* Distance from a vertex in the boundary to initial vertex indexed by vertex index, taking into - * account the length of all edges between them. Any vertex that is not in the boundary will have - * a distance of 0. */ - blender::Map distance; - - /* Data for drawing the preview. */ - blender::Vector> edges; - - /* Initial vertex index in the boundary which is closest to the current sculpt active vertex. */ - int initial_vert_i; - - /* Vertex that at max_propagation_steps from the boundary and closest to the original active - * vertex that was used to initialize the boundary. This is used as a reference to check how much - * the deformation will go into the mesh and to calculate the strength of the brushes. */ - blender::float3 pivot_position; - - /* Stores the initial positions of the pivot and boundary initial vertex as they may be deformed - * during the brush action. This allows to use them as a reference positions and vectors for some - * brush effects. */ - blender::float3 initial_vert_position; - - /* Maximum number of topology steps that were calculated from the boundary. */ - int max_propagation_steps; - - /* Indexed by vertex index, contains the topology information needed for boundary deformations. - */ - struct { - /* Vertex index from where the topology propagation reached this vertex. */ - blender::Array original_vertex_i; - - /* How many steps were needed to reach this vertex from the boundary. */ - blender::Array propagation_steps_num; - - /* Strength that is used to deform this vertex. */ - blender::Array strength_factor; - } edit_info; - - /* Bend Deform type. */ - struct { - blender::Array pivot_rotation_axis; - blender::Array pivot_positions; - } bend; - - /* Slide Deform type. */ - struct { - blender::Array directions; - } slide; - - /* Twist Deform type. */ - struct { - blender::float3 rotation_axis; - blender::float3 pivot_position; - } twist; -}; - struct SculptFakeNeighbors { bool use_fake_neighbors; diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.hh b/source/blender/editors/sculpt_paint/sculpt_intern.hh index ec46fdd607a..88b35b09ad5 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.hh +++ b/source/blender/editors/sculpt_paint/sculpt_intern.hh @@ -287,6 +287,65 @@ struct Cache { } +struct SculptBoundary { + /* Vertex indices of the active boundary. */ + blender::Vector verts; + + /* Distance from a vertex in the boundary to initial vertex indexed by vertex index, taking into + * account the length of all edges between them. Any vertex that is not in the boundary will have + * a distance of 0. */ + blender::Map distance; + + /* Data for drawing the preview. */ + blender::Vector> edges; + + /* Initial vertex index in the boundary which is closest to the current sculpt active vertex. */ + int initial_vert_i; + + /* Vertex that at max_propagation_steps from the boundary and closest to the original active + * vertex that was used to initialize the boundary. This is used as a reference to check how much + * the deformation will go into the mesh and to calculate the strength of the brushes. */ + blender::float3 pivot_position; + + /* Stores the initial positions of the pivot and boundary initial vertex as they may be deformed + * during the brush action. This allows to use them as a reference positions and vectors for some + * brush effects. */ + blender::float3 initial_vert_position; + + /* Maximum number of topology steps that were calculated from the boundary. */ + int max_propagation_steps; + + /* Indexed by vertex index, contains the topology information needed for boundary deformations. + */ + struct { + /* Vertex index from where the topology propagation reached this vertex. */ + blender::Array original_vertex_i; + + /* How many steps were needed to reach this vertex from the boundary. */ + blender::Array propagation_steps_num; + + /* Strength that is used to deform this vertex. */ + blender::Array strength_factor; + } edit_info; + + /* Bend Deform type. */ + struct { + blender::Array pivot_rotation_axis; + blender::Array pivot_positions; + } bend; + + /* Slide Deform type. */ + struct { + blender::Array directions; + } slide; + + /* Twist Deform type. */ + struct { + blender::float3 rotation_axis; + blender::float3 pivot_position; + } twist; +}; + /** * This structure contains all the temporary data * needed for individual brush strokes.