Skip to content

Unity import: PSXSkinnedObjectExporter with its clips - #226

Merged
rixnobis merged 2 commits into
mainfrom
unity-skinned
Oct 20, 2026
Merged

rixnobis merged 2 commits into
mainfrom
unity-skinned

Conversation

@rixnobis

Copy link
Copy Markdown
Contributor

Part of #223. The Unity importer now brings over PSXSkinnedObjectExporter: the mesh from the SkinnedMeshRenderer on or under it, the skeleton, and its AnimationClips as a skin (TargetFPS, up to 16 clips). A clip's fileID is xxh64 of Type:AnimationClip-><take><k>, or the .meta's internalID when it lists clip settings; both match Unity 6000.3 output in tests/fixtures/unity-models. Clip names and loop flags follow Unity, a PSXObjectExporter under a skinned one is skipped as in Unity, and an exporter with no usable clips plays the model's own clips with a report item.

Clip frame ranges are not applied yet: a clip cut from part of a take plays the whole take. The import report lists those clips.

ImportedModel::clips lists the .anim files a model import wrote, under
file-safe, deduplicated names, and leaves out takes that move no joint,
so a clip's place there does not say which take it came from.
ImportedModel::clipTakes, beside clips, holds each one's original take
name, which the Unity import needs to find the clip a scene names.
The object gets the mesh of the SkinnedMeshRenderer on it or on its
first active descendant, and a skin playing its AnimationClips at
TargetFPS. A clip inside a model is found by its fileID: the .meta's
clipAnimations internalID, else xxh64 of "Type:AnimationClip-><take><n>"
(measured with Unity 6000), under Unity's clip name and loop flag.
PSXObjectExporters on or under it are skipped, as Unity skips them.
No usable clip: the model's own clips play, and the report says so.
@rixnobis
rixnobis merged commit df56326 into main Oct 20, 2026
5 checks passed
@rixnobis
rixnobis deleted the unity-skinned branch October 20, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant