@@ -82,6 +82,19 @@ protected override void OnEnable ()
82
82
m_prefabExtLabelWidth = m_fbxExtLabelStyle . CalcSize ( new GUIContent ( ".prefab" ) ) . x ;
83
83
}
84
84
85
+ protected bool ExportSetContainsAnimation ( )
86
+ {
87
+ foreach ( var obj in ToExport )
88
+ {
89
+ var go = ModelExporter . GetGameObject ( obj ) ;
90
+ if ( go . GetComponentInChildren < Animation > ( ) || go . GetComponentInChildren < Animator > ( ) )
91
+ {
92
+ return true ;
93
+ }
94
+ }
95
+ return false ;
96
+ }
97
+
85
98
protected override bool Export ( )
86
99
{
87
100
if ( string . IsNullOrEmpty ( m_exportFileName ) ) {
@@ -107,11 +120,16 @@ protected override bool Export ()
107
120
108
121
if ( SettingsObject . UseMayaCompatibleNames && SettingsObject . AllowSceneModification )
109
122
{
123
+ string warning = "Names of objects in the hierarchy may change with the Compatible Naming option turned on" ;
124
+ if ( ExportSetContainsAnimation ( ) )
125
+ {
126
+ warning = "Compatible Naming option turned on. Names of objects in hierarchy may change and break animations." ;
127
+ }
128
+
110
129
// give a warning dialog that indicates that names in the scene may change
111
130
int result = UnityEditor . EditorUtility . DisplayDialogComplex (
112
- string . Format ( "{0} Warning" , ModelExporter . PACKAGE_UI_NAME ) ,
113
- "Names of objects in the hierarchy may change with the Compatible Naming option turned on" ,
114
- "OK" , "Turn off and convert" , "Cancel" ) ;
131
+ string . Format ( "{0} Warning" , ModelExporter . PACKAGE_UI_NAME ) , warning , "OK" , "Turn off and convert" , "Cancel"
132
+ ) ;
115
133
if ( result == 1 )
116
134
{
117
135
// turn compatible naming off
0 commit comments