-
Notifications
You must be signed in to change notification settings - Fork 0
/
hou_render.py
25 lines (20 loc) · 883 Bytes
/
hou_render.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# DO NOT RUN AS PY
# You must open python shell under Houdini - Windows/Python Source Editor
# Copy-paste this file in :)
import glob
import subprocess
def dorender(ixs):
fil = hou.node('/obj/file1/file1')
fname_parm = fil.parm('file')
desktop = hou.ui.curDesktop()
scene = desktop.paneTabOfType(hou.paneTabType.SceneViewer)
for i in ixs:
subprocess.call('mkdir /home/albert/render/render_tmp'.split())
nframe = len(glob.glob('/home/albert/taichi/outputs/mpm/t%d/frames/*.bgeo' % (i)))
file_str = '$HIP/taichi/outputs/mpm/t%d/frames/$F4.bgeo' % i
fname_parm.set(file_str)
hou.playbar.setFrameRange(1, nframe)
hou.playbar.setPlaybackRange(1, nframe)
scene.flipbook()
mv_call = 'mv /home/albert/render/render_tmp /home/albert/render/render_t%d_flip' % i
subprocess.call(mv_call.split())