Skip to content

Commit cb78e1b

Browse files
committed
Fix the many_materials and edit_material_on_gltf examples.
1 parent 7e30da9 commit cb78e1b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/3d/edit_material_on_gltf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fn change_material(
7575
if let Some(material) = mesh_materials
7676
.get(descendants)
7777
.ok()
78-
.and_then(|id| asset_materials.get_mut(id.id()))
78+
.and_then(|id| asset_materials.get_cloned_mut(id.id()))
7979
{
8080
// Create a copy of the material and override base color
8181
// If you intend on creating multiple models with the same tint, it

examples/stress_tests/many_materials.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn animate_materials(
9191
mut materials: ResMut<Assets<StandardMaterial>>,
9292
) {
9393
for (i, material_handle) in material_handles.iter().enumerate() {
94-
if let Some(material) = materials.get_mut(material_handle) {
94+
if let Some(material) = materials.get_cloned_mut(material_handle) {
9595
let color = Color::hsl(
9696
((i as f32 * 2.345 + time.elapsed_secs()) * 100.0) % 360.0,
9797
1.0,

0 commit comments

Comments
 (0)