From e80dc4ca8d2bf17ed6b39473d6d40a74fb617491 Mon Sep 17 00:00:00 2001 From: Andy Baker Date: Tue, 27 Aug 2024 14:00:46 +0100 Subject: [PATCH] Revert "Remove Google Poly integration" This reverts commit 4b1c762b72e1e86d27fd28bb007f37e872fcaa1f. --- src/config.js | 2 ++ src/editor/nodes/ModelNode.js | 2 +- src/ui/assets/sources/PolySource.js | 26 ++++++++++++++++++++++++++ src/ui/landing/LandingPage.js | 3 ++- src/ui/onboarding/Onboarding.js | 2 +- 5 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 src/ui/assets/sources/PolySource.js diff --git a/src/config.js b/src/config.js index ccc630671..96d57c031 100644 --- a/src/config.js +++ b/src/config.js @@ -57,6 +57,7 @@ import MediaFrameNode from "./editor/nodes/MediaFrameNode"; import MediaFrameNodeEditor from "./ui/properties/MediaFrameNodeEditor"; import SketchfabSource from "./ui/assets/sources/SketchfabSource"; +import PolySource from "./ui/assets/sources/PolySource"; import BingImagesSource from "./ui/assets/sources/BingImagesSource"; import BingVideosSource from "./ui/assets/sources/BingVideosSource"; import TenorSource from "./ui/assets/sources/TenorSource"; @@ -107,6 +108,7 @@ export function createEditor(api, settings) { editor.registerSource(new ArchitectureKitSource(api)); editor.registerSource(new RockKitSource(api)); editor.registerSource(new SketchfabSource(api)); + editor.registerSource(new PolySource(api)); editor.registerSource(new BingImagesSource(api)); editor.registerSource(new BingVideosSource(api)); editor.registerSource(new HubsSoundPackSource(editor)); diff --git a/src/editor/nodes/ModelNode.js b/src/editor/nodes/ModelNode.js index 289c13b5c..309dd1b12 100644 --- a/src/editor/nodes/ModelNode.js +++ b/src/editor/nodes/ModelNode.js @@ -270,7 +270,7 @@ export default class ModelNode extends EditorNodeMixin(Model) { getAttribution() { // Sketchfab models use an extra object inside the asset object - // Blender exporters add a copyright property to the asset object + // Blender & Google Poly exporters add a copyright property to the asset object const name = this.name.replace(/\.[^/.]+$/, ""); const assetDef = this.gltfJson.asset; const attributions = {}; diff --git a/src/ui/assets/sources/PolySource.js b/src/ui/assets/sources/PolySource.js new file mode 100644 index 000000000..c164875b3 --- /dev/null +++ b/src/ui/assets/sources/PolySource.js @@ -0,0 +1,26 @@ +import ModelMediaSource from "../ModelMediaSource"; +import { TransformPivot } from "../../../editor/controls/SpokeControls"; + +export default class PolySource extends ModelMediaSource { + constructor(api) { + super(api); + this.id = "poly"; + this.name = "Google Poly"; + this.tags = [ + { label: "Featured", value: "" }, + { label: "Animals", value: "animals" }, + { label: "Architecture", value: "architecture" }, + { label: "Art", value: "art" }, + { label: "Food", value: "food" }, + { label: "Nature", value: "nature" }, + { label: "Objects", value: "objects" }, + { label: "People", value: "people" }, + { label: "Scenes", value: "scenes" }, + { label: "Transport", value: "transport" } + ]; + + this.searchLegalCopy = "Search by Google"; + this.privacyPolicyUrl = "https://policies.google.com/privacy"; + this.transformPivot = TransformPivot.Bottom; + } +} diff --git a/src/ui/landing/LandingPage.js b/src/ui/landing/LandingPage.js index a2a624e2b..a42b0a67e 100644 --- a/src/ui/landing/LandingPage.js +++ b/src/ui/landing/LandingPage.js @@ -128,7 +128,8 @@ export default class LandingPage extends Component {

Discover

Explore images, videos, and 3D models from around the web, all without opening up a new tab. With - media integrations from Sketchfab, you'll be on your way to creating a scene in no time. + media integrations from Sketchfab and Google Poly, you'll be on your way to creating a scene in no + time.

diff --git a/src/ui/onboarding/Onboarding.js b/src/ui/onboarding/Onboarding.js index 7fd750015..3e5f255c1 100644 --- a/src/ui/onboarding/Onboarding.js +++ b/src/ui/onboarding/Onboarding.js @@ -21,7 +21,7 @@ import { Link } from "react-router-dom"; class CreateModelPopover extends Component { componentDidMount() { // TODO: Check if object was added - this.props.editor.setSource("sketchfab"); + this.props.editor.setSource("poly"); this.props.editor.addListener("sceneGraphChanged", this.onObjectAdded); }