Skip to content

Instantly share code, notes, and snippets.

@taikomatsu
Last active October 28, 2015 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taikomatsu/0a43cd4da1fc4eba24d4 to your computer and use it in GitHub Desktop.
Save taikomatsu/0a43cd4da1fc4eba24d4 to your computer and use it in GitHub Desktop.
Export sequential alembic file
# Alembicを全体で1ファイルではなく各フレームごとに出力したい場合に使用
# 以下では1-100Fまでを出力
# start, endの値を書き換えてデータを出力しているので、ファイル名に$Fなどが入っていないとだめ
abc = hou.node('/obj/obj_name/rop_alembic1')
for i in range(100):
f = i + 1
abc.parm('f1').set(f)
abc.parm('f2').set(f)
abc.parm('execute').pressButton()
# シェルフに登録する用にちょっと修正
import hou
for o in hou.selectedNodes():
if o.type().name() != 'rop_alembic':
continue
print('[INFO] Start {0}'.format(o.name()))
f1 = o.parm('f1')
f2 = o.parm('f2')
s = int(f1.eval())
e = int(f2.eval())
for i in range(s, e+1):
f1.set(i)
f2.set(i)
o.parm('execute').pressButton()
print('[PROGRESS] {0}/{1}'.format(i, e))
print('[INFO] Finish {0}'.format(o.name()))
f1.set(s)
f2.set(e)
print('[INFO] Done')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment