Nuke write node - File path
Quote from olle on 9. July 2019, 17:36Hello
How easy would it be to make a custom edit to this part of the file path in the prismWrite node? (see attached)
I tried converting the gizmo to a group and did some poor attempts of editing the code, but no luck so far 🙁
Can someone point me in the right direction?Thanks!
Olle
Hello
How easy would it be to make a custom edit to this part of the file path in the prismWrite node? (see attached)
I tried converting the gizmo to a group and did some poor attempts of editing the code, but no luck so far 🙁
Can someone point me in the right direction?
Thanks!
Olle
- You need to login to have access to uploads.
Quote from RichardF on 10. July 2019, 13:46You could modify the path in the Nuke node, which was generated by Prism or you could go into the Prism script and change the code directly, which generates the path.
For smaller changes it's probably easier to do it just in the Nuke node. For that you have to convert the gizmo to a group and dive into it. The "WritePrismBase" node is a usual write node with a python expression in the file parameter. Since it's a multiline expression it's easier to copy the expression to an external text editor, edit it there and than copy it back to the write node.
The default expression is:
[python -exec { opath = "" try: opath = pcore.appPlugin.getOutputPath(nuke.thisNode(), nuke.thisGroup()) except: opath = nuke.thisGroup().knob("fileName").toScript() }][python opath]You could modify it to something like this:
[python -exec { opath = "" try: opath = pcore.appPlugin.getOutputPath(nuke.thisNode(), nuke.thisGroup()) except: opath = nuke.thisGroup().knob("fileName").toScript() import os opath = os.path.dirname(opath) + "/myfilename.####.exr" nuke.thisGroup().knob("fileName").setValue(opath) }][python opath]
You could modify the path in the Nuke node, which was generated by Prism or you could go into the Prism script and change the code directly, which generates the path.
For smaller changes it's probably easier to do it just in the Nuke node. For that you have to convert the gizmo to a group and dive into it. The "WritePrismBase" node is a usual write node with a python expression in the file parameter. Since it's a multiline expression it's easier to copy the expression to an external text editor, edit it there and than copy it back to the write node.
The default expression is:
[python -exec { opath = "" try: opath = pcore.appPlugin.getOutputPath(nuke.thisNode(), nuke.thisGroup()) except: opath = nuke.thisGroup().knob("fileName").toScript() }][python opath]
You could modify it to something like this:
[python -exec { opath = "" try: opath = pcore.appPlugin.getOutputPath(nuke.thisNode(), nuke.thisGroup()) except: opath = nuke.thisGroup().knob("fileName").toScript() import os opath = os.path.dirname(opath) + "/myfilename.####.exr" nuke.thisGroup().knob("fileName").setValue(opath) }][python opath]