collada-exporter icon indicating copy to clipboard operation
collada-exporter copied to clipboard

Blender freezes when exporting with shapekeys

Open songproducer opened this issue 7 years ago • 8 comments

Traceback (most recent call last):
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 1938, in save
    exp.export()
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 1848, in export
    self.export_scene()
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 1497, in export_scene
    self.export_node(obj, 2)
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 1455, in export_node
    self.export_node(x, il)
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 1442, in export_node
    self.export_mesh_node(node, il)
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 1031, in export_mesh_node
    meshdata = self.export_mesh(node, armature)
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 416, in export_mesh
    md = self.export_mesh(node, None, k, None, shape.name)
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 686, in export_mesh
    v.normal.x, v.normal.y, v.normal.z)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/__init__.py", line 159, in execute
    return export_dae.save(self, context, **keywords)
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 1938, in save
    exp.export()
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/scripts/addons/io_scene_dae/export_dae.py", line 1933, in __exit__
    bpy.data.meshes.remove(mesh)
RuntimeError: Error: Mesh 'Mesh.002' must have zero users to be removed, found 1 (try with do_unlink=True parameter)


songproducer avatar Nov 02 '16 16:11 songproducer

Nope. It's working. You have another problem in your blend file.

RuntimeError: Error: Mesh 'Mesh.002' must have zero users to be removed, found 1 (try with do_unlink=True parameter)

set-killer avatar Nov 02 '16 20:11 set-killer

Indeed, I tried it with this sample model and it worked. However, just to be safe, is there a more Shape Keys-heavy model around on OpenGameArt or somewhere? Just so that the issue can be closed safely.

ghost avatar Nov 03 '16 15:11 ghost

I was using a model created with Manuel Bastioni's addon v1.3 which has a lot of shape keys.

They've just released v1.4

songproducer avatar Nov 03 '16 19:11 songproducer

That's true for all versions of Manuel Bastioni's addon. I encountered this error myslef and looked into it a bit. It seems something changed from Blender version 2.76 to 2.77. So I switched to Blender version 2.76 and it was working as expected.

Since v2.76 is enough for me I didn't look into it, but it seemed there was a relative easy fix available but I don't know how compatible it is with older Blender versions.

mutato avatar Mar 11 '17 15:03 mutato

I also experienced reproducible freezes trying to export a model created with Manuel Bastioni Lab. In my case, it's Blender 2.79b with MBLab 1.6 and the exporting process never finishes and makes the computer unusable eventually, possibly by exhausting memory.

mysticfall avatar Apr 10 '18 08:04 mysticfall

Hi guys, I also experienced this, but not with Manuel Model but with MMD. I used this blender addon to import MMD model (.pmx) to Blender. And this model to test (R1N4, the one in the bottom of the page).

The shape keys in the Model is for facial expression. And the mesh is full body, I tried to export the shape key and eventually i can't because of not enough memory problem. So i thought that if I separate the head with the rest of the mesh, because the shape keys is only facial expression, the export process will be much faster. And yes, it only several seconds to export, and the morph is working too in Blender. But when I import it to Godot the model is broken.

This is screenshot in blender, and here is the model if you need it (you might need to enable sugiany mmd_tools add-on in Blender which I link on the top of my comment) meshblender And this is when imported to Godot. meshdaxport

I dont really know of the shape keys workflow, so is it wrong to separate the head? or is it the exporter problem?

SORRY, NEVERMIND FIXED WITH TANGENT ARRAYS.

Oh, and also MMD model has a lot of shape keys, so they are Shape Keys-heavy model, in case you want to test the exporter.

sriedi7 avatar May 02 '18 01:05 sriedi7

It seems that out of 83 shape keys that Manuel Bastioni Lab character has, the exporting process freezes around 32nd keys on my PC which has 16Gb of memory.

mysticfall avatar May 27 '18 03:05 mysticfall

I tried to delete every shape keys other than a couple of them to see if it'd succeed. It did after a while, but it resulted in a .dae file which exceeds 1Gb in size.

On the other hand, if I export it using the default Collada exporter shipped with Blender, all 32 shape keys are exported to a file which is about 250mb in size.

Not sure if it'd help debugging the issue, but that's all I can find about the problem without going deeper into the code.

mysticfall avatar May 27 '18 05:05 mysticfall