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

Support publishing and loading node presets #70

Conversation

MustafaJafar
Copy link
Contributor

@MustafaJafar MustafaJafar commented Aug 9, 2024

Changelog Description

Fixes #68, This PR Implements publishing and loading node presets.
A node preset is simple serialization of subset of values on ROP node

There are still some edge cases to handle (e.g. animated parameters) and some code improvements, but that doesn't affect reviewing the suggested workflow, shown in the demo video below.

Additional info

Render setups in Houdini can be

  1. a collection of nodes (you can call it: a scene fragment, or a part of a node graph)
    This is partially solved by publishing HDAs as we can publish HDAs from different Houdini contexts.
    Also, we can use CPIO which should work in a similar manner as publishing node presets.
  2. a node preset of my render rop node. (which is solved by this PR)

Additional info 2

The new recopies system is an alternative solution to creating the node preset json file ourselves.
But, this is a topic for the future as it's only supported in Hou 20.5
https://www.sidefx.com/docs/houdini/network/recipes.html

Demo

2024-08-09.19-08-44.mp4

Testing notes:

Publishing:

  1. Create a node preset
  2. Update Source node parameter
  3. Publish
    Loading:
  4. Load a preset through the loader
  5. Mange its version via inventory
  6. Update target node parameter
  7. Click Apply Preset

@MustafaJafar MustafaJafar added type: feature Adding something new and exciting to the product sponsored This is directly sponsored by a client or community member labels Aug 9, 2024
@MustafaJafar MustafaJafar self-assigned this Aug 9, 2024
import hou


def _update_node_parmtemplate(node, defaults):
Copy link
Member

@moonyuet moonyuet Aug 12, 2024

Choose a reason for hiding this comment

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

A question: Does this function imprint the data into the instance_node already? (Or it is like the temp data publisher and it won't imprint the instance data?)
i.e. some variables you can find in almost every creator and they are missing in this creator.

            instance = CreatedInstance(
                self.product_type,
                product_name,
                instance_data,
                self)
            self._add_instance_to_context(instance)
            self.imprint(instance_node, instance.data_to_store())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The method _update_node_parmtemplate doesn't create the extra ayon parameters created by imprint.
It actually doesn't create any parameters at all.
It only captures the values of any existent parameters (including ayon extra parameters) from the source node and reassigns these values to the target node.


I have that feeling that the method name should be refactored but I couldn't come up with a better name :/

Copy link
Member

Choose a reason for hiding this comment

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

I remember @BigRoy has written a one-time publish node(along with the generic nodes for publishing). Maybe he can give some maps on this.

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.

I gave this PR a whirl - I guess it does what it says.

You can:

  1. Create a 'fake' ROP node that will generate a .json dump of the parms of the node specified on that ROP.
  2. Publish that to write the .json file.
  3. Load that to create another null placeholder node pointing to that published preset.
  4. Click a button on that node to apply the preset.

YET - I really don't see the point myself. 😕

  1. It works for ONE node only
  2. If this is intended as presets for ROPs - which are also our publish instance nodes... applying the preset also overrides the target folder, target task, etc.
  3. The node stored in the scene that applies the presets I really don't see any reason for. The only upside of that is that you can see in manager which preset is 'loaded' however that is very unlikely the case. Once you load it, you need to apply it manually separately... and even if anyone changes any parameters - you have no clue whether the node applied to still matches the preset.

Also, we're basically matching Houdini's own 'presets' (which are odd files, sure) but I just don't grasp what this would solve over their system.

The Houdini presets can also be saved and shared within a project location.


If for whatever reason anyone really likes this and we want to add it. I'd kill the way it loads.

Just apply the preset via the loader to selected nodes - no manage, no custom loaded nodes that you need to browse and configure, etc.

If you really want to go crazy write some "node menu" customization that allows you to add an AYON Presets submenu on a node that basically lists all presets in the project or whatever.
image

But even then - I feel like we're way overthinking this. I just don't get it.

Also, there are some "preset managers" tools for Houdini out there that can do some pretty slick stuff.


There's also so much goodies in Houdini 20.5 that do this, but more... I really feel like it's time wasted if we just don't adopt in that direction now if we want to go crazy with some nice stuff and "live with just a preset manager or houdini presets" for now.

There's some good API, docs on recipes and even nodes have asData() methods.

For this to be anywhere user-friendly I think we also need to define for the ticket/issue more the production use cases.

  • How often do you apply a preset?
  • Do you switch them around?
    etc.

I have a feeling that now, going through the loader to find them, which then loads a node, that I need to configure, etc. I've already spend so much time that could've just been a single click on the node itself using other tools - like e.g. Houdini's own preset system (which also sucks, but it has basically the same feature set, exports all parms and reapplies all parms)

@BigRoy
Copy link
Contributor

BigRoy commented Sep 5, 2024

Just noting there that this started from a client request but was put on hold for now - potentially in favor of Houdini 20.5+ Recipes in the future.

@MustafaJafar MustafaJafar marked this pull request as draft September 13, 2024 16:58
@MustafaJafar
Copy link
Contributor Author

After some discussion, we decided to close this PR in favor of Houdini 20.5+ Recipes.

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: feature Adding something new and exciting to the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Render Setup Workflow alternative for Houdini
3 participants