Curve: sync active material with selection

Changing active spline updates active material index.

Reviewed By: campbellbarton

Ref D14250
This commit is contained in:
Red Mser 2022-03-07 12:06:33 +11:00 committed by Campbell Barton
parent fae45a43fa
commit 8ec35c05b2
1 changed files with 6 additions and 0 deletions

View File

@ -4863,6 +4863,12 @@ bool ED_curve_editnurb_select_pick(
BKE_curve_nurb_active_set(cu, nu);
}
/* Change active material on object. */
if (nu->mat_nr != obedit->actcol - 1) {
obedit->actcol = nu->mat_nr + 1;
WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, NULL);
}
if (vc.view_layer->basact != basact) {
ED_object_base_activate(C, basact);
}