File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
com.unity.formats.fbx/Editor Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -3438,17 +3438,23 @@ internal int ExportAll (
3438
3438
Dictionary < GameObject , IExportData > exportData )
3439
3439
{
3440
3440
exportCancelled = false ;
3441
+
3442
+ m_lastFilePath = LastFilePath ;
3441
3443
3442
3444
// Export first to a temporary file
3443
3445
// in case the export is cancelled.
3444
3446
// This way we won't overwrite existing files.
3445
- try {
3446
- m_tempFilePath = Path . GetTempFileName ( ) ;
3447
+ try
3448
+ {
3449
+ // create a temp file in the same directory where the fbx will be exported
3450
+ var exportDir = Path . GetDirectoryName ( m_lastFilePath ) ;
3451
+ var lastFileName = Path . GetFileName ( m_lastFilePath ) ;
3452
+ var tempFileName = Path . GetFileNameWithoutExtension ( Path . GetRandomFileName ( ) ) + "_" + lastFileName ;
3453
+ m_tempFilePath = Path . Combine ( new string [ ] { exportDir , tempFileName } ) ;
3447
3454
}
3448
3455
catch ( IOException ) {
3449
3456
return 0 ;
3450
3457
}
3451
- m_lastFilePath = LastFilePath ;
3452
3458
3453
3459
if ( string . IsNullOrEmpty ( m_tempFilePath ) ) {
3454
3460
return 0 ;
You can’t perform that action at this time.
0 commit comments