Jump to content
Sign in to follow this  
eunchae

How to Copy Houdini's Mantra to Nuke

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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)

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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 by kiryha
  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×