Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Creating Relative Path When Absolute Path Is Used as Input #662

Open
yuxuanzhuang opened this issue Nov 20, 2024 · 1 comment · May be fixed by #663
Open

Error Creating Relative Path When Absolute Path Is Used as Input #662

yuxuanzhuang opened this issue Nov 20, 2024 · 1 comment · May be fixed by #663
Labels
bug Something isn't working

Comments

@yuxuanzhuang
Copy link
Contributor

Describe the bug
When providing an absolute path as input to make_path_relative, the output is incorrect.

Error Codes

import os
import molecularnodes

# Error path
molecularnodes.session.make_path_relative('/Users/yzhuang/test.pdb')
> ./Users/yzhuang/test.pdb

os.path.relpath('/home/yzhuang/test.pdb')
> ../../../home/yzhuang/test.pdb

# This only works with the current working directory
molecularnodes.session.make_path_relative('/current_working_directory/test.pdb')
> ./test.pdb

Desktop (please complete the following information):

  • OS: [e.g. Windows / MacOS / Linux]: MacOS
  • Hardware: [e.g. Intel Mac, M1 Mac, x86 PC]: M1 Mac
  • Blender Version: 4.3
  • MolecularNodes Version: develop
@yuxuanzhuang yuxuanzhuang added the bug Something isn't working label Nov 20, 2024
@BradyAJohnston
Copy link
Owner

Thanks for the report! This was something that was kind of hacky and that I had meant to get back to and clean up.

@BradyAJohnston BradyAJohnston linked a pull request Nov 21, 2024 that will close this issue
@BradyAJohnston BradyAJohnston linked a pull request Nov 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants