How to identify Factory Nodes shipped with Houdini?

   426   1   1
User Avatar
Member
900 posts
Joined: 2月 2016
Offline
Is there a Python method in Houdini to determine whether a node is built-in or external, such as a SideFX LABS tool, a custom HDA, or from another external toolset?

This information is crucial for communicating the required dependencies when releasing a digital asset to the public.
User Avatar
Member
1906 posts
Joined: 11月 2006
Offline
There's no super simple and straightforward way, but it's doable. Everything revolves around hou.OpNodeType and whether it's a digital asset definition, as well as the hou.nodeTypeSource value.

- Check if the node type has a non-None definition (hou.OpNodeType.definition()). If it is not none then the node type is an HDA. From there you can basically determine if the hou.HDADefinition.libraryFilePath() starts with the value of $HFS and is thus inside the install directory and is shipped with Houdini. If you want to be more specific and say tell if something is shipped as a "package" like SideFXLabs, kinefx, etc, you could be more specific and check that it starts with $HH or $HFS/packages to determine how it's included in the Houdini install.
- If something isn't a digital asset then that basically means it's a compiled node. You can get the return value of hou.OpNodeType.source() and compare that to the enum values.
- hou.nodeTypeSource.Internal generally means that the operator is defined internally in one of Houdini's libraries and a call to hou.OpNodeType.sourcePath() will return "Internal".
- A custom compiled operator will generally give you hou.nodeTypeSource.CompiledCode and sourcePath() will point to the actual file on disk.

There are some other possible things I think, usually to do with compiled shader stuff (other enum values for hou.nodeTypeSource) but the above is general for most cases and I've used such logic before for determining the dependencies and sources.
Edited by graham - 2023年11月13日 11:18:10
Graham Thompson, Technical Artist @ Rockstar Games
  • Quick Links