포매팅

This commit is contained in:
2026-02-01 19:42:47 +09:00
parent e4566118f7
commit 793e544eb0
4 changed files with 1331 additions and 1333 deletions

View File

@@ -1,4 +1,4 @@
// Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts, // Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts,
// for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies. // for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.
// EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// Eden.AutoMorpher.AutoMorpherLogCollector // Eden.AutoMorpher.AutoMorpherLogCollector
@@ -6,7 +6,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Eden.AutoMorpher;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
@@ -35,27 +34,27 @@ public class AutoMorpherLogCollector
public void BeginCapture() public void BeginCapture()
{ {
if (!_isCapturing) if (!this._isCapturing)
{ {
_isCapturing = true; this._isCapturing = true;
_entries.Clear(); this._entries.Clear();
_captureStartUtc = DateTime.UtcNow; this._captureStartUtc = DateTime.UtcNow;
Application.logMessageReceived += OnLogMessageReceived; Application.logMessageReceived += this.OnLogMessageReceived;
} }
} }
public void EndCapture() public void EndCapture()
{ {
if (_isCapturing) if (this._isCapturing)
{ {
_isCapturing = false; this._isCapturing = false;
Application.logMessageReceived -= OnLogMessageReceived; Application.logMessageReceived -= this.OnLogMessageReceived;
} }
} }
public string SaveToTextFile(string defaultFileName, bool includeWarningsAndInfo) public string SaveToTextFile(string defaultFileName, bool includeWarningsAndInfo)
{ {
EnsureLogDirectoryExists(); this.EnsureLogDirectoryExists();
string text = defaultFileName; string text = defaultFileName;
if (string.IsNullOrEmpty(text)) if (string.IsNullOrEmpty(text))
{ {
@@ -66,7 +65,7 @@ public class AutoMorpherLogCollector
text += ".txt"; text += ".txt";
} }
string text2 = Path.Combine("Assets/@Eden_Tools/Eden_AutoMorpher/Logs", text); string text2 = Path.Combine("Assets/@Eden_Tools/Eden_AutoMorpher/Logs", text);
string contents = BuildReportText(includeWarningsAndInfo); string contents = this.BuildReportText(includeWarningsAndInfo);
File.WriteAllText(text2, contents, Encoding.UTF8); File.WriteAllText(text2, contents, Encoding.UTF8);
AssetDatabase.Refresh(); AssetDatabase.Refresh();
Debug.Log("[AutoMorpher] Log report saved: " + text2); Debug.Log("[AutoMorpher] Log report saved: " + text2);
@@ -96,15 +95,15 @@ public class AutoMorpherLogCollector
{ {
StringBuilder stringBuilder = new StringBuilder(65536); StringBuilder stringBuilder = new StringBuilder(65536);
stringBuilder.AppendLine("==== EDEN AUTO MORPHER LOG REPORT ===="); stringBuilder.AppendLine("==== EDEN AUTO MORPHER LOG REPORT ====");
stringBuilder.AppendLine($"Captured (UTC) : {_captureStartUtc:yyyy-MM-dd HH:mm:ss} ~ {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}"); stringBuilder.AppendLine($"Captured (UTC) : {this._captureStartUtc:yyyy-MM-dd HH:mm:ss} ~ {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}");
stringBuilder.AppendLine("Unity Version : " + Application.unityVersion); stringBuilder.AppendLine("Unity Version : " + Application.unityVersion);
stringBuilder.AppendLine($"Platform : {Application.platform}"); stringBuilder.AppendLine($"Platform : {Application.platform}");
stringBuilder.AppendLine("Project : " + Application.productName); stringBuilder.AppendLine("Project : " + Application.productName);
stringBuilder.AppendLine(); stringBuilder.AppendLine();
stringBuilder.AppendLine("---- Logs ----"); stringBuilder.AppendLine("---- Logs ----");
for (int i = 0; i < _entries.Count; i++) for (int i = 0; i < this._entries.Count; i++)
{ {
LogEntry logEntry = _entries[i]; LogEntry logEntry = this._entries[i];
if (includeWarningsAndInfo || logEntry.type == LogType.Error || logEntry.type == LogType.Assert || logEntry.type == LogType.Exception) if (includeWarningsAndInfo || logEntry.type == LogType.Error || logEntry.type == LogType.Assert || logEntry.type == LogType.Exception)
{ {
stringBuilder.AppendLine($"[{i:0000}] - [{logEntry.type}] | {logEntry.utcTime:HH:mm:ss.fff} UTC"); stringBuilder.AppendLine($"[{i:0000}] - [{logEntry.type}] | {logEntry.utcTime:HH:mm:ss.fff} UTC");
@@ -122,18 +121,18 @@ public class AutoMorpherLogCollector
private void OnLogMessageReceived(string condition, string stackTrace, LogType type) private void OnLogMessageReceived(string condition, string stackTrace, LogType type)
{ {
if (_isCapturing) if (this._isCapturing)
{ {
_entries.Add(new LogEntry this._entries.Add(new LogEntry
{ {
utcTime = DateTime.UtcNow, utcTime = DateTime.UtcNow,
type = type, type = type,
condition = condition, condition = condition,
stackTrace = stackTrace stackTrace = stackTrace
}); });
if (_entries.Count > entriesCapacity) if (this._entries.Count > this.entriesCapacity)
{ {
_entries.RemoveRange(0, 1000); this._entries.RemoveRange(0, 1000);
} }
} }
} }

View File

@@ -1,50 +1,50 @@
// Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts, // Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts,
// for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies. // for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.
// EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// Eden.AutoMorpher.AutoMorpherValidator // Eden.AutoMorpher.AutoMorpherValidator
using System.Text;
using Eden.AutoMorpher; using Eden.AutoMorpher;
using System.Text;
using UnityEngine; using UnityEngine;
public class AutoMorpherValidator public class AutoMorpherValidator
{ {
public bool ValidateAutoModeObjects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateAutoModeObjects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
return ValidateAutoModeObjects_Internal(sourceAvatar, sourceClothes, targetAvatar, out errorMessage); return this.ValidateAutoModeObjects_Internal(sourceAvatar, sourceClothes, targetAvatar, out errorMessage);
} }
public bool ValidateManualMode_AutoSetup_Objects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateManualMode_AutoSetup_Objects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
return ValidateManualMode_AutoSetup_Objects_Internal(sourceAvatar, sourceClothes, targetAvatar, out errorMessage); return this.ValidateManualMode_AutoSetup_Objects_Internal(sourceAvatar, sourceClothes, targetAvatar, out errorMessage);
} }
public bool ValidateManualModeObjects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, GameObject targetClothes, out string errorMessage) public bool ValidateManualModeObjects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, GameObject targetClothes, out string errorMessage)
{ {
return ValidateManualModeObjects_Internal(sourceAvatar, sourceClothes, targetAvatar, targetClothes, out errorMessage); return this.ValidateManualModeObjects_Internal(sourceAvatar, sourceClothes, targetAvatar, targetClothes, out errorMessage);
} }
public bool ValidateProfileModeObjects(GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateProfileModeObjects(GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
return ValidateProfileModeObjects_Internal(sourceClothes, targetAvatar, out errorMessage); return this.ValidateProfileModeObjects_Internal(sourceClothes, targetAvatar, out errorMessage);
} }
public bool ValidateAutoModeObjects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateAutoModeObjects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object")); this.ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"));
if (sourceClothes != null) if (sourceClothes != null)
{ {
ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck")); this.ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck"));
HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (sourceAvatar != null) if (sourceAvatar != null)
{ {
IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck"));
} }
if (targetAvatar != null) if (targetAvatar != null)
{ {
IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck"));
} }
if (stringBuilder.Length == 0) if (stringBuilder.Length == 0)
{ {
@@ -58,15 +58,15 @@ public class AutoMorpherValidator
public bool ValidateProfileModeObjects_Internal(GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateProfileModeObjects_Internal(GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
ObjectNullCheck(stringBuilder, (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object")); this.ObjectNullCheck(stringBuilder, (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"));
if (sourceClothes != null) if (sourceClothes != null)
{ {
HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (targetAvatar != null) if (targetAvatar != null)
{ {
IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck"));
} }
if (stringBuilder.Length == 0) if (stringBuilder.Length == 0)
{ {
@@ -80,20 +80,20 @@ public class AutoMorpherValidator
public bool ValidateManualMode_AutoSetup_Objects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateManualMode_AutoSetup_Objects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object")); this.ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"));
if (sourceClothes != null) if (sourceClothes != null)
{ {
ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck")); this.ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck"));
HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (sourceAvatar != null) if (sourceAvatar != null)
{ {
IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck"));
} }
if (targetAvatar != null) if (targetAvatar != null)
{ {
IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck"));
} }
if (stringBuilder.Length == 0) if (stringBuilder.Length == 0)
{ {
@@ -107,30 +107,30 @@ public class AutoMorpherValidator
private bool ValidateManualModeObjects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, GameObject targetClothes, out string errorMessage) private bool ValidateManualModeObjects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, GameObject targetClothes, out string errorMessage)
{ {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"), (targetClothes, "- Target Clothes Object")); this.ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"), (targetClothes, "- Target Clothes Object"));
if (sourceClothes != null) if (sourceClothes != null)
{ {
ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck")); this.ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck"));
HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (targetClothes != null) if (targetClothes != null)
{ {
ClothesChildCheck(stringBuilder, targetAvatar, targetClothes, LanguageManager.Get("UI.Validator.TargetClothesChildCheck")); this.ClothesChildCheck(stringBuilder, targetAvatar, targetClothes, LanguageManager.Get("UI.Validator.TargetClothesChildCheck"));
HasSMRInClothes(stringBuilder, targetClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, targetClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, targetClothes, "Target " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, targetClothes, "Target " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (sourceAvatar != null) if (sourceAvatar != null)
{ {
IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck"));
} }
if (targetAvatar != null) if (targetAvatar != null)
{ {
IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck"));
} }
if (sourceClothes != null && targetClothes != null) if (sourceClothes != null && targetClothes != null)
{ {
AppendSmrAndVertexCheck(stringBuilder, sourceClothes, targetClothes); this.AppendSmrAndVertexCheck(stringBuilder, sourceClothes, targetClothes);
} }
if (stringBuilder.Length == 0) if (stringBuilder.Length == 0)
{ {

View File

@@ -1,13 +1,12 @@
// Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts, // Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts,
// for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies. // for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.
// EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// Eden.AutoMorpher.EdenAutoMorpherEditor // Eden.AutoMorpher.EdenAutoMorpherEditor
using Eden.AutoMorpher;
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using Eden.AutoMorpher;
using Eden.AutoMorpher.profile;
using UnityEditor; using UnityEditor;
using UnityEditorInternal; using UnityEditorInternal;
using UnityEngine; using UnityEngine;
@@ -101,36 +100,36 @@ public class EdenAutoMorpherEditor : Editor
private void OnEnable() private void OnEnable()
{ {
_validator = new AutoMorpherValidator(); this._validator = new AutoMorpherValidator();
_logCollector = new AutoMorpherLogCollector(); this._logCollector = new AutoMorpherLogCollector();
_currentMode = (MorpherMode)EditorPrefs.GetInt("EdenAutoMorpher_Mode", 0); this._currentMode = (MorpherMode)EditorPrefs.GetInt("EdenAutoMorpher_Mode", 0);
_selectedProfileName = EditorPrefs.GetString("EdenAutoMorpher_LastProfile", ""); this._selectedProfileName = EditorPrefs.GetString("EdenAutoMorpher_LastProfile", "");
_sourceAvatarObject = base.serializedObject.FindProperty("sourceAvatarObject"); this._sourceAvatarObject = base.serializedObject.FindProperty("sourceAvatarObject");
_sourceClothesObject = base.serializedObject.FindProperty("sourceClothesObject"); this._sourceClothesObject = base.serializedObject.FindProperty("sourceClothesObject");
_sourceBodyMeshes = base.serializedObject.FindProperty("sourceBodyMeshes"); this._sourceBodyMeshes = base.serializedObject.FindProperty("sourceBodyMeshes");
_profileName = base.serializedObject.FindProperty("profileName"); this._profileName = base.serializedObject.FindProperty("profileName");
_targetAvatarObject = base.serializedObject.FindProperty("targetAvatarObject"); this._targetAvatarObject = base.serializedObject.FindProperty("targetAvatarObject");
_targetClothesObjectOriginal = base.serializedObject.FindProperty("targetClothesObjectOriginal"); this._targetClothesObjectOriginal = base.serializedObject.FindProperty("targetClothesObjectOriginal");
_targetBodyMeshes = base.serializedObject.FindProperty("targetBodyMeshes"); this._targetBodyMeshes = base.serializedObject.FindProperty("targetBodyMeshes");
_minMargin = base.serializedObject.FindProperty("minMargin"); this._minMargin = base.serializedObject.FindProperty("minMargin");
_worldRadius = base.serializedObject.FindProperty("worldRadius"); this._worldRadius = base.serializedObject.FindProperty("worldRadius");
_sigma = base.serializedObject.FindProperty("sigma"); this._sigma = base.serializedObject.FindProperty("sigma");
_smoothingIteration = base.serializedObject.FindProperty("smoothingIteration"); this._smoothingIteration = base.serializedObject.FindProperty("smoothingIteration");
_fittingExpandIteration = base.serializedObject.FindProperty("fittingExpandIteration"); this._fittingExpandIteration = base.serializedObject.FindProperty("fittingExpandIteration");
_fittingShrinkIteration = base.serializedObject.FindProperty("fittingShrinkIteration"); this._fittingShrinkIteration = base.serializedObject.FindProperty("fittingShrinkIteration");
_isBodyAutoSetup = base.serializedObject.FindProperty("isBodyAutoSetup"); this._isBodyAutoSetup = base.serializedObject.FindProperty("isBodyAutoSetup");
_isReparentAccessoryBonesToTargetAvatar = base.serializedObject.FindProperty("isReparentAccessoryBonesToTargetAvatar"); this._isReparentAccessoryBonesToTargetAvatar = base.serializedObject.FindProperty("isReparentAccessoryBonesToTargetAvatar");
_skipFootFitting = base.serializedObject.FindProperty("skipFootFitting"); this._skipFootFitting = base.serializedObject.FindProperty("skipFootFitting");
_transferWeightToAvatar = base.serializedObject.FindProperty("transferWeightToAvatar"); this._transferWeightToAvatar = base.serializedObject.FindProperty("transferWeightToAvatar");
_addAnchorBone = base.serializedObject.FindProperty("addAnchorBone"); this._addAnchorBone = base.serializedObject.FindProperty("addAnchorBone");
_armatureBoneScaleCopy = base.serializedObject.FindProperty("armatureBoneScaleCopy"); this._armatureBoneScaleCopy = base.serializedObject.FindProperty("armatureBoneScaleCopy");
_isRemoveAutoMorphedClothes = base.serializedObject.FindProperty("isRemoveAutoMorphedClothes"); this._isRemoveAutoMorphedClothes = base.serializedObject.FindProperty("isRemoveAutoMorphedClothes");
RefreshProfiles(); this.RefreshProfiles();
} }
private void OnDestroy() private void OnDestroy()
{ {
StopProcess(); this.StopProcess();
} }
public override void OnInspectorGUI() public override void OnInspectorGUI()
@@ -151,7 +150,7 @@ public class EdenAutoMorpherEditor : Editor
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
Language currentLanguage = LanguageManager.CurrentLanguage; Language currentLanguage = LanguageManager.CurrentLanguage;
Language val = currentLanguage; Language val = currentLanguage;
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
val = (Language)(object)EditorGUILayout.EnumPopup((Enum)(object)currentLanguage, GUILayout.Width(80f)); val = (Language)(object)EditorGUILayout.EnumPopup((Enum)(object)currentLanguage, GUILayout.Width(80f));
} }
@@ -164,48 +163,48 @@ public class EdenAutoMorpherEditor : Editor
EditorGUILayout.LabelField(" - Version : 2.2.2", EditorStyles.boldLabel); EditorGUILayout.LabelField(" - Version : 2.2.2", EditorStyles.boldLabel);
EditorGUILayout.Space(6f); EditorGUILayout.Space(6f);
base.serializedObject.Update(); base.serializedObject.Update();
_edenAutoMorpher = (EdenAutoMorpher)base.target; this._edenAutoMorpher = (EdenAutoMorpher)base.target;
_isProgressing = _morphingEnumerator != null; this._isProgressing = this._morphingEnumerator != null;
if (!_isProgressing && _isUpdateWorking) if (!this._isProgressing && this._isUpdateWorking)
{ {
StopProcess(); this.StopProcess();
} }
InfoBox(); this.InfoBox();
EditorGUILayout.Space(); EditorGUILayout.Space();
string text = LanguageManager.Get("UI.Mode.AutoFitting"); string text = LanguageManager.Get("UI.Mode.AutoFitting");
string text2 = LanguageManager.Get("UI.Mode.ManualFitting"); string text2 = LanguageManager.Get("UI.Mode.ManualFitting");
string text3 = LanguageManager.Get("UI.Mode.ProfileFitting"); string text3 = LanguageManager.Get("UI.Mode.ProfileFitting");
string[] texts = new string[3] { text, text2, text3 }; string[] texts = new string[3] { text, text2, text3 };
int num = (int)_currentMode; int num = (int)this._currentMode;
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
num = GUILayout.Toolbar(num, texts); num = GUILayout.Toolbar(num, texts);
} }
if (num != (int)_currentMode) if (num != (int)this._currentMode)
{ {
_showAdvanced = false; this._showAdvanced = false;
_showMeshDetails = false; this._showMeshDetails = false;
_currentMode = (MorpherMode)num; this._currentMode = (MorpherMode)num;
EditorPrefs.SetInt("EdenAutoMorpher_Mode", num); EditorPrefs.SetInt("EdenAutoMorpher_Mode", num);
_edenAutoMorpher.ChangeMode(_currentMode); this._edenAutoMorpher.ChangeMode(this._currentMode);
} }
switch (_currentMode) switch (this._currentMode)
{ {
case MorpherMode.AutoMorpher: case MorpherMode.AutoMorpher:
DrawAutoFittingMode(_edenAutoMorpher, _currentMode); this.DrawAutoFittingMode(this._edenAutoMorpher, this._currentMode);
break; break;
case MorpherMode.ManualMorpher: case MorpherMode.ManualMorpher:
DrawManualFittingMode(_edenAutoMorpher, _currentMode); this.DrawManualFittingMode(this._edenAutoMorpher, this._currentMode);
break; break;
case MorpherMode.ProfileMorpher: case MorpherMode.ProfileMorpher:
DrawProfileFittingMode(_edenAutoMorpher, _currentMode); this.DrawProfileFittingMode(this._edenAutoMorpher, this._currentMode);
break; break;
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.Space(); EditorGUILayout.Space();
if (!_isProgressing) if (!this._isProgressing)
{ {
ApplyVariableConstraints(); this.ApplyVariableConstraints();
base.serializedObject.ApplyModifiedProperties(); base.serializedObject.ApplyModifiedProperties();
} }
} }
@@ -213,9 +212,9 @@ public class EdenAutoMorpherEditor : Editor
private void InfoBox() private void InfoBox()
{ {
EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.BeginVertical(EditorStyles.helpBox);
DrawLabelWithShortLink(" - How To Use:", "Open Documentation", "https://0xseoul.notion.site/How-to-Use-2bd1bca8582e8054a642efa8b35f4a9d"); this.DrawLabelWithShortLink(" - How To Use:", "Open Documentation", "https://0xseoul.notion.site/How-to-Use-2bd1bca8582e8054a642efa8b35f4a9d");
DrawLabelWithShortLink(" - Q&A:", "Open Q&A Page", "https://0xseoul.notion.site/Q-A-2bd1bca8582e80bc8122cb0cace28d25?source=copy_link"); this.DrawLabelWithShortLink(" - Q&A:", "Open Q&A Page", "https://0xseoul.notion.site/Q-A-2bd1bca8582e80bc8122cb0cace28d25?source=copy_link");
DrawLabelWithShortLink(" - Discord:", "Open Discord", "https://discord.gg/DgquvzGHC8"); this.DrawLabelWithShortLink(" - Discord:", "Open Discord", "https://discord.gg/DgquvzGHC8");
EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical();
} }
@@ -235,47 +234,47 @@ public class EdenAutoMorpherEditor : Editor
private void ApplyVariableConstraints() private void ApplyVariableConstraints()
{ {
if (_minMargin != null) if (this._minMargin != null)
{ {
_minMargin.floatValue = Mathf.Max(0f, _minMargin.floatValue); this._minMargin.floatValue = Mathf.Max(0f, this._minMargin.floatValue);
} }
if (_sigma != null) if (this._sigma != null)
{ {
_sigma.floatValue = Mathf.Max(0f, _sigma.floatValue); this._sigma.floatValue = Mathf.Max(0f, this._sigma.floatValue);
} }
if (_fittingExpandIteration != null) if (this._fittingExpandIteration != null)
{ {
_fittingExpandIteration.intValue = Mathf.Max(0, _fittingExpandIteration.intValue); this._fittingExpandIteration.intValue = Mathf.Max(0, this._fittingExpandIteration.intValue);
} }
if (_fittingShrinkIteration != null) if (this._fittingShrinkIteration != null)
{ {
_fittingShrinkIteration.intValue = Mathf.Max(0, _fittingShrinkIteration.intValue); this._fittingShrinkIteration.intValue = Mathf.Max(0, this._fittingShrinkIteration.intValue);
} }
} }
private void DrawAutoFittingMode(EdenAutoMorpher _edenAutoMorpher, MorpherMode morpherMode) private void DrawAutoFittingMode(EdenAutoMorpher _edenAutoMorpher, MorpherMode morpherMode)
{ {
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Basic Avatar Settings", EditorStyles.boldLabel); EditorGUILayout.LabelField("Basic Avatar Settings", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Source Avatar", EditorStyles.boldLabel); EditorGUILayout.LabelField("Source Avatar", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_sourceAvatarObject); EditorGUILayout.PropertyField(this._sourceAvatarObject);
EditorGUILayout.PropertyField(_sourceClothesObject); EditorGUILayout.PropertyField(this._sourceClothesObject);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Target Avatar", EditorStyles.boldLabel); EditorGUILayout.LabelField("Target Avatar", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_targetAvatarObject); EditorGUILayout.PropertyField(this._targetAvatarObject);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.Space(); EditorGUILayout.Space();
DrawBasicProperties(morpherMode); this.DrawBasicProperties(morpherMode);
EditorGUILayout.Space(); EditorGUILayout.Space();
DrawAdvanceProperties(); this.DrawAdvanceProperties();
EditorGUILayout.Space(); EditorGUILayout.Space();
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
@@ -288,18 +287,18 @@ public class EdenAutoMorpherEditor : Editor
gUIStyle.wordWrap = true; gUIStyle.wordWrap = true;
EditorGUILayout.LabelField("Auto Morphing", gUIStyle); EditorGUILayout.LabelField("Auto Morphing", gUIStyle);
EditorGUILayout.Space(); EditorGUILayout.Space();
ShowInspectorProgress(); this.ShowInspectorProgress();
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
GUIStyle gUIStyle2 = new GUIStyle(GUI.skin.button); GUIStyle gUIStyle2 = new GUIStyle(GUI.skin.button);
gUIStyle2.fontSize = 18; gUIStyle2.fontSize = 18;
gUIStyle2.fixedHeight = 40f; gUIStyle2.fixedHeight = 40f;
gUIStyle2.alignment = TextAnchor.MiddleCenter; gUIStyle2.alignment = TextAnchor.MiddleCenter;
bool flag = true; bool flag = true;
GameObject sourceAvatar = _sourceAvatarObject.objectReferenceValue as GameObject; GameObject sourceAvatar = this._sourceAvatarObject.objectReferenceValue as GameObject;
GameObject sourceClothes = _sourceClothesObject.objectReferenceValue as GameObject; GameObject sourceClothes = this._sourceClothesObject.objectReferenceValue as GameObject;
GameObject targetAvatar = _targetAvatarObject.objectReferenceValue as GameObject; GameObject targetAvatar = this._targetAvatarObject.objectReferenceValue as GameObject;
flag = _validator.ValidateAutoModeObjects(sourceAvatar, sourceClothes, targetAvatar, out var errorMessage); flag = this._validator.ValidateAutoModeObjects(sourceAvatar, sourceClothes, targetAvatar, out var errorMessage);
if (!flag) if (!flag)
{ {
EditorGUILayout.HelpBox(errorMessage, MessageType.Error); EditorGUILayout.HelpBox(errorMessage, MessageType.Error);
@@ -310,13 +309,13 @@ public class EdenAutoMorpherEditor : Editor
EditorGUILayout.Space(); EditorGUILayout.Space();
if (GUILayout.Button("Run All", gUIStyle2)) if (GUILayout.Button("Run All", gUIStyle2))
{ {
StartAutoMorphing(_edenAutoMorpher, morpherMode); this.StartAutoMorphing(_edenAutoMorpher, morpherMode);
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
_showStepByStepProgress = EditorGUILayout.Foldout(_showStepByStepProgress, "Step-by-step progress", toggleOnLabelClick: true); this._showStepByStepProgress = EditorGUILayout.Foldout(this._showStepByStepProgress, "Step-by-step progress", toggleOnLabelClick: true);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
if (!_showStepByStepProgress) if (!this._showStepByStepProgress)
{ {
return; return;
} }
@@ -325,14 +324,14 @@ public class EdenAutoMorpherEditor : Editor
{ {
if (GUILayout.Button("1.Run Fitting", gUIStyle2)) if (GUILayout.Button("1.Run Fitting", gUIStyle2))
{ {
StartFitting(_edenAutoMorpher, morpherMode); this.StartFitting(_edenAutoMorpher, morpherMode);
} }
bool flag2 = _edenAutoMorpher != null && _edenAutoMorpher.IsWeightingReady(isAutoMode: true); bool flag2 = _edenAutoMorpher != null && _edenAutoMorpher.IsWeightingReady(isAutoMode: true);
using (new EditorGUI.DisabledScope(!flag2)) using (new EditorGUI.DisabledScope(!flag2))
{ {
if (GUILayout.Button("2.Run Weighting", gUIStyle2)) if (GUILayout.Button("2.Run Weighting", gUIStyle2))
{ {
StartWeighting(_edenAutoMorpher); this.StartWeighting(_edenAutoMorpher);
} }
} }
} }
@@ -342,28 +341,28 @@ public class EdenAutoMorpherEditor : Editor
private void DrawManualFittingMode(EdenAutoMorpher _edenAutoMorpher, MorpherMode morpherMode) private void DrawManualFittingMode(EdenAutoMorpher _edenAutoMorpher, MorpherMode morpherMode)
{ {
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Basic Avatar Settings", EditorStyles.boldLabel); EditorGUILayout.LabelField("Basic Avatar Settings", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Source Avatar", EditorStyles.boldLabel); EditorGUILayout.LabelField("Source Avatar", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_sourceAvatarObject); EditorGUILayout.PropertyField(this._sourceAvatarObject);
EditorGUILayout.PropertyField(_sourceClothesObject); EditorGUILayout.PropertyField(this._sourceClothesObject);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Target Avatar", EditorStyles.boldLabel); EditorGUILayout.LabelField("Target Avatar", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_targetAvatarObject); EditorGUILayout.PropertyField(this._targetAvatarObject);
EditorGUILayout.PropertyField(_targetClothesObjectOriginal, new GUIContent("Target Clothes Object")); EditorGUILayout.PropertyField(this._targetClothesObjectOriginal, new GUIContent("Target Clothes Object"));
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.Space(); EditorGUILayout.Space();
DrawBasicProperties(morpherMode); this.DrawBasicProperties(morpherMode);
EditorGUILayout.Space(); EditorGUILayout.Space();
DrawAdvanceProperties(); this.DrawAdvanceProperties();
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
Rect controlRect = EditorGUILayout.GetControlRect(false, 1f); Rect controlRect = EditorGUILayout.GetControlRect(false, 1f);
@@ -375,8 +374,8 @@ public class EdenAutoMorpherEditor : Editor
gUIStyle.wordWrap = true; gUIStyle.wordWrap = true;
EditorGUILayout.LabelField("Auto Morphing", gUIStyle); EditorGUILayout.LabelField("Auto Morphing", gUIStyle);
EditorGUILayout.Space(); EditorGUILayout.Space();
ShowInspectorProgress(); this.ShowInspectorProgress();
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
GUIStyle gUIStyle2 = new GUIStyle(GUI.skin.button); GUIStyle gUIStyle2 = new GUIStyle(GUI.skin.button);
gUIStyle2.fontSize = 18; gUIStyle2.fontSize = 18;
@@ -384,11 +383,11 @@ public class EdenAutoMorpherEditor : Editor
gUIStyle2.alignment = TextAnchor.MiddleCenter; gUIStyle2.alignment = TextAnchor.MiddleCenter;
bool flag = true; bool flag = true;
bool flag2 = true; bool flag2 = true;
GameObject sourceAvatar = _sourceAvatarObject.objectReferenceValue as GameObject; GameObject sourceAvatar = this._sourceAvatarObject.objectReferenceValue as GameObject;
GameObject sourceClothes = _sourceClothesObject.objectReferenceValue as GameObject; GameObject sourceClothes = this._sourceClothesObject.objectReferenceValue as GameObject;
GameObject targetAvatar = _targetAvatarObject.objectReferenceValue as GameObject; GameObject targetAvatar = this._targetAvatarObject.objectReferenceValue as GameObject;
GameObject targetClothes = _targetClothesObjectOriginal.objectReferenceValue as GameObject; GameObject targetClothes = this._targetClothesObjectOriginal.objectReferenceValue as GameObject;
flag = _validator.ValidateManualMode_AutoSetup_Objects(sourceAvatar, sourceClothes, targetAvatar, out var errorMessage); flag = this._validator.ValidateManualMode_AutoSetup_Objects(sourceAvatar, sourceClothes, targetAvatar, out var errorMessage);
if (!flag) if (!flag)
{ {
EditorGUILayout.HelpBox(errorMessage, MessageType.Error); EditorGUILayout.HelpBox(errorMessage, MessageType.Error);
@@ -401,8 +400,8 @@ public class EdenAutoMorpherEditor : Editor
try try
{ {
_edenAutoMorpher.AutoPoseSetup(morpherMode); _edenAutoMorpher.AutoPoseSetup(morpherMode);
_resultInfo.isComplicated = true; this._resultInfo.isComplicated = true;
_resultInfo.processEndState = "Auto Setup Success"; this._resultInfo.processEndState = "Auto Setup Success";
} }
catch (AutoMorpherException ex) catch (AutoMorpherException ex)
{ {
@@ -410,9 +409,9 @@ public class EdenAutoMorpherEditor : Editor
string text = ex.title ?? "Eden AutoMorpher Error"; string text = ex.title ?? "Eden AutoMorpher Error";
string text2 = ex.Message + "\n\nIf you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately."; string text2 = ex.Message + "\n\nIf you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately.";
EditorUtility.DisplayDialog(text, text2, "OK"); EditorUtility.DisplayDialog(text, text2, "OK");
_resultInfo.isComplicated = true; this._resultInfo.isComplicated = true;
_resultInfo.processEndState = "Failed"; this._resultInfo.processEndState = "Failed";
_resultInfo.errorMessage = text + "\n\n" + text2; this._resultInfo.errorMessage = text + "\n\n" + text2;
} }
catch (Exception ex2) catch (Exception ex2)
{ {
@@ -420,14 +419,14 @@ public class EdenAutoMorpherEditor : Editor
string text3 = "Unexpected Error"; string text3 = "Unexpected Error";
string text4 = "If you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately.\n\nError Details:\n" + ex2.ToString(); string text4 = "If you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately.\n\nError Details:\n" + ex2.ToString();
EditorUtility.DisplayDialog(text3, text4, "OK"); EditorUtility.DisplayDialog(text3, text4, "OK");
_resultInfo.isComplicated = true; this._resultInfo.isComplicated = true;
_resultInfo.processEndState = "Failed"; this._resultInfo.processEndState = "Failed";
_resultInfo.errorMessage = text3 + "\n\n" + text4; this._resultInfo.errorMessage = text3 + "\n\n" + text4;
} }
} }
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
flag2 = _validator.ValidateManualModeObjects(sourceAvatar, sourceClothes, targetAvatar, targetClothes, out errorMessage); flag2 = this._validator.ValidateManualModeObjects(sourceAvatar, sourceClothes, targetAvatar, targetClothes, out errorMessage);
if (!flag2) if (!flag2)
{ {
EditorGUILayout.HelpBox(errorMessage, MessageType.Error); EditorGUILayout.HelpBox(errorMessage, MessageType.Error);
@@ -437,13 +436,13 @@ public class EdenAutoMorpherEditor : Editor
{ {
if (GUILayout.Button("Run All", gUIStyle2)) if (GUILayout.Button("Run All", gUIStyle2))
{ {
StartAutoMorphing(_edenAutoMorpher, morpherMode); this.StartAutoMorphing(_edenAutoMorpher, morpherMode);
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
_showStepByStepProgress = EditorGUILayout.Foldout(_showStepByStepProgress, "Step-by-step progress", toggleOnLabelClick: true); this._showStepByStepProgress = EditorGUILayout.Foldout(this._showStepByStepProgress, "Step-by-step progress", toggleOnLabelClick: true);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
if (!_showStepByStepProgress) if (!this._showStepByStepProgress)
{ {
return; return;
} }
@@ -452,14 +451,14 @@ public class EdenAutoMorpherEditor : Editor
{ {
if (GUILayout.Button("1. Run Fitting", gUIStyle2)) if (GUILayout.Button("1. Run Fitting", gUIStyle2))
{ {
StartFitting(_edenAutoMorpher, morpherMode); this.StartFitting(_edenAutoMorpher, morpherMode);
} }
bool flag3 = flag2 && _edenAutoMorpher != null && _edenAutoMorpher.IsWeightingReady(isAutoMode: false); bool flag3 = flag2 && _edenAutoMorpher != null && _edenAutoMorpher.IsWeightingReady(isAutoMode: false);
using (new EditorGUI.DisabledScope(!flag3)) using (new EditorGUI.DisabledScope(!flag3))
{ {
if (GUILayout.Button("2. Run Weighting", gUIStyle2)) if (GUILayout.Button("2. Run Weighting", gUIStyle2))
{ {
StartWeighting(_edenAutoMorpher); this.StartWeighting(_edenAutoMorpher);
} }
} }
} }
@@ -469,16 +468,16 @@ public class EdenAutoMorpherEditor : Editor
private void DrawProfileFittingMode(EdenAutoMorpher _edenAutoMorpher, MorpherMode morpherMode) private void DrawProfileFittingMode(EdenAutoMorpher _edenAutoMorpher, MorpherMode morpherMode)
{ {
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Basic Avatar Settings", EditorStyles.boldLabel); EditorGUILayout.LabelField("Basic Avatar Settings", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Source Avatar", EditorStyles.boldLabel); EditorGUILayout.LabelField("Source Avatar", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
if (_profileNames == null || _profileNames.Count == 0) if (this._profileNames == null || this._profileNames.Count == 0)
{ {
RefreshProfiles(); this.RefreshProfiles();
} }
using (new EditorGUILayout.HorizontalScope()) using (new EditorGUILayout.HorizontalScope())
{ {
@@ -486,17 +485,17 @@ public class EdenAutoMorpherEditor : Editor
EditorGUIUtility.labelWidth = labelWidth - 14f; EditorGUIUtility.labelWidth = labelWidth - 14f;
EditorGUILayout.PrefixLabel("Profile"); EditorGUILayout.PrefixLabel("Profile");
base.serializedObject.Update(); base.serializedObject.Update();
if (_profileNames != null && _profileNames.Count > 0) if (this._profileNames != null && this._profileNames.Count > 0)
{ {
int num = EditorGUILayout.Popup(_profileIndex, _profileNames.ToArray()); int num = EditorGUILayout.Popup(this._profileIndex, this._profileNames.ToArray());
if (num != _profileIndex) if (num != this._profileIndex)
{ {
_profileIndex = num; this._profileIndex = num;
_selectedProfileName = _profileNames[_profileIndex]; this._selectedProfileName = this._profileNames[this._profileIndex];
EditorPrefs.SetString("EdenAutoMorpher_LastProfile", _selectedProfileName); EditorPrefs.SetString("EdenAutoMorpher_LastProfile", this._selectedProfileName);
if (_profileName != null) if (this._profileName != null)
{ {
_profileName.stringValue = _selectedProfileName; this._profileName.stringValue = this._selectedProfileName;
} }
} }
} }
@@ -507,23 +506,23 @@ public class EdenAutoMorpherEditor : Editor
GUILayout.Space(8f); GUILayout.Space(8f);
if (GUILayout.Button("Refresh", GUILayout.Width(70f))) if (GUILayout.Button("Refresh", GUILayout.Width(70f)))
{ {
RefreshProfiles(); this.RefreshProfiles();
} }
EditorGUIUtility.labelWidth = labelWidth; EditorGUIUtility.labelWidth = labelWidth;
} }
EditorGUILayout.PropertyField(_sourceClothesObject); EditorGUILayout.PropertyField(this._sourceClothesObject);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Target Avatar", EditorStyles.boldLabel); EditorGUILayout.LabelField("Target Avatar", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_targetAvatarObject); EditorGUILayout.PropertyField(this._targetAvatarObject);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.Space(); EditorGUILayout.Space();
DrawBasicProperties(morpherMode); this.DrawBasicProperties(morpherMode);
EditorGUILayout.Space(); EditorGUILayout.Space();
DrawAdvanceProperties(); this.DrawAdvanceProperties();
EditorGUILayout.Space(); EditorGUILayout.Space();
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
@@ -536,8 +535,8 @@ public class EdenAutoMorpherEditor : Editor
gUIStyle.wordWrap = true; gUIStyle.wordWrap = true;
EditorGUILayout.LabelField("Auto Morphing", gUIStyle); EditorGUILayout.LabelField("Auto Morphing", gUIStyle);
EditorGUILayout.Space(); EditorGUILayout.Space();
ShowInspectorProgress(); this.ShowInspectorProgress();
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
GUIStyle gUIStyle2 = new GUIStyle(GUI.skin.button); GUIStyle gUIStyle2 = new GUIStyle(GUI.skin.button);
gUIStyle2.fontSize = 18; gUIStyle2.fontSize = 18;
@@ -545,15 +544,15 @@ public class EdenAutoMorpherEditor : Editor
gUIStyle2.alignment = TextAnchor.MiddleCenter; gUIStyle2.alignment = TextAnchor.MiddleCenter;
if (AutoMorpherDev.isDeveloperMode) if (AutoMorpherDev.isDeveloperMode)
{ {
using (new EditorGUI.DisabledScope(_isProgressing)) using (new EditorGUI.DisabledScope(this._isProgressing))
{ {
if (GUILayout.Button("0. Auto Setup", gUIStyle2)) if (GUILayout.Button("0. Auto Setup", gUIStyle2))
{ {
try try
{ {
_edenAutoMorpher.ProfileSetup(morpherMode); _edenAutoMorpher.ProfileSetup(morpherMode);
_resultInfo.isComplicated = true; this._resultInfo.isComplicated = true;
_resultInfo.processEndState = "Auto Setup Success"; this._resultInfo.processEndState = "Auto Setup Success";
} }
catch (AutoMorpherException ex) catch (AutoMorpherException ex)
{ {
@@ -561,9 +560,9 @@ public class EdenAutoMorpherEditor : Editor
string text = ex.title ?? "Eden AutoMorpher Error"; string text = ex.title ?? "Eden AutoMorpher Error";
string text2 = ex.Message + "\n\nIf you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately."; string text2 = ex.Message + "\n\nIf you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately.";
EditorUtility.DisplayDialog(text, text2, "OK"); EditorUtility.DisplayDialog(text, text2, "OK");
_resultInfo.isComplicated = true; this._resultInfo.isComplicated = true;
_resultInfo.processEndState = "Failed"; this._resultInfo.processEndState = "Failed";
_resultInfo.errorMessage = text + "\n\n" + text2; this._resultInfo.errorMessage = text + "\n\n" + text2;
} }
catch (Exception ex2) catch (Exception ex2)
{ {
@@ -571,17 +570,17 @@ public class EdenAutoMorpherEditor : Editor
string text3 = "Unexpected Error"; string text3 = "Unexpected Error";
string text4 = "If you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately.\n\nError Details:\n" + ex2.ToString(); string text4 = "If you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately.\n\nError Details:\n" + ex2.ToString();
EditorUtility.DisplayDialog(text3, text4, "OK"); EditorUtility.DisplayDialog(text3, text4, "OK");
_resultInfo.isComplicated = true; this._resultInfo.isComplicated = true;
_resultInfo.processEndState = "Failed"; this._resultInfo.processEndState = "Failed";
_resultInfo.errorMessage = text3 + "\n\n" + text4; this._resultInfo.errorMessage = text3 + "\n\n" + text4;
} }
} }
} }
} }
GameObject sourceClothes = _sourceClothesObject.objectReferenceValue as GameObject; GameObject sourceClothes = this._sourceClothesObject.objectReferenceValue as GameObject;
GameObject targetAvatar = _targetAvatarObject.objectReferenceValue as GameObject; GameObject targetAvatar = this._targetAvatarObject.objectReferenceValue as GameObject;
string errorMessage; string errorMessage;
bool flag = _validator.ValidateProfileModeObjects(sourceClothes, targetAvatar, out errorMessage); bool flag = this._validator.ValidateProfileModeObjects(sourceClothes, targetAvatar, out errorMessage);
if (!flag) if (!flag)
{ {
EditorGUILayout.HelpBox(errorMessage, MessageType.Error); EditorGUILayout.HelpBox(errorMessage, MessageType.Error);
@@ -591,13 +590,13 @@ public class EdenAutoMorpherEditor : Editor
{ {
if (GUILayout.Button("Run All", gUIStyle2)) if (GUILayout.Button("Run All", gUIStyle2))
{ {
StartAutoMorphing(_edenAutoMorpher, morpherMode); this.StartAutoMorphing(_edenAutoMorpher, morpherMode);
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
_showStepByStepProgress = EditorGUILayout.Foldout(_showStepByStepProgress, "Step-by-step progress", toggleOnLabelClick: true); this._showStepByStepProgress = EditorGUILayout.Foldout(this._showStepByStepProgress, "Step-by-step progress", toggleOnLabelClick: true);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
if (!_showStepByStepProgress) if (!this._showStepByStepProgress)
{ {
return; return;
} }
@@ -606,14 +605,14 @@ public class EdenAutoMorpherEditor : Editor
{ {
if (GUILayout.Button("1.Run Fitting", gUIStyle2)) if (GUILayout.Button("1.Run Fitting", gUIStyle2))
{ {
StartFitting(_edenAutoMorpher, morpherMode); this.StartFitting(_edenAutoMorpher, morpherMode);
} }
bool flag2 = _edenAutoMorpher != null && _edenAutoMorpher.IsWeightingReady(isAutoMode: true); bool flag2 = _edenAutoMorpher != null && _edenAutoMorpher.IsWeightingReady(isAutoMode: true);
using (new EditorGUI.DisabledScope(!flag2)) using (new EditorGUI.DisabledScope(!flag2))
{ {
if (GUILayout.Button("2.Run Weighting", gUIStyle2)) if (GUILayout.Button("2.Run Weighting", gUIStyle2))
{ {
StartWeighting(_edenAutoMorpher); this.StartWeighting(_edenAutoMorpher);
} }
} }
} }
@@ -624,44 +623,44 @@ public class EdenAutoMorpherEditor : Editor
private void RefreshProfiles() private void RefreshProfiles()
{ {
ProfileLoader profileLoader = new ProfileLoader(); ProfileLoader profileLoader = new ProfileLoader();
_profileNames = profileLoader.GetProfileList(); this._profileNames = profileLoader.GetProfileList();
if (_profileNames == null || _profileNames.Count == 0) if (this._profileNames == null || this._profileNames.Count == 0)
{ {
_profileIndex = 0; this._profileIndex = 0;
_selectedProfileName = ""; this._selectedProfileName = "";
if (_profileName != null) if (this._profileName != null)
{ {
base.serializedObject.Update(); base.serializedObject.Update();
_profileName.stringValue = ""; this._profileName.stringValue = "";
base.serializedObject.ApplyModifiedProperties(); base.serializedObject.ApplyModifiedProperties();
} }
return; return;
} }
int num = _profileNames.IndexOf(_selectedProfileName); int num = this._profileNames.IndexOf(this._selectedProfileName);
if (num >= 0) if (num >= 0)
{ {
_profileIndex = num; this._profileIndex = num;
} }
else else
{ {
_profileIndex = Mathf.Clamp(_profileIndex, 0, _profileNames.Count - 1); this._profileIndex = Mathf.Clamp(this._profileIndex, 0, this._profileNames.Count - 1);
} }
_selectedProfileName = _profileNames[_profileIndex]; this._selectedProfileName = this._profileNames[this._profileIndex];
if (_profileName != null) if (this._profileName != null)
{ {
base.serializedObject.Update(); base.serializedObject.Update();
_profileName.stringValue = _selectedProfileName; this._profileName.stringValue = this._selectedProfileName;
base.serializedObject.ApplyModifiedProperties(); base.serializedObject.ApplyModifiedProperties();
} }
} }
private void ShowInspectorProgress() private void ShowInspectorProgress()
{ {
if (_isProgressing) if (this._isProgressing)
{ {
using (new EditorGUI.DisabledGroupScope(disabled: false)) using (new EditorGUI.DisabledGroupScope(disabled: false))
{ {
ProcessInfo processInfo = _edenAutoMorpher.GetProcessInfo(); ProcessInfo processInfo = this._edenAutoMorpher.GetProcessInfo();
EditorGUILayout.HelpBox("ProgressInfo\n\n" + processInfo.title + "\n" + processInfo.text, MessageType.Info); EditorGUILayout.HelpBox("ProgressInfo\n\n" + processInfo.title + "\n" + processInfo.text, MessageType.Info);
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUI.ProgressBar(GUILayoutUtility.GetRect(18f, 18f, "TextField"), processInfo.progress, $"{processInfo.progress * 100f:0}%"); EditorGUI.ProgressBar(GUILayoutUtility.GetRect(18f, 18f, "TextField"), processInfo.progress, $"{processInfo.progress * 100f:0}%");
@@ -669,16 +668,16 @@ public class EdenAutoMorpherEditor : Editor
EditorGUILayout.Space(); EditorGUILayout.Space();
if (GUILayout.Button("Stop")) if (GUILayout.Button("Stop"))
{ {
StopProcess(); this.StopProcess();
_edenAutoMorpher.StopProcess(); this._edenAutoMorpher.StopProcess();
_resultInfo.processEndState = "Stopped"; this._resultInfo.processEndState = "Stopped";
} }
} }
} }
else if (_resultInfo.isComplicated) else if (this._resultInfo.isComplicated)
{ {
EditorGUILayout.HelpBox(_resultInfo.processTyep + " is " + _resultInfo.processEndState + "\n - Progressing time : " + _resultInfo.processTime, MessageType.Info); EditorGUILayout.HelpBox(this._resultInfo.processTyep + " is " + this._resultInfo.processEndState + "\n - Progressing time : " + this._resultInfo.processTime, MessageType.Info);
if (_resultInfo.processEndState == "Failed") if (this._resultInfo.processEndState == "Failed")
{ {
EditorGUILayout.Space(6f); EditorGUILayout.Space(6f);
using (new EditorGUILayout.VerticalScope(new GUIStyle(EditorStyles.helpBox) using (new EditorGUILayout.VerticalScope(new GUIStyle(EditorStyles.helpBox)
@@ -696,8 +695,8 @@ public class EdenAutoMorpherEditor : Editor
EditorGUILayout.LabelField("Error Occurred", style); EditorGUILayout.LabelField("Error Occurred", style);
EditorGUILayout.Space(4f); EditorGUILayout.Space(4f);
float height = 160f; float height = 160f;
_errorMessageScroll = EditorGUILayout.BeginScrollView(_errorMessageScroll, GUILayout.Height(height)); this._errorMessageScroll = EditorGUILayout.BeginScrollView(this._errorMessageScroll, GUILayout.Height(height));
EditorGUILayout.TextArea(_resultInfo.errorMessage ?? string.Empty, GUILayout.ExpandHeight(expand: true)); EditorGUILayout.TextArea(this._resultInfo.errorMessage ?? string.Empty, GUILayout.ExpandHeight(expand: true));
EditorGUILayout.EndScrollView(); EditorGUILayout.EndScrollView();
} }
} }
@@ -707,23 +706,23 @@ public class EdenAutoMorpherEditor : Editor
private void DrawMeshProperties() private void DrawMeshProperties()
{ {
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
_showMeshDetails = EditorGUILayout.Foldout(_showMeshDetails, "Mesh Info", toggleOnLabelClick: true); this._showMeshDetails = EditorGUILayout.Foldout(this._showMeshDetails, "Mesh Info", toggleOnLabelClick: true);
} }
if (_showMeshDetails) if (this._showMeshDetails)
{ {
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Mesh Lists", EditorStyles.boldLabel); EditorGUILayout.LabelField("Mesh Lists", EditorStyles.boldLabel);
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Source Avatar Meshes", EditorStyles.boldLabel); EditorGUILayout.LabelField("Source Avatar Meshes", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_sourceBodyMeshes, new GUIContent("Source Body Meshes"), true); EditorGUILayout.PropertyField(this._sourceBodyMeshes, new GUIContent("Source Body Meshes"), true);
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Target Avatar Meshes", EditorStyles.boldLabel); EditorGUILayout.LabelField("Target Avatar Meshes", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_targetBodyMeshes, new GUIContent("Target Body Meshes"), true); EditorGUILayout.PropertyField(this._targetBodyMeshes, new GUIContent("Target Body Meshes"), true);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
} }
} }
@@ -739,20 +738,20 @@ public class EdenAutoMorpherEditor : Editor
EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.BodyMeshInfo"), gUIStyle, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 40f)); EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.BodyMeshInfo"), gUIStyle, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 40f));
} }
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_isBodyAutoSetup, new GUIContent(LanguageManager.Get("UI.Property.BodyMeshTitle")), true); EditorGUILayout.PropertyField(this._isBodyAutoSetup, new GUIContent(LanguageManager.Get("UI.Property.BodyMeshTitle")), true);
if (!_edenAutoMorpher.isBodyAutoSetup) if (!this._edenAutoMorpher.isBodyAutoSetup)
{ {
if (morpherMode != MorpherMode.ProfileMorpher) if (morpherMode != MorpherMode.ProfileMorpher)
{ {
EditorGUILayout.LabelField("Source Avatar Meshes", EditorStyles.boldLabel); EditorGUILayout.LabelField("Source Avatar Meshes", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_sourceBodyMeshes, new GUIContent("Source Body Meshes"), true); EditorGUILayout.PropertyField(this._sourceBodyMeshes, new GUIContent("Source Body Meshes"), true);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
} }
EditorGUILayout.LabelField("Target Avatar Meshes", EditorStyles.boldLabel); EditorGUILayout.LabelField("Target Avatar Meshes", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_targetBodyMeshes, new GUIContent("Target Body Meshes"), true); EditorGUILayout.PropertyField(this._targetBodyMeshes, new GUIContent("Target Body Meshes"), true);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
} }
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
@@ -766,7 +765,7 @@ public class EdenAutoMorpherEditor : Editor
EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.MinMarginInfo"), gUIStyle2, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 40f)); EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.MinMarginInfo"), gUIStyle2, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 40f));
} }
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_minMargin); EditorGUILayout.PropertyField(this._minMargin);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.Space(); EditorGUILayout.Space();
@@ -780,28 +779,28 @@ public class EdenAutoMorpherEditor : Editor
EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.SkipFootFittingInfo"), style, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 40f)); EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.SkipFootFittingInfo"), style, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 40f));
} }
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_skipFootFitting); EditorGUILayout.PropertyField(this._skipFootFitting);
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Remove AutoMorphed Other Clothes", EditorStyles.boldLabel); EditorGUILayout.LabelField("Remove AutoMorphed Other Clothes", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_isRemoveAutoMorphedClothes, new GUIContent("Remove AutoMorphed Other Clothes")); EditorGUILayout.PropertyField(this._isRemoveAutoMorphedClothes, new GUIContent("Remove AutoMorphed Other Clothes"));
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUILayout.Space(); EditorGUILayout.Space();
} }
private void DrawAdvanceProperties() private void DrawAdvanceProperties()
{ {
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
_showAdvanced = EditorGUILayout.Foldout(_showAdvanced, "Advanced Option", toggleOnLabelClick: true); this._showAdvanced = EditorGUILayout.Foldout(this._showAdvanced, "Advanced Option", toggleOnLabelClick: true);
} }
if (!_showAdvanced) if (!this._showAdvanced)
{ {
return; return;
} }
using (new EditorGUI.DisabledGroupScope(_isProgressing)) using (new EditorGUI.DisabledGroupScope(this._isProgressing))
{ {
GUIStyle style = new GUIStyle(GUI.skin.box) GUIStyle style = new GUIStyle(GUI.skin.box)
{ {
@@ -820,7 +819,7 @@ public class EdenAutoMorpherEditor : Editor
{ {
EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.SigmaInfo"), EditorStyles.miniLabel); EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.SigmaInfo"), EditorStyles.miniLabel);
} }
EditorGUILayout.PropertyField(_sigma); EditorGUILayout.PropertyField(this._sigma);
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.Space(); EditorGUILayout.Space();
using (new EditorGUI.DisabledScope(disabled: true)) using (new EditorGUI.DisabledScope(disabled: true))
@@ -831,7 +830,7 @@ public class EdenAutoMorpherEditor : Editor
}; };
EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.SmoothingInfo"), style3); EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.SmoothingInfo"), style3);
} }
EditorGUILayout.PropertyField(_smoothingIteration); EditorGUILayout.PropertyField(this._smoothingIteration);
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("Fitting Iterations", EditorStyles.boldLabel); EditorGUILayout.LabelField("Fitting Iterations", EditorStyles.boldLabel);
@@ -840,16 +839,16 @@ public class EdenAutoMorpherEditor : Editor
EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.IterationInfo"), EditorStyles.miniLabel); EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.IterationInfo"), EditorStyles.miniLabel);
} }
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_fittingExpandIteration, new GUIContent("Expand Iteration")); EditorGUILayout.PropertyField(this._fittingExpandIteration, new GUIContent("Expand Iteration"));
EditorGUILayout.PropertyField(_fittingShrinkIteration, new GUIContent("Shrink Iteration")); EditorGUILayout.PropertyField(this._fittingShrinkIteration, new GUIContent("Shrink Iteration"));
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUILayout.LabelField("- Weighting Settings", style2); EditorGUILayout.LabelField("- Weighting Settings", style2);
using (new EditorGUILayout.VerticalScope(style)) using (new EditorGUILayout.VerticalScope(style))
{ {
EditorGUILayout.PropertyField(_transferWeightToAvatar, new GUIContent("Transfer Weight To Avatar")); EditorGUILayout.PropertyField(this._transferWeightToAvatar, new GUIContent("Transfer Weight To Avatar"));
bool boolValue = _transferWeightToAvatar.boolValue; bool boolValue = this._transferWeightToAvatar.boolValue;
if (boolValue) if (boolValue)
{ {
using (new EditorGUI.DisabledScope(!boolValue)) using (new EditorGUI.DisabledScope(!boolValue))
@@ -859,21 +858,21 @@ public class EdenAutoMorpherEditor : Editor
EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.ReparentAccessoryBones"), EditorStyles.miniLabel); EditorGUILayout.LabelField(LanguageManager.Get("UI.Property.ReparentAccessoryBones"), EditorStyles.miniLabel);
} }
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_isReparentAccessoryBonesToTargetAvatar, new GUIContent("Reparent Accessory Bones")); EditorGUILayout.PropertyField(this._isReparentAccessoryBonesToTargetAvatar, new GUIContent("Reparent Accessory Bones"));
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
} }
} }
else else
{ {
if (_isReparentAccessoryBonesToTargetAvatar.boolValue) if (this._isReparentAccessoryBonesToTargetAvatar.boolValue)
{ {
_isReparentAccessoryBonesToTargetAvatar.boolValue = false; this._isReparentAccessoryBonesToTargetAvatar.boolValue = false;
} }
EditorGUILayout.Space(); EditorGUILayout.Space();
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Adds an anchor bone to preserve clothes bone rotation.", EditorStyles.boldLabel); EditorGUILayout.LabelField("Adds an anchor bone to preserve clothes bone rotation.", EditorStyles.boldLabel);
EditorGUI.indentLevel++; EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_addAnchorBone, new GUIContent("Add Anchor Bone")); EditorGUILayout.PropertyField(this._addAnchorBone, new GUIContent("Add Anchor Bone"));
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
EditorGUI.indentLevel--; EditorGUI.indentLevel--;
} }
@@ -884,80 +883,80 @@ public class EdenAutoMorpherEditor : Editor
private void StartAutoMorphing(EdenAutoMorpher _edenAutoMorpher, MorpherMode _modeIndex) private void StartAutoMorphing(EdenAutoMorpher _edenAutoMorpher, MorpherMode _modeIndex)
{ {
StartProcess(_edenAutoMorpher, _edenAutoMorpher.AutoMorphingEnumerator(_modeIndex), "Auto Morphing"); this.StartProcess(_edenAutoMorpher, _edenAutoMorpher.AutoMorphingEnumerator(_modeIndex), "Auto Morphing");
} }
private void StartFitting(EdenAutoMorpher _edenAutoMorpher, MorpherMode morpherMode) private void StartFitting(EdenAutoMorpher _edenAutoMorpher, MorpherMode morpherMode)
{ {
StartProcess(_edenAutoMorpher, _edenAutoMorpher.FittingEnumerator(morpherMode), "Fitting"); this.StartProcess(_edenAutoMorpher, _edenAutoMorpher.FittingEnumerator(morpherMode), "Fitting");
} }
private void StartWeighting(EdenAutoMorpher _edenAutoMorpher) private void StartWeighting(EdenAutoMorpher _edenAutoMorpher)
{ {
StartProcess(_edenAutoMorpher, _edenAutoMorpher.WeightingEnumerator(), "Weighting"); this.StartProcess(_edenAutoMorpher, _edenAutoMorpher.WeightingEnumerator(), "Weighting");
} }
private void StartProcess(EdenAutoMorpher _edenAutoMorpher, IEnumerator enumerator, string processType) private void StartProcess(EdenAutoMorpher _edenAutoMorpher, IEnumerator enumerator, string processType)
{ {
if (_morphingEnumerator != null) if (this._morphingEnumerator != null)
{ {
UnityEngine.Debug.LogWarning("[EdenAutoMorpherEditor] Already AutoMorpher is Working"); UnityEngine.Debug.LogWarning("[EdenAutoMorpherEditor] Already AutoMorpher is Working");
return; return;
} }
this._edenAutoMorpher = _edenAutoMorpher; this._edenAutoMorpher = _edenAutoMorpher;
_morphingEnumerator = enumerator; this._morphingEnumerator = enumerator;
_resultInfo.processTyep = processType; this._resultInfo.processTyep = processType;
_resultInfo.processTime = string.Empty; this._resultInfo.processTime = string.Empty;
_resultInfo.processEndState = "Unknown"; this._resultInfo.processEndState = "Unknown";
_resultInfo.isComplicated = false; this._resultInfo.isComplicated = false;
_stopwatch.Reset(); this._stopwatch.Reset();
_stopwatch.Start(); this._stopwatch.Start();
_logCollector.BeginCapture(); this._logCollector.BeginCapture();
EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(OnEditorUpdate)); EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(this.OnEditorUpdate));
EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.update, new EditorApplication.CallbackFunction(OnEditorUpdate)); EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.update, new EditorApplication.CallbackFunction(this.OnEditorUpdate));
UnityEngine.Debug.Log("[EdenAutoMorpherEditor] Start " + processType + " Process"); UnityEngine.Debug.Log("[EdenAutoMorpherEditor] Start " + processType + " Process");
} }
private void StopProcess() private void StopProcess()
{ {
if (_isUpdateWorking) if (this._isUpdateWorking)
{ {
EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(OnEditorUpdate)); EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(this.OnEditorUpdate));
if (_stopwatch.IsRunning) if (this._stopwatch.IsRunning)
{ {
_stopwatch.Stop(); this._stopwatch.Stop();
double totalSeconds = _stopwatch.Elapsed.TotalSeconds; double totalSeconds = this._stopwatch.Elapsed.TotalSeconds;
_resultInfo.processTime = $"{totalSeconds:F2} sec"; this._resultInfo.processTime = $"{totalSeconds:F2} sec";
_resultInfo.isComplicated = true; this._resultInfo.isComplicated = true;
} }
EditorUtility.ClearProgressBar(); EditorUtility.ClearProgressBar();
SceneView.RepaintAll(); SceneView.RepaintAll();
EditorApplication.QueuePlayerLoopUpdate(); EditorApplication.QueuePlayerLoopUpdate();
InternalEditorUtility.RepaintAllViews(); InternalEditorUtility.RepaintAllViews();
_logCollector.SaveToTextFile("EdenAutoMorpher_Report.txt", includeWarningsAndInfo: true); this._logCollector.SaveToTextFile("EdenAutoMorpher_Report.txt", includeWarningsAndInfo: true);
_logCollector.EndCapture(); this._logCollector.EndCapture();
_morphingEnumerator = null; this._morphingEnumerator = null;
_isProgressing = false; this._isProgressing = false;
_isUpdateWorking = false; this._isUpdateWorking = false;
UnityEngine.Debug.Log("[EdenAutoMorpherEditor] AutoMorphing Process Ended"); UnityEngine.Debug.Log("[EdenAutoMorpherEditor] AutoMorphing Process Ended");
} }
} }
private void OnEditorUpdate() private void OnEditorUpdate()
{ {
if (_morphingEnumerator == null || _edenAutoMorpher == null) if (this._morphingEnumerator == null || this._edenAutoMorpher == null)
{ {
StopProcess(); this.StopProcess();
return; return;
} }
_isUpdateWorking = true; this._isUpdateWorking = true;
try try
{ {
bool flag = _morphingEnumerator.MoveNext(); bool flag = this._morphingEnumerator.MoveNext();
ProcessInfo processInfo = _edenAutoMorpher.GetProcessInfo(); ProcessInfo processInfo = this._edenAutoMorpher.GetProcessInfo();
try try
{ {
processInfo = _edenAutoMorpher.GetProcessInfo(); processInfo = this._edenAutoMorpher.GetProcessInfo();
} }
catch catch
{ {
@@ -968,41 +967,41 @@ public class EdenAutoMorpherEditor : Editor
if (EditorUtility.DisplayCancelableProgressBar(processInfo.title, processInfo.text, processInfo.progress)) if (EditorUtility.DisplayCancelableProgressBar(processInfo.title, processInfo.text, processInfo.progress))
{ {
UnityEngine.Debug.Log("[EdenAutoMorpherEditor] User Canceled Process"); UnityEngine.Debug.Log("[EdenAutoMorpherEditor] User Canceled Process");
_edenAutoMorpher.StopProcess(); this._edenAutoMorpher.StopProcess();
StopProcess(); this.StopProcess();
_resultInfo.processEndState = "Stopped"; this._resultInfo.processEndState = "Stopped";
} }
else if (!flag) else if (!flag)
{ {
StopProcess(); this.StopProcess();
_resultInfo.processEndState = "Ended"; this._resultInfo.processEndState = "Ended";
} }
else else
{ {
Repaint(); this.Repaint();
} }
} }
catch (AutoMorpherException ex) catch (AutoMorpherException ex)
{ {
EditorUtility.ClearProgressBar(); EditorUtility.ClearProgressBar();
UnityEngine.Debug.LogException(ex); UnityEngine.Debug.LogException(ex);
StopProcess(); this.StopProcess();
string text = ex.title ?? "Eden AutoMorpher Error"; string text = ex.title ?? "Eden AutoMorpher Error";
string text2 = ex.Message + "\n\nIf you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately."; string text2 = ex.Message + "\n\nIf you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately.";
EditorUtility.DisplayDialog(text, text2, "OK"); EditorUtility.DisplayDialog(text, text2, "OK");
_resultInfo.processEndState = "Failed"; this._resultInfo.processEndState = "Failed";
_resultInfo.errorMessage = text + "\n\n" + text2; this._resultInfo.errorMessage = text + "\n\n" + text2;
} }
catch (Exception ex2) catch (Exception ex2)
{ {
EditorUtility.ClearProgressBar(); EditorUtility.ClearProgressBar();
UnityEngine.Debug.LogException(ex2); UnityEngine.Debug.LogException(ex2);
StopProcess(); this.StopProcess();
string text3 = "Unexpected Error"; string text3 = "Unexpected Error";
string text4 = "If you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately.\n\nError Details:\n" + ex2.ToString(); string text4 = "If you need assistance resolving this issue,\nplease contact us on Discord and include the following information:\n\n1. A screenshot of the Console window showing the error message.\n2. A screenshot of the current Hierarchy window.\n3. This error dialog, including the avatar and clothing information used.\n4. The log file saved at:\n Assets/@Eden_Tools/Eden_AutoMorpher/Logs/EdenAutoMorpher_Report.txt\n\nProviding these details will help us identify the issue more accurately.\n\nError Details:\n" + ex2.ToString();
EditorUtility.DisplayDialog(text3, text4, "OK"); EditorUtility.DisplayDialog(text3, text4, "OK");
_resultInfo.processEndState = "Failed"; this._resultInfo.processEndState = "Failed";
_resultInfo.errorMessage = text3 + "\n\n" + text4; this._resultInfo.errorMessage = text3 + "\n\n" + text4;
} }
} }
} }

View File

@@ -1,4 +1,4 @@
// Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts, // Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts,
// for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies. // for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.
// EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// Eden.AutoMorpher.ResultInfo // Eden.AutoMorpher.ResultInfo