-
Notifications
You must be signed in to change notification settings - Fork 10
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
Generic Loader OTLs #121
Generic Loader OTLs #121
Conversation
Nice! HDA maintenanceI really dislike the fact that we now need to maintain multiple separate HDA definitions for something that is (or should essentially be) a node that has no uniqueness in behavior across the different contexts. It's just a node that takes input parameters to define the result on another parameter. It's quite cumbersome to update the HDA definitions if we need to do this per context - not impossible, but very annoying. This is just two contexts - but there may be way more. Maybe someone else knows how to better manage this or make the one HDA be able to be used across the different contexts without needing to handle the parameter configuration for each one separately. Let's 'figure that out' but for now hold off creating all the other ones, because it'll just mean more maintenance. Let's continue the work on these two - and then just keep 'checking' how much effort this really is to maintain. UDIM pathCurrently it'll return the resolved filepath - but there are some cases where we need it to resolve to So just noting that it may be on the todo list. Generic Loader in Loader UIIn your screenshot it's ordered at the top, let's move it down. It's the "last resort" type of loader, not the primary one to use. This can be configured with the Houdini native focusLoading from the Loader UI is fine - but our main focus with this HDA is:
|
Yeah, I think our case should be similar to the subnet nodes. since HDAs are built on top of subnets. |
I've ported the logic from the filepath loader. we may clean it later/move the logic to lib so that both file loader and hda_utils can share it. |
With the current state, I created an HDA with the loader node inside.
For reference, loading objects from different projects leads to this result. which I think is not related to this PR. |
I was able to use the generic loader in a for loop to load multiple products with the same name and different postfix number (although, I had to use a python node to change the product name and trigger the callback). |
Thanks - I see why this commit bccc305 would fix that. However, I'd love actually for somehow the menu script to stay attached to the 'inner' node in an HDA instead of also promoted. Because, that way - one wouldn't need to promote ALL relevant attributes to the parent HDA but could even (for whatever reason) promote e.g. only "Version" or whatever. The question becomes - how do you do that? In this case, how did you promote the attributes to the parent HDA? Did you copy/paste the parms? Or did you promote them upwards (which would then actually be referencing the inner parms I'd imagine?) Because we're now calling it on the "outer node" but it'd be great if we can keep all the interactions to the inner node - keeping the logic on the Generic Loader node itself. |
Yes, I copied/pasted these parms to the parent node and then copied them by reference to the inner node. This commit bccc305 allows me to copy e.g. I copied these parms to a null node and removed their callback actions. |
Correct - but it basically means the logic runs on that node. Which is what we'd like to avoid. We want it to run on the inner node preferably so that it's still contained all as logic there. Because now you need ALL those attributes exposed on the parent HDA. I'd prefer it it could also work if e.g. we ONLY expose e.g. the The question is - how can we easily make it do that without needing to be super-specific when making HDAs to remap those callbacks. |
Here's a demo for my last two commits. (I wish if I were able to avoid the noise in my street :" ) 2024-10-19.01-06-55.mp4 |
The issue here is with how you created the HDA and exposed the parameters the subnet. This is how it works absolutely fine:
So drag 'n' drop e.g. from here to root: Which just means - use the inner node's menu. So the issue was solely due to you 'copy pasting' the parameters instead of how you should be exposing the inner node's parameters upstream. So basically we shouldn't need to change anything, we can keep the We'll just need to document or provide pointers for non-senior Houdini artists that this is how they should expose these. I've played with this for a while - and it's really nice. I think we just need:
|
I've reverted the changes in f7d719c |
This commit baa2082 replaces the list of operator paths with operator list.
Although, I like the operator list less but it complies with mark tucker's comment on the side fx forums:
I also tried making an expression for the operator path parameter but it will be something like references = hou.parm('./file').parmsReferencingThis()
num = int(hou.expandString("$CH").split("_")[-1])
parm = references[num-1]
parm.node().path() |
@MustafaJafar I've made some commits to your branch - in particular it now 'replaces' the "Load filepath to node" loader. Aside of that I can't seem to get it to work that it shows me the popup panel? |
Thank you.
we only need to add: show_generic_loader_parmpanel(node) I've already add it here 5ed1357 ^^ |
Promoting the Generic Loader parametersWhen building a custom HDA that uses the generic loader, the recommended way to promote the generic loader parameters is by creating the parameters from nodes. But, you may hit an issue like this one if you promote a parameter with action, e.g. This issue is much similar when promoting some parameters (that have action callback) of the group sop node. The issue is discussed in SOP subnet parameter promotion issue | SideFx Forums
Here's a demo: permission errorTraceback (most recent call last):
File "ayon::Sop/generic_loader::1.0/product_name", line 2, in <module>
File "E:\Ynput\ayon-houdini\client\ayon_houdini\api\hda_utils.py", line 395, in on_representation_parms_changed
node.parm("representation").set(representation_id)
File "C:\PROGRA~1/SIDEEF~1/HOUDIN~1.805/houdini/python3.9libs\houpythonportion\Parm.py", line 91, in set
self._set(value)
File "C:\PROGRA~1/SIDEEF~1/HOUDIN~1.805/houdini/python3.9libs\hou.py", line 65711, in _set
return _hou.Parm__set(self, *args)
hou.PermissionError: Failed to modify node or parameter because of a permission error. Possible causes include locked assets, takes, product permissions or user specified permissions |
Show the parameter editor, set it to the node path without selecting the node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Nice work, I'd say - ready to merge!
…enhancement/generic_load_test # Conflicts: # client/ayon_houdini/api/hda_utils.py
Changelog Description
Hopefully, resolve #118
This PR mixes our solutions for LOPLoadAssetLoader and FilePathLoader resulting in the new generic loader otls.
The Generic Load OTL provides the following parameter UI to select an AYON product.
The filepath loader is now using the generic loader instead of a null node.
The generic Load OTL can be access via TAB menu. it comes with default parameter values (no products are selected at this moment).
Users can also find a parameter action
Load with AYON
whenright-click
any parameter of type file on any non Rop nodes.When using
Load with AYON
action, a parameter editor pane will pop up, where artists can easily modify the parameters.The generic Load OTL can also show you the thumbnail of the loaded product
The Generic Load OTL features:
Support contexts:
Additional Info
This PR extends our solution for
LOPLoadAssetLoader
and adds representation list so that artist can easily pick the representation to load.Additional Info 2 - Why using an HDA
An alternative solution to the Generic Loader OTL is to create a null node and add the parameters dynamically.
But, that solution requires additional work to update nodes in any old scenes.
Unlike using OTLs, OTLs make it easier to update the nodes automatically when opening the scenes.
Additional Info 3 - Promoting the Generic Loader parameters
When building a custom HDA that uses the generic loader, the recommended way to promote the generic loader parameters is by creating the parameters from nodes.
But, you may hit an issue like this one if you promote a parameter with action, e.g.
product
parameter.This issue is much similar when promoting some parameters (that have action callback) of the group sop node.
The issue is discussed in SOP subnet parameter promotion issue | SideFx Forums
and let me quote the easiest suggested solution:
Here's a demo:
I've
project
andfolder_path
parameters hidden, but they need to exist because the action script onproduct
expects them to be found on the node.Additional Info 4 - Expressions are so powerful
After using expressions instead of callbacks, This unlocked some powerful features.
e.g. I've these 3 products with different numbers
I can load them in a for loop. and it works either or not I put my nodes inside a custom HDA.
Testing notes:
right-click
file parameter on file nodes to connect it to a generic loader.