Fix MonoBehaviour preview, AnimatorOverrideController clips, and lazy-type GUI filter - #12
Merged
Merged
Conversation
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
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.
Three independent fixes, one commit each.
1. GUI type filter missing lazy-loaded asset types
UnityRiftGUI/Studio.cs(BuildAssetData)Added
case LazyObjectto the exportabilityswitch. Lazy placeholders (Mesh, AnimationClip, Font, TextAsset, MovieTexture, Shader) were falling through tocase NamedObjectand never marked exportable, so those types were absent from the GUI FilterType menu. Exportability is now derived from the realClassIDType. Avatar and AnimatorController placeholders (also lazy) stay non-exportable. CLI unaffected — it usesasset.typedirectly.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'sm_AnimationClips(the emptytemplate_*placeholder clips) and ignored the override map. It now appliesm_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
Managedfolder (viaAssemblyLoader.FindManagedFolderover 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 loggedFailed to read type, read 32 bytes but expected N bytesfor 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, andusingdirectives. A Windows build is recommended before merging.🤖 Generated with Claude Code
https://claude.ai/code/session_019E5uLMZZXCMvZcw7sXrgts
Generated by Claude Code