Skip to content

Commit

Permalink
Update to version 0.15.10
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhartmann committed Oct 16, 2024
1 parent 63baab1 commit 8c21de1
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 42 deletions.
5 changes: 3 additions & 2 deletions Editor/BuildScripts/ThumbnailGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ private static void TakeSnapshot(Camera camera, string directory, string filenam
{
return;
}

RenderTexture rt = new RenderTexture(ThumbnailResWidth, ThumbnailResHeight, 24);
rt.name = "ThumbnailGenerator.TakeSnapshot.rt";
camera.targetTexture = rt;
camera.Render();

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

camera.targetTexture = null;
Expand Down
2 changes: 2 additions & 0 deletions Editor/Components/MVirtualCameraEventTrackerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void OnEnable()
TrackerEditorCamera.VizCamera = TrackerEditorCamera.cameraObject.AddComponent<Camera>();

TrackerEditorCamera.VizTexture = new RenderTexture((int)(TrackerEditorCamera.defaultTextureHeight * instance_.CameraParams.AspectRatio), (int)TrackerEditorCamera.defaultTextureHeight, 0);
TrackerEditorCamera.VizTexture.name = "mtion.room.sdk.MVirtualCameraEventTrackerEditor.VizTexture";
TrackerEditorCamera.VizCamera.targetTexture = TrackerEditorCamera.VizTexture;
}

Expand Down Expand Up @@ -101,6 +102,7 @@ private static void DoOverlayUI(UnityEngine.Object target, SceneView sceneView)
TrackerEditorCamera.VizTexture = new RenderTexture(
(int)(TrackerEditorCamera.defaultTextureHeight * tracker.CameraParams.AspectRatio),
(int)TrackerEditorCamera.defaultTextureHeight, 0);
TrackerEditorCamera.VizTexture.name = "mtion.room.sdk.MVirtualCameraEventTrackerEditor.VizTexture";
TrackerEditorCamera.VizCamera.targetTexture = TrackerEditorCamera.VizTexture;
TrackerEditorCamera.VizCamera.Render();
}
Expand Down
74 changes: 70 additions & 4 deletions Editor/ControlPanels/MTIONSDKToolsBuildTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,44 @@ private static void DrawBuildOptions()
}
MTIONSDKToolsWindow.EndBox();


MTIONSDKToolsWindow.StartBox();
{
var blueprintSDKObject = GameObject.FindObjectOfType<MTIONSDKBlueprint>();
if (blueprintSDKObject != null)
{
bool sceneExists = false;
string[] guids = AssetDatabase.FindAssets("t:SceneAsset");
foreach (string guid in guids)
{
string path = AssetDatabase.GUIDToAssetPath(guid);
string sceneName = System.IO.Path.GetFileNameWithoutExtension(path);
if (sceneName == blueprintSDKObject.RoomSceneName)
{
sceneExists = true;
break;
}
}

if (!sceneExists)
{
EditorGUILayout.HelpBox("Room scene not found. Please drag and drop the scene file.", MessageType.Warning);
SceneAsset newSceneAsset = EditorGUILayout.ObjectField("Room Scene", null, typeof(SceneAsset), false) as SceneAsset;
if (newSceneAsset != null)
{
string sceneName = newSceneAsset.name;
blueprintSDKObject.RoomSceneName = sceneName;

EditorUtility.SetDirty(blueprintSDKObject);
}

return;
}
}
}
MTIONSDKToolsWindow.EndBox();


MTIONSDKToolsWindow.StartBox();
{
GUILayout.Label("Options", headerLabelStyle);
Expand Down Expand Up @@ -276,11 +314,39 @@ private static void DrawBuildOptions()
var blueprintSDKObject = GameObject.FindObjectOfType<MTIONSDKBlueprint>();
if (blueprintSDKObject != null)
{
bool SwitchScene = GUILayout.Button(new GUIContent("Switch to Environment Scene"), MTIONSDKToolsWindow.MediumButtonStyle);
if (SwitchScene)
bool sceneExists = false;
string[] guids = AssetDatabase.FindAssets("t:SceneAsset");
foreach (string guid in guids)
{
string path = AssetDatabase.GUIDToAssetPath(guid);
string sceneName = System.IO.Path.GetFileNameWithoutExtension(path);
if (sceneName == blueprintSDKObject.EnvironmentSceneName)
{
sceneExists = true;
break;
}
}

if (!sceneExists)
{
EditorGUILayout.HelpBox("Environment scene not found. Please drag and drop the scene file.", MessageType.Warning);
SceneAsset newSceneAsset = EditorGUILayout.ObjectField("Environment Scene", null, typeof(SceneAsset), false) as SceneAsset;
if (newSceneAsset != null)
{
string sceneName = newSceneAsset.name;
blueprintSDKObject.EnvironmentSceneName = sceneName;

EditorUtility.SetDirty(blueprintSDKObject);
}
}
else
{
var scene = EditorSceneManager.GetSceneByName(blueprintSDKObject.EnvironmentSceneName);
EditorSceneManager.SetActiveScene(scene);
bool SwitchScene = GUILayout.Button(new GUIContent("Switch to Environment Scene"), MTIONSDKToolsWindow.MediumButtonStyle);
if (SwitchScene)
{
var scene = EditorSceneManager.GetSceneByName(blueprintSDKObject.EnvironmentSceneName);
EditorSceneManager.SetActiveScene(scene);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions Editor/ControlPanels/MTIONSDKToolsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ public static Texture2D CreateTextureForColor(int width, int height, Color col)
pix[i] = col;
}
Texture2D result = new Texture2D(width, height);
result.name = "MTIONSDKToolsWindow.CreateTextureForColor";
result.SetPixels(pix);
result.Apply();
return result;
Expand Down
4 changes: 2 additions & 2 deletions Plugins/ThirdParty/MTIONStudioSDK_Public_Compiled_Editor.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/MTIONUtilityClasses.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Plugins/ThirdParty/UniVRM.Editor.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Plugins/ThirdParty/VRM.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion Plugins/ThirdParty/VRMShaders.GLTF.IO.Runtime.dll
Git LFS file not shown
6 changes: 2 additions & 4 deletions Scripts/ActionSystem/IMActionInterfaceImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ public interface IMMultiActionExitEvents : IAction
void UnbindToActionComplete(Action onActionComplete);
void SimulateActionComplete();
}



public interface IMActionExitParameterProvider : IAction
{
int Count { get; }
Expand All @@ -104,8 +103,7 @@ public interface IMActionForceInternalUpdate
{
void ForceInternalUpdate();
}



public interface IMActionEntryEvent : IAction
{

Expand Down
34 changes: 14 additions & 20 deletions Scripts/ActionSystem/Internal/ActionTypeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ namespace mtion.room.sdk.action
{





public static class TypeConversion
{

public static class NumericConverter
{
public static bool IsNumericType(Type type)
Expand Down Expand Up @@ -90,7 +86,6 @@ public static object ConvertToNumericValue(object input, Type expectedType)
}
}


public static class ContainerConverter
{
public static T DeserializeContainer<T>(string jsonString)
Expand Down Expand Up @@ -129,17 +124,16 @@ public static bool CanDeserialize(string jsonString, Type targetType)
return false;
}
}



public static bool IsContainer(Type type)
{
Type[] containerTypes =
{
typeof(List<>),
typeof(Dictionary<,>),
typeof(HashSet<>),
typeof(Array),
};
typeof(List<>),
typeof(Dictionary<,>),
typeof(HashSet<>),
typeof(Array),
};

foreach (Type containerType in containerTypes)
{
Expand Down Expand Up @@ -178,8 +172,7 @@ private static bool IsAssignableToGenericType(Type givenType, Type genericType)
return IsAssignableToGenericType(baseType, genericType);
}
}



public static List<object> GenerateParameters(List<object> inputParameters, List<ActionEntryParameterInfo> parameterDefinitions)
{
List<object> output = new List<object>();
Expand Down Expand Up @@ -210,6 +203,13 @@ public static List<object> GenerateParameters(List<object> inputParameters, List
param = NumericConverter.ConvertToNumericValue(param, expectedType);
}
else if (expectedType == typeof(string))
{
param = param.ToString();
}
}
else if (inputType == typeof(bool))
{
if (expectedType == typeof(string))
{
param = Convert.ChangeType(param, expectedType);
}
Expand Down Expand Up @@ -275,16 +275,10 @@ public static List<object> GenerateParameters(List<object> inputParameters, List
{
}


output.Add(param);
}

return output;
}





}
}
3 changes: 0 additions & 3 deletions Scripts/Utility/IResetStateListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ namespace mtion.room.sdk
{
public interface IResetStateListener
{
public string ClubhouseGuid { get; set; }
public string ElementGuid { get; set; }

public void ResetState();
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.mtion.sdk",
"description": "Tools to create assets and clubhouses for mtion studio.",
"version": "0.15.9",
"version": "0.15.10",
"supportedVersion": "2021.3.25f1",
"unity": "2021.3",
"displayName": "Mtion SDK",
Expand Down

0 comments on commit 8c21de1

Please sign in to comment.