diff --git a/pype/hosts/maya/customize.py b/pype/hosts/maya/customize.py index 8bd7052d9e..cf179e1d63 100644 --- a/pype/hosts/maya/customize.py +++ b/pype/hosts/maya/customize.py @@ -70,16 +70,13 @@ def override_component_mask_commands(): def override_toolbox_ui(): """Add custom buttons in Toolbox as replacement for Maya web help icon.""" - import pype - res = os.path.join(os.path.dirname(os.path.dirname(pype.__file__)), - "res") - icons = os.path.join(res, "icons") - import avalon.tools.sceneinventory as inventory import avalon.tools.loader as loader from avalon.maya.pipeline import launch_workfiles_app import mayalookassigner + from pype.api import resources + icons = resources.get_resource("icons") # Ensure the maya web icon on toolbox exists web_button = "ToolBox|MainToolboxLayout|mayaWebButton" diff --git a/pype/hosts/nuke/utils.py b/pype/hosts/nuke/utils.py index aa5bc1077e..72c7b7bc14 100644 --- a/pype/hosts/nuke/utils.py +++ b/pype/hosts/nuke/utils.py @@ -1,6 +1,7 @@ import os import nuke from avalon.nuke import lib as anlib +from pype.api import resources def set_context_favorites(favorites={}): @@ -9,9 +10,7 @@ def set_context_favorites(favorites={}): Argumets: favorites (dict): couples of {name:path} """ - dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) - icon_path = os.path.join(dir, 'res', 'icons', 'folder-favorite3.png') - + icon_path = resources.get_resource("icons", "folder-favorite3.png") for name, path in favorites.items(): nuke.addFavoriteDir( name,