Skip to content

Fix MonoBehaviour preview, AnimatorOverrideController clips, and lazy-type GUI filter - #12

Merged
Diphome merged 3 commits into
masterfrom
claude/unity-version-support-hbnxn6
Sep 9, 2026
Merged

Fix MonoBehaviour preview, AnimatorOverrideController clips, and lazy-type GUI filter#12
Diphome merged 3 commits into
masterfrom
claude/unity-version-support-hbnxn6

Conversation

@Diphome

@Diphome Diphome commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Three independent fixes, one commit each.

1. GUI type filter missing lazy-loaded asset types

UnityRiftGUI/Studio.cs (BuildAssetData)

Added case LazyObject to the exportability switch. Lazy placeholders (Mesh, AnimationClip, Font, TextAsset, MovieTexture, Shader) were falling through to case NamedObject and never marked exportable, so those types were absent from the GUI FilterType menu. Exportability is now derived from the real ClassIDType. Avatar and AnimatorController placeholders (also lazy) stay non-exportable. CLI unaffected — it uses asset.type directly.

2. AnimatorOverrideController clips exported/previewed as empty (0.00s)

UnityRiftUtility/ModelConverter.cs (CollectAnimationClip)

When the Animator's controller is an AnimatorOverrideController, the code iterated the base controller's m_AnimationClips (the empty template_* placeholder clips) and ignored the override map. It now applies m_Clips (original → override) so the real, playable clips are collected. Fixes clips showing 0.00s / unplayable in the GUI animator preview and empty takes in FBX export. The shared converter drives GUI preview and CLI/GUI FBX export, so all paths are fixed.

3. MonoBehaviour preview: blank assembly dialog + "Failed to read type" spam

UnityRiftGUI/Studio.cs (SelectAssemblyFolder)

Auto-load the Mono Managed folder (via AssemblyLoader.FindManagedFolder over the loaded files' paths) before showing the manual "Select Assembly Folder" picker. Standalone builds strip MonoBehaviour script fields, so without the assembly the preview read only the 32-byte base and logged Failed to read type, read 32 bytes but expected N bytes for every field. Mono games now resolve MonoBehaviour fields on click with no dialog and no errors. IL2CPP is unchanged: no Managed folder is found, so it falls through to the manual picker.

Testing

Not built in this environment — no .NET SDK is installed, and UnityRiftGUI targets Windows only (WinForms). Changes were verified manually against the surrounding types, method signatures (FindManagedFolder), field names, and using directives. A Windows build is recommended before merging.

🤖 Generated with Claude Code

https://claude.ai/code/session_019E5uLMZZXCMvZcw7sXrgts


Generated by Claude Code

Added `case LazyObject` to the exportability switch in BuildAssetData.
Lazy placeholders (Mesh, AnimationClip, Font, TextAsset, MovieTexture,
Shader) were falling through to `case NamedObject` and never marked
exportable, so those types were absent from the GUI FilterType menu.
Exportability is now derived from the real ClassIDType. Avatar and
AnimatorController placeholders (also lazy) stay non-exportable.

CLI (UnityRiftCLI/Studio.cs) unaffected -- it uses asset.type directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019E5uLMZZXCMvZcw7sXrgts
When the Animator's controller is an AnimatorOverrideController,
CollectAnimationClip iterated the base controller's m_AnimationClips,
which are the empty template_* placeholder clips, and ignored the
override map. Now its m_Clips (original -> override) is applied so the
real, playable clips are collected. Fixes clips showing 0.00s /
unplayable in the GUI animator preview and empty takes in FBX export.

The shared converter drives GUI preview and CLI/GUI FBX export, so all
paths are fixed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019E5uLMZZXCMvZcw7sXrgts
…pe" spam

Auto-load the Mono Managed folder (via AssemblyLoader.FindManagedFolder
over the loaded files' paths) before showing the manual "Select Assembly
Folder" picker in SelectAssemblyFolder. Standalone builds strip
MonoBehaviour script fields, so without the assembly the preview read
only the 32-byte base and logged "Failed to read type, read 32 bytes but
expected N bytes" for every field.

Now Mono games resolve MonoBehaviour fields on click with no dialog and
no errors. IL2CPP is unchanged: no Managed folder is found, so it falls
through to the manual picker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019E5uLMZZXCMvZcw7sXrgts
@Diphome
Diphome merged commit 7ff51f3 into master Sep 9, 2026
1 check passed
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.

2 participants