gelic-idealab / impress

Education Research domain module for the Komodo platform
3 stars 2 forks source link

Upgrade Komodo package to v0.5.4 #1

Open parseccentric opened 2 years ago

parseccentric commented 2 years ago

New Feature Description Integrate changes from KomodoCore package's main scene into Impress's modified main scene.

How to Test Action: Refer to Impress manual test plan. (Make one if needed) Expected Result: All tests pass

parseccentric commented 2 years ago

One thing to note is that v0.5.1 may have this bug: https://github.com/gelic-idealab/komodo-unity/issues/84

parseccentric commented 2 years ago

Some developer notes. Feel free to skip. Summary update coming in the next comment.

Cloned impress into gelic-idealab---impress-alt so that I could have both Unity projects open at once. Waited like 20 minutes for it to properly open the second time

    A meta data file (.meta) exists but its asset 'Packages/com.graingeridealab.komodo/KomodoCoreAssets/Images/WorldSkies.meta.orig' can't be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.
    Couldn't delete Packages/com.graingeridealab.komodo/KomodoCoreAssets/Images/WorldSkies.meta.orig.meta because it's in an immutable folder. [RESOLVED]
    A meta data file (.meta) exists but its asset 'Packages/com.graingeridealab.komodo/KomodoCoreAssets/Scenes/Main.unity.orig' can't be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.
    Couldn't delete Packages/com.graingeridealab.komodo/KomodoCoreAssets/Scenes/Main.unity.orig.meta because it's in an immutable folder. [RESOLVED]

I found and deleted the meta files.

    A meta data file (.meta) exists but its asset 'Packages/com.graingeridealab.komodo/KomodoCoreAssets/Images/WorldSkies.meta.orig' can't be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.
    Couldn't delete Packages/com.graingeridealab.komodo/KomodoCoreAssets/Images/WorldSkies.meta.orig.meta because it's in an immutable folder.
    A meta data file (.meta) exists but its asset 'Packages/com.graingeridealab.komodo/KomodoCoreAssets/Scenes/Main.unity.orig' can't be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.
    Couldn't delete Packages/com.graingeridealab.komodo/KomodoCoreAssets/Scenes/Main.unity.orig.meta because it's in an immutable folder.

Couldn’t fix by deleting meta files because I couldn’t find the meta files.

    Importer(NativeFormatImporter) generated inconsistent result for asset(guid:ac933aa07b1097d47a08984d469dccfc) "Packages/com.graingeridealab.komodo/Runtime/XR/Settings/Open XR Package Settings.asset"
    UnityEditor.AssemblyReloadEvents:OnAfterAssemblyReload ()
```
GUID [3be817036fd8b6a438aa920355228dac] for asset 'Packages/com.graingeridealab.komodo/KomodoCoreAssets/Materials/Darkener.mat' conflicts with:
  'Assets/IMPRESS/Materials/Darkener.mat' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [443290c8d3ab9be4fa6b60e052cd3c2b] for asset 'Packages/com.graingeridealab.komodo/KomodoCoreAssets/Materials/Eraser.mat' conflicts with:
  'Assets/IMPRESS/Materials/Eraser.mat' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [a527bfc774139ba4b85e91dd64d585ec] for asset 'Packages/com.graingeridealab.komodo/KomodoCoreAssets/Materials/Floor.mat' conflicts with:
  'Assets/IMPRESS/Materials/Floor.mat' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [04fec96f4b9beb64683f5f9914ce0427] for asset 'Packages/com.graingeridealab.komodo/KomodoCoreAssets/Materials/PhysicalFloor.mat' conflicts with:
  'Assets/IMPRESS/Materials/PhysicalFloor.mat' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [3f83561dfa14d984f92589b4a350a47f] for asset 'Packages/com.graingeridealab.komodo/KomodoCoreAssets/Scenes/Main.unity' conflicts with:
  'Assets/IMPRESS/Scene/Main.unity' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [d33cf533d5183984ea5c8045f7f3620b] for asset 'Packages/com.graingeridealab.komodo/Runtime/Prefabs/CreateMenu.prefab' conflicts with:
  'Assets/IMPRESS/Prefab/CreateMenu.prefab' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [a4efff3bd011ccf4581efc2ffb6c6013] for asset 'Packages/com.graingeridealab.komodo/Runtime/Prefabs/DrawLineRenderPrefab.prefab' conflicts with:
  'Assets/IMPRESS/Prefab/DrawLineRenderPrefab.prefab' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [3773d0422e0122743ad9688a0d03d9dd] for asset 'Packages/com.graingeridealab.komodo/Runtime/Prefabs/MenuUI.prefab' conflicts with:
  'Assets/IMPRESS/Prefab/ImpressMenu.prefab' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [0a1fe9a4692a92b429808dc7c4de1de1] for asset 'Packages/com.graingeridealab.komodo/Runtime/Prefabs/PlayerSet.prefab' conflicts with:
  'Assets/IMPRESS/Prefab/PlayerSet_IMPRESS.prefab' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [df0a0b63698060440aaac91cea3b9aab] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/ColorPicker.cs' conflicts with:
  'Assets/IMPRESS/Scripts/ColorPicker.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [78c5fe90b1fef0a40bb8143472560ebc] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/DrawingManager.cs' conflicts with:
  'Assets/IMPRESS/Scripts/DrawingManager.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [2429b02e5939d234aaca9c960fcd0a47] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/FontSizeAdjuster.cs' conflicts with:
  'Assets/IMPRESS/Scripts/FontSizeAdjuster.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [afc2231327ec50d43ad273c8e7ba4781] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/KomodoFixes.cs' conflicts with:
  'Assets/IMPRESS/Scripts/KomodoFixes.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [73210aabcb7f44349843562f770a1260] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/LayerVisibility.cs' conflicts with:
  'Assets/IMPRESS/Scripts/LayerVisibility.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [9fe9023b6b6128b458ec35207462f971] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/MenuAnchor.cs' conflicts with:
  'Assets/IMPRESS/Scripts/MenuAnchor.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [fbb0ac78183341b4594809d64fbf3e42] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/MenuPlacement.cs' conflicts with:
  'Assets/IMPRESS/Scripts/MenuPlacement.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [598234470ed8015488ad0e722146ac2c] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/MoveWithHover.cs' conflicts with:
  'Assets/IMPRESS/Scripts/MoveWithHover.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [4bd43d8d5b5432d4684a6f5aa2764f53] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/SetMenuAndToolPlacementHack.cs' conflicts with:
  'Assets/IMPRESS/Scripts/SetMenuAndToolPlacementHack.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [cff52261bd6d2f74291667fcf29930eb] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/TabButton.cs' conflicts with:
  'Assets/IMPRESS/Scripts/TabButton.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [b0cc00765f8f05141b81b30c6b008fe6] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/TabManager.cs' conflicts with:
  'Assets/IMPRESS/Scripts/TabManager.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [8b5a274f9f73b75449831e2e6cbedd17] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/ToolAnchor.cs' conflicts with:
  'Assets/IMPRESS/Scripts/ToolAnchor.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
GUID [be1373ee2907c0f41b176f773a88e6aa] for asset 'Packages/com.graingeridealab.komodo/Runtime/Scripts/RuntimeSession/ToolPlacement.cs' conflicts with:
  'Assets/IMPRESS/Scripts/ToolPlacement.cs' (current owner)
We can't assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
Identifier uniqueness violation: 'Name:6988635759825893139/Create Menu (Missing Prefab)/Missing Prefab (Dummy), Type:GameObject'. Multiple Objects with the same name/type are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.
Identifier uniqueness violation: 'Name:6988635759825893139/Create Menu (Missing Prefab)/Missing Prefab (Dummy)/Transform, Type:Transform'. Multiple Objects with the same name/type are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.
Identifier uniqueness violation: 'Name:6988635759825893139/Create Menu (Missing Prefab)/Missing Prefab (Dummy), Type:GameObject'. Multiple Objects with the same name/type are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.
Identifier uniqueness violation: 'Name:6988635759825893139/Create Menu (Missing Prefab)/Missing Prefab (Dummy)/Transform, Type:Transform'. Multiple Objects with the same name/type are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.
Identifier uniqueness violation: 'Name:6988635759825893139/Create Menu (Missing Prefab)/Missing Prefab (Dummy), Type:GameObject'. Multiple Objects with the same name/type are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.
Identifier uniqueness violation: 'Name:6988635759825893139/Create Menu (Missing Prefab)/Missing Prefab (Dummy)/Transform, Type:Transform'. Multiple Objects with the same name/type are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.
Identifier uniqueness violation: 'Name:6988635759825893139/Create Menu (Missing Prefab)/Missing Prefab (Dummy), Type:GameObject'. Multiple Objects with the same name/type are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.
Identifier uniqueness violation: 'Name:6988635759825893139/Create Menu (Missing Prefab)/Missing Prefab (Dummy)/Transform, Type:Transform'. Multiple Objects with the same name/type are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.

Deleted every meta file referred to (from inside the IMPRESS folder), plus a few others because of the Create Menu’s missing prefabs. Kept Unity open while doing so and occasionally focused Unity so it would re-create the meta files.


Uh oh: 

``` Library\PackageCache\com.graingeridealab.komodo@0.5.4\Runtime\Scripts\RuntimeSession\KomodoMenu.cs(114,16): error CS0246: The type or namespace name 'MenuAnchor' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.graingeridealab.komodo@0.5.4\Runtime\Scripts\RuntimeSession\KomodoMenu.cs(12,16): error CS0246: The type or namespace name 'TabButton' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.graingeridealab.komodo@0.5.4\Runtime\Scripts\RuntimeSession\KomodoMenu.cs(16,16): error CS0246: The type or namespace name 'TabButton' could not be found (are you missing a using directive or an assembly reference?)

Thankfully these went away when I fixed the meta files and I recompiled.

Restarted Unity and I got this:

    The package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered:
      Packages/com.graingeridealab.komodo/Runtime/XR/Settings/Open XR Package Settings.asset

    UnityEditor.AssemblyReloadEvents:OnAfterAssemblyReload ()
    ArgumentNullException: Value cannot be null.
    Parameter name: sameAssetFile
    UnityEditor.AssetDatabase.AddObjectToAsset (UnityEngine.Object objectToAdd, UnityEngine.Object assetObject) (at <c77ced6644e541b7ad3d7315a5e92a0a>:0)
    UnityEditor.XR.OpenXR.Features.FeatureHelpersInternal.GetAllFeatureInfo (UnityEditor.BuildTargetGroup group) (at Library/PackageCache/com.unity.xr.openxr@1.2.0/Editor/FeatureSupport/FeatureHelpers.cs:187)
UnityEditor.XR.OpenXR.Features.OpenXRFeatureSetManager.SetFeaturesFromEnabledFeatureSets (UnityEditor.BuildTargetGroup buildTargetGroup) (at Library/PackageCache/com.unity.xr.openxr@1.2.0/Editor/FeatureSupport/OpenXRFeatureSetManager.cs:368)
    UnityEditor.XR.OpenXR.Features.OpenXRFeatureSetManager.InitializeFeatureSets (System.Boolean addTestFeatureSet) (at Library/PackageCache/com.unity.xr.openxr@1.2.0/Editor/FeatureSupport/OpenXRFeatureSetManager.cs:298)
    UnityEditor.XR.OpenXR.Features.OpenXRFeatureSetManager.InitializeFeatureSets () (at Library/PackageCache/com.unity.xr.openxr@1.2.0/Editor/FeatureSupport/OpenXRFeatureSetManager.cs:214)
    UnityEditor.XR.OpenXR.Features.OpenXRFeatureSetManager.OnAssemblyReload () (at Library/PackageCache/com.unity.xr.openxr@1.2.0/Editor/FeatureSupport/OpenXRFeatureSetManager.cs:30)
    UnityEditor.AssemblyReloadEvents.OnAfterAssemblyReload () (at <c77ced6644e541b7ad3d7315a5e92a0a>:0)

Upgrading OpenXR plugin to v1.2.8. Those errors went away.

    The referenced script (Unknown) on this Behaviour is missing!
    [highlighted Reconnect button]

Deleted that gameObject.

    NullReferenceException: Object reference not set to an instance of an object
    Komodo.IMPRESS.CreatePrimitiveManager.InitializeTriggerAndGhost () (at Assets/IMPRESS/Scripts/CreatePrimitiveManager.cs:166)
    Komodo.IMPRESS.CreatePrimitiveManager.Awake () (at Assets/IMPRESS/Scripts/CreatePrimitiveManager.cs:133)

    _primitiveTrigger = player.triggerCreatePrimitiveLeft;

ImpressPlayer needs to be assigned.

    InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
    UnityEngine.Input.get_mousePosition () (at <6af207ecd21044628913f7cc589986ae>:0)
    UnityEngine.UI.MultipleDisplayUtilities.GetMousePositionRelativeToMainDisplayResolution () (at C:/Program Files/Unity/Hub/Editor/2020.3.10f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/MultipleDisplayUtilities.cs:40)
    UnityEngine.EventSystems.BaseInput.get_mousePosition () (at C:/Program Files/Unity/Hub/Editor/2020.3.10f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/BaseInput.cs:75)
    UnityEngine.EventSystems.StandaloneInputModule.UpdateModule () (at C:/Program Files/Unity/Hub/Editor/2020.3.10f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:175)
    UnityEngine.EventSystems.EventSystem.TickModules () (at C:/Program Files/Unity/Hub/Editor/2020.3.10f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:336)
    UnityEngine.EventSystems.EventSystem.Update () (at C:/Program Files/Unity/Hub/Editor/2020.3.10f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:351)

Player Settings > ?? > Active Input Handling = Both Restarted Unity editor Pressed Play It crashed

    'Komodo.IMPRESS.ImpressEventManager' is missing the class attribute 'ExtensionOfNativeClass'!
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

    UnassignedReferenceException: groupTab
    Komodo.IMPRESS.ImpressMenu.OnValidate () (at Assets/IMPRESS/Scripts/ImpressMenu.cs:54)
    UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

    GameObject (named 'ImpressMenu') references runtime script in scene file. Fixing!
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

I will need to comment out some parts of scripts as "delayed features" -- otherwise, I'd have to fix the prefab, and I don't think that is worth it for Primitive and Grouping.

parseccentric commented 2 years ago

Summary of Changes So Far

Manually tested world pulling in editor only. It seems to roughly work.

Did the same with the menu and drawing. It works about the same as it did before. Which includes the fact that the drawing stroke is either black or white for some reason.

Temporarily disabled…

Turned ImpressEventManager into purely a static class — it’s no longer a MonoBehaviour, and it has no singleton instance. In short, we don't have to add it as a GameObject in the scene, and it should work the exact same way.

Changed build settings so that Main showed up first.

For some reason, the PlayerSet prefab referred to the package version. So I copied it as a new Prefab, ImpressPlayerSet2. I did the same to create ImpressMenu2.

What's left to do?

parseccentric commented 2 years ago

Dev log

Problem

menu doesn't finish initializing, and thus FreeFlightController (spectator mode camera controls) don't initialize.

Solution

  1. Made sure UIManager has ImpressMenu2 assigned.
  2. Added an empty to the main scene called "v0.5.4Fixes" and added KomodoFixes.cs to that empty. See more details in the log below.

Log

I found out that in UIManager, it was pointing to the old prefab instead of ImpressMenu2. I reassigned ImpressMenu2. But it was the same result.

FreeFlightController and ClientSpawnManager wait for the menu to be ready. Doing a breakpoint on UIManager > IsReady reveals that both the SceneManagerExtensions and ModelImportInitializer are alive when they ask for it, so the problem is either in isModelButtonListReady or isSceneButtonListReady.

isSceneButtonListReady should be deprecated in KomodoCore, because we are not using any scene switching features at the moment.

Thankfully, the KomodoFixes.cs file that is somehow included in the v0.5.4 package has the exact workaround needed. The script, if added to a MonoBehaviour, simply sets isSceneButtonListReady to true in its Start function.

parseccentric commented 2 years ago

(Dev Notes)

Some odd errors that may be important later. I reran play mode and they went away.

ERROR
'Komodo.IMPRESS.ImpressEventManager' is missing the class attribute 'ExtensionOfNativeClass'!
WARNING
GameObject (named 'ImpressMenu') references runtime script in scene file. Fixing!
parseccentric commented 2 years ago

Dev log

Regression

Regression

Regression

Regression

Regression

parseccentric commented 2 years ago

Dev log

Problem Eraser only appears on the left hand when activated.

Solution In IMPRESSEraseManager, use KomodoEventManager instead of ImpressEventManager. As such, make sure it is "eraseTool.enable" and not "eraser.enable"

Status This is in the dev branch.

parseccentric commented 2 years ago

Dev log

Problem Color picker is broken, even after multiple open and close actions -- drawing strokes are black or, randomly, white.

Solution The MenuPlacement component was missing from the ImpressMenu2 prefab, so I replaced it. Along the way, I also fixed and refactored the structure of the prefabs so that the color picker is initialized properly every time. (Before, it would require two openings to start selecting colors properly.)

Final setup:

Status This is in the dev branch.

parseccentric commented 2 years ago

Dev log

Problem Settings tab has a dark blue outline, and People and Interact have a non-theme highlight color.

Solution Theme is now a part of ImpressMenu2. Colors have been manually copied from here into the various prefabs.

Status This is in the dev branch.

parseccentric commented 2 years ago

Regression