--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/60bf2bb7-f646-429a-96c3-2d299978e1den%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/CAB8pVgKd%3DsC4k4OXKA%2Bm70xhUzy9T8AfBsDOTJoBU0B2kvwovQ%40mail.gmail.com.
Pablo Gimenez, Senior CG Technical Director
Important Looking Pirates - ILP
Email: pablo....@ilpvfx.com
I tried the Box route but the limitation I found is that I can't promote the custom plug used in NameSwitch, which is the key in this tool, you lost the plus button plug to add more connections dynamically.
So probably the most realistic way is creating a new entry menu and in the post_creator function customise the NameSwitch UI
I have to abandon what I wanted to do having the default plug on the left side and the rest optional plugs on the top
Can I programmatically in python add a new connection to the name switch, in this button I have in mind the python callback needs to create a dot node and "connect" it to the plus plug so it creates the new connection.
--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/CAB8pVgL2MgZy7w1Dz2BE3Zu9FZVswOcgKHoAqxBM8ju38RhNkg%40mail.gmail.com.
However when I promote the in plug, first I need to connect the internal Name Switch to something so it creates te in plugin
then I promote it using your code snippet, and everything seems to be ok exceptfor the fact that the new connections added at the tool level are not propagated internally and the internal name switch is adding the nodes but is missing a Box In to actually create rte connections.
A different topic, the method Im following now is creating a custom menu entry , the initial creation just add a Name Switch, then in the post_create I add a Context Query node inside the Name Switch, all work well, however when I open the file again, I got an error saying the internal Context Query node doesn't exist and the parameter I did initialised removed.
--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/CAB8pVgJy8GP6OT%2Bnu4eAe7VX7ZQQsAp6EPj_A%3Dp6HVD-QPamNg%40mail.gmail.com.
Thanks for the answers John, and sorry for bombing with questions, just trying to find the best way to develop new nodes.
The example you sent me unfortunately didn't work, got lots of errors when using it in a Reference node:
My comment about the BoxIn missing is because I thought you need a box in to establish a connection from the graph at the box node level with its internals
I started to add connection to the Box node, nex plugs are correctly created for the Box node and the internal Name switch, but the Plugs in the Box node are not connected internally, which yields the NameSwitch to be useless unfortunately.
--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/CAB8pVgLVGWv%2BjYbCQLMK16gDyCVZ1cv0RJoWrF84cpJivHUraA%40mail.gmail.com.
The differences I have found in the promoted In Plug:
- The plug name only appears for the default plug if I hover over them , in the internal NameSwitch plugs names appear correctly.
- I can't delete a Plug entry from the NodeEditor, like doing right click in the NameSwitch parameters and select Delete.
- Since inputs are hidden in the internal NameSwitch I can't connect whatever is connected to the default Plug to the passTrough plug in the BoxOut node.
--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/CAB8pVgKEjFTBoyh_PKn7C8XRT%3D6O5Xucx7m51Tiq%3DV9y_vDOyQ%40mail.gmail.com.
You could do the same, but only if you create your own node type (derived from SceneNode, with an internal NameSwitch like you've been making).
I must admit this is a bit fiddlier than I would like. I checked out what Cinesite are doing, and they've made their own C++ subclass of NameSwitch and rebound it so it can be subclassed in Python. I'm going to talk to the team about just making it subclassable in the first place...
- I cant get the plugs label to work, when you hover over then, the metadata you specified, as you said, seems can only be used on creation but is not something I can add later ( noduleLayout:label)
- Is interesting because I manage to add the deletable metadata for the plugs correctly
- I couldn't connect whatever the default plug receives in the internal NameSwitch to the passTrouch plug in the BoxOut, I tried different options with setInput() but I always get a messageabout the passTrough plug rejecting any input I assign to it. I tried this:root['ShotSwitchDev']['BoxOut']['passThrough'].setInput(root['ShotSwitchDev']['NameSwitch']['in']['in0'])
- Custom Node from scratch with uses SceneNode as base class and creates an internal NameSwitch. I didn't spent too much time with this to ne honest.I prefer not to use this route if possible, although I know is the one that gives more flexibility
I'm also looking about good ways for artists to build their own tools in Gaffer
I have no idea how to that since the In plugin still doesnt exists ...
On Wed, Sep 9, 2026 at 11:38 AM 'Pablo Gimenez Pizarro' via gaffer-dev <gaffe...@googlegroups.com> wrote:- I cant get the plugs label to work, when you hover over then, the metadata you specified, as you said, seems can only be used on creation but is not something I can add later ( noduleLayout:label)
- Is interesting because I manage to add the deletable metadata for the plugs correctlyYeah, the `deletable` metadata is different because it is just a static value. The label metadata is actually a function that computes the label on the fly. We can serialise the static values when saving to `.gfr` or `.grf` but we can't serialise the function.
- I couldn't connect whatever the default plug receives in the internal NameSwitch to the passTrouch plug in the BoxOut, I tried different options with setInput() but I always get a messageabout the passTrough plug rejecting any input I assign to it. I tried this:root['ShotSwitchDev']['BoxOut']['passThrough'].setInput(root['ShotSwitchDev']['NameSwitch']['in']['in0'])The array elements are NameValuePlugs, which have two child plugs - one for the name and one for the value (the scene in this case). You're trying to connect the whole thing, but you need to connect from just the value :root['ShotSwitchDev']['BoxOut']['passThrough'].setInput( root['ShotSwitchDev']['NameSwitch']['in'][0]["value"] )
- Custom Node from scratch with uses SceneNode as base class and creates an internal NameSwitch. I didn't spent too much time with this to ne honest.I prefer not to use this route if possible, although I know is the one that gives more flexibilityIt's also the approach which is closest to your original attempt at deriving from NameSwitch. I'm confident that this approach could be made to work, including having the labels working. More faff though for sure, which is why I've just made NameSwitch subclassable.I'm also looking about good ways for artists to build their own tools in GafferWe're big on that too - all the Gaffer pipelines I've seen make big use of it, and we use it in our own development (ContactSheet and PointInstancer are authored as Boxes before exporting them as nodes). It's just unfortunate that your first use case hit the "metadata function" limitation.
I have no idea how to that since the In plugin still doesnt exists ...I think I mentioned in an earlier message, but there's a `setup()` method on the NameSwitch that will add the plug for you, assuming you're trying to do this from the API. Here's a Switch example from our unit tests : https://github.com/GafferHQ/gaffer/blob/main/python/GafferSceneTest/SceneSwitchTest.py#L52-L53.If you can wait a few days for the next release, then my recommendation would be go back to your original approach though, and subclass NameSwitch...
--Cheers...John
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/CAB8pVgK-OPTX%2B50Vvs6Y05%3DjROFCDGuBZ-H_ncXtT%3DN2V8zGKg%40mail.gmail.com.
About this it would be great for References if they could be disguised as a proper node type....
Just going back to my first point in my previous email, is there any way to make nodes that I create inside NameSwitch, in the private area, serializable?
--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/CAB8pVgKFCefbLOC6CAhH7DZzhfoCqMzDH7DHK%2BXO0VuYrGNUmA%40mail.gmail.com.
On Wed, Sep 9, 2026 at 3:18 PM 'Pablo Gimenez Pizarro' via gaffer-dev <gaffe...@googlegroups.com> wrote:About this it would be great for References if they could be disguised as a proper node type....A Reference is a Reference, and that won't change (ignoring https://github.com/GafferHQ/gaffer/issues/5664 for a second).
But you can actually already export Boxes into custom node types - that's how ContactSheet and others end up as their own type. This is done using `Gaffer.ExtensionAlgo`. Currently it isn't exposed in the UI because we're not sure how it should interact with people's pipelines. Where would it export to? Would all nodes go in one module? Would people want to put the Box in source control and export when building (that's what we do)? But it's very much available if you want to script it up for use in your pipeline.
Just going back to my first point in my previous email, is there any way to make nodes that I create inside NameSwitch, in the private area, serializable?Not really no - the internals of nodes are private and reserved for use by the node, both now and in the future. There are plenty of options for extending Gaffer without needing to break that encapsulation...
--Cheers...John
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/CAB8pVgKFCefbLOC6CAhH7DZzhfoCqMzDH7DHK%2BXO0VuYrGNUmA%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "gaffer-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gaffer-dev/fBjSrnaQ8U0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/dc6e05c0-a61a-4bd1-a12d-9ab35c07b32an%40googlegroups.com.
This is done using `Gaffer.ExtensionAlgo`.
Ah that sounds interesting, yes I remember seen it in the changelogs, is there any doc/example about how can I use it?
Just going back to my first point in my previous email, is there any way to make nodes that I create inside NameSwitch, in the private area, serializable?Not really no - the internals of nodes are private and reserved for use by the node, both now and in the future. There are plenty of options for extending Gaffer without needing to break that encapsulation...Any suggestions? I want the Selector parameter to show the evaluation of the context variable shot, instead of using $shot.
in Houdini you can middle click on the parameter and it evaluates the expression and you can check the result but I believe there is no way to do that in Gaffer.
On Wed, Sep 9, 2026 at 6:27 PM 'Pablo Gimenez Pizarro' via gaffer-dev <gaffe...@googlegroups.com> wrote:This is done using `Gaffer.ExtensionAlgo`.Ah that sounds interesting, yes I remember seen it in the changelogs, is there any doc/example about how can I use it?We're very light on documentation, but the unit tests contain a pretty simple example of how to use ExtensionAlgo : https://github.com/GafferHQ/gaffer/blob/main/python/GafferTest/ExtensionAlgoTest.py#L55. You can also see where we use it in our own build process here, but that's more complex than you'll need because you don't have the "chicken and egg" problem it talks about : https://github.com/GafferHQ/gaffer/blob/main/SConstruct#L2089-L2128.
Just going back to my first point in my previous email, is there any way to make nodes that I create inside NameSwitch, in the private area, serializable?Not really no - the internals of nodes are private and reserved for use by the node, both now and in the future. There are plenty of options for extending Gaffer without needing to break that encapsulation...Any suggestions? I want the Selector parameter to show the evaluation of the context variable shot, instead of using $shot.As Daniel suggested, subclassing NameSwitch will allow you to have an internal node.in Houdini you can middle click on the parameter and it evaluates the expression and you can check the result but I believe there is no way to do that in Gaffer.In Gaffer you can alt+middle click for the same.
--Cheers...John
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/CAB8pVg%2B5GyXokic2Rq8CC69VHxkcoO9wPbi3aHJmkiy7dAiuEA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gaffer-dev/9c338966-fc0d-4db3-9ff8-3a33f2c51e99n%40googlegroups.com.
Got all nicely working in the custom node for the shot switch node, much better than the hack customising a NameSwitch node from a menu entry.
I have tried different names for the plug, like in0.value, or just in0, but no one works as expected