T90372: Assets: When dropping material use active material slot.
Currently when dropping an asset the first material slot is always updated. This patch changes that logic to update the active material slot. In future the behavior will be updated to use the material slot of the face under the cursor. That requires better feedback tot he user. Reviewed By: Severin Maniphest Tasks: T90372 Differential Revision: https://developer.blender.org/D12056
This commit is contained in:
committed by
Jeroen Bakker
parent
a53feb0aff
commit
ebd55b4acd
@@ -2736,7 +2736,11 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, const wmEvent
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
BKE_object_material_assign(CTX_data_main(C), base->object, ma, 1, BKE_MAT_ASSIGN_USERPREF);
|
||||
Object *ob = base->object;
|
||||
const short active_mat_slot = ob->actcol;
|
||||
|
||||
BKE_object_material_assign(
|
||||
CTX_data_main(C), base->object, ma, active_mat_slot, BKE_MAT_ASSIGN_USERPREF);
|
||||
|
||||
DEG_id_tag_update(&base->object->id, ID_RECALC_TRANSFORM);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user