Convert .exrs from multiple rops to .png

   1145   2   0
User Avatar
Member
38 posts
Joined: Feb. 2018
Offline
Hello, new tops user here.

I have a Solaris network that contains multiple USD render ROPs, I would like to build a TOP network that will:

  • Render each rop sequentially.
  • Convert the .exr files from each ROP to .png in the same location of each .exr with the same filename, just replacing
    *.exr
    
    with
    *.png
    

Currently in my TOP network I am using RopFetch nodes followed by imagemagic nodes set to python expression language and operation "convert" with the "output file path" set to:
`@pdg_input`[:-3]+.png

I would expect this to use python string slicing to strip .exr from the incoming file path and replace it with .png for output, however I get my output files named:
*.exr[

Is this just bad syntax on my part? I would really like to set the file paths procedurally like this and avoid a spider web of relative reference parameters from the USD render ROPs to build the output file names.
User Avatar
Member
1746 posts
Joined: May 2006
Online
The rats nest of hscript vs python vs backticks vs tops attribs can be tricky.

Lately myself and coworkers steer away from @pdg_input, and instead generate standalone new attributes using the string filtering and attrib create top nodes to define them. It's more nodes, but we find it a little easier to debug.

Attached an example.
Edited by mestela - May 29, 2021 09:53:04

Attachments:
tops_exr_to_png.hip (99.1 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
38 posts
Joined: Feb. 2018
Offline
OK got that working, thanks Matt!
  • Quick Links