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