Skip to content

Commit

Permalink
Merge branch 'release/v3.2.2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Sep 8, 2023
2 parents 79a4ed8 + 4a35072 commit 75623c9
Show file tree
Hide file tree
Showing 17 changed files with 284 additions and 72 deletions.
3 changes: 2 additions & 1 deletion .github/latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
## Changelog

### Fixed
- issue of missing mesh references when prefabs were created by avatar loader window
- an issue with module installer causing errors when importing on some Windows machines by @rYuuk in [#117](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/117)


56 changes: 56 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Run Integration Tests

on:
push:
branches:
- main
- develop
- release/*
jobs:
runAllTests:
name: ${{ matrix.unityVersion }} integration tests
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
testMode:
- editmode
unityVersion:
- 2020.3.0f1
steps:
- name: Checkout empty unity project repository
uses: actions/checkout@v3
with:
repository: "readyplayerme/rpm-unity-empty-project"
fetch-depth: 0
ref: main
token: ${{ secrets.DEV_SDK_TOKEN }}
- name: Cache Project
uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
- name: Get npm
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install openupm-cli
run: npm install -g openupm-cli
- name: Add core with current branch as package
run: openupm add com.readyplayerme.core@https://github.com/readyplayerme/rpm-unity-sdk-core.git#${GITHUB_REF##*/}
- name: Run Tests
uses: game-ci/unity-test-runner@v2
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
unityVersion: ${{ matrix.unityVersion }}
testMode: ${{ matrix.testMode }}
projectPath: ${{ matrix.projectPath }}
checkName: ${{ matrix.unityVersion }} ${{ matrix.testMode }} tests result
githubToken: ${{ secrets.GITHUB_TOKEN }}
coverageOptions: "generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ sysinfo.txt
# Crashlytics generated file
crashlytics-build.properties


.idea/
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.2.2] - 2023.09.07

### Fixed
- an issue with module installer causing errors when importing on some Windows machines by @rYuuk in [#117](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/117)

## [3.2.1] - 2023.08.28

### Fixed
- issue of missing mesh references when prefabs were created by avatar loader window
- issue of missing mesh references when prefabs were created by avatar loader window by @harrisonhough in [#109](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/109)

## [3.2.0] - 2023.08.24

Expand Down
10 changes: 6 additions & 4 deletions Editor/EditorAssetGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ public class EditorAssetGenerator

static EditorAssetGenerator()
{
if (!Resources.Load<AvatarLoaderSettings>(AvatarLoaderSettings.SETTINGS_PATH))
{
CreateSettingsAssets();
}
EditorApplication.delayCall += CreateSettingsAssets;
}

~EditorAssetGenerator()
{
EditorApplication.delayCall -= CreateSettingsAssets;
}

private static void CreateSettingsAssets()
Expand Down
56 changes: 19 additions & 37 deletions Editor/Module Management/ModuleInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Unity.CodeEditor;
using UnityEditor;
using UnityEditor.Compilation;
using UnityEditor.PackageManager;
Expand All @@ -23,9 +22,10 @@ public static class ModuleInstaller

private const int THREAD_SLEEP_TIME = 100;
private const string PROGRESS_BAR_TITLE = "Ready Player Me";
private const string READY_PLAYER_ME_SYMBOL = "READY_PLAYER_ME";
private const string GLTFAST_SYMBOL = "GLTFAST";
private const string READY_PLAYER_ME_SYMBOL = "READY_PLAYER_ME";
private const string CORE_MODULE_NAME = "com.readyplayerme.core";
private const string GLTFAST_NAME = "com.atteneder.gltfast";

private const string MODULE_INSTALLATION_SUCCESS_MESSAGE =
"All the modules are installed successfully. Ready Player Me avatar system is ready to use.";
Expand All @@ -36,51 +36,33 @@ public static class ModuleInstaller
private const float TIMEOUT_FOR_MODULE_INSTALLATION = 20f;
private const string AVATAR_LOADER_SUBSTRING = "avatarloader";

private static bool modulesInstalled;

static ModuleInstaller()
{
#if !GLTFAST
AddGltfastSymbol();
#endif
Events.registeredPackages += OnRegisteredPackages;
Events.registeringPackages += OnRegisteringPackages;
}


/// <summary>
/// Called when a package is added, removed or changed.
/// </summary>
/// <param name="args">Describes the <c>PackageInfo</c> entries of packages that have just been registered.</param>
private static void OnRegisteredPackages(PackageRegistrationEventArgs args)
{
Events.registeredPackages -= OnRegisteredPackages;
#if RPM_DEVELOPMENT
return;
# if RPM_DEVELOPMENT
modulesInstalled = true;
#endif
// Core Module installed
if (args.added != null && args.added.Any(p => p.name == CORE_MODULE_NAME))
if (!modulesInstalled)
{
InstallModules();
CoreSettingsHandler.CreateCoreSettings();
AddScriptingDefineSymbolToAllBuildTargetGroups(READY_PLAYER_ME_SYMBOL);
AddGltfastSymbol();
EditorApplication.delayCall += DelayCreateCoreSettings;
}
ValidateModules();
}

/// <summary>
/// Called when a package is about to be added, removed or changed.
/// </summary>
/// <param name="args">Describes the <c>PackageInfo</c> entries of packages currently registering.</param>
private static void OnRegisteringPackages(PackageRegistrationEventArgs args)
{
// Core module uninstalled
if (args.removed != null && args.removed.Any(p => p.name == CORE_MODULE_NAME))
#if !GLTFAST
if (IsModuleInstalled(GLTFAST_NAME))
{
// Remove modules that depend on core here, or not?
AddGltfastSymbol();
AddScriptingDefineSymbolToAllBuildTargetGroups(READY_PLAYER_ME_SYMBOL);
}
#endif

Events.registeringPackages -= OnRegisteringPackages;
}

private static void DelayCreateCoreSettings()
{
CoreSettingsHandler.CreateCoreSettings();
EditorApplication.delayCall -= DelayCreateCoreSettings;
}

/// <summary>
Expand All @@ -107,8 +89,8 @@ private static void InstallModules()
EditorUtility.DisplayProgressBar(PROGRESS_BAR_TITLE, ALL_MODULES_ARE_INSTALLED, 1);
Thread.Sleep(THREAD_SLEEP_TIME);
}

EditorUtility.ClearProgressBar();
modulesInstalled = true;
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions Editor/Utils/EditorUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public static bool IsUrlShortcodeValid(string urlString)
return !string.IsNullOrEmpty(urlString) &&
(Regex.Match(urlString, SHORT_CODE_REGEX).Length > 0 || Uri.IsWellFormedUriString(urlString, UriKind.Absolute) && urlString.EndsWith(".glb"));
}
public static GameObject CreateAvatarPrefab(AvatarMetadata avatarMetadata, string path)

public static GameObject CreateAvatarPrefab(AvatarMetadata avatarMetadata, string path, string prefabPath = null)
{
var modelFilePath = $"{path}.glb";
AssetDatabase.Refresh();
Expand All @@ -53,7 +53,7 @@ public static GameObject CreateAvatarPrefab(AvatarMetadata avatarMetadata, strin
var avatarData = newAvatar.AddComponent<AvatarData>();
avatarData.AvatarMetadata = avatarMetadata;
avatarData.AvatarId = newAvatar.name;
CreatePrefab(newAvatar, $"{path}.prefab");
CreatePrefab(newAvatar, prefabPath ?? $"{path}.prefab");
return newAvatar;
}
}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Ready Player Me Unity SDK Core

[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/readyplayerme/rpm-unity-sdk-core)](https://github.com/readyplayerme/rpm-unity-sdk-core/releases/latest) [![GitHub Discussions](https://img.shields.io/github/discussions/readyplayerme/rpm-unity-sdk-core)](https://github.com/readyplayerme/rpm-unity-sdk-core/discussions)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/readyplayerme/rpm-unity-sdk-core)](https://github.com/readyplayerme/rpm-unity-sdk-core/releases/latest) [![GitHub Discussions](https://img.shields.io/github/discussions/readyplayerme/rpm-unity-sdk-core)](https://github.com/readyplayerme/rpm-unity-sdk-core/discussions) [![Run Integration Tests](https://github.com/readyplayerme/rpm-unity-sdk-core/actions/workflows/integration-test.yml/badge.svg)](https://github.com/readyplayerme/rpm-unity-sdk-core/actions/workflows/integration-test.yml)

This is an open source Unity plugin that contains all the core functionality required for and manages all the plugin updates and dependencies including Ready Player Me Avatar Loader and glTFast.
This is an open source Unity plugin that contains all the core functionality required for a Ready Player Me avatar integration, and manages all the plugin updates and dependencies including Ready Player Me Avatar Loader and glTFast.

Please visit the online documentation and join our public `discord` community.

Expand All @@ -20,7 +20,7 @@ Please visit the online documentation and join our public `discord` community.

**1.** To add the new Ready Player Me Unity SDK to your project you can use the Unity Package Manager to import the package directly from the Git URL.

**2.** With your Unity Project open open up the Package Manager window by going to `Window > Package Manager`.
**2.** With your Unity Project open, open up the Package Manager window by going to `Window > Package Manager`.

![open-package-manager](https://user-images.githubusercontent.com/7085672/206432665-da233187-06ad-40b5-a25e-660c97d6726f.png)

Expand Down Expand Up @@ -92,7 +92,7 @@ After the process is complete you project will have imported these packages:
}
],
"dependencies": {
"com.readyplayerme.core": "3.2.0"
"com.readyplayerme.core": "3.2.2"
}
}
```
Expand Down
6 changes: 3 additions & 3 deletions Runtime/AvatarObjectLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void LoadAvatar(string url)
avatarUrl = url;
Load(url);
}

/// <summary>
/// Load avatar asynchronously from a URL and return the result as eventArgs.
/// </summary>
Expand All @@ -92,12 +92,12 @@ public async Task<EventArgs> LoadAvatarAsync(string url)
eventArgs = args;
isCompleted = true;
};

startTime = Time.timeSinceLevelLoad;
SDKLogger.Log(TAG, $"Started loading avatar with config {(AvatarConfig ? AvatarConfig.name : "None")} from URL {url}");
avatarUrl = url;
Load(url);

while (!isCompleted)
{
await Task.Yield();
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Data/ApplicationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace ReadyPlayerMe.Core
{
public static class ApplicationData
{
private const string SDK_VERSION = "v3.2.0";
private const string SDK_VERSION = "v3.2.2";
private const string TAG = "ApplicationData";
private const string DEFAULT_RENDER_PIPELINE = "Built-In Render Pipeline";
private static readonly AppData Data;
Expand Down
Loading

0 comments on commit 75623c9

Please sign in to comment.