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

Create correct Hdas from Subnetworks, keeping Parms, Outputs and Inputs. #160

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

Lypsolon
Copy link

@Lypsolon Lypsolon commented Nov 5, 2024

Changelog Description

This PR automatically detects how many outputs are present in an subnet and how many inputs are connected to any node. it also moves all the parms from a subnet over to the generated hda.
the Parms, inputs and outputs are kept intact when generating an HDA from an Subnet by copy pasting them over.

  • test if some expressions might get broken by copy pasting them.

Additional review information

Old Behavior

  • when creating an HDA from an Subnet the outputs of the hda will be set to 1 and the inputs to 0.
  • when creating an HDA from a Subnet the parms will be deleted.
  • if you change the inputs of the HDA from the type definition the inputs will survive into the published hda

New Behavior

  • check the indirect inputs of the selected subnet and check if those inputs have a node connected to them. we will then count the subnet inputs that have a node connected (inside the subnet not tpo layer) and set the max inputs of the HDA.
  • we then collect the Output nodes and check if there index is unique (Houdini dose not allow you to create multiple output nodes with the same index but you could create them and then create a HDA this would then internally error.) from this list we then set the HDA outps (we need to set the HDA outputs in there HDA definition after the creation because Houindi dose not offer a parameter in the .CreateHda() function from hou.Node class
  • we copy the parameter template from the source subnet into a tempVar before we create the hda from it. then we simply add the template onto the hda definition.

Testing notes:

  1. Create a subnet add a few output nodes and connect what ever you want to the input nodes of the subnet(internally not the external ones)
  2. Ayon -> Create -> Create HDA
  3. check if all your connections still function correctly and if the right inputs outputs and prams exist. also check if relative parm references and parm expressions still work as expected.

extra points:

  • create an hda from a selection of nodes and check if this works.

@Lypsolon Lypsolon linked an issue Nov 5, 2024 that may be closed by this pull request
Copy link
Contributor

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct that this draft PR is ONLY code style changes currently - or what am I missing?

@BigRoy BigRoy added type: enhancement Improvement of existing functionality or minor addition sponsored This is directly sponsored by a client or community member labels Nov 5, 2024
@Lypsolon
Copy link
Author

Lypsolon commented Nov 6, 2024

Is it correct that this draft PR is ONLY code style changes currently - or what am I missing?

i always create a PR right away, this is how GitLab works and i believe its simply better in all ways.

also i forgot to push the changes yesterday.

@Lypsolon Lypsolon marked this pull request as ready for review November 6, 2024 08:50
@Lypsolon Lypsolon changed the title Export HDAs correctly Create correct Hdas from Subnetworks, keeping Parms, Outputs and Inputs. Nov 6, 2024
…ected subnet, add docstrings for the input and parm template logic.
@MustafaJafar
Copy link
Contributor

Hello,
I've created another PR #172 based on the changes on this PR.

@MustafaJafar MustafaJafar marked this pull request as draft November 15, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AY-6728_Keep additional parameters as inputs on HDA publish
3 participants