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

Mesh animation distortion when importing Collada (from blender export) #1316

Closed
Razzlegames opened this issue Jan 30, 2015 · 9 comments
Closed

Comments

@Razzlegames
Copy link
Contributor

Issue

After importing an animated mesh, and accessing the animation player, the mesh is fine for the first frame on any animation strip. When moving to another frame (or playing) then moving back to the first frame, the mesh is suddenly distorted and cannot be restored until the scene is reloaded.

Steps to reproduce:

  • In Blender, pose the armature in a transformed state (move it around etc).
  • Export it using the "Better collada exporter"
  • Import in Godot using Import->"3D Scene"
  • Open the scene's Animation player in Godot.
  • Push play or just move to another frame.
    • Notice the distortion
  • Move back to frame 0 and it still remains etc.
  • You can now repopen the scene and the distortion will be gone.

This is after first importing the mesh.

showing_ok_mesh_first_frame

After moving away from frame 0 in the animation player (by playing etc). Moving back to frame zero retains distortion, as seen here:

messed_up_first_frame

If you reopen the scene it will look normal again, until you animate. The same behavior is seen if you animate in code, by referencing any animation name (even if they just contain the rest pose).

Workaround

The issue appears to be when exporting if you leave the armature in a transformed state (not in the rest identity transform, pose). As seen here:

default_pose_blender

The solution is to clear all rotations, scale and translations in pose mode before exporting. Additionally I made a "default" animation strip as the first animation and have 1 frame with just the rest pose.

Shown here:

rest_pose

The project is here:
https://drive.google.com/file/d/0By6FH_3O43IRWnBtWWhUYXhuQVU/view?usp=sharing

  • The blender file located under RawAssets->3d_santa.blend
  • The Collada file is under RawAssets->3d_santa.dae
@Razzlegames Razzlegames changed the title Mesh distortion when importing Collada (from blender export) Mesh animation distortion when importing Collada (from blender export) Jan 30, 2015
@reduz
Copy link
Member

reduz commented Feb 15, 2015

Thanks! I will give it a test asap,sorry I couldn't check before as I was on vacation.

@reduz reduz added the bug label Feb 15, 2015
@Razzlegames
Copy link
Contributor Author

No worries. It's easy to work around. Thanks!

@akien-mga
Copy link
Member

I just checked and the above linked blend is still available, if someone could give it a try and see if it's reproducible in the current master branch.

@Razzlegames
Copy link
Contributor Author

I was able to reproduce it just a few months ago. I should be able to get
a test together and just upload the whole project.

On Tue, Jan 5, 2016 at 2:31 AM, Rémi Verschelde [email protected]
wrote:

I just checked and the above linked blend is still available, if someone
could give it a try and see if it's reproducible in the current master
branch.


Reply to this email directly or view it on GitHub
#1316 (comment).

@Razzlegames
Copy link
Contributor Author

Here's a simple example project that shows the issue.

https://github.com/Razzlegames/MeshTestGodot

You only need to export the model to Animated collada using the "Better collada" Godot exporter plugin. The model needs to be not in a rest post when exporting and the issue will show itself. If you reset back to rest post and export it will not happen.

BTW, after Godot notifies you that the model changes and you select to reimport the model, you will have to close the 3D scene and repopen it, to see the issue.

This was tested on a "pretty up to date" master with last pulled commit:

commit ec3d17b4e2b3d87ec6b46c57280ec853b264b20b
Author: Juan Linietsky <[email protected]>
Date:   Thu Dec 31 16:24:27 2015 -0300

    force thread model to single-safe when running editor, fixes #2387

Here are my exporter settings:

collada_export_settings

@Razzlegames
Copy link
Contributor Author

These are the hilarious results LOL. Santa is trying out for a spot in Resident Evil:
santa_horror_bug

@akien-mga
Copy link
Member

First of all thank you for your report and sorry for the delay.

We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.

We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about it here?

For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.

Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.

Thanks in advance.

Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.

@akien-mga
Copy link
Member

As there was no answer to the above request, we're closing this issue as inactive.
If you can still reproduce it, please open a new issue against a currently supported release of Godot.

@jitspoe
Copy link
Contributor

jitspoe commented Jul 30, 2019

This issue is actually an exporter issue with the better collada exporter. It can be fixed by adding the following 2 lines:

                arm.update_tag()
                bpy.context.scene.frame_set(bpy.context.scene.frame_current)

after this:

        if(armature_modifier):
            #doing this per object is inefficient, should be improved, maybe?
            armature_poses = [arm.pose_position for arm in bpy.data.armatures]
            for arm in bpy.data.armatures:
                print(arm.pose_position)
                arm.pose_position = "REST"

in exporte_dae.py

Better collada issue here: godotengine/collada-exporter#99

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

4 participants