remix icon indicating copy to clipboard operation
remix copied to clipboard

feat(remix-dev): Add loaders config for 3d models

Open ikarus-akhil opened this issue 3 years ago • 5 comments
trafficstars

Adds support for importing .glb, .gltf and .hdr files.

Closes: #4430

Testing Strategy:

I was able to import .glb and .hdr files and use them in google model viewer linked using its CDN.

import model from "../../public/mod/Hololens.glb";
import env from "../../public/mod/Neutral.hdr";
const Model = () => {
  return (
    <model-viewer
      style={{ height: "100vh", width: "100vw" }}
      src={model}
      shadow-intensity="1"
      camera-controls
      touch-action="pan-y pinch-zoom"
      environment-image={env}
      camera-orbit="calc(-0.25rad + env(window-scroll-y) * 12rad) calc(90deg + env(window-scroll-y) * 45deg) calc(10m - env(window-scroll-y) * 10m)"
    />
  );
};
export default Model;

ikarus-akhil avatar Oct 31 '22 04:10 ikarus-akhil

🦋 Changeset detected

Latest commit: 2254eefd04dbdb9d3a7d45fcf50e8a8450ccca1a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@remix-run/dev Minor
create-remix Minor
@remix-run/css-bundle Minor
remix Minor
@remix-run/architect Minor
@remix-run/cloudflare Minor
@remix-run/cloudflare-pages Minor
@remix-run/cloudflare-workers Minor
@remix-run/deno Minor
@remix-run/eslint-config Minor
@remix-run/express Minor
@remix-run/netlify Minor
@remix-run/node Minor
@remix-run/react Minor
@remix-run/serve Minor
@remix-run/server-runtime Minor
@remix-run/testing Minor
@remix-run/vercel Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Oct 31 '22 04:10 changeset-bot[bot]

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

remix-cla-bot[bot] avatar Nov 02 '22 05:11 remix-cla-bot[bot]

@machour Have made the appropriate changes.

ikarus-akhil avatar Nov 04 '22 11:11 ikarus-akhil

@machour Can you please review the code and approve it it is okay, as we need these loaders for our project.

ikarus-akhil avatar Nov 08 '22 11:11 ikarus-akhil

@ikarus-akhil there seem to be a conflict with the changeset file, other than that looks good to me. 👌🏼 Someone from the Remix team will eventually attend this.

In the mean time, if you can't wait any longer, I suggest using https://www.npmjs.com/package/patch-package to apply these changes on your project.

You might also be interested in this proposal https://github.com/remix-run/remix/discussions/4549 that will turn into an RFC soon and hopefully make it to Remix.

machour avatar Nov 08 '22 19:11 machour

@machour I have resolved the conflict, can you please merge this code.

ikarus-akhil avatar Dec 19 '22 12:12 ikarus-akhil

@machour Sorry for the delay and all the trouble, was having problem with the changeset but now I think it should be good.

ikarus-akhil avatar Dec 29 '22 08:12 ikarus-akhil

Looks like this was shipped in 1.11, resolved in https://github.com/remix-run/remix/pull/5030. I'm going to close this but I'll add @ikarus-akhil to our contributors list since we dropped the ball on reviewing in a timely manner. Sorry about that!

chaance avatar Feb 09 '23 12:02 chaance