Fix: Creating sharp_face attribute skipped with smooth set

There is an optimization to avoid creating the attribute if we only
set faces smooth. But since "use_smooth" and "sharp_face" are
inverted, the check for that case needs to be invertex compared
to other similar attribute setters.
This commit is contained in:
Hans Goudey
2023-06-19 09:46:07 -04:00
parent a6a32a8279
commit 30bf4c0945

View File

@@ -733,7 +733,7 @@ static void rna_MeshPolygon_use_smooth_set(PointerRNA *ptr, bool value)
bool *sharp_faces = (bool *)CustomData_get_layer_named_for_write(
&mesh->pdata, CD_PROP_BOOL, "sharp_face", mesh->totpoly);
if (!sharp_faces) {
if (!value) {
if (value) {
/* Skip adding layer if the value is the same as the default. */
return;
}