Merge pull request #15203 from dback2/avatarExporterBlockExportFromConfigMaster

Case 21760: Avatar Exporter v0.3.7 - block exporting from Humanoid
This commit is contained in:
David Back 2019-03-22 10:23:21 -07:00 committed by GitHub
commit 6956d01099
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 20 deletions

View file

@ -17,7 +17,7 @@ using System.Text.RegularExpressions;
class AvatarExporter : MonoBehaviour {
// update version number for every PR that changes this file, also set updated version in README file
static readonly string AVATAR_EXPORTER_VERSION = "0.3.6";
static readonly string AVATAR_EXPORTER_VERSION = "0.3.7";
static readonly float HIPS_GROUND_MIN_Y = 0.01f;
static readonly float HIPS_SPINE_CHEST_MIN_SEPARATION = 0.001f;
@ -332,8 +332,7 @@ class AvatarExporter : MonoBehaviour {
static List<string> alternateStandardShaderMaterials = new List<string>();
static List<string> unsupportedShaderMaterials = new List<string>();
static Scene previewScene;
static string previousScene = "";
static SceneSetup[] previousSceneSetup;
static Vector3 previousScenePivot = Vector3.zero;
static Quaternion previousSceneRotation = Quaternion.identity;
static float previousSceneSize = 0.0f;
@ -1223,14 +1222,22 @@ class AvatarExporter : MonoBehaviour {
}
static bool OpenPreviewScene() {
// store the current scene setup to restore when closing the preview scene
previousSceneSetup = EditorSceneManager.GetSceneManagerSetup();
// if the user is currently in the Humanoid Avatar Configuration then inform them to close it first
if (EditorSceneManager.GetActiveScene().name == "Avatar Configuration" && previousSceneSetup.Length == 0) {
EditorUtility.DisplayDialog("Error", "Please exit the Avatar Configuration before exporting.", "Ok");
return false;
}
// see if the user wants to save their current scene before opening preview avatar scene in place of user's scene
if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) {
return false;
}
// store the user's current scene to re-open when done and open a new default scene in place of the user's scene
previousScene = EditorSceneManager.GetActiveScene().path;
previewScene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene);
// open a new empty scene in place of the user's scene
EditorSceneManager.NewScene(NewSceneSetup.EmptyScene);
// instantiate a game object to preview the avatar and a game object for the height reference prefab at 0, 0, 0
UnityEngine.Object heightReferenceResource = AssetDatabase.LoadAssetAtPath(HEIGHT_REFERENCE_PREFAB, typeof(UnityEngine.Object));
@ -1259,13 +1266,8 @@ class AvatarExporter : MonoBehaviour {
DestroyImmediate(avatarPreviewObject);
DestroyImmediate(heightReferenceObject);
// re-open the scene the user had open before switching to the preview scene
if (!string.IsNullOrEmpty(previousScene)) {
EditorSceneManager.OpenScene(previousScene);
}
// close the preview scene and flag it to be removed
EditorSceneManager.CloseScene(previewScene, true);
// restore to the previous scene setup that the user had open before exporting
EditorSceneManager.RestoreSceneManagerSetup(previousSceneSetup);
// restore the camera pivot and rotation to the user's previous scene settings
var sceneView = SceneView.lastActiveSceneView;

View file

@ -599,7 +599,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2}
- {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -774,7 +774,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2}
- {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -809,7 +809,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2}
- {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -844,7 +844,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2}
- {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -879,7 +879,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2}
- {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0

View file

@ -1,8 +1,8 @@
High Fidelity, Inc.
Avatar Exporter
Version 0.3.6
Version 0.3.7
Note: It is recommended to use Unity versions between 2017.4.17f1 and 2018.2.12f1 for this Avatar Exporter.
Note: It is recommended to use Unity versions between 2017.4.15f1 and 2018.2.12f1 for this Avatar Exporter.
To create a new avatar project:
1. Import your .fbx avatar model into your Unity project's Assets by either dragging and dropping the file into the Assets window or by using Assets menu > Import New Assets.