Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions UnityRiftGUI/Studio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,24 @@ public static (string, List<TreeNode>) BuildAssetData()
containers.Add((m_Container.Value, m_Container.Key));
}
break;
case LazyObject lazyAsset:
// Heavy assets are loaded as placeholders; derive exportability from
// the real ClassIDType so lazy Mesh/AnimationClip/Shader/Font/TextAsset/
// MovieTexture are not dropped from the type filter. Avatar and
// AnimatorController placeholders stay non-exportable.
assetItem.Text = lazyAsset.m_Name;
switch (lazyAsset.type)
{
case ClassIDType.Mesh:
case ClassIDType.AnimationClip:
case ClassIDType.Shader:
case ClassIDType.Font:
case ClassIDType.TextAsset:
case ClassIDType.MovieTexture:
exportable = true;
break;
}
break;
case NamedObject m_NamedObject:
assetItem.Text = m_NamedObject.m_Name;
break;
Expand Down Expand Up @@ -984,6 +1002,25 @@ private static void SelectAssemblyFolder()
{
if (!assemblyLoader.Loaded)
{
// Standalone builds strip MonoBehaviour script fields, so without the game's
// assemblies the preview reads only the 32-byte base and logs "Failed to read
// type, read 32 bytes but expected N bytes" for every field. Auto-load the Mono
// "Managed" folder found next to the loaded files before falling back to the
// manual picker. IL2CPP games have no Managed folder, so they still fall through
// to the manual "Select Assembly Folder" dialog.
var paths = assetsManager.AssetsFileList
.Select(f => f.originalPath ?? f.fullName)
.Where(p => p != null)
.Distinct()
.ToList();
var managed = AssemblyLoader.FindManagedFolder(paths);
if (managed != null)
{
assemblyLoader.Load(managed);
AssembliesLoaded?.Invoke();
return;
}

var openFolderDialog = new OpenFolderDialog();
openFolderDialog.Title = "Select Assembly Folder";
if (openFolderDialog.ShowDialog() == DialogResult.OK)
Expand Down
16 changes: 15 additions & 1 deletion UnityRiftUtility/ModelConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,22 @@ private void CollectAnimationClip(Animator m_Animator)
{
AnimatorController m_AnimatorController;
var animationList = new List<AnimationClip>();
var overrideMap = new Dictionary<AnimationClip, AnimationClip>();
if (m_Controller is AnimatorOverrideController overrideController)
{
if (!overrideController.m_Controller.TryGet(out m_AnimatorController))
return;
// The base controller only holds empty template_* placeholder clips; the
// real animation data lives in the override map. Map each original clip to
// its override so we collect the playable clips instead of 0.00s templates.
foreach (var clipOverride in overrideController.m_Clips)
{
if (clipOverride.m_OriginalClip.TryGet(out var originalClip)
&& clipOverride.m_OverrideClip.TryGet(out var overrideClip))
{
overrideMap[originalClip] = overrideClip;
}
}
}
else
{
Expand All @@ -319,7 +331,9 @@ private void CollectAnimationClip(Animator m_Animator)
{
if (pptr.TryGet(out var m_AnimationClip))
{
animationList.Add(m_AnimationClip);
animationList.Add(overrideMap.TryGetValue(m_AnimationClip, out var overrideClip)
? overrideClip
: m_AnimationClip);
}
}
animationClipUniqArray = animationList.Distinct(animationClipEqComparer).ToArray();
Expand Down
Loading