diff --git a/plugins/3d/vrml/v2/vrml2_base.cpp b/plugins/3d/vrml/v2/vrml2_base.cpp index dbce4bca1c..f97a0774a3 100644 --- a/plugins/3d/vrml/v2/vrml2_base.cpp +++ b/plugins/3d/vrml/v2/vrml2_base.cpp @@ -133,6 +133,13 @@ SGNODE* WRL2BASE::GetInlineData( const std::string& aName ) wxFileName fn; fn.Assign( tname ); + if( fn.IsRelative() && !m_dir.empty() ) + { + wxString fname = wxString::FromUTF8Unchecked( m_dir.c_str() ); + fname.append( tname ); + fn.Assign( fname ); + } + if( !fn.Normalize() ) { m_inlineModels.insert( std::pair< std::string, SGNODE* >( aName, NULL ) ); @@ -200,6 +207,7 @@ bool WRL2BASE::Read( WRLPROC& proc ) } WRL2NODE* node = NULL; + m_dir = proc.GetParentDir(); while( ReadNode( proc, this, &node ) && !proc.eof() ); diff --git a/plugins/3d/vrml/v2/vrml2_base.h b/plugins/3d/vrml/v2/vrml2_base.h index f8ab805a02..edfd8188f2 100644 --- a/plugins/3d/vrml/v2/vrml2_base.h +++ b/plugins/3d/vrml/v2/vrml2_base.h @@ -60,6 +60,7 @@ class WRL2BASE : public WRL2NODE { private: bool m_useInline; + std::string m_dir; // parent directory of the file // handle cases of USE / DEF bool implementUse( WRLPROC& proc, WRL2NODE* aParent, WRL2NODE** aNode ); diff --git a/plugins/3d/vrml/vrml.cpp b/plugins/3d/vrml/vrml.cpp index eec0cfa756..15cfc1159b 100644 --- a/plugins/3d/vrml/vrml.cpp +++ b/plugins/3d/vrml/vrml.cpp @@ -45,8 +45,8 @@ #define PLUGIN_VRML_MAJOR 1 #define PLUGIN_VRML_MINOR 3 -#define PLUGIN_VRML_PATCH 0 -#define PLUGIN_VRML_REVNO 1 +#define PLUGIN_VRML_PATCH 1 +#define PLUGIN_VRML_REVNO 0 const char* GetKicadPluginName( void )