Repository navigation
Unity import: find exporters added to placed models (#223) - #225
Merged
Merged
Conversation
Unity 2019.3+ writes internalIDToNameTable: [] in a model's .meta and names the model's objects by XXH64 of "Type:<type>-><path>0", so an exporter added to a placed .fbx hung off an object we could not find and was dropped (#223). Hash the root and every node's GameObject, Transform, MeshFilter, MeshRenderer and SkinnedMeshRenderer; the .meta's table still wins. A lone top-level node is the prefab root, as in Unity. Fixture tests/fixtures/unity-models saved by Unity 6000.3.
An object holding a PSXSkinnedObjectExporter was reported both as "not imported yet" and as having a mesh Unity did not export, which Unity does export (as a skinned mesh). Keep the first item only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unity 2019.3+ writes
internalIDToNameTable: []in a model's.metaand gives the model's objects ids from XXH64 ofType:<type>-><path>0. An exporter added to a placed.fbx(#223'splane_2x2) hangs off one of those ids, so the importer found no object for it and skipped it.instantiateModelnow hashes the root and each node for GameObject, Transform, MeshFilter, MeshRenderer and SkinnedMeshRenderer; a filled.metatable is used first (older projects), and a single top-level node merges into the root as Unity does.All 48 ids in the new fixture
tests/fixtures/unity-models(FBX files, metas and scene saved by Unity 6000.3.12f1) match.testUnityModelIdschecks them and the import; with the fix reverted it fails 8 checks with #223's message.Partly fixes #223:
PSXSkinnedObjectExporter(Sibilla_model) now reports "not imported yet" in place of the mesh message, because the importer has no skinned import yet. That comes next.