From 3ba711050f7de3e59a44bb2034fb02afbced5c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 1 Jan 2022 19:22:22 +0000 Subject: [PATCH] do not add plugin ExtractComponentPlugin twice for StandardMaterial (#3502) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Objective - After updating #2988, all the examples started crashing with ``` thread 'main' panicked at 'Plugin "bevy_render::render_component::ExtractComponentPlugin>" was already added', crates/bevy_app/src/app.rs:831:33 ``` ## Solution Plugin was added twice: directly: https://github.com/bevyengine/bevy/blob/1d0d8a3397bd6fc2c14d42ffd0668d2443748912/crates/bevy_pbr/src/lib.rs#L73 and through `MaterialPlugin`: https://github.com/bevyengine/bevy/blob/1d0d8a3397bd6fc2c14d42ffd0668d2443748912/crates/bevy_pbr/src/lib.rs#L72 https://github.com/bevyengine/bevy/blob/1d0d8a3397bd6fc2c14d42ffd0668d2443748912/crates/bevy_pbr/src/material.rs#L183 I removed the extra plugin Co-authored-by: François <8672791+mockersf@users.noreply.github.com> --- crates/bevy_pbr/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/bevy_pbr/src/lib.rs b/crates/bevy_pbr/src/lib.rs index 62129a9009..2e4fddbc82 100644 --- a/crates/bevy_pbr/src/lib.rs +++ b/crates/bevy_pbr/src/lib.rs @@ -38,7 +38,6 @@ use bevy_ecs::prelude::*; use bevy_reflect::TypeUuid; use bevy_render::{ prelude::Color, - render_component::ExtractComponentPlugin, render_graph::RenderGraph, render_phase::{sort_phase_system, AddRenderCommand, DrawFunctions}, render_resource::{Shader, SpecializedPipelines}, @@ -70,7 +69,6 @@ impl Plugin for PbrPlugin { app.add_plugin(MeshRenderPlugin) .add_plugin(MaterialPlugin::::default()) - .add_plugin(ExtractComponentPlugin::>::default()) .init_resource::() .init_resource::() .init_resource::()