Giter VIP home page Giter VIP logo

gltf-blender-importer's Introduction

If you're looking for the official importer included with Blender, go here.

Fox model by PixelMannen, rigging by Tom Kranis

gltf-blender-importer Build status

Un-official Blender importer for glTF 2.0.

Installation

Click the "Download Add-on" button above to download the ZIP containing the add-on. In Blender, navigate to File > User Preferences... > Add-ons (or Edit > User Preferences... > Add-ons) and install that ZIP with the Install Add-on from File... button (or Install... button). Then type 'glTF' in the search bar and tick the checkbox next to KSons' glTF 2.0 Importer to enable it.

You can now import glTFs with File > Import > KSons' glTF 2.0 (.glb/.gltf).

See INSTALL.md for further installation instructions.

Supported Extensions

  • KHR_materials_pbrSpecularGlossiness
  • KHR_lights_punctual
  • KHR_materials_unlit
  • KHR_texture_transform
  • MSFT_texture_dds
  • EXT_property_animation (extension abandoned upstream)

Unsupported Features

  • Inverse bind matrices are ignored

Samples Renderings

BoomBox Corset Lantern

See also

Official Importer-Exporter: glTF-Blender-IO

gltf-blender-importer's People

Contributors

dvd0101 avatar giorgiomarcias avatar ksons avatar scurest avatar webprofusion-chrisc avatar wnayes avatar zignig 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gltf-blender-importer's Issues

Broken in Blender 2.80.5

I just updated to .3 version it works great for 2.79! and decided to try it on Blender 2.80.5, I get an error(see attach image).

error

How to use?

Can you write some instructions on how to use this?

Store vertex color alpha into a second color attribute

It's possible that I don't fully understand Blender, but it's my understanding that gltf lets you store vertex colors in RGBA format while Blender only accepts vertex colors in RGB format. So the importer ends up discarding the extra alpha values of the vertex colors in a gltf file. Is it possible to stash those alpha values into a second vertex color attribute during import? So the importer would create a COLOR_0 and a ALPHA_0/COLOR_0_ALPHA or something like that.

error on import gltf 2.0 file

When trying to import https://sketchfab.com/models/b4bdfa9b1d1d4506a41fee8c9b1ae728#

Traceback (most recent call last):
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 282, in execute
    [self.create_group(nodes[idx], None) for idx in scene['nodes']]
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 282, in <listcomp>
    [self.create_group(nodes[idx], None) for idx in scene['nodes']]
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 261, in create_group
    self.create_group(self.root['nodes'][idx], ob)
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 261, in create_group
    self.create_group(self.root['nodes'][idx], ob)
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 261, in create_group
    self.create_group(self.root['nodes'][idx], ob)
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 261, in create_group
    self.create_group(self.root['nodes'][idx], ob)
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 261, in create_group
    self.create_group(self.root['nodes'][idx], ob)
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 261, in create_group
    self.create_group(self.root['nodes'][idx], ob)
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 261, in create_group
    self.create_group(self.root['nodes'][idx], ob)
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 249, in create_group
    ob = self.create_mesh(node, self.root['meshes'][node['mesh']])
  File "C:\Users\i\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf\__init__.py", line 213, in create_mesh
    me = bpy.data.meshes.new(mesh['name'])
KeyError: 'name'

location: <unknown location>:-1


glTF import for glTF export

It would like awesome to follow the nodes from glTF-Blender-Exporter here:
https://github.com/KhronosGroup/glTF-Blender-Exporter

The workflow: you export a model from substance painter in glTF, you import with your ksons/gltf-blender-importer, you animate the scene in blenber, and export with glTF-Blender-Exporter for ThreeJS, Unity or BabylonJS. Not need to replace the nodes.

Modo 12 to Blender, import error.

I'm saving the .glb file from Modo 12 and trying to get a simple cube into Blender 2.79.1. Upon importing I get the following errors(see attachment) ,the cube.glb is also attached in the zip.

CubeTest.zip

gltf_import_error

Importing original vertex normals

Current importer relies on smoothing groups with normals discarded rather than carrying original vertex normals, will there be a plan to support it?

Extras field is not imported.

When importing in Blender a file that contains extras fields, that data is lost. Later if I decide to export the scene back to gltf, the custom meta is gone.

Issue with Add-On installation

I am using both Blender 2.79 with Python 3.5 and Python 3.6, somewhat after installing add-on, I am not seeing it inside the Add-On Preferences. Thus I cannot enable it and cannot see the IO import.

Any pointer? Thanks!

The difference between import the gltf1.0 and gltf2.0

Thanks for this addon that enable me to import the gltf into blender.
And now I am wondering if it could import gltf1.0 into blender. To start with, I try to change the code of searching way. Because there is a dict behind every main properties in gltf 1.0, while it is list behind the main properties. But it is quite difficult, and especially in creating the virtual nodes. I'm not sure if it is a good way.
And if there are already some ways to convert the gltf1.0 to gltf2.0?

cant import models at all

ok so yes it works but i cant import armatures

on this one it simply doesnt import bones and on the bones branch it doesnt import at all

on the bones branch i get

  File "C:\Users\Flashlight Bulbton\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf2222\__init__.py", line 116, in execute
    scene.create_scenes(self)
  File "C:\Users\Flashlight Bulbton\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf2222\scene.py", line 7, in create_scenes
    realize_vforest(op)
  File "C:\Users\Flashlight Bulbton\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf2222\scene.py", line 146, in realize_vforest
    pass2(root)
  File "C:\Users\Flashlight Bulbton\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_gltf2222\scene.py", line 128, in pass2
    bone_name = op.id_to_vnode[node_id]['blender_name']
KeyError: 'blender_name'

location: <unknown location>:-1

the 2222 is because it wouldnt even install right for some reason (that was a fault on my end)

im trying to import a vroid vrm model

The addon doesn't shouw up in the list of add-ons after intallation

When I try to install it using "Install addon from file" button in user preferences and pointing directly to the init.py it doesn't appear in addon's list.
When I renamed the file to glTF2Importer.py and the installed all appeared fine. So, I suggest to rename the file.

Blender version 2.79, Windows 10

Animation doesn't seem to be working, or maybe I have to do something to use it

I tried the animation glTF samples, e.g. AnimatedTriangle. When it's imported, I don't see any animation on the triangle's rotation (as specified in the glTF file) or any keyframes in the graph editor. I see in the import code it's doing something with the animation, I just don't know how to get that to actually animate.

Float error

Hello,
getting error for this line about TypeError: 'float' object is not subscriptable
mesh.py: 287
weight = weight_set[pidx][j]

A320_NEO_LOD01.zip

Failed to import .gltf file exported from three.js demo editor

Traceback (most recent call last):
File "C:\Users\Alex\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\glTF2Importer.py", line 282, in execute
[self.create_group(nodes[idx], None) for idx in scene['nodes']]
File "C:\Users\Alex\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\glTF2Importer.py", line 282, in
[self.create_group(nodes[idx], None) for idx in scene['nodes']]
File "C:\Users\Alex\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\glTF2Importer.py", line 251, in create_group
ob = bpy.data.objects.new(node['name'], None)
KeyError: 'name'

location: :-1

location: :-1

The input file is attached.

scene.zip

VROID import does not have bones

When import VROID character (vrd -> gltf) the bone hierarchy comes as Empty, is there anyway we can import the bones but with weight and everything?

Thanks!

Feature request: importing a gltf+bin

I've been trying to import a gltf+bin file but had no success. When I convert the file to glb it works fine.

Does the importer not support gltf+bin? If so, any chance this can be added?

Vertex Groups

Hey just wondering if vertex groups supported with this importer?, loaded in a animation but no vertex groups on the mesh.

Importer duplicates accessors in memory for every mesh that references it, causing extreme memory usage

There is a problem regarding shared accessors. If you have a single accessor containing all vertices for the .gltf file, but there are multiple meshes, then all vertices in that accessor will get loaded into every mesh. This is a big problem when you have a big .gltf with hundreds of meshes. For instance, we had a .gtlf with 150k tris, but when loading it, the importer would load 260 million verts because of the duplication. This caused Blender to sit at a whopping 10GB memory usage, in an empty scene with just that model.

Here is a simple example of 2 boxes. The caps are separate meshes, and the body is a single mesh. So 3 submeshes per box for body and caps, 48 vertices total in the accessor. This means 2348=288 vertices loaded in Blender, where we would only expect 48 vertices loaded.
incorrect.zip

This problem came to light when exporting using the Sketchup GLTF exporter by CentaurMare. This plugin puts all vertices in a single accessor to save a bit of file size. The author of that plugin was very helpful, and we had some back and forth to come to this conclusion. The author says he discussed the problem on https://gitter.im/KhronosGroup/glTF to check if shared accessors like that are part of the .gltf spec. Consensus was that it is, and so it should be a bug in the importer in Blender rather than the exporter in Sketchup. Maybe worth noting is that the official Unity GLTF importer exhibits the exact same issue as the Blender importer, I have made a report there as well.

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.