Giter Club home page Giter Club logo

gltf-import-export's People

Contributors

bghgary avatar dependabot[bot] avatar emackey avatar najadojo avatar ousttrue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gltf-import-export's Issues

SyntaxError: Cannot use import statement outside a module

I am a noob. Can someone help me with this?

First: the script is named ZZZZZZZZZZZZZ.js, so I can find it more easily.

When I do:
node .\ZZZZZZZZZZZZZZZZ.js

I get:

SyntaxError: Cannot use import statement outside a module

(node:13604) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
D:\HASHLIPS NFT NFT NFT NFT\Hbargutangs XXXXXXX - Beta prkt\gltf-import-export-master\ZZZZZZZZZZZZZZZZ.js:3
import { ConvertGLBtoGltf, ConvertGltfToGLB, ConvertToGLB} from 'gltf-import-export';
^^^^^^

using .mjs on index.js doesn't change anything. Doing "type":"module" in .json is not relevant. What to do?

How to use command line tool?

First off: Thanks for making this available!

I am able to clone the repo and build the project using "npm i" and then "npm run build", which produces a dist folder full of js and map files, but I don't see how to generate and/or run the command line tool. Do you have any hints on how to proceed?

Materials not detected

Whenever I use this model : tree.zip

The material on it isn't converted and does not show up in the gltf file. Using an online service to convert the glb to gltf, i noticed that the file uses two extensions :

"extensionsUsed": [
        "KHR_materials_volume",
        "FB_ngon_encoding"
],

And the material shows up correctly

"materials": [
        {
            "name": "material"
        }
    ],

Any idea why ? :D

2c.glb in npm package

Hi @najadojo, looks like the glTF 2-cylinder engine sample model got accidentally published with the last npm release.

The npm 1.0.18 release was 52kb, and the npm 1.0.19 release is 1.89 MB. The size difference is a new file "2c.glb" that looks to be one of the sample models.

Not a big deal, but would be nice to recover the space in a future version.

No @types/gltf-import-export for Typescript

Hi

I was trying this exporter out, but it seems that it doesn't have typings module for Typescript. When I did npm install --save-dev @types/gltf-import-export I got a 404 not found.

Are there any plans on making one available?
Thanks in advance.

Kind regards

fs.readFileSync is not a function

when i used this tools in nodejs +vuejs ,it has accured a mistake ,it show that fs.readFileSync is not a function

when i find the problem in the code file exportProvider.js, the fs modules has not installed.
could u give me some sugestion

Support base64-encoded binary GLBs

Issue KhronosGroup/glTF-Blender-IO#61 talks about Blender exporting GLBs with base64-encoded data URIs in the JSON part. This doesn't strike me as the ideal way to structure a GLB, but, it looks like the glTF ecosystem may have some number of these in the wild already.

It looks like the GLB importer here fails to load these, producing an empty .bin file and "byteLength": 0 in the resulting glTF.

Sample model from that issue: glb_cubes.zip (use _io_2_79_cube.glb)

TypeError: Cannot read property 'length' of undefined

Converting some GLTF file to GLB results in an error.
The GLTF file is the output of COLLADA2GLTF.
The original DAE file is the output of Maya.

See below:

D:\projectDir> COLLADA2GLTF-bin.exe -i "D:\projectDir\coco-low-sofa-ottoman.dae" -o "D:\projectDir\coco-low-sofa-ottoman.gltf" -v 2.0
Converting D:\projectDir\coco-low-sofa-ottoman.dae -> D:\projectDir\coco-low-sofa-ottoman.gltf
Time: 87 ms

D:\projectDir> gltf-import-export D:\projectDir\coco-low-sofa-ottoman.gltf

D:\projectDir\node_modules\gltf-import-export\dist\exportProvider.js:130
    for (; bufferIndex < gltf.buffers.length; bufferIndex++) {
                                      ^

TypeError: Cannot read property 'length' of undefined
    at ConvertToGLB (D:\projectDir\node_modules\gltf-import-export\dist\exportProvider.js:130:39)
    at Object.ConvertGltfToGLB (D:\projectDir\node_modules\gltf-import-export\dist\exportProvider.js:109:5)
    at Object.<anonymous> (D:\projectDir\node_modules\gltf-import-export\dist\tool.js:31:13)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)

D:\projectDir>

Versions:

  • gltf-import-export: 1.0.11
  • COLLADA2GLTF: 2.1.2 Windows x64

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.