Sculpt: Add global automasking propagation steps #117316
|
@ -384,8 +384,6 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene)
|
|||
IDP_ClearProperty(idprop);
|
||||
}
|
||||
|
||||
/* Ensure sculpt-mode global automasking_boundary_edges_propagation_steps is defaulted
|
||||
* correctly.*/
|
||||
if (ts->sculpt) {
|
||||
Sean-Kim marked this conversation as resolved
|
||||
ts->sculpt->automasking_boundary_edges_propagation_steps = 1;
|
||||
}
|
||||
|
|
|
@ -204,8 +204,6 @@ static bool needs_factors_cache(const Sculpt *sd, const Brush *brush)
|
|||
return true;
|
||||
}
|
||||
|
||||
/* TODO: I'm unsure why the BRUSH_AUTOMASKING_VIEW_NORMAL cares at all about the propagation
|
||||
* steps being non 1, should this only check for brush being non-nullptr? */
|
||||
if (automasking_flags & BRUSH_AUTOMASKING_VIEW_NORMAL) {
|
||||
return brush && brush->automasking_boundary_edges_propagation_steps != 1;
|
||||
}
|
||||
Sean-Kim marked this conversation as resolved
Outdated
Hans Goudey
commented
Agreed, but how about handling that in a separate PR? Agreed, but how about handling that in a separate PR?
|
||||
|
@ -807,6 +805,7 @@ bool tool_can_reuse_automask(int sculpt_tool)
|
|||
std::unique_ptr<Cache> cache_init(Sculpt *sd, Brush *brush, Object *ob)
|
||||
{
|
||||
SculptSession *ss = ob->sculpt;
|
||||
const int totvert = SCULPT_vertex_count_get(ss);
|
||||
|
||||
if (!is_enabled(sd, ss, brush)) {
|
||||
return nullptr;
|
||||
|
@ -899,10 +898,19 @@ std::unique_ptr<Cache> cache_init(Sculpt *sd, Brush *brush, Object *ob)
|
|||
SCULPT_ATTRIBUTE_NAME(automasking_factor),
|
||||
¶ms);
|
||||
|
||||
/* Topology builds up the mask from zero which other modes can subtract from.
|
||||
* If it isn't enabled, initialize to 1. */
|
||||
float initial_value = !(mode & BRUSH_AUTOMASKING_TOPOLOGY) ? 1.0f : 0.0f;
|
||||
const int totvert = SCULPT_vertex_count_get(ss);
|
||||
float initial_value;
|
||||
|
||||
/* Topology, boundary and boundary face sets build up the mask
|
||||
* from zero which other modes can subtract from. If none of them are
|
||||
* enabled initialize to 1.
|
||||
*/
|
||||
if (!(mode & BRUSH_AUTOMASKING_TOPOLOGY)) {
|
||||
initial_value = 1.0f;
|
||||
}
|
||||
else {
|
||||
initial_value = 0.0f;
|
||||
}
|
||||
|
||||
for (int i : IndexRange(totvert)) {
|
||||
PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
This is basically the point of this function, so this comment isn't adding much. I'd suggest removing it.