how can i access the path where my script is located.
for example when my addon is called my_addon and is in the folder blender/2.xx/my_addon.py
i want to give out the value of the path “blender/2.xx”
how can i access the path where my script is located.
for example when my addon is called my_addon and is in the folder blender/2.xx/my_addon.py
i want to give out the value of the path “blender/2.xx”
works, but only when installed over the user preferences and not opened in the texteditor. but that is ok.
i tried that before and i wondered that it gave me the path of the blend-file
import bpy
i = 1
for area in bpy.context.screen.areas:
if area.type == 'TEXT_EDITOR':
filepath = area.spaces[0].text.filepath
if not filepath:
filepath = "Internal"
print("Path %i: %s" % (i, filepath))