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

Re-importing Collada deforms the mesh #32766

Closed
MilosLukic opened this issue Oct 12, 2019 · 8 comments
Closed

Re-importing Collada deforms the mesh #32766

MilosLukic opened this issue Oct 12, 2019 · 8 comments

Comments

@MilosLukic
Copy link

MilosLukic commented Oct 12, 2019

Godot version:
3.2 alpha 1

OS/device including version:
Windows 10

Issue description:
Reimporting .dae breaks existing scene (deforms mesh), even though the file stays the same. Everything is ok in 3.1, breaks in 3.2

Steps to reproduce:
I exported a mesh from blender using better collada (Blender 2.8), I import it in godot, open it, everything works perfect. I choose a new inherited scene, save it as .tscn, click "reimport" on the .dae, close the .tscn scene, it asks me whether I want to save - probably due to the reimport, save or don't - the result is the same. Close godot, open it (I think you can also just close and open the scene again, without restarting godot), open the .tscn scene and you get this beauty (it's supposed to be human):
unknown

Tried it in 3.1 and it works, so the problem is just in 3.2 alpha.

Minimal reproduction project:
Try it on the unit_2.dae in this project.
sample_project_reimport_bug.zip

@akien-mga
Copy link
Member

I can reproduce it on Linux in the current master branch (3ca1296). Note that one should follow the steps to reproduce closely, simply reimporting the .dae is not enough to trigger the issue, one should also have an inherited scene open and save/close it.

@slapin
Copy link
Contributor

slapin commented Oct 14, 2019

This is caching issue. Importer gets instanced/duplicated object from cache instead of what it normally should get. Which is already maimed/modified by importing so mess happens (actually lots of kinds of mess happen) and this object does not relate to file on disk you import, so what kind of mess you get varies. Some people do not care about that at all.
ESCN and dae import are in the same boat (I think all importers are, but it is just not noticed).
You don't need to have inherited scene, any referene in project or just opening/closing is enough, just letting Godot know of object is enough whatever way that is. For clean session you need any resource reference in any of your tscn or tres files. This way the reimport will break immediately without any manipulation.

The only workaround is removal of .import directory for reimport to succeed (Godot exiting is highly recommended but sometimes not required if you're very agile with alt-tabbing or doing that from terminal then alt-tab to Godot, but did not work for me sometimes). This might work as solution as long as somebody gets interested enough to fix this bug if at all.

@rhossack
Copy link

rhossack commented Oct 25, 2019

Gonna add to this, as this bug has been tripping me up for the last few days.

If you import a glb file, Godot will automatically unpack its materials into separate files. If you then import another glb file that references materials with those same names, even if you changed those materials in this second file you're importing, it will not re-unpack them over the originals, as you likely intend; it will simply load the existing ones. So if you want to re-import fully, you have to delete not only the original file you imported, but any built-in files that Godot unpacked from it. This is in 3.2 alpha 2 btw.

@fire
Copy link
Member

fire commented Nov 7, 2019

@rhossack That is a separate issue, can you make one for materials not being rewritten. I believe it's part of some workflows that materials don't change import, while the geometry changes.

@akien-mga
Copy link
Member

I bisected this as a regression of #32275, CC @reduz @marstaik.

@akien-mga
Copy link
Member

akien-mga commented Nov 27, 2019

I bisected this as a regression of #32275, CC @reduz @marstaik.

The first bad commit in the PR is d81ddaf.

I assume that this removal is what breaks Collada: d81ddaf#diff-f4c0a679eb47b23489fb761cc8c98821L179

@akien-mga akien-mga changed the title Re-importing deforms the mesh Re-importing Collada deforms the mesh Nov 27, 2019
@RevoluPowered
Copy link
Contributor

RevoluPowered commented Nov 28, 2019

I am having this issue with FBX too but in my case initial mesh is wrong on reimport, but clearing .import/ fixes the issue.

@reduz
Copy link
Member

reduz commented Dec 16, 2019

Although this issue should be fixed, you may need to manually erase the broken Skin resource in the MeshInstance affected in scenes that inherit or instantiate the dae.

marstaik pushed a commit to marstaik/godot that referenced this issue Dec 24, 2019
…e#32766

Even though this fixes the issue, the broken Skin resource in the inherited scene mesh will remain, it needs to be erased manually.
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

7 participants