set tab shelf location properly and revert unnecessary logic

This commit is contained in:
MustafaJafar 2024-06-12 22:24:37 +03:00
parent 0fe6836b3a
commit 17ec19f506
3 changed files with 3 additions and 19 deletions

View file

@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
"""Creator plugin for creating publishable Houdini Digital Assets."""
import hou
from assettools import setToolSubmenu
import ayon_api
from ayon_core.pipeline import CreatorError
from ayon_core.lib import (
@ -109,10 +111,7 @@ class CreateHDA(plugin.HoudiniCreator):
hda_def.setUserInfo(get_ayon_username())
if pre_create_data.get("use_project"):
tool_name = hou.shelves.defaultToolName(
hda_def.nodeTypeCategory().name(), hda_def.nodeTypeName())
hou.shelves.tool(tool_name).setToolLocations(
("AYON/{}".format(self.project_name),))
setToolSubmenu(hda_def, "AYON/{}".format(self.project_name))
return hda_node

View file

@ -62,13 +62,6 @@ class HdaLoader(plugin.HoudiniLoader):
hda_node = parent_node.createNode(name, node_name)
hda_node.moveToGoodPosition()
# Set TAB Menu location interactively
# This shouldn't be needed if the Tool Location is saved in the HDA.
tool_name = hou.shelves.defaultToolName(
hda_def.nodeTypeCategory().name(), hda_def.nodeTypeName())
hou.shelves.tool(tool_name).setToolLocations(
("AYON/{}".format(context["project"]["name"]),))
# Imprint it manually
data = {
"schema": "openpype:container-2.0",

View file

@ -25,14 +25,6 @@ class ExtractHDA(plugin.HoudiniExtractorPlugin):
hda_def.setOptions(hda_options)
hda_def.save(hda_def.libraryFilePath(), hda_node, hda_options)
if instance.data["creator_attributes"].get("use_project"):
# Set TAB Menu location interactively
# This shouldn't be needed if the Tool Location is saved in the HDA.
tool_name = hou.shelves.defaultToolName(
hda_def.nodeTypeCategory().name(), hda_def.nodeTypeName())
hou.shelves.tool(tool_name).setToolLocations(
("AYON/{}".format(instance.context.data["projectName"]),))
if "representations" not in instance.data:
instance.data["representations"] = []