浏览代码

Merge pull request #60 from sdfgeoff/master

Fixes issue with material search materials now showing on windows
sdfgeoff 7 年之前
父节点
当前提交
9238888d70
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      io_scene_godot/structures.py

+ 4 - 1
io_scene_godot/structures.py

@@ -221,10 +221,13 @@ class ExternalResource(FileEntry):
 
     def fix_path(self, export_settings):
         """Makes the resource path relative to the exported file"""
+        # The replace line is because godot always works in linux
+        # style slashes, and python doing relpath uses the one
+        # from the native OS
         self.heading['path'] = os.path.relpath(
             self.heading['path'],
             os.path.dirname(export_settings["path"]),
-        )
+        ).replace('\\', '/')
 
 
 class InternalResource(FileEntry):