I'm having trouble using the filerename node. The rename field seems to be limited to a string expression, and I found it surprisingly difficult to find a way to express the rename that I want.
I have a terrain file called terrain_x0_y0.png, and I want to rename it to terrain_x0_y0_uint16.png.
How can I express this? Ideally, I'd like to use the string functions in python, because it's easy to do a string replace, or splitting, etc. I tried setting the node language to python and set a keyframe to force evaluating the string in python.
I couldn't even get the filename pdg attribute into the newpath parameter after trying all of these variations:
kwargs('filename')
workItem().environment
workItem().stringAttribute('filename')
workItem().envLookup('filename')
Finally, I tried this expression that seemed to do the trick, but it seemed especially awkward. Is this the best expected solution?
`@directory`/`substr(@filename, 0, strlen(@filename) - 4)`_uint16.png