mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Get the type name from the HDA definition
This commit is contained in:
parent
74d039feb9
commit
66994e81ca
1 changed files with 8 additions and 5 deletions
|
|
@ -28,14 +28,17 @@ class HdaLoader(plugin.HoudiniLoader):
|
|||
# Get the root node
|
||||
obj = hou.node("/obj")
|
||||
|
||||
# Create a unique name
|
||||
counter = 1
|
||||
namespace = namespace or context["folder"]["name"]
|
||||
formatted = "{}_{}".format(namespace, name) if namespace else name
|
||||
node_name = "{0}_{1:03d}".format(formatted, counter)
|
||||
node_name = "{}_{}".format(namespace, name) if namespace else name
|
||||
|
||||
hou.hda.installFile(file_path)
|
||||
hda_node = obj.createNode(name, node_name)
|
||||
|
||||
# Get the type name from the HDA definition.
|
||||
hda_defs = hou.hda.definitionsInFile(file_path)
|
||||
for hda_def in hda_defs:
|
||||
type_name = hda_def.nodeTypeName()
|
||||
|
||||
hda_node = obj.createNode(type_name, node_name)
|
||||
|
||||
self[:] = [hda_node]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue