GithubHelp home page GithubHelp logo

Comments (7)

drcmda avatar drcmda commented on July 21, 2024 3

should be fixed! at least banana.gltf goes through. the draco thing for some reason still doesn't. but you can at least keep on working, the output structure between the two would be the same.

from gltfjsx.

drcmda avatar drcmda commented on July 21, 2024

the other error should be gone too. it kind of sucks, gltfloader doesn't work under node and im basically just ripping out all the pieces that crash. i don't need it to actually create buffers, i just need the structure from it - there's probably an easier way: @donmccurdy

from gltfjsx.

drcmda avatar drcmda commented on July 21, 2024

1.0.5: also fixed support for bones. it will add the root bone as a single raw primitive and wire up the skeleton of the skinnedmesh. it works ootb, here's an updated example (Stacy.js): https://codesandbox.io/s/r3f-bones-3i7iu

not 100% sure if that's the right way. previously it would put all the bones into proper jsx, but they wouldn't function. looks to me like skeleton is, once again, imperative. 🙈

const skeleton = new Skeleton(bones)
mesh.bind(skeleton)

that's a tragedy as it kills declarative usage.

from gltfjsx.

donmccurdy avatar donmccurdy commented on July 21, 2024

it kind of sucks, gltfloader doesn't work under node and im basically just ripping out all the pieces that crash.

I've hacked around the nodejs issues before, but it took hacks all the way down. Draco is the hardest part — and that link is outdated, in that regard — because it now uses Web Workers. Open to ideas on improving nodejs support.

Do you just need the JSON from the glTF file? Or the exact threejs object hierarchy that GLTFLoader would return?

from gltfjsx.

donmccurdy avatar donmccurdy commented on July 21, 2024

If the JSON is enough, I can share how to decode that from a .glb easily.

If you need a full threejs hierarchy, which would be the same as the glTF JSON plus some added leaf nodes, I'm guessing mrdoob/three.js#18484 might help you out — write a plugin that "provides" all the buffers and textures with empty data, let the rest run normally.

from gltfjsx.

donmccurdy avatar donmccurdy commented on July 21, 2024

If the JSON is enough, I can share how to decode that from a .glb easily.

Specifically: https://github.com/donmccurdy/glTF-Transform/blob/c6fa67080f7863f4ed79560ab1b812ccd8a73fbe/packages/core/src/util.ts#L35-L65

from gltfjsx.

drcmda avatar drcmda commented on July 21, 2024

Do you just need the JSON from the glTF file? Or the exact threejs object hierarchy that GLTFLoader would return?

i think it would need to be the object hierarchy. i think relying on pure gltf would be the easiest when it comes to reading out, but emulating a basic threejs structure is probably going to be very hard.

the current workflow is based on the /bin directory in this repo, a fork of the loader and everything that ever wants to fetch requests for assets or create things that node can't is removed little by little. i think i oriented myself around the gist you posted, i saw it in the threejs discourse forum i believe. unfortunately i must have minimized it in the very beginning, very clever ... 🤭

from gltfjsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.