Skip to content

Commit

Permalink
Revert "Remove Google Poly integration"
Browse files Browse the repository at this point in the history
This reverts commit 4b1c762.
  • Loading branch information
andybak committed Aug 27, 2024
1 parent 6afca85 commit e80dc4c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/editor/nodes/ModelNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
26 changes: 26 additions & 0 deletions src/ui/assets/sources/PolySource.js
Original file line number Diff line number Diff line change
@@ -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;
}
}
3 changes: 2 additions & 1 deletion src/ui/landing/LandingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ export default class LandingPage extends Component {
<h3>Discover</h3>
<p>
Explore images, videos, and 3D models from around the web, all without opening up a new tab. With
media integrations from Sketchfab, you&#39;ll be on your way to creating a scene in no time.
media integrations from Sketchfab and Google Poly, you&#39;ll be on your way to creating a scene in no
time.
</p>
</Callout>
<Callout imageSrc={editor}>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/onboarding/Onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit e80dc4c

Please sign in to comment.