[Bf-blender-cvs] [8ec35c05b2f] master: Curve: sync active material with selection

Red Mser noreply at git.blender.org
Mon Mar 7 02:08:26 CET 2022


Commit: 8ec35c05b2fe40f23fe9be9d95b03622c844b4f2
Author: Red Mser
Date:   Mon Mar 7 12:06:33 2022 +1100
Branches: master
https://developer.blender.org/rB8ec35c05b2fe40f23fe9be9d95b03622c844b4f2

Curve: sync active material with selection

Changing active spline updates active material index.

Reviewed By: campbellbarton

Ref D14250

===================================================================

M	source/blender/editors/curve/editcurve.c

===================================================================

diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index a33fbb29f85..ba9502b80bf 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -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);
     }



More information about the Bf-blender-cvs mailing list