Fix #145228: Wrong material when copying grease pencil strokes
When copying grease pencil strokes, `BKE_object_material_get()` was used to retrieve the material ID, but the index starts at 1 instead of 0, this caused the pasted material to be wrong. Now the index is properly incremented to 1 when copying. Pull Request: https://projects.blender.org/blender/blender/pulls/145398
This commit is contained in:
@@ -2587,7 +2587,7 @@ static wmOperatorStatus grease_pencil_copy_strokes_exec(bContext *C, wmOperator
|
||||
if (!is_material_index_used(material_index)) {
|
||||
continue;
|
||||
}
|
||||
const Material *material = BKE_object_material_get(object, material_index);
|
||||
const Material *material = BKE_object_material_get(object, material_index + 1);
|
||||
clipboard.materials.append({material ? material->id.session_uid : 0, material_index});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user