mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #2350 from pypeclub/bugfix/OP-2081_houdini-create-hda
Houdini: Fix HDA creation
This commit is contained in:
commit
d9bdf007b8
3 changed files with 12 additions and 18 deletions
|
|
@ -45,19 +45,14 @@ class CreateHDA(plugin.Creator):
|
|||
if (self.options or {}).get("useSelection") and self.nodes:
|
||||
# if we have `use selection` enabled and we have some
|
||||
# selected nodes ...
|
||||
to_hda = self.nodes[0]
|
||||
if len(self.nodes) > 1:
|
||||
# if there is more then one node, create subnet first
|
||||
subnet = out.createNode(
|
||||
"subnet", node_name="{}_subnet".format(self.name))
|
||||
to_hda = subnet
|
||||
else:
|
||||
# in case of no selection, just create subnet node
|
||||
subnet = out.createNode(
|
||||
"subnet", node_name="{}_subnet".format(self.name))
|
||||
subnet = out.collapseIntoSubnet(
|
||||
self.nodes,
|
||||
subnet_name="{}_subnet".format(self.name))
|
||||
subnet.moveToGoodPosition()
|
||||
to_hda = subnet
|
||||
|
||||
else:
|
||||
to_hda = out.createNode(
|
||||
"subnet", node_name="{}_subnet".format(self.name))
|
||||
if not to_hda.type().definition():
|
||||
# if node type has not its definition, it is not user
|
||||
# created hda. We test if hda can be created from the node.
|
||||
|
|
@ -69,13 +64,12 @@ class CreateHDA(plugin.Creator):
|
|||
name=subset_name,
|
||||
hda_file_name="$HIP/{}.hda".format(subset_name)
|
||||
)
|
||||
hou.moveNodesTo(self.nodes, hda_node)
|
||||
hda_node.layoutChildren()
|
||||
elif self._check_existing(subset_name):
|
||||
raise plugin.OpenPypeCreatorError(
|
||||
("subset {} is already published with different HDA"
|
||||
"definition.").format(subset_name))
|
||||
else:
|
||||
if self._check_existing(subset_name):
|
||||
raise plugin.OpenPypeCreatorError(
|
||||
("subset {} is already published with different HDA"
|
||||
"definition.").format(subset_name))
|
||||
hda_node = to_hda
|
||||
|
||||
hda_node.setName(subset_name)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 4f10fb1255beb156f23afa1bb8362dfc53d0c6f8
|
||||
Subproject commit ffe9e910f1f382e222d457d8e4a8426c41ed43ae
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 8529332aeddddc0bfccc7b1455ce0fa0aa571da9
|
||||
Subproject commit 43f6ea943980b29c02a170942b566ae11f2b7080
|
||||
Loading…
Add table
Add a link
Reference in a new issue