Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Creating Multiple String Plugs on the Node Using a Loop Expression

103 views
Skip to first unread message

Sudarshan Havale

unread,
Aug 12, 2024, 11:35:49 AM8/12/24
to gaffer-dev
Hello Everyone,

Is it possible to create multiple string plugs on a node using a loop expression? I want to add each AOV filename path into the `ArnoldRender` node's Deadline settings using plug names like `OutputDirectory1`, `OutputDirectory2`, `OutputDirectory3`, and so on.

For example below snippet can be executed from python editor but .addChild is not available in the expression node

```
plug_name = 'OutputDirectory1'
plug_value = '/aov1/output/path/filename.ext'

root["ArnoldRender"]["dispatcher"]["deadline"]["deadlineSettings"].addChild( Gaffer.NameValuePlug( plug_name, Gaffer.StringPlug( "value", defaultValue = plug_value, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), True, "internalName", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )

Thanks,
Sudarshan
```

Murray Stevenson

unread,
Aug 14, 2024, 1:09:37 PM8/14/24
to gaffer-dev
Hi Sudarshan,

Creating plugs from within an expression is not possible as the node graph cannot be modified while it is being computed. Expressions are run as part of the node graph computation so are restricted from making those sorts of modifications.

Unfortunately, I'm not super familiar with GafferDeadline, but maybe Eric has some thoughts on alternate ways of configuring these Deadline settings?

Cheers,

Murray

eric...@gmail.com

unread,
Aug 15, 2024, 5:22:22 PM8/15/24
to gaffer-dev
Hi Sudarshan,
We were talking about this a bit today and I think the solution is to add a `CompoundData` plug to the GafferDeadline dispatch options that allows you so supply a set of Deadline options as a Python dictionary from an expression. Then you wouldn't need to create multiple plugs, just fill in a dictionary from whatever your source is and supply it to this new plug. I have a few other things I've been wanting to get to on GafferDeadline so I'll try to get this added soon.

- Eric

eric...@gmail.com

unread,
Aug 17, 2024, 4:39:05 PM8/17/24
to gaffer-dev
Hi Sudarshan,
I just released a new GafferDeadline version, 0.58.0.0. https://github.com/hypothetical-inc/GafferDeadline/releases/tag/0.58.0.0

This includes the new plug I mentioned above `extraDeadlineSettings` where you can set it via an expression to add multiple Deadline settings. And if you're only needing to add outputs, you can also add an expression on the `outputs` plug that has been around for a few versions. That is a `StringVectorDataPlug` you can set with an expression as well. It also handles not substituting the frame numbers based on the context, which will help Deadline find the right output frames.

- Eric
Reply all
Reply to author
Forward
0 new messages