Fix T103195: Initialize face sets from bevel weights broken

The conversion from char to float (divide by 255) wasn't removed in
291c313f80. Also fix a crash when the edge crease layer
didn't exist.
This commit is contained in:
Hans Goudey 2022-12-13 14:26:46 -06:00 committed by Thomas Dinges
parent 94e7e83cd9
commit d666c64f5d
Notes: blender-bot 2024-01-31 11:35:08 +01:00
Referenced by issue #103195, Sculpting - Face Sets, Initialise Face Sets - By Edge Bevel Weights do not work
Referenced by issue #102967, 3.4: Potential candidates for corrective releases
1 changed files with 2 additions and 2 deletions

View File

@ -692,7 +692,7 @@ static int sculpt_face_set_init_exec(bContext *C, wmOperator *op)
CustomData_get_layer(&mesh->edata, CD_CREASE));
sculpt_face_sets_init_flood_fill(
ob, [&](const int /*from_face*/, const int edge, const int /*to_face*/) -> bool {
return creases[edge] < threshold;
return creases ? creases[edge] < threshold : true;
});
break;
}
@ -709,7 +709,7 @@ static int sculpt_face_set_init_exec(bContext *C, wmOperator *op)
CustomData_get_layer(&mesh->edata, CD_BWEIGHT));
sculpt_face_sets_init_flood_fill(
ob, [&](const int /*from_face*/, const int edge, const int /*to_face*/) -> bool {
return bevel_weights ? bevel_weights[edge] / 255.0f < threshold : true;
return bevel_weights ? bevel_weights[edge] < threshold : true;
});
break;
}