libgdx_blender_g3d_exporter icon indicating copy to clipboard operation
libgdx_blender_g3d_exporter copied to clipboard

Export fail if scene only contains animation

Open Scellow opened this issue 7 years ago • 4 comments

Hello

I have some FBX that only contains animation, and it fail to export because it requeires a model with material

Would be cool if it was able to still export even if it is only for the animation

Scellow avatar Feb 20 '18 20:02 Scellow

image

Traceback (most recent call last):
  File "C:\Users\Scellow\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_g3d\g3d_exporter.py", line 116, in execute
    return self.startExport(context)
  File "C:\Users\Scellow\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_g3d\profile.py", line 33, in profile_fun
    return fun(*args, **kwargs)
  File "C:\Users\Scellow\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_g3d\g3d_exporter.py", line 140, in startExport
    materials = self.generateMaterials(context)
  File "C:\Users\Scellow\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_g3d\profile.py", line 33, in profile_fun
    return fun(*args, **kwargs)
  File "C:\Users\Scellow\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_g3d\g3d_exporter.py", line 543, in generateMaterials
    raise RuntimeError("Can't have a model without materials, use at least one material in your mesh objects.")
RuntimeError: Can't have a model without materials, use at least one material in your mesh objects.

location: <unknown location>:-1


Scellow avatar Feb 20 '18 20:02 Scellow

Here is a FBX that only contains the animation I tried to add a mesh with a material so i can strip the animation data, but there was nothing, looks like it didn't recognize it at all

test.zip

Scellow avatar Feb 20 '18 20:02 Scellow

I can't seems to figure out why it doesn't recognize the animation from my FBX :/

Scellow avatar Feb 21 '18 08:02 Scellow

I'm on my phone now but I'll take a look into this (and into your pull request) as soon as I can.

From what I remember the G3D format represents animations as a series of transforms to bones, represented in the file as meshless nodes, and then the actual model nodes are linked to these bones with a weight ratio.

So in the G3D file you need at least the bones to be exported. I took a quick look into your code and it seems if I check the "only animation" option then armatures aren't exported? If that's the case I don't think it will work. I'll have to take a look into this.

Dancovich avatar Feb 21 '18 11:02 Dancovich