Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2350 from pypeclub/bugfix/OP-2081_houdini-create-hda
Browse files Browse the repository at this point in the history
Houdini: Fix HDA creation
  • Loading branch information
antirotor authored Dec 23, 2021
2 parents 2ea6da4 + 8f427dc commit d9bdf00
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
26 changes: 10 additions & 16 deletions openpype/hosts/houdini/plugins/create/create_hda.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,14 @@ def _process(self, instance):
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.
Expand All @@ -69,13 +64,12 @@ def _process(self, instance):
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)
Expand Down
2 changes: 1 addition & 1 deletion repos/avalon-core
2 changes: 1 addition & 1 deletion repos/avalon-unreal-integration

0 comments on commit d9bdf00

Please sign in to comment.