In this Blender tutorial, you will learn how to get the path to a file that is located next to the script when running it in different ways, including from Blender’s Text Editor, the command line, and from an add-on.
Final Code
https://gist.github.com/CGArtPython/9e7affc6028ad087e9b71f17ba7bd1f3
00:00 – Intro
00:20 – Trying to use __file__
02:20 – Getting the script file path in Blender’s Text Editor
03:42 – Supporting Blender’s Text Editor and the command line
04:40 – Get the folder path where the script is
05:24 – Get a path to a file next to the script
#blender #python #scripting #tutorial #tip