ynput / ayon-core

Apache License 2.0
18 stars 30 forks source link

Houdini: Custom parameters disappear after publishing #624

Closed MustafaJafar closed 3 weeks ago

MustafaJafar commented 4 weeks ago

Is there an existing issue for this?

Current Behavior:

Custom parameters add to HDAs disappears after publishing.

Expected Behavior:

They shouldn't disappear and keep the references correctly.

Version

1.0.0

What platform you are running on?

Windows

Steps To Reproduce:

  1. Create an HDA in Houdini using publisher.
  2. Add custom parameters
  3. Publish HDA
  4. Load it in a new scene or even create it from tab menu in the same scene

Are there any labels you wish to add?

Relevant log output:

No response

Additional context:

Here are the result of replicating this issue on my side: I was able to replicate the issue. In my screenshot: I created an HDA with three custom parameters

  1. Primitive Type: which is referenced by a parameter inside the HDA
  2. Rotation: which references a parameter inside the HDA
  3. Uniform scale: which is referenced by a parameter inside the HDA.

after publishing, I found out that Rotation parameter has disappeared. Also, my default values disappeared.

do you have a workaround for this?

I found something that works.

  1. Reference the parameters inside the HDA.
  2. After publishing, open Type Properties... and apply then revert layout. This will keep the parameters in the same folder.

Unfortunately, Default values still disappears including references to parameters inside.

image image image

MustafaJafar commented 3 weeks ago

Hey, I furtherly explored this issue. It a nutshell, this issue can be solved without modifying any thing in the code. we are also able to force some practice. however, it may work for a studio and doesn't work for another.

On my side, in ayon-core develop branch, custom parameters disappear only if I added them using Edit Parameter Interface... instead of Type Properties... and there are also some notes about parameters relative references.

In essence, I add my parameters from Type Properties... window and then click Apply and Revert Layout. Animation_69

Relative References

As far as I know, There are two cases:

Referenced by a parameter

It happens when a parameter on an inner node references a parameter on the HDA itself. e.g. size parameter on the HDA is referenced by size parameter on box node (which is inside the HDA). This one should work out of the box publishing and loading the HDA. image

References a parameter

It happens when a parameter on the HDA references a parameter on an inner node. e.g. Uniform Scale parameter on the HDA references Uniform Scale on box node (which is inside the HDA). image This one won't work until you set the default value of the parameter to the expression in Type Properties... This is not an issue in ayon-houdini addon but it's an issue in Houdini itself. check HDA creation - parameters relative reference problem. image

Did I missed something ? yeah, definitely! After loading, you'll notice that you are not able to change the value of the parameter because the HDA is locked and you need to right-click it and select Allow Editing of Contents. Animation_70

Alternatively, you can add your inner node to Editable Nodes before publishing the HDA. In my screenshot, I rearranged my HDA contents and moved them all to a subnetwork called {hda_name}_editable. Then, I added it to Editable Nodes and Dive Target. image

and here's a demo where I didn't have to select Allow Editing of Contents which I find more intuitive. Animation_71

BigRoy commented 3 weeks ago

I have a feeling you're basically describing how HDAs work - and that all of these are not errors on the publishing itself.

On my side, in ayon-core develop branch, custom parameters disappear only if I added them using Edit Parameter Interface... instead of Type Properties... and there are also some notes about parameters relative references.

Honestly - this is expected behavior because those would be attributes that are NOT inside the HDA definition. I'd expect that to happen knowing how HDAs work.

This one won't work until you set the default value of the parameter to the expression in Type Properties... This is not an issue in ayon-houdini addon but it's an issue in Houdini itself.

Again, this for me is expected behavior. No matter what values you set on the subnet itself - if you want to propagate those to a resulting HDA it would mean you'd need to make those the default values.

Wasn't there a way to 'force set current value to default value' for HDAs? I recall seeing that in context menus somewhere.

I'm not sure if that "Make current value default" works on the type properties or the current instance's properties.

image

If that works, that'd be an easier way to do so instead of having to go through the type parameters interface.

Did I missed something ? yeah, definitely! After loading, you'll notice that you are not able to change the value of the parameter because the HDA is locked and you need to right-click it and select Allow Editing of Contents.

Actually, I believe you should be able to "remove the expression" by right-mouse click "Delete Channels" (Ctrl+Shift+LMB) since then the expression connection wouldn't be there.

Dive targets however are especially useful if you want to "build" something internally that's used elsewhere in the HDA. Like e.g. could be useful for certain look building templates or alike.

MustafaJafar commented 3 weeks ago

I have a feeling you're basically describing how HDAs work - and that all of these are not errors on the publishing itself.

This is how I felt after exploring the issue. Also, I wonder if there's anything we can do to help artists avoid this issue. knowing the fact that this is not a bug but rather this how it works.

BigRoy commented 3 weeks ago

Also, I wonder if there's anything we can do to help artists avoid this issue. knowing the fact that this is not a bug but rather this how it works.

We could have a validator that spews out warnings during publishing for parms that are not at their default values that those will not be propagated. But admittedly - you might also just 'assume' a Houdini artists is familiar enough in that area so it may not be worth the coding time spent for that. But that could e.g. report:

If it's a problem for studios that could be a more stricter validation that errors and has a "Set current as default values" or "Revert to defaults" for the artist to pick.

But as said, you'd be implementing code that'd need to be maintained but we're basically almost making a guided tutorial on how Houdini works so I'm not sure if it's a valid time investment.


We could also swap the idea around and have a toggle on the instance that says "Use current values as default values for the HDA" and then the Extractor could secretly set those as default for the properties, write the HDA, and revert so that nothing in the workfile changes and the user doesn't have to care about type properties, etc.

But it'd involve quite some logic and feels a bit like abusing Houdini HDA workflows and 'simplifying' it but it may be nice for those very simple cases where an artists just wants to publish EXACTLY what they're seeing.

MustafaJafar commented 3 weeks ago

I have a feeling you're basically describing how HDAs work - and that all of these are not errors on the publishing itself. We could have a validator that spews out warnings during publishing for parms that are not at their default values that those will not be propagated. But admittedly - you might also just 'assume' a Houdini artists is familiar enough in that area so it may not be worth the coding time spent for that.

Let's close this issue taking into consideration that there are not any demand (by clients and community) for developing the suggested solutions. It's considered to add a note about it in the documentation.