Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into experiments/moonsharp
Browse files Browse the repository at this point in the history
# Conflicts:
#	Assets/Scripts/Widgets/ModelWidget.cs
  • Loading branch information
andybak committed Dec 20, 2023
2 parents 2103362 + f093fb2 commit ceccc52
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 32 deletions.
82 changes: 65 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ jobs:
cache: Android_GLES
# Pico requested Chinese build that doesn't have google/sketchfab login.
extraoptions: -btb-il2cpp -btb-disableAccountLogins
versionSuffix: 0
versionSuffix: 1
extra_defines: PICO_SUPPORTED

steps:
Expand Down Expand Up @@ -495,11 +495,12 @@ jobs:
mv OpenBrush.tgz build/${{ matrix.vrsdk }}/
- name: Upload build/
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: |
build/${{ matrix.vrsdk }}
!build/Pico/*.symbols.zip
!build/**/*_BackUpThisFolder_ButDontShipItWithYourGame
- name: Check if packages-lock.json has changed or if it's cacheable
Expand Down Expand Up @@ -599,37 +600,37 @@ jobs:
run: echo "$CHANGELOG"

- name: Download Build Artifacts (Windows OpenXR)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Windows OpenXR
path: build_windows_openxr

- name: Download Build Artifacts (Windows Rift)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Windows Rift
path: build_windows_rift

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

- name: Download Build Artifacts (Android OpenXR)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Android OpenXR
path: build_android_openxr

- name: Download Build Artifacts (Oculus Quest 2+)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Oculus Quest (2+)
path: build_oculus_quest

- name: Download Build Artifacts (Pico)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Android Pico
path: build_android_pico
Expand Down Expand Up @@ -749,7 +750,7 @@ jobs:
echo "${{ secrets.STEAM_CONFIG_VDF}}" | base64 -d - > /home/runner/Steam/config/config.vdf
md5sum /home/runner/Steam/config/config.vdf
- name: Download Build Artifacts (Windows OpenXR)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Windows OpenXR
path: build_windows_openxr
Expand All @@ -775,7 +776,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.SECRET_UPDATER_PAT }}
- name: Save logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: steamcmd logs
Expand All @@ -797,7 +798,7 @@ jobs:
steps:
- name: Download Build Artifacts (Windows Pimax)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Windows Pimax
path: build_windows_pimax
Expand Down Expand Up @@ -829,7 +830,7 @@ jobs:
steps:
- name: Download Build Artifacts (Windows OpenXR)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Windows OpenXR
path: build_windows_openxr
Expand Down Expand Up @@ -860,13 +861,13 @@ jobs:
steps:
- name: Download Build Artifacts (Windows OpenXR)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Windows OpenXR
path: build_windows_openxr

- name: Download Build Artifacts (Oculus Quest 2+)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Oculus Quest (2+)
path: build_oculus_quest
Expand Down Expand Up @@ -898,7 +899,7 @@ jobs:
steps:
- name: Download Build Artifacts (Oculus Quest 2+)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Oculus Quest (2+)
path: build_oculus_quest
Expand Down Expand Up @@ -939,7 +940,7 @@ jobs:
steps:
- name: Download Build Artifacts (Oculus Quest 1)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Oculus Quest (1)
path: build_oculus_quest1
Expand Down Expand Up @@ -980,7 +981,7 @@ jobs:
steps:
- name: Download Build Artifacts (Windows Rift)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Windows Rift
path: build_windows_rift
Expand All @@ -1006,3 +1007,50 @@ jobs:
CHANGELOG="${RAW_CHANGELOG}"
./ovr-platform-util upload-rift-build --app-id ${OCULUS_RIFT_APP_ID} --app-secret ${OCULUS_RIFT_APP_SECRET} --build-dir OpenBrush_Rift_$VERSION --launch-file OpenBrush.exe --channel BETA --version $VERSION --firewall_exceptions true --redistributables 822786567843179,1675031999409058,2657209094360789 --notes "${CHANGELOG}"
fi
publish_pico:
name: Publish Pico Releases
needs: [configuration, build]
runs-on: ubuntu-latest # the ovr-platform-util tool is only available for Mac and Windows
if: |
github.event_name == 'push' &&
github.repository == 'icosa-foundation/open-brush' &&
(github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
steps:
- name: Download Build Artifacts (Android Pico)
uses: actions/download-artifact@v4
with:
name: Android Pico
path: build_android_pico
- name: Download Build Artifacts (Android Pico CN)
uses: actions/download-artifact@v4
with:
name: Android Pico (CN)
path: build_android_pico_cn
- name: Publish Pico Builds
env:
VERSION: ${{ needs.configuration.outputs.version }}
PRERELEASE: ${{ needs.configuration.outputs.prerelease }}
RAW_CHANGELOG: ${{ needs.configuration.outputs.rawchangelog }}
PICO_APP_ID: ${{ secrets.PICO_APP_ID }}
PICO_APP_SECRET: ${{ secrets.PICO_APP_SECRET }}
run: |
mkdir releases
mv build_android_pico/*/com.Icosa.OpenBrush*apk releases/OpenBrush_Pico_$VERSION.apk
mv build_android_pico_cn/*/com.Icosa.OpenBrush*apk releases/OpenBrush_Pico_CN_$VERSION.apk
cd releases
# pico-cli v1.0.3
curl -L 'https://p16-platform-static-va.ibyteimg.com/tos-maliva-i-jo6vmmv194-us/linux-noncn/202304111056/pico-cli?r=1681181814847245000' -o pico-cli
chmod 755 pico-cli
if [ "$PRERELEASE" == "false" ]
then
# The order here matters, because the Chinese build has a slightly higher version code due to the suffix of 1 vs 0
./pico-cli upload-build --app-id $PICO_APP_ID --app-secret $PICO_APP_SECRET --region noncn --apk OpenBrush_Pico_$VERSION.apk --channel 2 --notes-en "Version $VERSION" --device 'PICO Neo3,PICO Neo3 Pro,PICO Neo3 Eye,PICO 4'
./pico-cli upload-build --app-id $PICO_APP_ID --app-secret $PICO_APP_SECRET --region noncn --apk OpenBrush_Pico_CN_$VERSION.apk --channel 1 --notes-en "Version $VERSION" --device 'PICO Neo3,PICO Neo3 Pro,PICO Neo3 Eye,PICO 4'
else
# For Pico, Beta channels can only get one build, not a separate China / non-China build
./pico-cli upload-build --app-id $PICO_APP_ID --app-secret $PICO_APP_SECRET --region noncn --apk OpenBrush_Pico_$VERSION.apk --channel 3 --notes-en "Version $VERSION" --device 'PICO Neo3,PICO Neo3 Pro,PICO Neo3 Eye,PICO 4'
fi
2 changes: 1 addition & 1 deletion .github/workflows/get_license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
unityVersion: 2019.4.25f1
# Upload artifact (Unity_v20XX.X.XXXX.alf)
- name: Expose as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.getManualLicenseFile.outputs.filePath }}
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
5 changes: 5 additions & 0 deletions Assets/Prefabs/PopUps/PopupWindow_LayerOptions.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 4000012974061348}
m_Modifications:
- target: {fileID: 4486572399880723504, guid: 5056dc0f2865306449988b756f72f2c2,
type: 3}
propertyPath: m_CenterPopupOnButton
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4486572399880723504, guid: 5056dc0f2865306449988b756f72f2c2,
type: 3}
propertyPath: m_BeforePopupAction.m_PersistentCalls.m_Calls.Array.size
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/ModelCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ public void LoadModels()
if (m_MissingModelsByRelativePath.ContainsKey(relativePath))
{
ModelWidget.CreateModelsFromRelativePath(
relativePath, null, m_MissingModelsByRelativePath[relativePath], null, null);
relativePath, null, m_MissingModelsByRelativePath[relativePath], null, null, null);
m_MissingModelsByRelativePath.Remove(relativePath);
}
if (m_MissingNormalizedModelsByRelativePath.ContainsKey(relativePath))
{
ModelWidget.CreateModelsFromRelativePath(
relativePath, m_MissingNormalizedModelsByRelativePath[relativePath], null, null, null);
relativePath, m_MissingNormalizedModelsByRelativePath[relativePath], null, null, null, null);
m_MissingModelsByRelativePath.Remove(relativePath);
}
}
Expand Down
25 changes: 13 additions & 12 deletions Assets/Scripts/Widgets/ModelWidget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -482,15 +482,15 @@ public static async void CreateModelFromSaveData(TiltModels75 modelDatas)
Task<bool> okTask = CreateModelsFromRelativePath(
modelDatas.FilePath,
modelDatas.Transforms, modelDatas.RawTransforms, modelDatas.PinStates,
modelDatas.GroupIds);
modelDatas.GroupIds, modelDatas.LayerIds);
ok = await okTask;

}
else if (modelDatas.AssetId != null)
{
CreateModelsFromAssetId(
modelDatas.AssetId,
modelDatas.RawTransforms, modelDatas.PinStates, modelDatas.GroupIds);
modelDatas.RawTransforms, modelDatas.PinStates, modelDatas.GroupIds, modelDatas.LayerIds);
ok = true;
}
else
Expand All @@ -510,12 +510,11 @@ public static async void CreateModelFromSaveData(TiltModels75 modelDatas)
/// Returns false if the model can't be loaded -- in this case, caller is responsible
/// for creating the missing-model placeholder.
public static async Task<bool> CreateModelsFromRelativePath(
string relativePath,
TrTransform[] xfs, TrTransform[] rawXfs, bool[] pinStates, uint[] groupIds)
string relativePath, TrTransform[] xfs, TrTransform[] rawXfs, bool[] pinStates, uint[] groupIds, int[] layerIds)
{
// Verify model is loaded. Or, at least, has been tried to be loaded.
Model model = ModelCatalog.m_Instance.GetModel(relativePath);
;

if (model == null) { return false; }

if (!model.m_Valid)
Expand All @@ -535,7 +534,7 @@ public static async Task<bool> CreateModelsFromRelativePath(
{
bool pin = (pinStates != null && i < pinStates.Length) ? pinStates[i] : true;
uint groupId = (groupIds != null && i < groupIds.Length) ? groupIds[i] : 0;
CreateModel(model, xfs[i], pin, isNonRawTransform: true, groupId);
CreateModel(model, xfs[i], pin, isNonRawTransform: true, groupId, 0);
}
}
if (rawXfs != null)
Expand All @@ -545,15 +544,16 @@ public static async Task<bool> CreateModelsFromRelativePath(
{
bool pin = (pinStates != null && i < pinStates.Length) ? pinStates[i] : true;
uint groupId = (groupIds != null && i < groupIds.Length) ? groupIds[i] : 0;
CreateModel(model, rawXfs[i], pin, isNonRawTransform: false, groupId);
int layerId = (layerIds != null && i < layerIds.Length) ? layerIds[i] : 0;
CreateModel(model, rawXfs[i], pin, isNonRawTransform: false, groupId, layerId);
}
}
return true;
}

/// isNonRawTransform - true if the transform uses the pre-M13 meaning of transform.scale.
protected static void CreateModel(Model model, TrTransform xf, bool pin,
bool isNonRawTransform, uint groupId, string assetId = null)
s bool isNonRawTransform, uint groupId, int layerId, string assetId = null)
{

var modelWidget = Instantiate(WidgetManager.m_Instance.ModelWidgetPrefab) as ModelWidget;
Expand Down Expand Up @@ -584,12 +584,12 @@ protected static void CreateModel(Model model, TrTransform xf, bool pin,
modelWidget.m_PolyCallbackActive = true;
}
modelWidget.Group = App.GroupManager.GetGroupFromId(groupId);
modelWidget.SetCanvas(App.Scene.GetOrCreateLayer(layerId));
}

// Used when loading model assetIds from a serialized format (e.g. Tilt file).
static void CreateModelsFromAssetId(
string assetId, TrTransform[] rawXfs,
bool[] pinStates, uint[] groupIds)
static void CreateModelsFromAssetId(string assetId, TrTransform[] rawXfs,
bool[] pinStates, uint[] groupIds, int[] layerIds)
{
// Request model from Poly and if it doesn't exist, ask to load it.
Model model = App.PolyAssetCatalog.GetModel(assetId);
Expand All @@ -609,7 +609,8 @@ static void CreateModelsFromAssetId(
{
bool pin = (i < pinStates.Length) ? pinStates[i] : true;
uint groupId = (groupIds != null && i < groupIds.Length) ? groupIds[i] : 0;
CreateModel(model, rawXfs[i], pin, isNonRawTransform: false, groupId, assetId: assetId);
int layerId = (layerIds != null && i < layerIds.Length) ? layerIds[i] : 0;
CreateModel(model, rawXfs[i], pin, isNonRawTransform: false, groupId, layerId, assetId);
}
}

Expand Down

0 comments on commit ceccc52

Please sign in to comment.