Skip to content

Commit

Permalink
Migrate background to environment-settings
Browse files Browse the repository at this point in the history
fixes #4648
  • Loading branch information
netpro2k committed Sep 22, 2021
1 parent 28ebf39 commit 61777cb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gltf-component-mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function registerRootSceneComponent(componentName) {
}

registerRootSceneComponent("fog");
registerRootSceneComponent("background");

AFRAME.GLTFModelPlus.registerComponent("duck", "duck", el => {
el.setAttribute("duck", "");
Expand Down Expand Up @@ -599,6 +598,14 @@ AFRAME.GLTFModelPlus.registerComponent("audio-zone", "audio-zone", (el, componen
el.setAttribute(componentName, { ...componentData });
});

AFRAME.GLTFModelPlus.registerComponent("background", "background", (el, _componentName, componentData) => {
console.warn(
"The `background` component is deprecated, use `backgroundColor` on the `environment-settings` component instead."
);
// This assumes the background component is on the root entity, which it is for spoke, the only thing using this component
el.setAttribute("environment-settings", { backgroundColor: new THREE.Color(componentData.color) });
});

AFRAME.GLTFModelPlus.registerComponent(
"environment-settings",
"environment-settings",
Expand Down

0 comments on commit 61777cb

Please sign in to comment.