Page MenuHome

Default .glTF importer not importing vertex groups data
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.12

Blender Version
Broken: version: 3.0.0 Beta, branch: master, commit date: 2021-11-03 21:09, hash: rB3e6907eb8a3d
Worked: 2.93.5

Short description of error
Importing any .glTF file with a skeleton imports its vertex groups as empty.

Exact steps for others to reproduce the error

  1. In Blender, import any .glTF file with rigging/skeleton.
  2. Check its vertex groups in Weight Paint mode and you will see that the vertex groups do not have any data.
  3. Furthermore, trying to move any bone of my character does not yield any result.

Screenshots



Event Timeline

Festivity created this task.Nov 4 2021, 8:13 AM
Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Nov 4 2021, 4:29 PM
Philipp Oeser (lichtwerk) triaged this task as High priority.

Can confirm.

@Julien DUROURE (julien) : mind checking?

  • I can confirm the problem on 3.0
  • No problem occurs on 2.93 with addon code from 3.0

So, the problem probably come from an regression or change of bpy python API

Run this code in 2.93 and in 3.0 get different result:

import bpy

mesh = bpy.data.meshes.new(name="meshnew")
obj = bpy.data.objects.new("test1", mesh)

obj.vertex_groups.new(name="vg1")
obj.vertex_groups.new(name="vg2")

bpy.data.objects.remove(obj)
obj2 = bpy.data.objects.new("test2", mesh)
print(len(obj2.vertex_groups))

Adding Python API tag, as it not seems to be relative to a specific addon

CC @Hans Goudey (HooglyBoogly) : is this expected (sorry, no time to check further today)?

Probably because of https://developer.blender.org/D11689 which moved vertex group data from the Object to the Mesh?

Can easily be fixed by moving the code that sets the name from object creation time (here) to mesh creation time (here).

There is never a situation where the glTF importer would have shared the same Mesh between Objects with different vertex group names to worry about btw.

What @Julien DUROURE (julien) observes is expected. The vertex group names are now stored on the mesh rather than the object.

What @Scurest (scurest) says sounds correct to me, I'm not sure exactly how the glTF importer works, but if it relies on the fact that the vertex group names will stay when replacing an object's data, it will have to change.

Thanks @Hans Goudey (HooglyBoogly) for your feedback.
I already prepared a patch to change glTF importer that I will merge soon.