Skip to content

Commit

Permalink
v0.15.5 minor patch for avatar export
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhartmann committed Sep 2, 2024
1 parent 21df799 commit a2028e5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
49 changes: 35 additions & 14 deletions Editor/BuildScripts/SceneExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void ExportSDKScene()
break;

case MTIONObjectType.MTIONSDK_ASSET:
ExportAssetScene();
ExportAssetScene(MTIONObjectType.MTIONSDK_ASSET);
break;

case MTIONObjectType.MTIONSDK_ROOM:
Expand All @@ -62,28 +62,49 @@ public void ExportSDKScene()
break;

case MTIONObjectType.MTIONSDK_AVATAR:
ExportAssetScene();
ExportAssetScene(MTIONObjectType.MTIONSDK_AVATAR);
break;
}
}

private void ExportAssetScene()
private void ExportAssetScene(MTIONObjectType objectType)
{
SDKServerManager.Init();
MTIONSDKAsset asset = sceneObjectDescriptor as MTIONSDKAsset;

Resource resource = null;
var resourceTask = Task.Run(async () =>

if (objectType == MTIONObjectType.MTIONSDK_ASSET)
{
resource = await SDKServerManager.GetResourceById(asset.GUID);
MTIONSDKAsset asset = sceneObjectDescriptor as MTIONSDKAsset;

});
resourceTask.Wait();
var ownerId = SDKServerManager.UserId;
if (resource == null || resource.OwnerId != ownerId)
Resource resource = null;
var resourceTask = Task.Run(async () =>
{
resource = await SDKServerManager.GetResourceById(asset.GUID);

});
resourceTask.Wait();
var ownerId = SDKServerManager.UserId;
if (resource == null || resource.OwnerId != ownerId)
{
asset.GenerateNewGUID(asset.GUID);
EditorUtility.SetDirty(asset);
}
}
else if (objectType == MTIONObjectType.MTIONSDK_AVATAR)
{
asset.GenerateNewGUID(asset.GUID);
EditorUtility.SetDirty(asset);
MTIONSDKAvatar asset = sceneObjectDescriptor as MTIONSDKAvatar;
Resource resource = null;
var resourceTask = Task.Run(async () =>
{
resource = await SDKServerManager.GetResourceById(asset.GUID);

});
resourceTask.Wait();
var ownerId = SDKServerManager.UserId;
if (resource == null || resource.OwnerId != ownerId)
{
asset.GenerateNewGUID(asset.GUID);
EditorUtility.SetDirty(asset);
}
}

SceneVerificationUtil.VerifySceneIntegrity(sceneObjectDescriptor);
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.4",
"version": "0.15.5",
"supportedVersion": "2021.3.25f1",
"unity": "2021.3",
"displayName": "Mtion SDK",
Expand Down

0 comments on commit a2028e5

Please sign in to comment.