feat(sdk): addon asset path resolution — addon_resource() (#389) #401
Reference in New Issue
Block a user
Delete Branch "feat/sdk-addon-resource"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Standard way for addons to locate their bundled assets (icons, translations, data files) without hardcoding paths.
Changes
addon_resource(name, relative_path)function that:AddonManifestfromFreeCAD.KindredAddonsmanifest.addon_rootwith the relative pathLookupErrorif addon not registered,FileNotFoundErrorif path missingaddon_resourceUsage
Replaces fragile
os.path.dirname(__file__)patterns scattered across addons.Closes #389