Skip to content

Commit

Permalink
Remove almost all uses of Experimental Mode, and combine Monoscopic i…
Browse files Browse the repository at this point in the history
…nto the main releases (icosa-foundation#674)

* No need for experimental watermark any more

* Brush replacement seems like an odd thing to tie to experimental mode. Make it an editor-only change.

* Promote the alternate gif modes to regular features

* remove dead "jogging mode" code

* Dead code for USD intro scene that doesn't exist any more

* Make SkipIntro into a user setting

* No need to gatekeep USD import. Either it works or it doesn't

* Pretty sure this makes sense. There's no way to create non-batched strokes unless the main config switch is off

* Probably not worth keeping - might relate to skipping intro? Easy to fix if so.

* Move previous experimental mode shortcuts into a user config controlled mode.

Also remove some dead code from "ExportAll" which we removed in 2.4

* Moving the button to Labs so also move the related code

* Remove an experimental guard that doesn't make a difference as there's no way to trigger the command

* Allow all color picker modes that were previously experimental

* Fixes a possible NRE

* Probably safe to enable this now

* I've never noticed the presence or absence of this. Let's enable it and get feedback

* Always show experimental buttons

* Dead code

* Keep this code for reference but never execute it

* More dead code

* Move experimental buttons to labs. Hide twitch, youtube and poly buttons

* Update text for the experimental mode button as it now only effects brushes

* Attempt at allowing monoscopic mode in any build

Also allow forcing 2d view-only mode even if headset is detected
[CI BUILD]

* Remove build window code for monoscopic builds

[CI BUILD]

* Don't init SDK on start. Move init logic to VrSdk

[CI BUILD]

* Keyboard overrides for vr and mono modes during launch

[CI BUILD]

* Code cleanup around brush catalog logic

* Missed out the english label change

* Always skip intro in monoscopic mode

* Force monoscopic mode on MacOS

* Disable building Windows Monoscopic (since it's included in Windows OpenXR)

* Adaptive UI layout for view mode controls

* Mac should default to view-only mode as monoscopic takes priority if turned on

* Early exit if we're not in an XR mode

* Skip intro whenever we haven't initialized a headset

* View Mode UI Scale

* Catch a NRE on MacOS

* Never show intro in non-XR modes

* Hopefully fixes an NRE on Rift builds with trying to get into view mode

* Localize the view mode dialog (untested)

* Attempted fix for Linux NRE

* Explain the logic of IsHmdInitialized wrt monoscopic mode

* Also show close button in monoscopic mode

* Try to fix localization for view mode

* Rename Monoscopic builds

Also fix something missed in 627bd94

* Refactor all the code that launches a browser to go through a common method

* Help button for non-VR modes (currently untested)

* Translation tweaks

* Help UI tweaks

* We can use the same help pop up for desktop and mobile. No need to warn people about quitting open brush

* Fixes a harmless error

* This wasn't fixed during the localisation

* Fix help popup on desktop

* Clean up unused panel map options

* Center help popup on button

* Still trying to fix the help popup which is broken only in builds.

* no change, just to trigger a build

* Swap the button commands just to see if it helps shed some light the popup bug

* Revert "Swap the button commands just to see if it helps shed some light the popup bug"

This reverts commit e9f3b09.

* swap the popup prefab references this time

* Revert "swap the popup prefab references this time"

This reverts commit 51a1498.

* Try swapping out the popup prefab for dup

---------

Co-authored-by: Mike Miller <[email protected]>
  • Loading branch information
andybak and mikeage authored Apr 7, 2024
1 parent 1074a3b commit 5c3b945
Show file tree
Hide file tree
Showing 55 changed files with 2,763 additions and 2,102 deletions.
52 changes: 19 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,12 @@ jobs:
cache: Windows
extra_defines: OCULUS_SUPPORTED

- name: Windows Monoscopic
targetPlatform: StandaloneWindows64
vrsdk: Monoscopic
cache: Windows

- name: Linux Monoscopic
- name: Linux
targetPlatform: StandaloneLinux64
vrsdk: Monoscopic
vrsdk: Monoscopic # All builds include monoscopic, but this one has no additional XrSdk, so we'll keep the name monoscopic
cache: Linux

- name: MacOS Monoscopic
- name: MacOS
targetPlatform: StandaloneOSX
vrsdk: Monoscopic
cache: MacOS
Expand Down Expand Up @@ -591,8 +586,8 @@ jobs:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: MacOS Monoscopic
path: build_macos_monoscopic
name: MacOS
path: build_macos

# See https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development
- name: Install the Apple certificate and provisioning profile
Expand Down Expand Up @@ -629,7 +624,7 @@ jobs:
env:
VERSION: ${{ needs.configuration.outputs.version }}
run: |
tar xvfz build_macos_monoscopic/*tgz
tar xvfz build_macos/*tgz
export FILENAME=$(basename $(readlink -f StandaloneOSX/OpenBrush*.app))
Expand All @@ -644,7 +639,7 @@ jobs:
- name: Upload signed app
uses: actions/upload-artifact@v4
with:
name: MacOS Monoscopic (signed)
name: MacOS (signed)
path: |
OpenBrush.tgz
Expand All @@ -669,14 +664,14 @@ jobs:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: MacOS Monoscopic (signed)
path: build_macos_monoscopic
name: MacOS (signed)
path: build_macos

- name: Create a notarized DMG
env:
VERSION: ${{ needs.configuration.outputs.version }}
run: |
tar xvfz build_macos_monoscopic/*tgz
tar xvfz build_macos/*tgz
export FILENAME=$(basename $(readlink -f StandaloneOSX/OpenBrush*.app))
mkdir dist
Expand All @@ -701,7 +696,7 @@ jobs:
- name: Upload notarized dmg
uses: actions/upload-artifact@v4
with:
name: MacOS Monoscopic (DMG)
name: MacOS (DMG)
path: |
dist/OpenBrush.dmg
Expand Down Expand Up @@ -765,12 +760,6 @@ jobs:
name: Windows Rift
path: build_windows_rift

- name: Download Build Artifacts (Windows Monoscopic)
uses: actions/download-artifact@v4
with:
name: Windows Monoscopic
path: build_windows_mono

- name: Download Build Artifacts (Android OpenXR)
uses: actions/download-artifact@v4
with:
Expand All @@ -792,8 +781,8 @@ jobs:
- name: Download Build Artifacts (Mac)
uses: actions/download-artifact@v4
with:
name: MacOS Monoscopic (DMG)
path: build_monoscopic_macos
name: MacOS (DMG)
path: build_macos

- name: Package Artifacts for release
env:
Expand All @@ -805,15 +794,12 @@ jobs:
mv build_android_pico/*/com.Icosa.OpenBrush*apk releases/OpenBrush_Pico_$VERSION.apk
mv build_windows_openxr/StandaloneWindows64/ releases/OpenBrush_Desktop_$VERSION/
mv build_windows_rift/StandaloneWindows64/ releases/OpenBrush_Rift_$VERSION/
mv build_windows_mono/StandaloneWindows64/ releases/OpenBrush_Mono_$VERSION/
mv build_monoscopic_macos/*.dmg releases/OpenBrush_Mac_Mono_$VERSION.dmg
mv build_macos/*.dmg releases/OpenBrush_Mac_$VERSION.dmg
cd releases
zip -r OpenBrush_Desktop_$VERSION.zip OpenBrush_Desktop_$VERSION/
zip -r OpenBrush_Rift_$VERSION.zip OpenBrush_Rift_$VERSION/
zip -r OpenBrush_Mono_$VERSION.zip OpenBrush_Mono_$VERSION/
rm -rf OpenBrush_Desktop_$VERSION
rm -rf OpenBrush_Rift_$VERSION
rm -rf OpenBrush_Mono_$VERSION
- name: Publish
uses: softprops/action-gh-release@v2
Expand Down Expand Up @@ -917,20 +903,20 @@ jobs:
with:
name: Windows OpenXR
path: build_windows_openxr
- name: Download Build Artifacts (MacOS Monoscopic Signed)
- name: Download Build Artifacts (MacOS Signed)
uses: actions/download-artifact@v4
with:
name: MacOS Monoscopic (signed)
path: build_macos_monoscopic
name: MacOS (signed)
path: build_macos
- name: Upload Build
run: |
cd build_macos_monoscopic
cd build_macos
tar xvfz OpenBrush.tgz
cd -
pip install -U jinjanator
jinjanate Support/steam/app.vdf.j2 > app.vdf
jinjanate Support/steam/main_depot.win.vdf.j2 > build_windows_openxr/main_depot.vdf
jinjanate Support/steam/main_depot.mac.vdf.j2 > build_macos_monoscopic/main_depot.vdf
jinjanate Support/steam/main_depot.mac.vdf.j2 > build_macos/main_depot.vdf
jinjanate Support/steam/installscript_win.vdf.j2 > build_windows_openxr/installscript_win.vdf
steamcmd +login $STEAM_USERNAME +run_app_build $(pwd)/app.vdf +quit
env:
Expand Down
39 changes: 3 additions & 36 deletions Assets/Editor/BuildTiltBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ public BuildFailedException(string message)
private static readonly List<KeyValuePair<XrSdkMode, BuildTarget>> kValidSdkTargets
= new List<KeyValuePair<XrSdkMode, BuildTarget>>()
{
// Mono
new KeyValuePair<XrSdkMode, BuildTarget>(XrSdkMode.Monoscopic, BuildTarget.StandaloneWindows64),

// OpenXR
new KeyValuePair<XrSdkMode, BuildTarget>(XrSdkMode.OpenXR, BuildTarget.StandaloneWindows64),
new KeyValuePair<XrSdkMode, BuildTarget>(XrSdkMode.OpenXR, BuildTarget.Android),
Expand Down Expand Up @@ -204,7 +201,6 @@ public static XrSdkMode GuiSelectedSdk
set
{
EditorPrefs.SetString(kMenuPluginPref, value.ToString());
Menu.SetChecked(kMenuPluginMono, value == XrSdkMode.Monoscopic);
Menu.SetChecked(kMenuPluginOpenXr, value == XrSdkMode.OpenXR);
#if OCULUS_SUPPORTED
Menu.SetChecked(kMenuPluginOculus, value == XrSdkMode.Oculus);
Expand Down Expand Up @@ -392,19 +388,6 @@ static bool MenuItem_BackgroundBuild_Validate()

//======= SDKs =======

[MenuItem(kMenuPluginMono, isValidateFunction: false, priority: 100)]
static void MenuItem_Plugin_Mono()
{
GuiSelectedSdk = XrSdkMode.Monoscopic;
}

[MenuItem(kMenuPluginMono, isValidateFunction: true)]
static bool MenuItem_Plugin_Mono_Validate()
{
Menu.SetChecked(kMenuPluginMono, GuiSelectedSdk == XrSdkMode.Monoscopic);
return true;
}

[MenuItem(kMenuPluginOpenXr, isValidateFunction: false, priority: 110)]
static void MenuItem_Plugin_OpenXr()
{
Expand Down Expand Up @@ -630,17 +613,6 @@ static public BuildTargetGroup TargetToGroup(BuildTarget buildTarget)
}
}

static public SdkMode XrTargetToSdk(XrSdkMode mode)
{
switch (mode)
{
case XrSdkMode.Monoscopic:
return SdkMode.Monoscopic;
default:
return SdkMode.UnityXR;
}
}

// Removes the the given suffix from text.
// Returns true on success
static bool RemoveSuffix(ref string text, string suffix)
Expand Down Expand Up @@ -1200,9 +1172,6 @@ public TempSetXrPlugin(TiltBuildOptions tiltOptions)
case XrSdkMode.Zapbox:
targetXrPluginsRequired = new string[] { "Zappar.XR.ZapboxLoader" };
break;
case XrSdkMode.Monoscopic:
targetSettings.InitManagerOnStart = false;
break;
default:
break;
}
Expand Down Expand Up @@ -1466,7 +1435,7 @@ static void ShowBrushExportTextures()
using (var unused = new TempHookUpSingletons())
{
// Set consultUserConfig = false to keep user config from affecting the build output.
TiltBrushManifest manifest = App.Instance.GetMergedManifest(consultUserConfig: false);
TiltBrushManifest manifest = App.Instance.GetMergedManifest(forceExperimental: true);

StringBuilder s = new StringBuilder();
foreach (BrushDescriptor desc in manifest.UniqueBrushes())
Expand Down Expand Up @@ -1558,8 +1527,7 @@ public static void DoBuild(TiltBuildOptions tiltOptions)
"ProjectSettings/GraphicsSettings.asset")))
{
var config = App.Config;
// TODO: can we think of a better way of switching to mono/something else in the future?
config.m_SdkMode = XrTargetToSdk(xrSdk);
config.m_SdkMode = SdkMode.UnityXR;
config.m_AutoProfile = tiltOptions.AutoProfile;
config.m_BuildStamp = stamp;
//config.OnValidate(xrSdk, TargetToGroup(target));
Expand All @@ -1579,8 +1547,7 @@ public static void DoBuild(TiltBuildOptions tiltOptions)
// to be run at build-time (ie when nobody has called Start(), Awake()).
// TempHookupSingletons() has done just enough initialization to make it happy.
// Also set consultUserConfig = false to keep user config from affecting the build output.
TiltBrushManifest manifest = App.Instance.GetMergedManifest(
consultUserConfig: false, forceExperimental: true);
TiltBrushManifest manifest = App.Instance.GetMergedManifest(forceExperimental: true);

// Some sanity checks
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/Editor/PanelLister.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static void ListPanels()
panelList.AppendLine($"m_Advanced\tm_Basic\tm_ModeGvr\tm_ModeMono\tm_ModeQuest\tm_ModeVr\tm_PanelPrefab\tm_ModeVrExperimental");
foreach (var panel in m_PanelMap)
{
panelList.AppendLine($"{panel.m_Advanced}\t{panel.m_Basic}\t{panel.m_ModeGvr}\t{panel.m_ModeMono}\t{panel.m_ModeQuest}\t{panel.m_ModeVr}\t{panel.m_PanelPrefab}\t{panel.m_ModeVrExperimental}");
panelList.AppendLine($"{panel.m_Advanced}\t{panel.m_Basic}\t{panel.m_ModeMono}\t{panel.m_ModeQuest}\t{panel.m_ModeVr}\t{panel.m_PanelPrefab}");
}


Expand Down
31 changes: 7 additions & 24 deletions Assets/Editor/PanelMapKeyDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,36 +63,19 @@ public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)

NextRect(baseX, pos.y, 10, baseHeight, 12);
EditorGUI.PropertyField(drawRect, prop.FindPropertyRelative("m_ModeVr"), GUIContent.none);
NextRect(baseX, pos.y, 30, baseHeight, 30);
EditorGUI.LabelField(drawRect, new GUIContent("VR"));

NextRect(baseX, pos.y, 10, baseHeight, 12);
EditorGUI.PropertyField(drawRect, prop.FindPropertyRelative("m_ModeVrExperimental"),
GUIContent.none);
NextRect(baseX, pos.y, 30, baseHeight, 30);
EditorGUI.LabelField(drawRect, new GUIContent("Exp"));

NextRect(baseX, pos.y, 10, baseHeight, 12);
EditorGUI.PropertyField(drawRect, prop.FindPropertyRelative("m_ModeQuestExperimental"),
GUIContent.none);
NextRect(baseX, pos.y, 30, baseHeight, 30);
EditorGUI.LabelField(drawRect, new GUIContent("ExpQ"));

NextRect(baseX, pos.y, 10, baseHeight, 12);
EditorGUI.PropertyField(drawRect, prop.FindPropertyRelative("m_ModeMono"), GUIContent.none);
NextRect(baseX, pos.y, 30, baseHeight, 30);
EditorGUI.LabelField(drawRect, new GUIContent("Mo", "Monoscopic"));
NextRect(baseX, pos.y, 40, baseHeight, 40);
EditorGUI.LabelField(drawRect, new GUIContent("PCVR"));

NextRect(baseX, pos.y, 10, baseHeight, 12);
EditorGUI.PropertyField(drawRect, prop.FindPropertyRelative("m_ModeQuest"),
GUIContent.none);
NextRect(baseX, pos.y, 30, baseHeight, 30);
EditorGUI.LabelField(drawRect, new GUIContent("OQ", "Oculus Quest"));
NextRect(baseX, pos.y, 40, baseHeight, 40);
EditorGUI.LabelField(drawRect, new GUIContent("Quest", "Oculus Quest"));

NextRect(baseX, pos.y, 10, baseHeight, 12);
EditorGUI.PropertyField(drawRect, prop.FindPropertyRelative("m_ModeGvr"), GUIContent.none);
NextRect(baseX, pos.y, 30, baseHeight, 30);
EditorGUI.LabelField(drawRect, new GUIContent("GVR"));
EditorGUI.PropertyField(drawRect, prop.FindPropertyRelative("m_ModeMono"), GUIContent.none);
NextRect(baseX, pos.y, 40, baseHeight, 60);
EditorGUI.LabelField(drawRect, new GUIContent("Mono", "Monoscopic"));

NextRect(baseX, pos.y, 10, baseHeight, 12);
EditorGUI.PropertyField(drawRect, prop.FindPropertyRelative("m_Basic"), GUIContent.none);
Expand Down
Loading

0 comments on commit 5c3b945

Please sign in to comment.