Skip to content

Commit

Permalink
Merge pull request #321 from AlpenAalAlex/simple_walker
Browse files Browse the repository at this point in the history
Fix simple_walker's sensor rotation, fix relative paths under Windows
  • Loading branch information
hwiedPro authored Sep 21, 2023
2 parents c7bc799 + 850e75e commit 221b6b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Binary file modified models/simple_walker_finished.blend
Binary file not shown.
2 changes: 1 addition & 1 deletion phobos/io/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def __init__(self, name=None, filepath=None, posix_path=None, image=None, **kwar
self.image = image
self.input_type = "img"
if BPY_AVAILABLE and isinstance(image, bpy.types.Image):
self.input_file = os.path.normpath(bpy.path.abspath(misc.sys_path(image.filepath)))
self.input_file = os.path.normpath(misc.sys_path(bpy.path.abspath(image.filepath)))
self.input_type = "img_bpy"
if self.unique_name is None:
self.unique_name, ext = os.path.splitext(image.name)
Expand Down
5 changes: 4 additions & 1 deletion phobos/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def sys_path(path):
if path is None:
return path
if platform.system() == "Windows":
return path.replace("/", "\\")
if path.startswith("//"): # Handles Blender's relative paths
return "//" + path[2:].replace("/", "\\")
else:
return path.replace("/", "\\")
else:
return path.replace("\\", "/")

Expand Down

0 comments on commit 221b6b3

Please sign in to comment.