Rendering TOPs with Cmd

   4475   5   2
User Avatar
Member
26 posts
Joined: Dec. 2010
Offline
Hey Guys!
I am interesting is there any ways to rendering TOPs Network with Command line ?

I am really often using for ROPs something like that

SET hbatchDir="C:/Program Files/Side Effects Software/Houdini 17.5.173/bin/"

SET hipFile1=d_Jobs_/test.hip

SET ropPath000=/obj/Render_sim/Render
SET ropPath111=/obj/Render_sim/wedge_sim

CD /d %hbatchDir%
(ECHO mread %hipFile1%
ECHO render -V -I %ropPath111%) | hbatch


But now I am Using TOP NETWORK, how deal about that?

Thank You
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
We haven't added a command for rendering a top network like that yet. In the meantime you can use HOM via hython instead:

import hqueue.houdini as hq 
node = hq.getNode("/obj/topnet") 
disp_node = node.displayNode() 
# blocking full cook of PDG
disp_node.executeGraph(False, True, False)
User Avatar
Member
26 posts
Joined: Dec. 2010
Offline
Yeah, this is works good inside Houdini pythonShell

Damn just spend all day to try run python code on windows10 outside Houdini and its fail
any help please

>>> import hou
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named hou
>>>

so the idea just build 2 files with py and bat

py file with

import hou
hou.hipFile.load("d:/_Jobs_/tests/test.hip")

import hqueue.houdini as hq 
node = hq.getNode("/obj/Render/topnet1") 
disp_node = node.displayNode() 
# blocking full cook of PDG
disp_node.executeGraph(False, True, False)
hou.node("/obj/Render/Render").render()

and run with bat file

"C:\python27\python.exe" "d:\_Jobs_\tests\RenderHoudini_TOPSsdasda.py"
pause


Thanks
Edited by cool1986vfx - April 16, 2019 12:34:00
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
You'll have to run that with hython, not python:

%hbatchDir%/hython.exe "d:\_Jobs_\tests\RenderHoudini_TOPSsdasda.py"
User Avatar
Member
26 posts
Joined: Dec. 2010
Offline
oh yes yes! This is exactly what I am looking for! Thanks @chrisgreb

Btw, I am have right now two files and they are looking like that

file RenderHoudini_TOPS_Render.py
import hou
hou.hipFile.load("d:/_Jobs_/tests/RenderHoudini_TOPS.hip")

import hqueue.houdini as hq 
node = hq.getNode("/obj/Render") 
disp_node = node.displayNode() 
# blocking full cook of PDG
disp_node.executeGraph(False, True, False)

and for Trigger
file RenderHoudini_TOPS_Render.bat
SET hbatchDir="C:/Program Files/Side Effects Software/Houdini 17.5.173/bin/"

%hbatchDir%hython.exe "d:\_Jobs_\tests\RenderHoudini_TOPS_Render.py"


and is there any way it make smarter for example
merge and keep in one file
and one more what the best way to change range of Rendering without open Houdini

Thank !
Edited by cool1986vfx - April 16, 2019 15:26:52
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
Take a look at HOM reference and you can also look at what we do in $HFS/houdini/python2.7lib/pdg/job/rop.py

import hqueue.houdini as hq 

hou.hipFile.merge(...)
hq.render(node, (start,end,increment))
  • Quick Links