UI: Gray out Scene Auto-Masking option if equivalent Brush option is used #102971 #106126

Open
Henry-Chang wants to merge 11 commits from Henry-Chang/blender:gray-out-automasking into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 6 additions and 0 deletions
Showing only changes of commit d232b8800a - Show all commits

View File

@ -1809,7 +1809,13 @@ static int rna_Scene_automasking_view_normal_editable(struct PointerRNA *ptr, co
if (sd && (sd->paint.brush->automasking_flags & BRUSH_AUTOMASKING_VIEW_NORMAL)) {
*r_info = "The active brush already has the same auto-masking enabled.";
// TODO should probably utilize RNA_def_property_float_funcs to sync values between automasking_view and automasking_scene_view
sd->automasking_scene_view_normal_limit = sd->automasking_view_normal_limit;
Review

Do not change properties inside of an editable callback, these are meant to be mere queries and not modify data.

Do not change properties inside of an editable callback, these are meant to be mere queries and not modify data.
Review

Agreed. Will definitely revert them.

Agreed. Will definitely revert them.
sd->automasking_scene_view_normal_falloff = sd->automasking_view_normal_falloff;
return PROP_INACTIVE | PROP_EDITABLE;
} else {
sd->automasking_view_normal_limit = sd->automasking_scene_view_normal_limit;
sd->automasking_view_normal_falloff = sd->automasking_scene_view_normal_falloff;
}
return sd ? PROP_EDITABLE: 0;