Skip to content

Commit

Permalink
Update version 0.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhartmann committed Mar 7, 2024
1 parent 95179a6 commit 8d5c760
Show file tree
Hide file tree
Showing 90 changed files with 728 additions and 167 deletions.
2 changes: 2 additions & 0 deletions Editor/BuildScripts/ThumbnailGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ private static void TakeSnapshot(Camera camera, string directory, string filenam

RenderTexture.active = rt;
Texture2D snapshot = new Texture2D(ThumbnailResWidth, ThumbnailResHeight, TextureFormat.RGB24, false);
snapshot.name = $"Snapshoot-{filename}";
snapshot.ReadPixels(new Rect(0, 0, ThumbnailResWidth, ThumbnailResHeight), 0, 0);

camera.targetTexture = null;
RenderTexture.active = null; // JC: added to avoid errors
GameObject.DestroyImmediate(rt);

WriteSnapshotToFile(snapshot, directory, filename);
GameObject.Destroy(snapshot);
}

private static void WriteSnapshotToFile(Texture2D snapshot, string directory, string filename)
Expand Down
2 changes: 1 addition & 1 deletion Editor/Components/MVirtualLightingTrackerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public override void OnInspectorGUI()

var lightComponent = instance_.gameObject.GetComponent<Light>();

LightType unityType = instance_.LightParams.LightType == LightingComponentType.PointLight ? LightType.Point : LightType.Spot;
LightType unityType = instance_.LightParams.LightType == LightingComponentType.POINT_LIGHT ? LightType.Point : LightType.Spot;
if (lightComponent.type != unityType)
{
lightComponent.type = unityType;
Expand Down
48 changes: 48 additions & 0 deletions Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using UnityEditor;
using UnityEngine;

namespace mtion.room.sdk
{
public static class MTIONSDKToolsAvatarAnimationsTab
{
private static Vector2 _scrollPos;
private static AvatarAnimations _avatarAnimations;
private static Editor _avatarAnimationsEditor;


public static void Refresh()
{
if (_avatarAnimations == null)
{
_avatarAnimations = GameObject.FindObjectOfType<AvatarAnimations>();
_avatarAnimationsEditor = Editor.CreateEditor(_avatarAnimations);
}
}

public static void Draw()
{
using (var scrollView = new EditorGUILayout.ScrollViewScope(_scrollPos))
{
_scrollPos = scrollView.scrollPosition;
DrawAvatarAnimations();
}
}

private static void DrawAvatarAnimations()
{
if (_avatarAnimations == null)
{
MTIONSDKToolsWindow.StartBox();
{
EditorGUILayout.LabelField("Add an avatar to edit animations",
MTIONSDKToolsWindow.ListHeaderStyle);
}
MTIONSDKToolsWindow.EndBox();
return;
}

_avatarAnimationsEditor.OnInspectorGUI();
}
}

}
11 changes: 11 additions & 0 deletions Editor/ControlPanels/MTIONSDKToolsAvatarAnimationsTab.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using UnityEditor;
using UnityEngine;

namespace mtion.room.sdk
{
public static class MTIONSDKToolsAvatarMovementTab
{
private static Vector2 _scrollPos;
private static AvatarMovementSettings _avatarMovement;
private static Editor _avatarMovementEditor;


public static void Refresh()
{
if (_avatarMovement == null)
{
_avatarMovement = GameObject.FindObjectOfType<AvatarMovementSettings>();
_avatarMovementEditor = Editor.CreateEditor(_avatarMovement);
}
}

public static void Draw()
{
using (var scrollView = new EditorGUILayout.ScrollViewScope(_scrollPos))
{
_scrollPos = scrollView.scrollPosition;
DrawAvatarMovementSettings();
}
}

private static void DrawAvatarMovementSettings()
{
if (_avatarMovement == null)
{
MTIONSDKToolsWindow.StartBox();
{
EditorGUILayout.LabelField("Add an avatar to edit movement settings",
MTIONSDKToolsWindow.ListHeaderStyle);
}
MTIONSDKToolsWindow.EndBox();
return;
}

_avatarMovementEditor.OnInspectorGUI();
}
}
}
3 changes: 3 additions & 0 deletions Editor/ControlPanels/MTIONSDKToolsAvatarMovementTab.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Editor/ControlPanels/MTIONSDKToolsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ private enum Tabs
ACTIONS,
OPTIMIZATION,
RAGDOLL,
AVATAR_MOVEMENT,
AVATAR_ANIMATIONS,
HELP
}

Expand All @@ -33,6 +35,8 @@ public enum WarningType
private static bool _showPropPanel;
private static bool _showActionPanel;
private static bool _showRagdollPanel;
private static bool _showAvatarMovementPanel;
private static bool _showAvatarAnimationsPanel;

private static ListRequest _packageListRequest;
private static string _sdkVersion;
Expand Down Expand Up @@ -131,6 +135,12 @@ private void OnFocus()
case Tabs.ACTIONS:
MTIONSDKToolsActionTab.Refresh();
break;
case Tabs.AVATAR_MOVEMENT:
MTIONSDKToolsAvatarMovementTab.Refresh();
break;
case Tabs.AVATAR_ANIMATIONS:
MTIONSDKToolsAvatarAnimationsTab.Refresh();
break;
case Tabs.OPTIMIZATION:
break;
case Tabs.HELP:
Expand Down Expand Up @@ -359,6 +369,20 @@ private void DrawTabButtons()
{
_selectedTab = Tabs.RAGDOLL;
}
else if (_showAvatarMovementPanel && GUILayout.Button("Movement", _selectedTab == Tabs.AVATAR_MOVEMENT
? _toolbarButtonSelectedStyle
: _toolbarButtonStyle))
{
_selectedTab = Tabs.AVATAR_MOVEMENT;
MTIONSDKToolsAvatarMovementTab.Refresh();
}
else if (_showAvatarAnimationsPanel && GUILayout.Button("Animations", _selectedTab == Tabs.AVATAR_ANIMATIONS
? _toolbarButtonSelectedStyle
: _toolbarButtonStyle))
{
_selectedTab = Tabs.AVATAR_ANIMATIONS;
MTIONSDKToolsAvatarAnimationsTab.Refresh();
}
else if (GUILayout.Button("Help", _selectedTab == Tabs.HELP
? _toolbarButtonSelectedStyle
: _toolbarButtonStyle))
Expand Down Expand Up @@ -389,6 +413,12 @@ private void DrawTabContent()
case Tabs.RAGDOLL:
MTIONSDKToolsRagdollTab.Draw();
break;
case Tabs.AVATAR_MOVEMENT:
MTIONSDKToolsAvatarMovementTab.Draw();
break;
case Tabs.AVATAR_ANIMATIONS:
MTIONSDKToolsAvatarAnimationsTab.Draw();
break;
case Tabs.HELP:
MTIONSDKToolsHelpTab.Draw();
break;
Expand All @@ -403,13 +433,17 @@ private void UpdateTabsToDisplay()
_showPropPanel = false;
_showActionPanel = false;
_showRagdollPanel = false;
_showAvatarMovementPanel = false;
_showAvatarAnimationsPanel = false;
}
else
{
_showPropPanel = descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_ROOM;
_showActionPanel = descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_ASSET ||
descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_AVATAR;
_showRagdollPanel = descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_AVATAR;
_showAvatarMovementPanel = descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_AVATAR;
_showAvatarAnimationsPanel = descriptorObject.ObjectType == MTIONObjectType.MTIONSDK_AVATAR;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/Draco.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/DracoEditor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/DracoEncoder.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/FastSpringBone.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/FastSpringBone10.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/GLTFSerialization.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/Ktx.Editor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/Ktx.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Plugins/ThirdParty/MTIONServerAPI_Core.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled.dll
Git LFS file not shown
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/MTIONUtilityClasses.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/MToon.Editor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/MToon.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/NakamaRuntime.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/System.Threading.Channels.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Plugins/ThirdParty/UniGLTF.Editor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/UniGLTF.Utils.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/UniGLTF.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/UniHumanoid.Editor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/UniHumanoid.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/UniVRM.Editor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/UnityGLTFEditor.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Plugins/ThirdParty/UnityGLTFScripts.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRM.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRM10.Editor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRM10.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRMShaders.GLTF.IO.Editor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRMShaders.GLTF.IO.Runtime.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Editor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRMShaders.GLTF.UniUnlit.Runtime.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRMShaders.VRM.IO.Runtime.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRMShaders.VRM10.Format.Runtime.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRMShaders.VRM10.MToon10.Editor.dll
Git LFS file not shown
Loading

0 comments on commit 8d5c760

Please sign in to comment.