Cleanup: Sculpt: Resolve todo about const in auto-masking argument

It turns out the undo push is unrelated to this though.
This commit is contained in:
Hans Goudey
2024-06-06 17:10:53 -04:00
parent 5758149546
commit bd5bf4aac4
4 changed files with 6 additions and 11 deletions

View File

@@ -94,13 +94,8 @@ namespace auto_mask {
/**
* Calculate all auto-masking influence on each vertex.
*
* \todo Remove call to `undo::push_node` deep inside this function so the `object` argument can be
* const. That may (hopefully) require pulling out the undo node push into the code for each brush.
* That should help clarify the code path for brushes, and various optimizations will depend on
* brush implementations doing their own undo pushes.
*/
void calc_vert_factors(Object &object,
void calc_vert_factors(const Object &object,
const Cache &cache,
const PBVHNode &node,
Span<int> verts,

View File

@@ -1208,7 +1208,7 @@ void SCULPT_orig_vert_data_unode_init(SculptOrigVertData &data,
}
void SCULPT_orig_vert_data_init(SculptOrigVertData &data,
Object &ob,
const Object &ob,
const PBVHNode &node,
const blender::ed::sculpt_paint::undo::Type type)
{

View File

@@ -594,7 +594,7 @@ static void mesh_orig_vert_data_update(SculptOrigVertData &orig_data, const int
orig_data.no = orig_data.normals[vert];
}
void calc_vert_factors(Object &object,
void calc_vert_factors(const Object &object,
const Cache &cache,
const PBVHNode &node,
const Span<int> verts,
@@ -612,7 +612,7 @@ void calc_vert_factors(Object &object,
}
}
NodeData node_begin(Object &object, const Cache *automasking, const PBVHNode &node)
NodeData node_begin(const Object &object, const Cache *automasking, const PBVHNode &node)
{
if (!automasking) {
return {};

View File

@@ -1007,7 +1007,7 @@ Set<int> gather_hidden_face_sets(Span<bool> hide_poly, Span<int> face_sets);
* handles #BMesh, #Mesh, and multi-resolution.
*/
void SCULPT_orig_vert_data_init(SculptOrigVertData &data,
Object &ob,
const Object &ob,
const PBVHNode &node,
blender::ed::sculpt_paint::undo::Type type);
/**
@@ -1337,7 +1337,7 @@ struct NodeData {
/**
* Call before PBVH vertex iteration.
*/
NodeData node_begin(Object &object, const Cache *automasking, const PBVHNode &node);
NodeData node_begin(const Object &object, const Cache *automasking, const PBVHNode &node);
/* Call before factor_get and SCULPT_brush_strength_factor. */
void node_update(NodeData &automask_data, const PBVHVertexIter &vd);