Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Houdini: Cannot import name 'setToolSubmenu' from 'assettools' #697

Closed
2 tasks done
BigRoy opened this issue Jun 25, 2024 · 2 comments · Fixed by #698
Closed
2 tasks done

Houdini: Cannot import name 'setToolSubmenu' from 'assettools' #697

BigRoy opened this issue Jun 25, 2024 · 2 comments · Fixed by #698
Assignees
Labels
type: bug Something isn't working

Comments

@BigRoy
Copy link
Collaborator

BigRoy commented Jun 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior:

Recently the CreateHDA logic has been changed to use a assettools.setToolSubmenu function. However, in Houdini 20.0.724 I'm getting this error:

WARNING:ayon_core.lib.python_module_tools:Failed to load path: "E:\dev\ayon-core\server_addon\houdini\client\ayon_houdini\plugins\create\create_hda.py"
Traceback (most recent call last):
  File "E:\dev\ayon-core\client\ayon_core\lib\python_module_tools.py", line 92, in modules_from_path
    module = import_filepath(full_path, mod_name)
  File "E:\dev\ayon-core\client\ayon_core\lib\python_module_tools.py", line 38, in import_filepath
    module_loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "E:\dev\ayon-core\server_addon\houdini\client\ayon_houdini\plugins\create\create_hda.py", line 4, in <module>
    from assettools import setToolSubmenu
ImportError: cannot import name 'setToolSubmenu' from 'assettools' (C:\PROGRA~1/SIDEEF~1/HOUDIN~1.724/houdini/python3.10libs\assettools.py)

The relevant PR that added the import is #644

Expected Behavior:

It should not error.

Version

1.0.0

What platform you are running on?

Windows

Steps To Reproduce:

  1. Launch Houdini 20.0.742 in AYON
  2. Check output in Houdini console.
  3. In publisher create tab the "Create HDA" also is not listed (because it errors)

Are there any labels you wish to add?

  • I have added the relevant labels to the bug report.

Relevant log output:

WARNING:ayon_core.lib.python_module_tools:Failed to load path: "E:\dev\ayon-core\server_addon\houdini\client\ayon_houdini\plugins\create\create_hda.py"
Traceback (most recent call last):
  File "E:\dev\ayon-core\client\ayon_core\lib\python_module_tools.py", line 92, in modules_from_path
    module = import_filepath(full_path, mod_name)
  File "E:\dev\ayon-core\client\ayon_core\lib\python_module_tools.py", line 38, in import_filepath
    module_loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "E:\dev\ayon-core\server_addon\houdini\client\ayon_houdini\plugins\create\create_hda.py", line 4, in <module>
    from assettools import setToolSubmenu
ImportError: cannot import name 'setToolSubmenu' from 'assettools' (C:\PROGRA~1/SIDEEF~1/HOUDIN~1.724/houdini/python3.10libs\assettools.py)

Additional context:

No response

@BigRoy BigRoy added the type: bug Something isn't working label Jun 25, 2024
@BigRoy
Copy link
Collaborator Author

BigRoy commented Jun 25, 2024

For what it's worth. assettools does exist in Hou 20.0.724 and has a setTabSubMenu function.

>>> help(assettools.setTabSubMenu)
Help on function setTabSubMenu in module assettools:

setTabSubMenu(defn: 'hou.HDADefinition', menu_name: 'str')

More details:

>>> print(dir(assettools))
['ADDITIVE_CONFIG_KEYS', 'ASSET_NAME_CHARS', 'AUTHOR_COLOR', 'Any', 'AssetMessage', 
'AssetNameEditor', 'AssetNameHighlighter', 'BASENAME_COLOR', 'BIG_MARGIN', 'BIG_TEXT
_SIZE', 'BLANK_ICON', 'BRANCH_COLOR', 'CATEGORY_NAMES', 'CHECKBOX_HEIGHT', 'CONFIG_F
ILE_NAME', 'CONFIG_SAVE_PATH', 'CONTROL_HEIGHT', 'CUSTOM_PATTERN_DATA', 'Callable', 
'CollapseHeader', 'Collapser', 'CollapsingSection', 'ConfigDict', 'EDIT_VALUE', 'EXC
LUDE_NAMESPACES', 'HDA_LIB_EXTENSIONS', 'HFS_PATH', 'ICON_BUTTON_SIZE', 'INSTALL_DIR
S', 'Iterable', 'LINK_COLOR', 'LINK_HEX', 'LinkLine', 'MANUAL_PATTERN_DATA', 'MEDIUM
_TEXT_SIZE', 'MENU_OBJECT_TYPE', 'MENU_WIDTH', 'MIN_POPUP_WIDTH', 'MONOSPACE_FONT_FA
MILY', 'MessageBoard', 'Method', 'NAMING_SCHEMES', 'NS_PART_SEP', 'NamePart', 'Named
Tuple', 'NamespaceListEditor', 'Optional', 'PLACEHOLDER_COLOR', 'PartSpec', 'Qt', 'Q
tCore', 'QtGui', 'QtWidgets', 'SCOPE_COLOR', 'SECTION_BG_COLOR', 'SECTION_MARGIN', '
SMALL_ICON_SIZE', 'SMALL_MARGIN', 'SMALL_TEXT_SIZE', 'Sequence', 'SuffixedLineEdit',
 'T', 'TINY_MARGIN', 'TINY_TEXT_SIZE', 'TypeVar', 'TypedDict', 'USER_ASSETS_DIR', 'U
SER_PREFS_DIR', 'USER_PREFS_PATH', 'Union', 'VERSION_COLOR', 'VHDASaveDialog', 'Vers
ionSpec', '__annotations__', '__builtins__', '__cached__', '__doc__', '__file__', '_
_loader__', '__name__', '__package__', '__spec__', 'allTabSubMenus', 'annotations', 
'assetMessageBoard', 'assetTabSubMenu', 'assetTabSubMenus', 'authorPartOfNs', 'autho
rPresets', 'branchPartOfNs', 'branchPresets', 'branchSuffix', 'cast', 'copy', 'creat
eAssetFromSubnet', 'createDefaultTool', 'createVHDA', 'dataclasses', 'dedup', 'defau
ltAuthor', 'defaultBranch', 'defaultConfig', 'enum', 'expandFileNamePattern', 'expan
dedPath', 'expandedPathString', 'findExistingAuthors', 'findExistingBranches', 'find
ExistingNamespaceParts', 'freshConfig', 'hou', 'increaseMajorNumber', 'increaseMajor
Version', 'increaseMinorNumber', 'increaseMinorVersion', 'increaseNumericString', 'i
sOnHoudiniPath', 'isUnderHfs', 'json', 'loadConfig', 'loadUserConfig', 'locationPres
ets', 'menu_tooltip', 'nameParts', 'name_badchars_expr', 'name_var_expr', 'ns_delim_
expr', 'ns_parts_expr', 'num_suffix_expr', 'os', 'part_color', 'part_desc', 'part_to
oltip', 'partitionNs', 'pathVarsExist', 'pathlib', 'random', 're', 'removeBranchSuff
ix', 'saveAs', 'saveConfig', 'setComboboxToData', 'setTabSubMenu', 'showHelp', 'stri
ng', 'traceback', 'valid_name_expr', 'versionSpecFromString']

It seems that somewhere assettools.setToolSubmenu may have been replaced with assettools.setTabSubMenu in Houdini.

@MustafaJafar
Copy link
Contributor

It seems that somewhere assettools.setToolSubmenu may have been replaced with assettools.setTabSubMenu in Houdini.

Yeah, I think the same.
I didn't know/expect that these libs change frequently.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants