This file contains 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 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 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 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 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 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 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 nuke | |
import os.path | |
reads = nuke.allNodes('Read') | |
err_cnt = 0 | |
for i, r in enumerate(reads): | |
raw = r.knob('file').getValue() | |
evaluated = r.knob('file').getEvaluatedValue() | |
full_path = '{}/{}'.format(os.path.dirname(evaluated), os.path.basename(raw)) | |
try: |
This file contains 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で諸事情によりカメラスケール使えなかった時用に調べて書いた | |
# degreeとmmで計算してます | |
import math | |
def focal_to_aov(focal, aperture): | |
''' | |
focal: focal length | |
aperture: horizontal aperture (mm) | |
''' |
This file contains 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
# とりあえず大急ぎで書いてる | |
# あれこれ書き方忘れてたので参考ページもメモ | |
# https://area.autodesk.jp/column/tutorial/maya_atoz/attribute_plug/ | |
# http://ianwaters.co.uk/wp/mash/accessing-mash-point-data-with-the-maya-api/ | |
from maya import OpenMaya | |
import pymel.core as pm | |
def mdg_from_name(name): |
This file contains 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
from pymel.core import * | |
import math | |
pt0, pt1 = selected(fl=True) | |
p0 = dt.Vector(xform(pt0, q=True, ws=True, t=True, a=True)) | |
p1 = dt.Vector(xform(pt1, q=True, ws=True, t=True, a=True)) | |
diff = p0-p1 | |
axis = dt.Vector(0, 0, 1) | |
print(math.degrees(math.acos(diff.normal().dot(axis)))) |