Skip to content

Commit

Permalink
feat: fix issue with picture of avatar not being editable (#254)
Browse files Browse the repository at this point in the history
<!-- Copy the TICKETID for this task from Jira and add it to the PR name
in brackets -->
<!-- PR name should look like: [TICKETID] My Pull Request -->

<!-- Add link for the ticket here editing the TICKETID-->

## [SDK-883](https://ready-player-me.atlassian.net/browse/SDK-883)

## Description

-   Fix issue, where you can't edit avatar done with the photo

<!-- Fill the section below with Added, Updated and Removed information.
-->
<!-- If there is no item under one of the lists remove it's title. -->

<!-- Testability -->

## How to Test

-   Make a photo and check, that you can edit the avatar

<!-- Update your progress with the task here -->

## Checklist

-   [ ] Tests written or updated for the changes.
-   [ ] Documentation is updated.
-   [ ] Changelog is updated.

<!--- Remember to copy the Changes Section into the commit message when
you close the PR -->





[SDK-883]:
https://ready-player-me.atlassian.net/browse/SDK-883?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
rk132 authored Apr 3, 2024
2 parents 7c63da1 + d820ca6 commit 3c20dd9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [6.1.1] - 2024.02.26

### Updated

- avatars done with a photo are now added as a draft avatars [#254](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/254)

## [6.1.0] - 2024.03.04

### Updated
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Core/Scripts/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
{
public const string SDK_VERSION = "v6.0.1";
public const string SDK_VERSION = "v6.1.1";
private const string TAG = "ApplicationData";
private const string DEFAULT_RENDER_PIPELINE = "Built-In Render Pipeline";
private static readonly AppData Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class CameraPhotoSelection : State
[SerializeField] private RawImage rawImage;
[SerializeField] private Button cameraButton;

private WebCamTexture camTexture;

public override StateType StateType => StateType.CameraPhoto;
public override StateType NextState => StateType.Editor;

private WebCamTexture camTexture;

public override async void ActivateState()
{
cameraButton.onClick.AddListener(OnCameraButton);
Expand All @@ -34,22 +34,22 @@ public override void DeactivateState()

private void OpenCamera()
{
WebCamDevice[] devices = WebCamTexture.devices;
var devices = WebCamTexture.devices;
if (devices.Length == 0)
{
return;
}

rawImage.color = Color.white;

WebCamDevice webCamDevice = devices.FirstOrDefault(device => device.isFrontFacing);
var webCamDevice = devices.FirstOrDefault(device => device.isFrontFacing);
if (webCamDevice.Equals(default(WebCamDevice)))
{
webCamDevice = devices[0];
}

Vector2 size = rawImage.rectTransform.sizeDelta;
camTexture = new WebCamTexture(webCamDevice.name, (int)size.x, (int)size.y);
var size = rawImage.rectTransform.sizeDelta;
camTexture = new WebCamTexture(webCamDevice.name, (int) size.x, (int) size.y);
camTexture.Play();
rawImage.texture = camTexture;
rawImage.SizeToParent();
Expand Down Expand Up @@ -79,6 +79,7 @@ private void OnCameraButton()

AvatarCreatorData.AvatarProperties.Id = string.Empty;
AvatarCreatorData.AvatarProperties.Base64Image = Convert.ToBase64String(bytes);
AvatarCreatorData.AvatarProperties.isDraft = true;
AvatarCreatorData.IsExistingAvatar = false;

StateMachine.SetState(StateType.Editor);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.readyplayerme.core",
"version": "6.1.0",
"version": "6.1.1",
"displayName": "Ready Player Me Core",
"description": "This Module contains all the core functionality required for using Ready Player Me avatars in Unity, including features such as: \n - Module management and automatic package setup logic\n - Avatar loading from .glb files \n - Avatar creation \n - Avatar and 2D render requests \n - Optional Analytics\n - Custom editor windows\n - Sample scenes and assets",
"unity": "2020.3",
Expand Down

0 comments on commit 3c20dd9

Please sign in to comment.