2015-03-02

operationChanger

I would like to share operationChanger.py I just made.

operationChanger.py

The function is like this,,,





2015-01-28

lerp()

expression でlerp()ってがある。
任意のアニメーション(curve)のfitコマンドみたいなものみたい・・・
既に、アニメーションがついているknobに対して、

lerp(30, f(30), 90, f(74), x)

とかってやると、既についていたアニメーションの30フレーム目を起点に、74フレーム目の値を90フレーム目に持っていく→74フレーム目の値を90フレーム目にシフトする用に補完し直す。って感じ。

y = f(x) のつもりです。この場合xが時間軸、yがその値。

lerp([python nuke.thisNode().knob('rotate').animation(0).keys()\[0\].x], curve([python nuke.thisNode().knob('rotate').animation(0).keys()\[0\].x]), [python nuke.toNode('FrameHold1').knob('first_frame').value()], curve([python nuke.thisNode().knob('rotate').animation(0).keys()\[1\].x]), x)

2015-01-12

cacheBaker

I made this gizmo for kinda "baking".
Have fun!

https://drive.google.com/file/d/0B77RQxzB7Z2aZlF5blFSd3lQX2M/view?usp=sharing

I updated it. 2015.01.13 17:00PM PST

2014-12-16

expression in "filter" knob

TransformノードやReformatノードのfilterにexpressionを張りたいときは、
If you want to add expression at "filter" in Transform node or Reformat node,

ノード選択してコピーして、Script Editorでペーストする。
Select the node and copy and then paste in Script Editor.


ここでnameの直前に、インデントをあわせて、filter {{Transform1.filter}} を加える。
Here, you just need to add "filter {{Transform1.filter}}" avobe the "name" line. Please don't forget there should be " " means space at the top of this line, I mean it's kinda indent.

 filter {{Transform1.filter}}


この場合、Transform1のfilterに向けてリンクがはられる。
In this case, this is the "link" to the "filter" knob of Transform1.



あとは、このScript Editorの内容をノードグラフすればTransform1のfilterにリンクしたTransformノードができる。
And then, once you copy and paste these code in Script Editor on NodeGraph, you'll get Transform node which has the expression for "Transform1" in its filter knob.






2014-11-03

ColorMatrix

ColorMatrixノードはピクセルのrgb値に対して指定したmatrixを掛けてくれるものだ。
たとえば、world spaceのnormalパスがあるとして、これをcamera spaceのnormalパスに変換したい場合、world spaceのnormalにカメラの回転マトリクスの逆行列をかければいい。

CameraMatrix allow us to multiply a "matrix" by the value of rgb.
For example, here is kinda normal pass which was rendered in CG as normal in world space, and then we will convert it to one in camera space. How? We can do this with multiplication the value of rgb of normal in world space and the inverse matrix which is "rotation matrix" of camera.






また、カメラの回転マトリクスは、カメラのスケールが(1,1,1)であれば、"Camera"ノードのworld matrixの((0,1,2),  (4,5,6), (8,9,10)) として得ることができる。

Well, when scale of Camera node is (1, 1, 1), you can handle as the world matrix of Camera node as the "rotation matrix" of camera. Actually it should be in m[0], m[1], m[2], m[4], m[5], m[6], m[8], m[9] and m[10].



なので、これをColorMatrixノードに代入する。逆行列ってのはこのColorMatrixのinverseにチェックをいれればOKです。

And then, put them in ColorMatrix node. Because we use it as inverse matrix, just check "inverse" box.




その後、このColorMatrixノードをworld spaceのnormalパスにつなげると

After that, we connect the input of this ColorMatrix to the Read node which has normal pass in world space......





normal pass(world space) > normal pass(camera space) の変換ができる。
逆に、camera space を world space に変えたい場合は、inverseのチェックをはずせばいい。

And We can get the normal pass in camera space!
In case that camera space one would be converted to world space one, we don't need to check "inverse" box.




この方法で、normal pass の回転も可能です。

You can rotate your normal pass in this way.

pyAlembic

You can find pyAlembic for windows in the following link.

http://pyalembic.sourceforge.net/
http://sourceforge.net/projects/pyalembic/files/


Actually in my Environment,

AlembicPyIex.dll
AlembicPyImath.dll
awBoost_python-1_52.dll

alembic.pyd
iex.pyd
imath.pyd

I have these files in the folder which is contained in result of "nuke.pluginPath()"



2014-10-22

matrix


matrixに値を入れたいとき、
node['matrix'].setValueAt(value, frame, index) 
matrixの値を取得したいとき、
node['matrix'].getValueAt(frame)[index]



When you want to set the value into matrix,
node['matrix'].setValueAt(value, frame, index) 
When you want to get the value of matrix,
node['matrix'].getValueAt(frame)[index]