Merge pull request #15137 from thoys/fix/unityAvatarExporter/allowOptimizedRigs

Case 21069: Avatar Exporter v0.3.3 - temporary de-optimize game objects during the export process
This commit is contained in:
John Conklin II 2019-03-08 15:05:59 -08:00 committed by GitHub
commit e69eda8e84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 3 deletions

View file

@ -14,7 +14,7 @@ using System.Collections.Generic;
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.2";
static readonly string AVATAR_EXPORTER_VERSION = "0.3.3";
static readonly float HIPS_GROUND_MIN_Y = 0.01f;
static readonly float HIPS_SPINE_CHEST_MIN_SEPARATION = 0.001f;
@ -364,7 +364,14 @@ class AvatarExporter : MonoBehaviour {
" the Rig section of it's Inspector window.", "Ok");
return;
}
// if the rig is optimized we should de-optimize it during the export process
bool shouldDeoptimizeGameObjects = modelImporter.optimizeGameObjects;
if (shouldDeoptimizeGameObjects) {
modelImporter.optimizeGameObjects = false;
modelImporter.SaveAndReimport();
}
humanDescription = modelImporter.humanDescription;
string textureWarnings = SetTextureDependencies();
SetBoneAndMaterialInformation();
@ -375,6 +382,15 @@ class AvatarExporter : MonoBehaviour {
// format resulting avatar rule failure strings
// consider export-blocking avatar rules to be errors and show them in an error dialog,
// and also include any other avatar rule failures plus texture warnings as warnings in the dialog
if (shouldDeoptimizeGameObjects) {
// switch back to optimized game object in case it was originally optimized
modelImporter.optimizeGameObjects = true;
modelImporter.SaveAndReimport();
}
// format resulting bone rule failure strings
// consider export-blocking bone rules to be errors and show them in an error dialog,
// and also include any other bone rule failures plus texture warnings as warnings in the dialog
string boneErrors = "";
string warnings = "";
foreach (var failedAvatarRule in failedAvatarRules) {

View file

@ -1,6 +1,6 @@
High Fidelity, Inc.
Avatar Exporter
Version 0.3.2
Version 0.3.3
Note: It is recommended to use Unity versions between 2017.4.17f1 and 2018.2.12f1 for this Avatar Exporter.