Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import: exception for 'Node' object has no attribute 'blender_bone_name' #239

Closed
scurest opened this issue Jan 21, 2019 · 6 comments · Fixed by #857
Closed

Import: exception for 'Node' object has no attribute 'blender_bone_name' #239

scurest opened this issue Jan 21, 2019 · 6 comments · Fixed by #857
Labels
bug Something isn't working importer This involves or affects the import process Mesh_&_Object

Comments

@scurest
Copy link
Contributor

scurest commented Jan 21, 2019

Traceback (most recent call last):
  File "/home/scurest/.config/blender/2.79/scripts/addons/io_scene_gltf2/__init__.py", line 468, in execute
    return self.import_gltf2(context)
  File "/home/scurest/.config/blender/2.79/scripts/addons/io_scene_gltf2/__init__.py", line 487, in import_gltf2
    BlenderGlTF.create(self.gltf_importer)
  File "/home/scurest/.config/blender/2.79/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py", line 35, in create
    BlenderScene.create(gltf, scene_idx)
  File "/home/scurest/.config/blender/2.79/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_scene.py", line 78, in create
    BlenderSkin.create_vertex_groups(gltf, skin_id)
  File "/home/scurest/.config/blender/2.79/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_skin.py", line 163, in create_vertex_groups
    obj.vertex_groups.new(name=gltf.data.nodes[bone].blender_bone_name)
AttributeError: 'Node' object has no attribute 'blender_bone_name'

Test file

Not sure what's wrong, but maybe caused by a mesh being instantiated on one of the joints of its skin.

@julienduroure julienduroure added bug Something isn't working importer This involves or affects the import process labels Jan 21, 2019
@julienduroure
Copy link
Collaborator

Your node idx 0 is at the same time a mesh (mesh idx 0), and is listed in joints list.
In Blender, your node can't be at same time a mesh and a bone. Will check what spec says about that.

  • If this is something possible in glTF2.0, we will have to find a way to manage it.
  • If not possible in glTF2.0, will add some checks to avoid exception traceback

@donmccurdy is this something allowed in glTF2.0 spec?

@donmccurdy
Copy link
Contributor

See KhronosGroup/glTF#1433 — this is valid, and if we interpret a node referencing a mesh to mean that node "is" a mesh, then a node can simultaneously be a mesh, a bone, a camera, and a light. The robust way to deal with that is to consider nodes empties, and whatever things they reference become children without a transform of their own.

A lot of tools want to avoid overcomplicating the node hierarchy and optimistically flatten, so I'm sure the importer is not the only tool that will have trouble with this asset. I would suggest we handle this as best we can on import, but avoid writing dual-purpose nodes from the exporter like this.

I'm tempted to say this should be tightened up in a future version of the spec, to reduce edge cases.

@emackey
Copy link
Member

emackey commented Jan 25, 2019

I'm tempted to say this should be tightened up in a future version of the spec, to reduce edge cases.

Agreed. It might be helpful to inquire the history of this. Were multi-purpose nodes intentionally allowed at some point, or were they just an artifact of the schema's ability to assign one of each thing to a node?

@julienduroure
Copy link
Collaborator

julienduroure commented Jan 26, 2019

Note for importer implementation: I will work first on a version where node can be multiple "things" except joints. This will be the more easy part, even it will not solve this issue.
Then I will work on second part, node being able to be joint and something else

@scurest
Copy link
Contributor Author

scurest commented Feb 11, 2019

Note that this same error occurs if a mesh is skinned by joints not in the same scene. See KhronosGroup/glTF#1558.

@julienduroure
Copy link
Collaborator

Started a simple implementation on branch importer_multipletype
Only for objects for now (that means that the bug is not solved yet, because this is a object / rig case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working importer This involves or affects the import process Mesh_&_Object
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants