3d: correct expanded model location

When expanding WRZ, make sure we are reading the new file and that it
has been created in the user's temporary directory.

Fixes https://gitlab.com/kicad/code/kicad/issues/5360
This commit is contained in:
Seth Hillbrand 2020-08-25 12:32:26 -07:00
parent b863beaaf6
commit a8ade66fb6
1 changed files with 3 additions and 1 deletions

View File

@ -169,6 +169,8 @@ SCENEGRAPH* LoadVRML( const wxString& aFileName, bool useInline )
{ {
wxFileInputStream ifile( aFileName ); wxFileInputStream ifile( aFileName );
tmpfilename = wxFileName( aFileName ); tmpfilename = wxFileName( aFileName );
tmpfilename.SetPath( wxStandardPaths::Get().GetTempDir() );
tmpfilename.SetExt( "WRL" ); tmpfilename.SetExt( "WRL" );
wxFileOffset size = ifile.GetLength(); wxFileOffset size = ifile.GetLength();
@ -200,7 +202,7 @@ SCENEGRAPH* LoadVRML( const wxString& aFileName, bool useInline )
{ {
// set the max char limit to 8MB; if a VRML file contains // set the max char limit to 8MB; if a VRML file contains
// longer lines then perhaps it shouldn't be used // longer lines then perhaps it shouldn't be used
modelFile = new FILE_LINE_READER( aFileName, 0, 8388608 ); modelFile = new FILE_LINE_READER( filename, 0, 8388608 );
} }
catch( IO_ERROR & ) catch( IO_ERROR & )
{ {