Fix: wrong rna pointer for material slot

This was missing from rB1a81d268a19f2f1402f408ad1dadf92c7a399607.
This commit is contained in:
Jacques Lucke 2021-05-20 12:14:31 +02:00
parent b084b57fbf
commit b51bd859fd
Notes: blender-bot 2023-02-14 08:06:38 +01:00
Referenced by issue #90907, Change "Link materials to the object or the object's data" on multiple objects
Referenced by issue #88465, Crashing when selecting Materials
1 changed files with 2 additions and 1 deletions

View File

@ -975,7 +975,8 @@ int /*eContextResult*/ buttons_context(const bContext *C,
if (matnr < 0) {
matnr = 0;
}
CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, &ob->mat[matnr]);
/* Keep aligned with rna_Object_material_slots_get. */
CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, POINTER_FROM_INT(matnr + 1));
}
}