Jump to content

How to Copy Houdini's Mantra to Nuke


eunchae

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.

Link to comment
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)

 

Link to comment
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.

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...