Arnold buitin ID AOVs?

1,027 views
Skip to first unread message

Rachid Hadj abderrahmane

unread,
Jan 1, 2022, 11:15:09 AM1/1/22
to gaffer-dev
Hi guys
Has anyone succeeded rendering Arnold ID Aovs
I tried both methods, the builtin ID Arnold Aovs( kick -laovs -i Nul  )to get a list of available AOVS.
and via aiUtility==>AovWriteRgb==>ArnoldAOVShader, without Success!
Both methods return the same error:
WARNING [Arnold] 00:00:00  792MB  [aov] output requires illegal type "ID" for AOV "UINT"
So is there any type to output ID AOV?

any help will be appreciated!
Gaffer_0.60.7.0 py3.0
Arnold-6.2.1.1
Windows 10

Daniel Dresser

unread,
Jan 2, 2022, 3:20:14 AM1/2/22
to gaffer-dev
I don't have Arnold handy at the moment to test this, but if you want to use AovWriteRgb, you should just create a custom color aov to write to.  I'm not sure what the built-in ID aov is, but since it's built-in, it probably has some sort of automatic ID value in it, you probably can't write to it with an AovWriteRGB.

Rachid Hadj abderrahmane

unread,
Jan 2, 2022, 6:01:57 AM1/2/22
to gaffer-dev
Hi
Yes any custom color, data  with AovWriteRgb work fine except for the ID AOV
Here is the snapshot for the  built-in ID  using kick -laovs -i Nul  command to show all available AOVs
kick_-laovs.jpg
and here is it in Maya
MtoA_ID.jpg

Rachid Hadj abderrahmane

unread,
Jan 5, 2022, 6:55:21 AM1/5/22
to gaffer-dev

Hi
Any update on this?

Daniel Dresser

unread,
Jan 5, 2022, 2:32:57 PM1/5/22
to gaffer-dev
Setting this up the same way as in Maya looks like it probably works at a technical level - I've pasted a node that does this at the bottom of this message.

I wasn't really able to confirm that it's working though, since I can't really think of any software that will load a uint exr properly - it's a pretty uncommon format.  I guess Maya's Arnold Renderview is doing something special to translate ids to colors.

I'm not quite sure why you want this integer id aov?  The most useful options would probably be just to make a custom aov with the color output from Arnold's `utility` shader in "id" mode ( you could do this using the ArnoldAOVShader node ) if you want a color EXR with different colors for each object, or if you really want ids rather than colors, maybe use cryptomatte?

-Daniel

"""
import Gaffer
import GafferScene
import imath

Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 61, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 1, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 1, persistent=False )

__children = {}

__children["Outputs"] = GafferScene.Outputs( "Outputs" )
parent.addChild( __children["Outputs"] )
__children["Outputs"]["outputs"].addChild( Gaffer.ValuePlug( "output3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Outputs"]["outputs"]["output3"].addChild( Gaffer.StringPlug( "name", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Outputs"]["outputs"]["output3"].addChild( Gaffer.BoolPlug( "active", defaultValue = True, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Outputs"]["outputs"]["output3"].addChild( Gaffer.StringPlug( "fileName", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Outputs"]["outputs"]["output3"].addChild( Gaffer.StringPlug( "type", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Outputs"]["outputs"]["output3"].addChild( Gaffer.StringPlug( "data", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Outputs"]["outputs"]["output3"].addChild( Gaffer.CompoundDataPlug( "parameters", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Outputs"]["outputs"]["output3"]["parameters"].addChild( Gaffer.NameValuePlug( "", Gaffer.StringPlug( "value", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), True, "member1", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
__children["Outputs"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Outputs"]["outputs"]["output3"]["name"].setValue( 'Batch/Arnold/TestID' )
__children["Outputs"]["outputs"]["output3"]["fileName"].setValue( '${project:rootDirectory}/renders/${script:name}/testID/testID.####.exr' )
__children["Outputs"]["outputs"]["output3"]["type"].setValue( 'exr' )
__children["Outputs"]["outputs"]["output3"]["data"].setValue( 'id uint' )
__children["Outputs"]["outputs"]["output3"]["parameters"]["member1"]["name"].setValue( 'filter' )
__children["Outputs"]["outputs"]["output3"]["parameters"]["member1"]["value"].setValue( 'closest' )
__children["Outputs"]["__uiPosition"].setValue( imath.V2f( -24.3499985, -21.2696781 ) )


del __children

Rachid Hadj abderrahmane

unread,
Jan 5, 2022, 6:28:49 PM1/5/22
to gaffer-dev
Thanks for your effort, but sorry it doesn't work, and your script is exactly the same as mine
Name: Batch / Arnold / Id
Type: exr
Data: UINT ID

The console displays the following error:
00:00:00 277MB WARNING | [aov] filter "ieCoreArnold: filter: Batch / Arnold / Id" does not support uint inputs

I tried all type of data:
Data: Int,  WARNING [Arnold] 00:00:04  834MB  [aov] filter "ieCoreArnold:filter:Interactive/Arnold/Id" does not support Int inputs
Data: Float  no error but render black
Data: RGB  no error but render black
Data: Uint  WARNING [Arnold] 00:00:04  853MB  [aov] filter "ieCoreArnold:filter:Interactive/Arnold/Id" does not support Uint inputs
yes you can make custom aov with a flat color, or use Cryptomatte etc..but I want to know what works and what doesn't, simple curiosity.

and this for both methods
aiUtility==>AovWriteRgb==>ArnoldAOVShader
or
directly from Outputs/Interactive/Arnold/Id
Finally,  Gaffer does not render Arnold ID, all others AOVs work fine.

Daniel Dresser

unread,
Jan 5, 2022, 6:34:28 PM1/5/22
to gaffer-dev
Are you sure you tried with my node?  Those errors sound like you haven't set the filter to "closest", which appears to be the only Arnold filter that supports ints.

-Daniel

Rachid Hadj abderrahmane

unread,
Jan 5, 2022, 7:10:05 PM1/5/22
to gaffer-dev
yes I just added Beauty Pass

id.jpg

Daniel Dresser

unread,
Jan 5, 2022, 7:28:04 PM1/5/22
to gaffer-dev
Hmm, it's a little bit hard to debug this remotely ... and it's more of an Arnold thing than a Gaffer thing, but I can try.

What's the exact error message you're getting with this setup?  The error message you posted before referenced "Batch / Arnold / Id" rather than "Batch / Arnold / TestId", so I assume it came from a different node ... sorry for being a bit pendantic here, but the issue is probably in a detail - I don't understand how you can get the message "filter does not support uint inputs" if you are using the "closest" filter, which does support uint inputs.

Note that even if this works, the image will probably appear black in most software, since most software doesn't support uint exrs.

-Daniel

Rachid Hadj abderrahmane

unread,
Jan 5, 2022, 7:51:43 PM1/5/22
to gaffer-dev
Oh yes the first try, the render image appear black without error in the console, same with other data type: Float, Int, Rgba.. then I intentionally removed the filter for debugging.

Daniel Dresser

unread,
Jan 5, 2022, 8:52:31 PM1/5/22
to gaffer-dev
In what software did the image appear black?  Was it something special that handles uint exrs?  A lot of software does not support uint exrs.  Running "exrheader" on the exr you produce should verify that you've at least written a uint exr, but I'm not sure what you're hoping to do with it afterwards.

Rachid Hadj abderrahmane

unread,
Jan 5, 2022, 9:39:33 PM1/5/22
to gaffer-dev
Hi
Both Nuke and djv show black image
where to find exrheader for windows?

Daniel Dresser

unread,
Jan 5, 2022, 9:50:48 PM1/5/22
to gaffer-dev
It's part of the OpenEXR package.

I wouldn't be surprised if neither Nuke or djv support integer exrs - they're intended to show image that contain colors.

Have you done a batch render from Maya that wrote an integer exr using their aov setup, and been able to open that in anything?

Rachid Hadj abderrahmane

unread,
Jan 6, 2022, 5:18:43 AM1/6/22
to gaffer-dev
I thought it worked fine with Maya, but I discovered another problem.
- in ARV all work fine the ID look correctly
ARV_ID.jpg

1- if I batch render with mergeAOV "on" and see the image under nuke, there is no ID aov in the channel name, in fact
the ID is stored under channel named "other" in RED channel, it look like alpha channel. but it's not
as you can see in the image bellow the values are so high! we can't use it at all.
maya_ID.jpg

if I shuffle the channel "other", I can see other.ID
I tried to remap the values with grade Node in w/B point, but the result is not adequate
remap_ID.jpg
2- if I save Multi-Layer EXR from ARV I get the correct file, the aov ID is stored correctly, like in ARV but this for a single image!

at the end it's a good experience, thank you so much
Reply all
Reply to author
Forward
0 new messages