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

Blender 2.8 error trying to export with Rigify Armature. #154

Open
Angeloss opened this issue Feb 5, 2019 · 13 comments
Open

Blender 2.8 error trying to export with Rigify Armature. #154

Angeloss opened this issue Feb 5, 2019 · 13 comments

Comments

@Angeloss
Copy link

Angeloss commented Feb 5, 2019

OS:
Windows 10

Blender version:
2.8

Issue description:
I don't know if it is related to Rigify , but I got the error:

Traceback (most recent call last):
  File "D:\Development\GameCoder\InternalProjects\Blender-src\build_windows_Full_x64_vc15_Release\bin\Release\2.80\scripts\addons\io_scene_godot\__init__.py", line 190, in execute
    return export_godot.save(self, context, **keywords)
  File "D:\Development\GameCoder\InternalProjects\Blender-src\build_windows_Full_x64_vc15_Release\bin\Release\2.80\scripts\addons\io_scene_godot\export_godot.py", line 246, in save
    exp.export()
  File "D:\Development\GameCoder\InternalProjects\Blender-src\build_windows_Full_x64_vc15_Release\bin\Release\2.80\scripts\addons\io_scene_godot\export_godot.py", line 210, in export
    self.export_scene()
  File "D:\Development\GameCoder\InternalProjects\Blender-src\build_windows_Full_x64_vc15_Release\bin\Release\2.80\scripts\addons\io_scene_godot\export_godot.py", line 176, in export_scene
    if self.should_export_object(obj):
  File "D:\Development\GameCoder\InternalProjects\Blender-src\build_windows_Full_x64_vc15_Release\bin\Release\2.80\scripts\addons\io_scene_godot\export_godot.py", line 162, in should_export_object
    if self.config["use_export_selected"] and not obj.select:
AttributeError: 'Object' object has no attribute 'select'

location: <unknown location>:-1

I checked the "Selected Objects" option.

Minimal reproduction project:

  • New Blender 2.8 project.
  • Add Some Mesh.
  • Add Rigify Armature.
  • Bind Mesh to Armature.
  • Try to export.
@Jason0214
Copy link
Collaborator

fixed by #155

@Angeloss
Copy link
Author

Angeloss commented Feb 6, 2019

I'm sorry but it is still not possible to export the model correctly with Rigify armature.
This is the model I'm trying to export:
PlayerCharacter.zip
Thank you.

@Jason0214 Jason0214 reopened this Feb 6, 2019
@Jason0214
Copy link
Collaborator

I can confirm the exporting crashed at some point exporting rig animation. The exporter have not really take Rigify and Animation Driver into account yet, so most likely it is related to them.

@Angeloss
Copy link
Author

Angeloss commented Feb 7, 2019

Thank you very much for checking this out. You Rocks!

@Angeloss
Copy link
Author

Angeloss commented Feb 8, 2019

In an effort to try and test your changes in the pull request I opened and saved my 2.7 file(because the "better collada exporter") in 2.8 and now I can't open it back in 2.7 to export. 😓 😢.
Regarding the exporter, it seems that only exports the animation selected in the Dope Sheet Action Editor and sets the pose of the Mesh in that Action, but the rig imports as A-Pose in Godot and also the info of the animation is wrong.

image

image

image

Now I'm going to try to append the animations from the 2.8 file to a new 2.7 file. 😞

@Jason0214
Copy link
Collaborator

Ah, sorry for the trouble.. yeah it's annoying 2.8 blend file can not revert to 2.7.

I just made another try with the branch HEAD, it comes out fine on mine. By looking at how deformed your screenshot is, I wonder are you export to the escn file which is opened in Godot? Sometimes, it cause very wild deform. If so, try to clear the .import folder and .import file and export it again. Thanks

@Angeloss
Copy link
Author

Angeloss commented Feb 8, 2019

You are right. It works! I just find out that the mesh is posed as the top Action Stash while the Armature is posed in Default. To make it works the "Default Pose Action" needs to be at the top of the stash.
image

image


image

image

And materials exports weird, as shader materials instead of spatial materials 😅 but that's easily fixable, thank you very much!

Now that we have this power, how can we put custom/engine properties, like if an object should have a particular script, or parameter values things like that, is it posible?

Again, thank you!! 🤘

@Jason0214
Copy link
Collaborator

Glad you have made it work! And thanks for your patience :D

I just find out that the mesh is posed as the top Action Stash while the Armature is posed in Default. To make it works the "Default Pose Action" needs to be at the top of the stash.

Are you suggesting the A-Pose only exports when putting on the top of the stack? I am not very clear about this part. If it is something need user to pay attention only to make it work, it is bad, it should better be handled by scripts.

how can we put custom/engine properties, like if an object should have a particular script, or parameter values things like that, is it posible

I think it is exactly why this addon is brought up by community, everything is possible as any godot scene can be fully described by ESCN/TSCN. Though, still a lot work needs to be done at this addon side.

And materials exports weird, as shader materials instead of spatial materials

Actually now it is designed to exporting Shader Material.., because Shader Material is able to cover general CYCLE/EEVEE shader node tree. A little more complex shader (e.g. with any converter node) would be not able to export to Spatial Material. However, Spatial Material could be useful for shader tree with only one shader and texture input, so I opened #158.

By the way I checked your blend file, most of the materials should be successfully exported as Shader Material, but I noticed your screenshot is all black 😂. If you want, you can just open another issue about the material

@Jason0214
Copy link
Collaborator

close this issue as the main animation bug is fixed, feel free to open new issues if you think the exporting workflow need improvement.

@Angeloss
Copy link
Author

Hi! Sorry for late reply.

Are you suggesting the A-Pose only exports when putting on the top of the stack? I am not very clear about this part. If it is something need user to pay attention only to make it work, it is bad, it should better be handled by scripts.

The Mesh is posed and exported as the top action, here in the screenshot you can see that my top action is "CharacterIdle":

image

When opened in Godot, you can see that the Armature is posed in its Rest Position but the Mesh pose is the "CharacterIdle", when this happens the animations are broken because the mesh is not in sync with the armature.
So yes, it is something the user needs to pay attention. I think at least should be documented somewhere.

image

It wold be nice to have spatial materials for simple Principled BSDF configurations though😄

Another think I found is that animations with "_loop" suffix are not marked as loop in Godot. I think I could open an issue about this little enhance.

Thank you so much for your help 😃

@Jason0214
Copy link
Collaborator

you can see that the Armature is posed in its Rest Position but the Mesh pose is the "CharacterIdle", when this happens the animations are broken because the mesh is not in sync with the armature.

Got it, it is a bug (actually a regression I solved this for blender2.79) that exported mesh is deformed by armature

@Jason0214 Jason0214 reopened this Feb 12, 2019
@Angeloss
Copy link
Author

I just found out another thing the user needs to be aware off in order to export correctly.
In the Blender NLA only the Armature has to be checked/selected, otherwise the export will be broken.

alldisabled

alldisabledbutone

onlyarmature

Rigards!

@Jason0214
Copy link
Collaborator

When opened in Godot, you can see that the Armature is posed in its Rest Position but the Mesh pose is the "CharacterIdle", when this happens the animations are broken because the mesh is not in sync with the armature.

weird, I tried a lot and can not reproduces this issue 🤔, all the exported mesh is in not deformed by armature (i.e. in REST position) . Also I think the exporter has some code making sure exported mesh is not deformed. So I am kind of lost on this issue.


I just found out another thing the user needs to be aware off in order to export correctly.
In the Blender NLA only the Armature has to be checked/selected, otherwise the export will be broken.

Thanks for post this here, it is a bug. I will add some fix to make sure animation can be correctly exported when the object is mute. Also update the doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants