File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -123,8 +123,26 @@ public override void OnInspectorGUI() {
123
123
string mayaPath = EditorUtility . OpenFilePanel ( "Select Maya Application" , ExportSettings . kDefaultAdskRoot , ext ) ;
124
124
125
125
// check that the path is valid and references the maya executable
126
- if ( ! string . IsNullOrEmpty ( mayaPath ) &&
127
- Path . GetFileNameWithoutExtension ( mayaPath ) . ToLower ( ) . Equals ( "maya" ) ) {
126
+ if ( ! string . IsNullOrEmpty ( mayaPath ) ) {
127
+ if ( ! Path . GetFileNameWithoutExtension ( mayaPath ) . ToLower ( ) . Equals ( "maya" ) ) {
128
+ // clicked on the wrong application, try to see if we can still find
129
+ // maya in this directory.
130
+ var mayaDir = new DirectoryInfo ( Path . GetDirectoryName ( mayaPath ) ) ;
131
+ var files = mayaDir . GetFiles ( "*." + ext ) ;
132
+ bool foundMaya = false ;
133
+ foreach ( var file in files ) {
134
+ var filename = Path . GetFileNameWithoutExtension ( file . Name ) . ToLower ( ) ;
135
+ if ( filename . Equals ( "maya" ) ) {
136
+ mayaPath = file . FullName . Replace ( "\\ " , "/" ) ;
137
+ foundMaya = true ;
138
+ break ;
139
+ }
140
+ }
141
+ if ( ! foundMaya ) {
142
+ Debug . LogError ( string . Format ( "Could not find Maya at: \" {0}\" " , mayaDir . FullName ) ) ;
143
+ return ;
144
+ }
145
+ }
128
146
ExportSettings . AddMayaOption ( mayaPath ) ;
129
147
Repaint ( ) ;
130
148
} else {
You can’t perform that action at this time.
0 commit comments