I've created a small addon, which wrap a much bigger addon. In the execute code, I want first to get the addon' path, add it to python path, and then import my main class and call its main function:
user_preferences = context.user_preferences addon_prefs = user_preferences.addons[__name__].preferences addon_root = os.path.abspath(addon_prefs.addon_folder) sys.path.append(addon_root) import main_addon main_addon.main(addon_prefs)
As you can see, for now I've let the user to set the addon's path in addon_prefs.addon_folder, but I want to find it automatically. Can I get the full path of my wrapper addon (both the wrapper addon and my main addon exist in the same folder), and get the folder from there? When I've tried
I got the ".../config/blender/2.76/scripts/addons" folder, which isn't the original folder.