Closed mysticfall closed 5 years ago
Possibly relevant: https://github.com/godotengine/godot/issues/12618
In my case, I have the same warning message mentioned in #12618, but not the error. I tested again with triangulation applied to the mesh by different methods, and applying triangulation to all faces didn't make any change while using a modifier produced the 'out of size' error.
I could eliminate the warning by checking the triangulation option from the exporter panel, but it just broke the mesh in a different way (as probably mentioned by another issue: godotengine/collada-exporter#69).
I took the Blender file from the link, exported it with the current version of the "Godot's Better Collada" add-on for Blender. I imported it in Godot 3.1 alpha 2. I got the following state:
This is a difficult issue because of the size of the model! Since the 'current state' of the issue is different than the reporter's, I'll build the old revision marked above - try to reproduce the issue there. Also, I'll investigate why the head mesh is partially visible on the current 'master' branch of Godot.
I built the revision 430d847 of Godot and reproduced the 'current state' of the issue. I checked the 'Godot's Better Collada' add-on code: there's been no relevant changes since May 2018. I checked the reporter's git-hub and the linked Blender file did change in September 2018, so that safely explains the difference between the 'reported state' and the 'current state'.
The head mesh is not visible because its base mesh is discarded during the import process. It is discarded because its morph targets have differing vertex counts after their import. The COLLADA document is coherent, though. The different vertex counts in the morph targets come from the Godot COLLADA importer. The Godot COLLADA importer calls 'SurfaceTool::generate_tangents' for all the morph target meshes. This function does a lot more than generate tangents: A) It de-indexes the vertices before the tangent generation. B) Calls the 'mikktspace' third-party library to generate the tangents. C) It re-indexes the vertices after the tangent generation (which can greatly reduce the vertex count).
Unfortunately, some of the head's vertices degenerate in only one/some morph targets. The 'SurfaceTool::generate_tangents' function therefore optimizes the morph target meshes differently. I suspect the the 'mikktspace' library, where the function 'MergeVertsFast' uses the position/normal/tex-coord values to match vertices. Depending on the degeneration of some triangles, their tangents will differ between morph targets and the optimization opportunities differ.
In the Head mesh, the 'Expressions_eyeClosedPressureL_max' morph target has 3169 vertices for its third surface, while the 'Expressions_eyeClosedPressureL_min' morph target has 3168 vertices for its third surface.
@glaforte I don't have much to add to this issue, since I now use Blender exporter and the problem doesn't exist any more.
But I'm pretty sure there would be people who need to use blend shapes with COLLADA and I know how difficult to track down this type of issues. I just wanted to say thanks to you hard work so, thanks and hope you to get to the bottom of the problem soon! :+1:
@mysticfall Thanks for encouragement! I'll review my assumptions and assertions, this morning. I think there might be something that escapes me still :)
Filed https://github.com/godotengine/collada-exporter/issues/93 with an export bug in the Godot's Better Collada'. Working around this bug, now.
When checking the export option for the "tangent arrays" export option in Godot's Better Collada' export, in Blender, the issue does not occur.
Wrote a fix that removes the 'de-index' and 're-index' steps in the 'SurfaceTool::generate_tangents' function. The callbacks for the 'mikktspace' library are capable of working with the indexed data..
Godot version:
master
/ 430d84769OS/device including version: Manjaro Linux 17.1
Issue description: If I import a Collada(*.dae) file which was created with Godot's Better Collada addon, it will create an instant horror game ready asset when it contains shape keys:
When viewed inside the editor:
Assuming from its physiology, it seems that the creature is of a different species that I found in #16994.
Steps to reproduce: The source material which reproduces the issue is available from the below link, but because of godotengine/collada-exporter#41, you'll need to delete most of the shape keys to avoid a freeze when you export it:
I checked 'Shape Keys` when I export it from Blender, and imported it to Godot with saving meshes separately / no animation settings.