Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created January 2, 2019 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/a2b5fc2f8f9ddeaec8a28f924728d239 to your computer and use it in GitHub Desktop.
Save zeffii/a2b5fc2f8f9ddeaec8a28f924728d239 to your computer and use it in GitHub Desktop.
def setup():
import os, bpy, pathlib
path = os.path.dirname(bpy.data.filepath)
root = pathlib.Path(bpy.app.binary_path).parent
# old way
py = os.path.join(root, "2.80", "python", "include")
build = os.path.join(path, "build")
srcs = os.path.join(path, "voro", "src")
print(f'{path}\n{root}\n{py}\n{build}\n{srcs}\n')
# using pathlib.Path
from pathlib import Path
path = Path(bpy.data.filepath).parent
root = Path(bpy.app.binary_path).parent
py = Path(root) / "2.80" / "python" / "include"
build = Path(path) / "build"
srcs = Path(path) / "voro" / "src"
print(f'{path}\n{root}\n{py}\n{build}\n{srcs}\n')
setup()
@zeffii
Copy link
Author

zeffii commented Jan 3, 2019

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment