This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hou | |
from PySide2 import QtWidgets | |
class MainWindow(QtWidgets.QMainWindow): | |
def __init__(self, parent=None): | |
super(MainWindow, self).__init__(parent) | |
self.construct_ui() | |
def construct_ui(self): | |
self.setWindowTitle('PySide2 Test') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# filecache SOPにボタンを追加して、そのボタンのCallback Scriptに登録して使う | |
# filecacheと同名のropにジャンプする | |
# ジャンプした際、対象のropは選択状態になっている | |
node = hou.pwd() | |
out_node = '/out/{}'.format(node.name()) | |
hou.hscript('panepath -f {}'.format(out_node)) | |
hou.node(out_node).setSelected(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Houdiniにカメラを持っていく用に、値をbakeしてシンプルなデータにするための処理を自動化。 | |
# 一応複数対応してる感じで書いてるけど、あんまり想定してないしテストもしていないw | |
# filmoffsetに関して、アニメーションの再接続をしているもののこれもそのままは持っていけないので一応やってるだけ。 | |
# bakeするレンジはtime sliderに準拠する。 | |
from pymel.core import * | |
cams = [] | |
for o in selected(): | |
new_cam = duplicate(o, rr=True)[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// curveの先端を接線(というか隣のポイントとの差分)を使って伸ばす | |
vector p0 = point(0, "P", 0); | |
vector p1 = point(0, "P", 1); | |
vector np0 = point(0, "P", i@numpt-1); | |
vector np1 = point(0, "P", i@numpt-2); | |
vector tan_in = normalize(p0-p1); | |
vector tan_out = normalize(np0 - np1); | |
float ext = ch("ext"); | |
addpoint(0, p0+tan_in*ext); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maya FluidからRedshift用のVolumeオブジェクトを作成 | |
# Redshiftでは現状Maya Fluidが直接レンダリング出来ないので、BE_OpenVDBを使用して一旦.vdbに出力する | |
# その際あれこれ接続したりとか諸々面倒なので自動化 | |
# 今回は煙が作れればOKだったのでRSVolumeにはdensityだけ設定してある。 | |
# 位置は元のFluidに合わせてあるが、シーンの作り方によっては合わないので要調整。 | |
# MayaFluidは一応キャッシュをとってから実行した方がより安心です。 | |
from pymel.core import * | |
import os | |
import os.path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 超簡易Backburner Submitterスクリプト | |
# IFDを所定のフォルダに出力した後に、backburnerに投げたいROP(mantraのみ)を選んでこのツールを実行 | |
# 各ROPのIFDの場所を読んでコマンドを生成してジョブを投げる | |
# 生成したコマンドやタスクファイルは、$HIP/dispatch以下に格納され、それが実行されるという流れ | |
# 基本的にはShelfに登録して使う想定 | |
# priorityやserversなどはROP側に新規でparm追加して読むなどすればROP側での調整も可能だが未対応 | |
import hou | |
import os | |
import os.path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# render用のdelayed loadオブジェクトとシェーダを作成する | |
# 当然それらにはリンクが設定してある状態になる | |
# SOPで任意のノード(rop_alembic, rop_geometry, filecache)を選んでshelfボタンをポチで完了 | |
import hou | |
type_pairs = {'rop_alembic': 'filename', | |
'rop_geometry': 'sopoutput', | |
'filecache': 'file'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = hou.node('/') | |
rop = hou.node('/out/any_rop') | |
root.recursiveGlob(rop.evalParm('forceobject'), hou.nodeTypeFilter.Obj) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mayaで大量のシーンのplayblastを一斉に取りたい時用のスクリプト。 | |
# 事前に取得したシーンファイル名をムービー保存ディレクトリと一緒に渡すとプレイブラスト開始。 | |
# このスクリプトではフォーカスしたいオブジェクトを記述すればそれにフォーカスしてプレイブラストをするものの、 | |
# カメラの固定やジョイントの表示をOFFにしたいなどあれこれやりたいことはあると思うので、 | |
# その場合はviewport settingsの下辺りに追加してやればOKのはず。 | |
from pymel.core import * | |
import os | |
import os.path |