eunchae Posted April 8, 2021 Share Posted April 8, 2021 Hi. I have an image rendered with Mantra in Houdini. Please let me know if there is a way to do it with a python script. Do you know how to copy only this mantra node to Nuke and that image can be loaded directly from Nuke? Thank you. Quote Link to comment Share on other sites More sharing options...
kiryha Posted April 8, 2021 Share Posted April 8, 2021 Do you want to have Mantra render engine in Nuke, or you just need to load rendered image (exr or whatever)? To load image in Nuke you need to create Reader node and provide a path to this image: import nuke path_exr = "C:/temp/awesome_render.exr" nuke.nodes.Read(name="My_EXR", file=path_exr) Quote Link to comment Share on other sites More sharing options...
eunchae Posted April 10, 2021 Author Share Posted April 10, 2021 On 2021. 4. 9. at 1:38 AM, kiryha said: Do you want to have Mantra render engine in Nuke, or you just need to load rendered image (exr or whatever)? To load image in Nuke you need to create Reader node and provide a path to this image: import nuke path_exr = "C:/temp/awesome_render.exr" nuke.nodes.Read(name="My_EXR", file=path_exr) just need to load rendered image. Should this python code apply to both Houdini and Nuke? I want to have the image load when I copy the mantra to Houdini and paste it into Nuke. Thank you. Quote Link to comment Share on other sites More sharing options...
kiryha Posted April 12, 2021 Share Posted April 12, 2021 (edited) I don't know how to utilize such functionality via copy-paste... But as an option, you can build a Python script for Houdini which (with selected Mantra Node) will run Nuke and create a reader with exr: import subprocess import hou NUKE = "C:/Nuke12.1v2/Nuke12.1.exe" mantra = hou.selectedNodes()[0] exr_path = mantra.parm('vm_picture').eval() command = 'C:/temp/nuke_create.py' subprocess.Popen([NUKE, '--nukex', command, exr_path]) and the content of nuke_create.py would be: import sys import nuke exr_path = sys.argv[1] nuke.nodes.Read(name="My_EXR", file=exr_path) Edited April 12, 2021 by kiryha 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.