tag:blogger.com,1999:blog-7381225452139272152024-03-19T18:11:55.016+09:00tiraokan.masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.comBlogger68125tag:blogger.com,1999:blog-738122545213927215.post-6474625387671161912016-06-02T16:28:00.003+09:002016-06-02T16:28:29.571+09:00selectSnap + nodeShift + backDropSelectorThese ones are what I made before, so they are a bit old, But still useful :)<br />
<a href="https://drive.google.com/file/d/0B77RQxzB7Z2aZmZuWl9uMjlFZ2s/view?usp=sharing">selectSnap</a><br />
https://drive.google.com/file/d/0B77RQxzB7Z2aZmZuWl9uMjlFZ2s/view?usp=sharing<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/M8YlYBTqTV4" width="420"></iframe><br />
<br />
<a href="https://drive.google.com/file/d/0B77RQxzB7Z2aVF81amhWaTdmTFk/view?usp=sharing">nodeShift</a><br />
https://drive.google.com/file/d/0B77RQxzB7Z2aVF81amhWaTdmTFk/view?usp=sharing<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/HVD3Hm9HFoI" width="420"></iframe><br />
<br />
<a href="https://drive.google.com/file/d/0B77RQxzB7Z2aamVhd1ZkMTdzbHM/view?usp=sharing">backDropSelector</a><br />
https://drive.google.com/file/d/0B77RQxzB7Z2aamVhd1ZkMTdzbHM/view?usp=sharing<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/oI71avmj9b8" width="420"></iframe>masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-40079374958809707932016-06-01T17:25:00.001+09:002016-06-02T16:04:57.557+09:00dotsMod + aimForTheTop(2016/06/02 updated)<a href="https://drive.google.com/file/d/0B77RQxzB7Z2aNUpKdjU0eHdfYzQ/view?usp=sharing">dotsMod</a>(2016/06/02 updated)<br />
https://drive.google.com/file/d/0B77RQxzB7Z2aNUpKdjU0eHdfYzQ/view?usp=sharing<br />
<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/NMEAzu9t3-8" width="420"></iframe><br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/jmK2Xtw7xRc" width="420"></iframe><br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/-0fNmZiBCEM" width="420"></iframe><br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/2T-s5Vh78eQ" width="420"></iframe><br />
new:2016/06/02<br />
<br />
<br />
<a href="https://drive.google.com/file/d/0B77RQxzB7Z2aM3BrN0Nld2lRUnc/view?usp=sharing">aimForTheTop</a><br />
https://drive.google.com/file/d/0B77RQxzB7Z2aM3BrN0Nld2lRUnc/view?usp=sharing<br />
<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/f7Zi0dX1l7A" width="420"></iframe>masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-42450557319364209452016-05-29T11:35:00.000+09:002016-05-29T11:35:28.096+09:00node graph tidy up tools<br />
<br />
<a href="https://drive.google.com/file/d/0B77RQxzB7Z2aeDU4cmpYUUpNMnc/view?usp=sharing">nodeScaler.py</a><br />
https://drive.google.com/file/d/0B77RQxzB7Z2aeDU4cmpYUUpNMnc/view?usp=sharing<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dwKU8MqXjBHm_yxHblwZItTONV7_uP7PcnbZubl3OYRiZ8cJdUWLQSkpKbdJO9RLEhUcJo2hsHcRA8x8Gvfww' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
<a href="https://drive.google.com/file/d/0B77RQxzB7Z2acWY2bXdzTlZyYWs/view?usp=sharing">backdropRefine.py</a></div>
<div class="separator" style="clear: both; text-align: left;">
https://drive.google.com/file/d/0B77RQxzB7Z2acWY2bXdzTlZyYWs/view?usp=sharing</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dzpYO_J7Qju9U7pAJLeRKO1EFwWABEA6d4h7ez7_BYuevbjqVihHbzkT6DEvHKsm-vxeTmTWSymtVeFdsJa-w' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: left;">
<a href="https://drive.google.com/file/d/0B77RQxzB7Z2aMm1OOFF6TWJBRlE/view?usp=sharing">tidyY.py</a></div>
<div class="" style="clear: both; text-align: left;">
https://drive.google.com/file/d/0B77RQxzB7Z2aMm1OOFF6TWJBRlE/view?usp=sharing</div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dyckye250BSUPuDXqhNziXhypbB-xgKVp8kc1vTeGkPijMRPCP7EMYi0THzETLR42OqPFkw08amNxoBPNM3ag' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<div class="" style="clear: both; text-align: left;">
<br /></div>
<br />masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-71123095082050402602016-02-10T11:03:00.000+09:002016-02-10T11:11:48.511+09:00PrefとPworldからデフォームアニメーションするジオメトリの特定の点の座標を求める(ただしそれは、画面上に常に見えている)<span style="font-size: x-small;">デフォームアニメーションしているジオメトリの特定の点の座標をPrefとPworldから求める方法をきかれたので、ココにメモしておきます。まぁまぁニッチです。</span><br />
<span style="font-size: x-small;">ちなみに、mayaでPoint Constraint(Point on Poly)でやるのが一番よさそうです・・・</span><br />
<span style="font-size: x-small;">ただ、PrefとPworldからそれが出来ると、ディスプレイスメントが施されてレンダリングされたものでも求めることができるってメリットがあります。</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">PworldとPrefが下の感じです。</span><br />
<span style="font-size: x-small;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwGnURRiLlN4bfUGPssc5x6ocVz3udfI9zU6qJOLxrtxjVA-yB_a0AjgeZAQydhtSMPRJO-LGadj9gf0kF_gKIloGQTlVHfoDp-ysCwYkNXLTv4T9zN_4noDpGq-W0MKu6gSYK3bQTfaWv/s1600/001.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-size: x-small;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwGnURRiLlN4bfUGPssc5x6ocVz3udfI9zU6qJOLxrtxjVA-yB_a0AjgeZAQydhtSMPRJO-LGadj9gf0kF_gKIloGQTlVHfoDp-ysCwYkNXLTv4T9zN_4noDpGq-W0MKu6gSYK3bQTfaWv/s640/001.png" width="640" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: x-small;">Pworld</span></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPpmwssyaS4cyO3brPCXjfQ2LOeLCISGE3pFTcrp-2GfWVfZRPVyp_jDP3HwcDur1krdGhrq7t88bP2dA0Owaxq60opj8bcMWJtrJVMm16gXQ9wGZfbNXVBRbnquFjdNAzN_fJUlPrGs-w/s1600/002.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-size: x-small;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPpmwssyaS4cyO3brPCXjfQ2LOeLCISGE3pFTcrp-2GfWVfZRPVyp_jDP3HwcDur1krdGhrq7t88bP2dA0Owaxq60opj8bcMWJtrJVMm16gXQ9wGZfbNXVBRbnquFjdNAzN_fJUlPrGs-w/s640/002.png" width="640" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: x-small;">Pref</span></td></tr>
</tbody></table>
<br />
<span style="font-size: x-small;">Prefはデフォームしているジオメトリでもreference poseでのpworldが出力される優れものです。Vray, mtoa, RISだとデフォルトで出力可能なAOVです。他のレンダラは調べてないので、ちょっと分かりません・・・</span><br />
<span style="font-size: x-small;"></span><br />
<span style="font-size: x-small;"></span>
<span style="font-size: x-small;">まずは、Prefをつかって、特定の点がスクリーン座標上でどこを通るか求めます。</span><br />
<span style="font-size: x-small;">Prefのカラーはジオメトリにへばりついているので、特定の点はPref上では、常に同じRGB値になります。ここではそれが、(0.49121, 10.54687,1.92187) だったとします。</span><br />
<span style="font-size: x-small;">そうすると、この点から、Pref上の各ピクセル(rgb)までの距離は</span><br />
<span style="font-size: x-small;"></span><br />
<span style="font-size: x-small;"></span>
<span style="font-size: x-small;">√((r - 0.49121)^2 + (g - 10.54687)^2 + (b - 1.92187)^2)</span><br />
<span style="font-size: x-small;"></span><br />
<span style="font-size: x-small;"></span>
<span style="font-size: x-small;">となります。これをExpressionノードで再現すると・・・</span><br />
<span style="font-size: x-small;"></span><br />
<span style="font-size: x-small;"></span>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjloxtXS0TgyLh4f1EnmIo5y9u3l8pjJD6312oO-874TqbYtmSZkggqCu5-i5IR7SXkwo1h1pb08tpNuxWugetBQ8TMZ2zDhuGcGs-s5QAGA1__YwfqoNEftuhNHJtTnCgKITqeXo4jX8Ep/s1600/Screen+Shot+2016-02-09+at+17.14.10.png" imageanchor="1"><span style="font-size: x-small;"><img border="0" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjloxtXS0TgyLh4f1EnmIo5y9u3l8pjJD6312oO-874TqbYtmSZkggqCu5-i5IR7SXkwo1h1pb08tpNuxWugetBQ8TMZ2zDhuGcGs-s5QAGA1__YwfqoNEftuhNHJtTnCgKITqeXo4jX8Ep/s640/Screen+Shot+2016-02-09+at+17.14.10.png" width="640" /></span></a><br />
<span style="font-size: x-small;"></span><br />
<span style="font-size: x-small;"></span>
<span style="font-size: x-small;">こんな感じです。</span><br />
<span style="font-size: x-small;">ちなみに、</span><br />
<span style="font-size: x-small;"><br /></span>
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7yOV_Gae59im2onftaHCWa94ubgTcw4F6eDFSsN184GCkwS2tOtVGdMaxkEHcg52WFc5HmKh8scYiTaioPpbZZna2Tixowx8m5WKE7ANa7Kpw3TFDwP0PcjUEy3_bR_v8AEWbHlhHKUgv/s1600/003.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-size: x-small;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7yOV_Gae59im2onftaHCWa94ubgTcw4F6eDFSsN184GCkwS2tOtVGdMaxkEHcg52WFc5HmKh8scYiTaioPpbZZna2Tixowx8m5WKE7ANa7Kpw3TFDwP0PcjUEy3_bR_v8AEWbHlhHKUgv/s640/003.png" width="640" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: x-small;">分かりやすく色つけてます</span></td></tr>
</tbody></table>
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"></span><br />
<span style="font-size: x-small;"></span>
<span style="font-size: x-small;">とちゃんと同じ点にへばりついてるのが確認出来ます。</span><br />
<span style="font-size: x-small;">使いづらいので、これを1からマイナスしてクランプしました。</span><br />
<span style="font-size: x-small;"></span><br />
<span style="font-size: x-small;"></span><br />
<span style="font-size: x-small;"></span>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikQIOaE1VwqjtXv0VLMjNtU7S4LjEPeNJjgMwDk39BEXdSHhUjLxXUKw6kA3yBuS96wWUrjoGLnWU3nhMC3bYLPnomUJewxHfoCi5k0Z0Owf4cP9n5tPNEq-sy1OzDmiDNQOzm7CndwHUa/s1600/Screen+Shot+2016-02-09+at+17.23.37.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><span style="font-size: x-small;"><img border="0" height="362" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikQIOaE1VwqjtXv0VLMjNtU7S4LjEPeNJjgMwDk39BEXdSHhUjLxXUKw6kA3yBuS96wWUrjoGLnWU3nhMC3bYLPnomUJewxHfoCi5k0Z0Owf4cP9n5tPNEq-sy1OzDmiDNQOzm7CndwHUa/s640/Screen+Shot+2016-02-09+at+17.23.37.png" width="640" /></span></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: x-small;">Rチャンネルのみ表示の結果</span></td></tr>
</tbody></table>
<span style="font-size: x-small;"></span><br />
<span style="font-size: x-small;"></span>
<span style="font-size: x-small;">これをCurveToolを使って明るさが最大値のピクセルを追いかけます。</span><br />
<span style="font-size: x-small;">上で述べた「まずは、Prefをつかって、特定の点がスクリーン座標上でどこを通るか求めます」に当たります。</span><br />
<span style="font-size: x-small;">さっきのExpressionノードではRチャンネルのみをしょりしたので、shuffleとか使って、全部完全に白黒画像にしています。r r rです。</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEqcJPjWXk4J5KGEJ0Y9i53OzHARJNCxYsGj4kIqkxbEdC1a3o1Gu364RQ_usFFWnsvty_hFKWRy_c3YLcN8zxzsuPiz8qRtEYb_WLLSk-5N6KzOHv2bfJpbRs7h1Gq4a76yBQ4NOW9q1Y/s1600/Screen+Shot+2016-02-09+at+17.26.13.png" imageanchor="1"><img border="0" height="612" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEqcJPjWXk4J5KGEJ0Y9i53OzHARJNCxYsGj4kIqkxbEdC1a3o1Gu364RQ_usFFWnsvty_hFKWRy_c3YLcN8zxzsuPiz8qRtEYb_WLLSk-5N6KzOHv2bfJpbRs7h1Gq4a76yBQ4NOW9q1Y/s640/Screen+Shot+2016-02-09+at+17.26.13.png" width="640" /></a></span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">こんな感じで、CurveTool加えて、Max Luma Pixel で [Go!] です。</span><br />
<span style="font-size: x-small;">そうすると、</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj50XHC8NC-QYHPT8HLrFM6T3bxnklXHM-9e4zCGxx9tpWjXAMZePw8teL3gNSWCrhKKKG7DwX26oanjWP1byQR7AuPqbVeA6IK17dOetFv12nQKr7i0e5V3gKFlL3Xct93F4u6DXKA209k/s1600/Screen+Shot+2016-02-09+at+17.26.20.png" imageanchor="1"><img border="0" height="382" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj50XHC8NC-QYHPT8HLrFM6T3bxnklXHM-9e4zCGxx9tpWjXAMZePw8teL3gNSWCrhKKKG7DwX26oanjWP1byQR7AuPqbVeA6IK17dOetFv12nQKr7i0e5V3gKFlL3Xct93F4u6DXKA209k/s640/Screen+Shot+2016-02-09+at+17.26.20.png" width="640" /></a></span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">こんなです。</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">これで、ジオメトリ上の特定の点がスクリーン座標上のどこを通ったかが分かったので、この2D座標をつかって、Pworldのカラー(rgb)をサンプルすると、そのrgb値がそのまま、その特定の点が通る(x,y,z)となります。</span><br />
<span style="font-size: x-small;">サンプルする方法は、tclの</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">[sample node channel x y]</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"> を用いるか、pythonの</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">nuke.sample(node, 'channel', x, y)</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">になります。簡単なのは、Axisだしてtclでtranslateに上のエクスプレションをはれば一応にくるんですが、nukeはこの手のエクスプレッションを毎フレーム評価するのが結構苦手です。</span><br />
<span style="font-size: x-small;">なので、そういう場合は毎フレーム計算実行するノードでかつpythonタブのついているもので、そのpython使って毎フレームAxisノードに座標をsetValueしていくのが回避策とされてます。CurveToolハックと呼ばれる手法です。</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">CurveToolが2回でてきているのでややこしいですが、今回のはpythonを毎フレーム実行してAxisノードのtranslateにsetValueするためのモノです。</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">Axisノードと新たに、CurveToolを作って、</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjWZXfvpo6de3YPPuSC0uQOZjV8HTceZQEYi4wbnmlF55OfnyGo0cHr0VX_o6J09e50BRXqyz-Os6sU98-LQV5BbdvhclbW6LQQSt3-jzzkk4zw0j3BnjYKVTxe-f4yf8GrfeHdTWSxx7e/s1600/Screen+Shot+2016-02-09+at+17.44.51.png" imageanchor="1"><img border="0" height="546" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjWZXfvpo6de3YPPuSC0uQOZjV8HTceZQEYi4wbnmlF55OfnyGo0cHr0VX_o6J09e50BRXqyz-Os6sU98-LQV5BbdvhclbW6LQQSt3-jzzkk4zw0j3BnjYKVTxe-f4yf8GrfeHdTWSxx7e/s640/Screen+Shot+2016-02-09+at+17.44.51.png" width="640" /></a></span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">CurveToolのpythonタブの[before each frame]にAxis2のtranslateに、Pworldの特定の点をsampleして得た値をsetValueするようなpythonを書きます。</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">nuke.toNode("Axis2")['translate'].setValue([r,g,b])</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">って具合です。[r,g,b]のところはコードが長いので、下記のように展開します。</span><br />
<span style="font-size: x-small;">[r,g,b] のところはたとえば実際にはrを書いてみると・・・</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">nuke.sample(nuke.toNode(Read4"), "Pworld.red", parent.CurveTool2.maxlumapixdata.x, parent.CurveTool2.maxlumapixdata.y)</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">この場合だと、nuke.toNode(Read4"), "Pworld.red" の代わりに、Shuffle17を使って、</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">nuke.sample(nuke.toNode("Shuffle17"), "red", parent.CurveTool2.maxlumapixdata.x, parent.CurveTool2.maxlumapixdata.y)</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">でも可能です。チャンネルは""でくるむ必要があるので注意を。rgbaは省略できます。</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">これをあとg,b分かいて、[]でくるんで、setValue()の中に入れます。</span><br />
<span style="font-size: x-small;">また、Axis2のtranslateには、アニメーションさせるため予め適当なフレームで「空(から)キーフレーム」を打っておきます。</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">これで、CurveTool3の[Go!]すると、</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6zYZEd1w0goWzN2rBgxnKkWoFB12uhz1hAkE_nGxVKrK1KmLyN_9JiN6Bg-ifj9FM44mkOjQLiG6ImMChxzMMQjL5FPcnwhQRe6ukCL64s_RoASoYupAaxK9fK6bgMtF_slVu2cQRidbL/s1600/Screen+Shot+2016-02-09+at+17.59.15.png" imageanchor="1"><img border="0" height="368" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6zYZEd1w0goWzN2rBgxnKkWoFB12uhz1hAkE_nGxVKrK1KmLyN_9JiN6Bg-ifj9FM44mkOjQLiG6ImMChxzMMQjL5FPcnwhQRe6ukCL64s_RoASoYupAaxK9fK6bgMtF_slVu2cQRidbL/s640/Screen+Shot+2016-02-09+at+17.59.15.png" width="640" /></a></span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">ってな感じでAxisのtranslateで特定の点の座標を得ることができます。</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;">実際には、こんなこと毎回するの面倒なので、ツール化するのが良いと思います。</span><br />
<span style="font-size: x-small;">これらをひとまとまりでやると、他では使えないツールになるので、前半と後半と分けてツールにするのが良いかと。実際ボクは前半部分はツール化したものを割と使っています。後半は、結構ニッチなのと、mayaから持って来た方が確実なので、そこまでやったことは無かったです:)</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><br /></span>
masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com2tag:blogger.com,1999:blog-738122545213927215.post-65762025322033443772015-07-05T10:24:00.001+09:002015-07-13T10:12:56.280+09:00secret of IBK<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">There are some nice tutorials about IBK in the following link,</span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">http://compositingmentor.com</span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">This is pretty much amazing! Thank you pretty much, Tony.</span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">IBK node which IBK Colour and IBK Gizmo have it inside themselves can be broken down into the following formula.</span></div>
<div>
<span style="background-color: #eeeeee;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif; line-height: 20px; white-space: pre-wrap;"><b style="background-color: white;">alpha = </b></span><span style="font-family: Arial, Helvetica, sans-serif;"><b>(Ag-Ar*rw-Ab*gbw)<=0?1:clamp(1-(Ag-Ar*rw-Ab*gbw)/(Bg-Br*rw-Bb*gbw))</b></span></div>
<div>
<span style="background-color: white; font-family: Arial, 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', Osaka, メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif; line-height: 20px; white-space: pre-wrap;"><b><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif;"><br /></span></b></span></div>
<div>
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;">A is pfg and B is c. and this is the the case of "Green" keying, I mean we choose "Green" on IBK.</span></span></div>
<div>
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;">rw is the value of "red weight" and gbw is the value of "green/blur weight".</span></span></div>
<div>
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;">So, When preparing clean plate with IBK Colour, we need to tweak the value of the "darks" and the "lights" on itself. The "darks" is the "offset" of the Grade node which affects on input plate in IBK Colour. The "lights" is the "multiple" of the Grade node as well.</span></span></div>
<div>
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;"><br /></span></span>
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;">Anyway, we compare green and red + blue. If the pixel goes "green > red + blue", the pixel would be remained. Or if the pixel goes to "green < red + blue", the pixel would be turned to black. I mean IBK Colour-wise.</span></span><br />
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;">When the green in the green screen looks saturated, I usually take the red or the blue value of "lights" up.</span></span></div>
<div>
<div>
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;">When the green in the green screen doesn't so saturated, I usually take the red or the blue value of "lights" down. This is the case of Green screen.</span></span></div>
<div>
<br />
<span style="font-family: Arial, ヒラギノ角ゴ Pro W3, Hiragino Kaku Gothic Pro, Osaka, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif; font-size: xx-small;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 20px; white-space: pre-wrap;"><br /></span></span></div>
<div>
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGb1oFfC72OJEANobYr3cDs6kilxQhqgDbkROuqUOKC5jo5hdx88OR03UJfx7C_tBmKG_hYF_rxZ0dnvCc0eysEhSXsTJEdD6xNZBmxx2H-gJaauiWAZwdqOuaVyAF8ZmDJZQNMtZY3y2h/s1600/fig001.png" imageanchor="1" style="background-color: #eeeeee; margin-left: auto; margin-right: auto;"><img border="0" height="243" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGb1oFfC72OJEANobYr3cDs6kilxQhqgDbkROuqUOKC5jo5hdx88OR03UJfx7C_tBmKG_hYF_rxZ0dnvCc0eysEhSXsTJEdD6xNZBmxx2H-gJaauiWAZwdqOuaVyAF8ZmDJZQNMtZY3y2h/s400/fig001.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">the top node(IBK Colour) of IBK Stack, this is the case of "Saturated"</span></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3is99oGzGPzXV8xOf6hhfQ-yAkVWrLtARSQl7doZy-w-v6eCMEawAbNV7f4JXqCpLNBKURDYb6dhfIeObTJIHqO6SfqIA6q6SMB-ZTz70lIhbjr60UQsbNzZBtJHtzIrk2d72VdVrMbOd/s1600/fig004.png" imageanchor="1" style="background-color: #eeeeee; margin-left: auto; margin-right: auto;"><img border="0" height="243" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3is99oGzGPzXV8xOf6hhfQ-yAkVWrLtARSQl7doZy-w-v6eCMEawAbNV7f4JXqCpLNBKURDYb6dhfIeObTJIHqO6SfqIA6q6SMB-ZTz70lIhbjr60UQsbNzZBtJHtzIrk2d72VdVrMbOd/s400/fig004.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">the top node(IBK Colour) of IBK Stack, this is the case of "Less Saturated"</span></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeQfCpSzk8XDOauq-pFz-dqosYeKisV9ePWsJmBbX_cNGH4gQkmhXBXGVqswZkdRiLtO0OlwPaTfqlo9ohoSnvBcofnD2-1kZks-DLdodNmzVnY5fL1wthzJo3BYBGFw_764JUlnQX4aKa/s1600/fig002.png" imageanchor="1" style="background-color: #eeeeee; margin-left: 1em; margin-right: 1em;"><img border="0" height="222" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeQfCpSzk8XDOauq-pFz-dqosYeKisV9ePWsJmBbX_cNGH4gQkmhXBXGVqswZkdRiLtO0OlwPaTfqlo9ohoSnvBcofnD2-1kZks-DLdodNmzVnY5fL1wthzJo3BYBGFw_764JUlnQX4aKa/s400/fig002.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">the clean plate which is the resulted of IBK stack.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: #eeeeee;"><br /></span></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs22QY2o6HK8f3-4_MNFecEGUy_fGLjuCCwls_yLnUqI5431oKThqXh39S-6q5uXIoR4XOPNv0yWgCvY-G6DQPkbm5F_cXW3MDzLSvUQ0LChv0J3U-o7y8w0t-8forFf0J77Gd7BGsbtk3/s1600/fig003.png" imageanchor="1" style="background-color: #eeeeee; margin-left: auto; margin-right: auto;"><img border="0" height="222" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs22QY2o6HK8f3-4_MNFecEGUy_fGLjuCCwls_yLnUqI5431oKThqXh39S-6q5uXIoR4XOPNv0yWgCvY-G6DQPkbm5F_cXW3MDzLSvUQ0LChv0J3U-o7y8w0t-8forFf0J77Gd7BGsbtk3/s400/fig003.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">checking for key extract</span></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: #eeeeee;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: #eeeeee; font-size: x-small; line-height: 20px; white-space: pre-wrap;">And "use bkg luminance" on "IBK Gizmo" works like "Additive Keyer"</span></span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><span style="line-height: 20px; white-space: pre-wrap;">See </span>http://www.nukepedia.com/written-tutorials/additive-keyer/</span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">This is also awesome great tutorial.</span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="background-color: #eeeeee; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">(CC) Blender Foundation | mango.blender.org</span></div>
</div>
masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com2tag:blogger.com,1999:blog-738122545213927215.post-76676875499604570232015-03-02T16:23:00.002+09:002015-03-02T16:29:06.831+09:00operationChangerI would like to share operationChanger.py I just made.<br />
<br />
<a href="https://drive.google.com/file/d/0B77RQxzB7Z2ackFkakIxNjNDSU0/view?usp=sharing">operationChanger.py</a><br />
<br />
The function is like this,,,<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/vSZyt2yYiZg/0.jpg" frameborder="0" height="266" src="http://www.youtube.com/embed/vSZyt2yYiZg?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
<br />
<br />masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-40977795739622661692015-01-28T16:40:00.001+09:002015-01-28T16:49:13.789+09:00lerp()expression でlerp()ってがある。<br />
任意のアニメーション(curve)のfitコマンドみたいなものみたい・・・<br />
既に、アニメーションがついているknobに対して、<br />
<br />
lerp(30, f(30), 90, f(74), x)<br />
<br />
とかってやると、既についていたアニメーションの30フレーム目を起点に、74フレーム目の値を90フレーム目に持っていく→74フレーム目の値を90フレーム目にシフトする用に補完し直す。って感じ。<br />
<br />
y = f(x) のつもりです。この場合xが時間軸、yがその値。<br />
<br />
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)masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-19354686888309853272015-01-12T15:27:00.004+09:002015-01-15T10:07:23.245+09:00cacheBakerI made this gizmo for kinda "baking".<br />
Have fun!<br />
<br />
<a href="https://drive.google.com/file/d/0B77RQxzB7Z2aZlF5blFSd3lQX2M/view?usp=sharing">https://drive.google.com/file/d/0B77RQxzB7Z2aZlF5blFSd3lQX2M/view?usp=sharing</a><br />
<br />
I updated it. <i>2015.01.13 17:00PM PST</i>masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-86163233033305517072014-12-16T08:04:00.002+09:002014-12-16T08:04:44.776+09:00expression in "filter" knob<span style="font-size: small;">TransformノードやReformatノードのfilterにexpressionを張りたいときは、</span><br />
<span style="font-size: small;">If you want to add expression at "filter" in Transform node or Reformat node,</span><br />
<span style="font-size: small;"><br /></span>
<span style="font-size: small;">ノード選択してコピーして、Script Editorでペーストする。</span><br />
<span style="font-size: small;">Select the node and copy and then paste in Script Editor.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZaQw_oyvsDVtavckZwEUc_i_X0RirEhs6tQQaozDzJiB4fvKw4w6D4vFAFX3yoL2Iqr4fxta1K6nq0wbS-f9LkZMowb0alb5IjgD8_PqlRQjntDDmo5TcsLsKiR9f6eG3VaMlsfqD8G_A/s1600/001.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZaQw_oyvsDVtavckZwEUc_i_X0RirEhs6tQQaozDzJiB4fvKw4w6D4vFAFX3yoL2Iqr4fxta1K6nq0wbS-f9LkZMowb0alb5IjgD8_PqlRQjntDDmo5TcsLsKiR9f6eG3VaMlsfqD8G_A/s1600/001.PNG" height="166" width="400" /></a></span></div>
<br />
<span style="font-size: small;">ここでnameの直前に、インデントをあわせて、filter {{Transform1.filter}} を加える。</span><br />
<span style="font-size: small;">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.</span><br />
<span style="font-size: small;"><br /></span>
<div style="background-color: #e6e6e6; font-family: Times; font-size: 13px;">
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: "MS PGothic"; line-height: normal; white-space: normal;">
<div style="margin: 0px;">
<span style="font-size: small;"> filter {{Transform1.filter}}</span></div>
</div>
</pre>
</div>
<br />
<br />
この場合、Transform1のfilterに向けてリンクがはられる。<br />
In this case, this is the "link" to the "filter" knob of Transform1.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEj2d2MX3RQBxHQ7-ieZKVPXQmfwABkZo9zkOSrNuF5VWSPhZfdVUhbDiyZaSqK4mt3YmVs8bHRy_TQtu-dcD6jezeK5msRmKRzcz5tPW4hq-BJXb1M6HrdWX76t8e4yq9pMr0oYkES1N9/s1600/002.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEj2d2MX3RQBxHQ7-ieZKVPXQmfwABkZo9zkOSrNuF5VWSPhZfdVUhbDiyZaSqK4mt3YmVs8bHRy_TQtu-dcD6jezeK5msRmKRzcz5tPW4hq-BJXb1M6HrdWX76t8e4yq9pMr0oYkES1N9/s1600/002.PNG" height="250" width="400" /></a></div>
<br />
<br />
あとは、このScript Editorの内容をノードグラフすればTransform1のfilterにリンクしたTransformノードができる。<br />
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.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixheBMq9VSQ7ZlB_Jk5taJI0HLgF29kJtUG5cA_EniD2Cmo5WEFKKpwzurS7L2U6CJVqIkaA9GQQQY9rKOjkN3JgNTUh6sFRdyIXyN6FeL6-LsbsdIZN5DzmS7auVWbzAMc4YrA444Hie6/s1600/003.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixheBMq9VSQ7ZlB_Jk5taJI0HLgF29kJtUG5cA_EniD2Cmo5WEFKKpwzurS7L2U6CJVqIkaA9GQQQY9rKOjkN3JgNTUh6sFRdyIXyN6FeL6-LsbsdIZN5DzmS7auVWbzAMc4YrA444Hie6/s1600/003.PNG" height="127" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-26313978801196288612014-11-03T18:56:00.001+09:002014-11-03T19:08:04.527+09:00ColorMatrixColorMatrixノードはピクセルのrgb値に対して指定したmatrixを掛けてくれるものだ。<br />
たとえば、world spaceのnormalパスがあるとして、これをcamera spaceのnormalパスに変換したい場合、world spaceのnormalにカメラの回転マトリクスの逆行列をかければいい。<br />
<br />
CameraMatrix allow us to multiply a "matrix" by the value of rgb.<br />
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. <br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAGBU4qXCAoGrFLGq9ZiHuxywuxS49lj0YQ4mU3d5AoiEC9rZeJmjDl2i1vvNjBJ91cEaniTidCZtMdPNLtoltYqHbtlb368a-G3fQJUAycYivi1n6vKTBv906r8aqbVPbS5cGwT0vikd8/s1600/001.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAGBU4qXCAoGrFLGq9ZiHuxywuxS49lj0YQ4mU3d5AoiEC9rZeJmjDl2i1vvNjBJ91cEaniTidCZtMdPNLtoltYqHbtlb368a-G3fQJUAycYivi1n6vKTBv906r8aqbVPbS5cGwT0vikd8/s1600/001.PNG" height="202" width="400" /></a></div>
<br />
<br />
<br />
<br />
また、カメラの回転マトリクスは、カメラのスケールが(1,1,1)であれば、"Camera"ノードのworld matrixの((0,1,2), (4,5,6), (8,9,10)) として得ることができる。<br />
<br />
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]. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioNlaQPA16jT6o-5Dv0d-XADM70bYQQY37g3ykWp5YXVPDOxjKSybuqKLi2h9uDu9v2A31UA2MpopNSydMD8bk8hyphenhyphen057RSXCEOjWi7jM5i8xZ26dD41gmxpsoAR7-d8TF0S1G1ApFRNG10/s1600/002.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioNlaQPA16jT6o-5Dv0d-XADM70bYQQY37g3ykWp5YXVPDOxjKSybuqKLi2h9uDu9v2A31UA2MpopNSydMD8bk8hyphenhyphen057RSXCEOjWi7jM5i8xZ26dD41gmxpsoAR7-d8TF0S1G1ApFRNG10/s1600/002.png" height="400" width="362" /></a></div>
<br />
<br />
なので、これをColorMatrixノードに代入する。逆行列ってのはこのColorMatrixのinverseにチェックをいれればOKです。<br />
<br />
And then, put them in ColorMatrix node. Because we use it as inverse matrix, just check "inverse" box.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg91i_HxPZ5GDv8oiZ1HXP3HjCDnQBQJG8GeLO0x1eUHx7hAA0lxNpfUlDuvX_f-7vLhhvJBWi7TL5eSC3hbNCpaJvcr9yhfgM914-NEUd_Y5Qoludm8_GHLMO_R56dYRqz1orZum_JBEn2/s1600/003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg91i_HxPZ5GDv8oiZ1HXP3HjCDnQBQJG8GeLO0x1eUHx7hAA0lxNpfUlDuvX_f-7vLhhvJBWi7TL5eSC3hbNCpaJvcr9yhfgM914-NEUd_Y5Qoludm8_GHLMO_R56dYRqz1orZum_JBEn2/s1600/003.png" height="201" width="400" /></a></div>
<br />
<br />
<br />
その後、このColorMatrixノードをworld spaceのnormalパスにつなげると<br />
<br />
After that, we connect the input of this ColorMatrix to the Read node which has normal pass in world space......<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ZjiTlNLOjH-7KltLnFSwdUoy1NGMKUPvDXIVKnNDy9IqPyzpVD3BsPmol5LfD2FgZoJ9rM7dITW0TOuDmU8r6dOZ4cv05xa8IXaw5-sv_gNObgByOBXzXRWOVDNdQfUsSfLJc_6XlgtS/s1600/004.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ZjiTlNLOjH-7KltLnFSwdUoy1NGMKUPvDXIVKnNDy9IqPyzpVD3BsPmol5LfD2FgZoJ9rM7dITW0TOuDmU8r6dOZ4cv05xa8IXaw5-sv_gNObgByOBXzXRWOVDNdQfUsSfLJc_6XlgtS/s1600/004.PNG" height="236" width="400" /></a></div>
<br />
<br />
<br />
normal pass(world space) > normal pass(camera space) の変換ができる。<br />
逆に、camera space を world space に変えたい場合は、inverseのチェックをはずせばいい。<br />
<br />
And We can get the normal pass in camera space!<br />
In case that camera space one would be converted to world space one, we don't need to check "inverse" box.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvqg_efy5FpUwe2wZ-3SXLnYmuxsNH8V90ts6AR-v3Es8ReWVUFYVnAX4iAyaEzBzB50MT7wyqV6nwYnqBSEWoQ3r02HeNWQYN703bYsDcxWIbeWACcHc0EzMZh0eT8vzrYEvG8OzCByrU/s1600/005.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvqg_efy5FpUwe2wZ-3SXLnYmuxsNH8V90ts6AR-v3Es8ReWVUFYVnAX4iAyaEzBzB50MT7wyqV6nwYnqBSEWoQ3r02HeNWQYN703bYsDcxWIbeWACcHc0EzMZh0eT8vzrYEvG8OzCByrU/s1600/005.PNG" height="195" width="400" /></a></div>
<br />
<br />
この方法で、normal pass の回転も可能です。<br />
<br />
You can rotate your normal pass in this way.masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-10016750451294703172014-11-03T10:28:00.004+09:002014-11-03T11:32:14.489+09:00pyAlembicYou can find pyAlembic for windows in the following link.<br />
<br />
<a href="http://pyalembic.sourceforge.net/">http://pyalembic.sourceforge.net/</a><br />
<a href="http://sourceforge.net/projects/pyalembic/files/">http://sourceforge.net/projects/pyalembic/files/</a><br />
<br />
<br />
Actually in my Environment,<br />
<br />
AlembicPyIex.dll<br />
AlembicPyImath.dll<br />
awBoost_python-1_52.dll<br />
<br />
alembic.pyd<br />
iex.pyd<br />
imath.pyd<br />
<br />
I have these files in the folder which is contained in result of "nuke.pluginPath()"<br />
<br />
<br />
<br />masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-78977378711968288752014-10-22T18:02:00.001+09:002014-10-22T18:02:36.406+09:00matrix<br />
matrixに値を入れたいとき、
<br />
<div style="background-color: #e6e6e6; font-family: Times; font-size: 13px;">
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
<div style="margin: 0px;">
<span style="font-size: small;">node['matrix'].setValueAt(value, frame, index) </span></div>
</div>
</pre>
</div>
matrixの値を取得したいとき、
<span style="color: #333333; font-family: Georgia, serif; font-size: x-small;"><span style="background-color: #e6e6e6; line-height: 20.7999992370605px;"></span></span><br />
<div style="background-color: #e6e6e6; font-family: Times; font-size: 13px;">
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
<div style="margin: 0px;">
<span style="font-size: small;">node['matrix'].getValueAt(frame)[index]</span></div>
</div>
</pre>
</div>
<br />
<br />
<br />
When you want to set the value into matrix,<br />
<div style="background-color: #e6e6e6; font-family: Times; font-size: 13px;">
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
<div style="margin: 0px;">
<span style="font-size: small;">node['matrix'].setValueAt(value, frame, index) </span></div>
</div>
</pre>
</div>
When you want to get the value of matrix,<br />
<div style="background-color: #e6e6e6; font-family: Times; font-size: 13px;">
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
<div style="margin: 0px;">
<span style="font-size: small;">node['matrix'].getValueAt(frame)[index]</span></div>
</div>
</pre>
</div>
<br />
<br />masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-64007780235785284512014-10-15T15:16:00.001+09:002014-10-17T00:44:03.353+09:00ノードグラフ上でノードを移動するツールあれ?これって標準であったりする?<br />
<div>
ノードグラフ上でグリッドの値だけノードをオフセットするツール。</div>
<div>
<br /></div>
<div>
NodeShift.py<br />
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div>
<div style="margin: 0px;">
<span style="font-family: Times;"><span style="white-space: normal;">import nuke</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">def shiftHP():</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> shiftH = nuke.toNode('preferences')['GridWidth'].value()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> sn = nuke.selectedNodes()<span class="Apple-tab-span" style="white-space: pre;"> </span></span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> for n in sn:</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> posX = n['xpos'].value()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> newPosX = posX + shiftH</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> n['xpos'].setValue(newPosX)</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">def shiftHN():</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> shiftH = nuke.toNode('preferences')['GridWidth'].value()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> sn = nuke.selectedNodes()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> for n in sn:</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> posX = n['xpos'].value()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> newPosX = posX - shiftH</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> n['xpos'].setValue(newPosX)</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">def shiftVP():</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> shiftV = nuke.toNode('preferences')['GridHeight'].value()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> sn = nuke.selectedNodes()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> for n in sn:</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> posY = n['ypos'].value()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> newPosY = posY - shiftV</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> n['ypos'].setValue(newPosY)</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">def shiftVN():</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> shiftV = nuke.toNode('preferences')['GridHeight'].value()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> sn = nuke.selectedNodes()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">
</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> for n in sn:</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> posY = n['ypos'].value()</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> newPosY = posY + shiftV</span></span>
<span style="font-family: Times;"><span style="white-space: normal;"> n['ypos'].setValue(newPosY)</span></span></div>
</div>
</pre>
</div>
<br />
<br />
でmenu.pyに<br />
<br />
menu.py<br />
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="margin: 0px;">
<span style="font-family: Times;"><span style="white-space: normal;">import NodeShift</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">m.addCommand("shiftHP", "NodeShift.shiftHP()", "ctrl+shift+Right")</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">m.addCommand("shiftHN", "NodeShift.shiftHN()", "ctrl+shift+Left")</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">m.addCommand("shiftVP", "NodeShift.shiftVP()", "ctrl+shift+Up")</span></span>
<span style="font-family: Times;"><span style="white-space: normal;">m.addCommand("shiftVN", "NodeShift.shiftVN()", "ctrl+shift+Down")</span></span></div>
</pre>
</div>
<br />
の記述を加えれば。ctrl + shift + カーソルキー(矢印キー)で選んだノードを矢印方向に1グリッドだけ動かせる。複数選択でもOK。<br />
<br /></div>
masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com2tag:blogger.com,1999:blog-738122545213927215.post-81713421474103735052014-10-09T15:49:00.000+09:002015-01-31T15:24:12.847+09:00キーフレームにアクセスする今回も、果たして誰かの役にたっているのだろうか・・・ というかなり備忘録的なpythonに関してです。<br />
<div>
<br /></div>
<div>
あるattributeにアニメーションがついているとして、そのキーフレームにアクセスして値を取得したり、シフトしたりしたいとします。<br />
たとえばその場合、Transform1ノードのtranslateにx,yについている2個目のキーフレームの値を取得したい場合。<br />
<br />
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
</div>
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; margin: 0px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: "MS PGothic"; line-height: normal; white-space: normal;">
<div style="margin: 0px;">
<span style="font-family: Times;">nuke.toNode('Transform1')['translate'].animation(0).keys()[1].y</span></div>
</div>
</pre>
</div>
となり、これが、xのアニメーション( animation(0) )の2個目のキーフレーム( keys()[1] )の値( y ) となります。<!--EndFragment--><br />
また、その2番目のキーフレームが何フレーム目に存在しているかってのは、<br />
<br />
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: "MS PGothic"; line-height: normal; white-space: normal;">
<span style="font-family: Times;">nuke.toNode('Transform1')['translate'].animation(0).keys()[1].x</span></div>
</pre>
</div>
<br />
となります。実行すると、そのフレームナンバーが返ってきます。<br />
Graph Editor上でのxとy、つまり時間軸とその値です。<br />
<br />
また、そのキーフレームの値を変更する場合は・・・<br />
<br />
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: "MS PGothic"; line-height: normal; white-space: normal;">
nuke.animation("<span style="font-family: Times;">Transform1</span>.translate.x" , "x", ("2", "10"))</div>
</pre>
</div>
<br />
これで、Transform1 ってノードのattribute "translate.x" ( 位置のx座標 ) をフレームナンバー的( x ) に3個目のキーフレーム ( "2" ) を10フレーム目 ( "10" ) に移動させるといったことになります。<br />
<br />
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: "MS PGothic"; line-height: normal; white-space: normal;">
nuke.animation("<span style="font-family: Times;">Transform1</span>.translate.x" , "y", ("2", "-30"))</div>
</pre>
</div>
<br />
これで、Transform1 の translate.x の3個目のキーフレームの値を( GraphEditor的にy値を )、-30 にするってことになります。<br />
<br />
値を取得する場合は、<br />
<br />
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: "MS PGothic"; line-height: normal; white-space: normal;">
<span style="font-family: Times;">animation(i).keys() </span></div>
</pre>
</div>
<br />
で、値を変更したい場合は、<br />
<br />
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; line-height: normal; white-space: normal;">
<span style="font-family: MS PGothic;">nuke.animation("</span><span style="font-family: Times;">ノード名</span><span style="font-family: MS PGothic;">.アトリビュート名" , "コマンド名", (コマンドの種類に応じた引数))</span></div>
</pre>
</div>
<br />
となります。<br />
後者はココが参考になるかと。<br />
<a href="http://www.nukepedia.com/python/using-nukeanimation-without-tearing-your-hair-out">http://www.nukepedia.com/python/using-nukeanimation-without-tearing-your-hair-out</a><br />
<br />
<br /></div>
masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-86460952188316637202014-10-03T15:08:00.002+09:002015-01-16T13:05:22.132+09:00ディレクトリをOSのファイルブラウザから開くnukeは、ファイルブラウズにOSのファインダーやエクスプロラーなどといったものを使わずにnuke独自のものを使ってファイルを読み込んだりする。<br />
<div>
が、時にこれが不便だったりする。特にReadノードのファイルパスの階層を開きたいとか、同じくWriteノードで指定しているファイルパスの階層にいきたいとか・・・</div>
<div>
<br /></div>
<div>
そんなときに長方するスクリプトです。</div>
<div>
<br /></div>
<div>
dirOpen.py</div>
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
import nuke</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
import os</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
def main():</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
sn = nuke.selectedNode()</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
fP = sn['file'].value()</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
dirP = os.path.dirname(fP)</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
dirP = dirP.replace("/", "\\")</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
dirP = dirP + "\\"</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
#print dirP</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
os.popen("explorer.exe" + " " + os.path.dirname(dirP))</div>
</pre>
</div>
<div>
<br /></div>
<div>
dirOpen,pyとか適当に名前をつけて保存して、nukeのpluginPathに保存します。</div>
<div>
ちなみにmacの場合は・・・</div>
<div>
<br /></div>
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
import nuke</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
import os</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
def main():</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
sn = nuke.selectedNode()</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
fP = sn['file'].value()</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
dirP = os.path.dirname(fP)</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
</div>
<div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
os.popen("open" + " " + os.path.dirname(dirP))</div>
<div>
</div>
</pre>
</div>
<div>
<br /></div>
<div>
あとは、menu.pyに登録します。</div>
<div>
<br /></div>
<div>
menu.py<br />
<div style="background-color: #e6e6e6;">
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><div style="color: black; font-family: 'MS PGothic'; line-height: normal; white-space: normal;">
<div style="margin: 0px;">
<span style="font-size: small;">import dirOpen</span></div>
<div style="margin: 0px;">
<span style="font-size: small;">
</span></div>
<div style="margin: 0px;">
<span style="font-size: small;">m = nuke.menu("Nodes")</span></div>
<div style="margin: 0px;">
<span style="font-size: small;">m.addCommand("dirOpen", "dirOpen.main()", "ctrl+shift+o") </span></div>
</div>
</pre>
<div style="color: #333333; font-family: Times; font-size: 13px; line-height: 20.7999992370605px;">
<br /></div>
<div>
<div style="color: #333333; font-family: Times; font-size: 13px; line-height: 20.7999992370605px;">
この場合、ctrl + shift + o ってショートカットを当ててます。
</div>
<span style="color: #333333; font-family: Times; font-size: x-small;"><span style="line-height: 20.7999992370605px;">ReadノードやWriteノードを選んで、そのショートカットを実行するとOSのファイルブラウザでその階層が開けます。</span></span></div>
</div>
</div>
masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com5tag:blogger.com,1999:blog-738122545213927215.post-42698214202052109962014-10-01T13:10:00.001+09:002014-10-01T13:10:59.801+09:00ノードにあるpythonタブの活用 とか諸々ノードによってはPropertyにPythonタブがあるものがある。<br />
たとえば、Writeノードとか。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf0GnJsqn53yUG9xZJf6emmi_dAXrK3s9rF25JyrQcMqajn6A0Mymgc6y49_knpbnfWKHrRGbWN30S5phTxIJUh8P7pAVnK_DwYBeJK-au66K0wLJUH40WCRyB9MkG21SUSvIX91sag01c/s1600/001.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf0GnJsqn53yUG9xZJf6emmi_dAXrK3s9rF25JyrQcMqajn6A0Mymgc6y49_knpbnfWKHrRGbWN30S5phTxIJUh8P7pAVnK_DwYBeJK-au66K0wLJUH40WCRyB9MkG21SUSvIX91sag01c/s1600/001.PNG" height="166" width="400" /></a></div>
<br />
ここにpythonを読み込むと、たとえば、Writeノードのファイルパス(指定のファイルパスのフォルダディレクトリ/フォルダ)がなければ、レンダー時にそのディレクトリを作成するといったことも可能だ。<br />
具体的には、まずこのWriteノード( nuke.thisNode() )のファイルパス( ['file'].value() )が、存在しなければ( if not os.path.exists() )そのディレクトリを作成する( os.makedirs() )、って言う具合なpythonを書く。<br />
<br />
<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;">import os
sn = nuke.thisNode()
fp = sn['file'].value()
dirP = os.path.dirname(fp)
if not os.path.exists(dirP):
os.makedirs(dirP)</pre>
<br />
こんな感じ。<br />
これをファンクションとして定義して、.pyで保存する。<br />
<br />
makeDir.py<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><span style="color: #333333;"><span style="line-height: 15px;">import os
import nuke
def main():
sn = nuke.thisNode()
fp = sn['file'].value()
dirP = os.path.dirname(fp)
if not os.path.exists(dirP):
os.makedirs(dirP)</span></span><span style="color: #333333; line-height: 15px;">
</span></pre>
<div>
<br /></div>
<div>
<br />
これを、プラグインパスとして読み込むことのできる場所においてやる。<br />
ちなみに、プラグインパス の調べ方は、スクリプトエディタで nuke.pluginPath() とやればOKです。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0BlagWgmSB7mvPTLKaolYu6BuYFUINegTQCwweflmxnabGLdaVWPcO6DhLNaiPWeH2YLPVsDIhOZ9r1N-hVJxh37IcwszfM4rYR9qRdDKQLTOjWptbj8LFIi07fFQTgbf7OS8cZQWDp-p/s1600/002.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0BlagWgmSB7mvPTLKaolYu6BuYFUINegTQCwweflmxnabGLdaVWPcO6DhLNaiPWeH2YLPVsDIhOZ9r1N-hVJxh37IcwszfM4rYR9qRdDKQLTOjWptbj8LFIi07fFQTgbf7OS8cZQWDp-p/s1600/002.PNG" height="115" width="400" /></a></div>
<br />
こんな感じででます。もし、この際あたらしいパスを追加したいって場合は、<a href="http://tiraoka.blogspot.ca/2014/09/nukepluginaddpath.html">こちら</a>を参照してください。<br />
<br />
ともあれ、その場所に上記 makeDir.py をおいたらWriteノードのPythonタブのbefore renderのところに、<br />
<br />
<br />
<div>
</div>
<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; margin: 0px; orphans: auto; overflow-x: auto; overflow-y: hidden; padding: 5px; text-align: start; text-indent: 0px; widows: auto;"><span style="color: #333333;"><span style="line-height: 15px;">import makeDir;</span></span><span style="color: #333333; line-height: 15px;">makeDir</span><span style="color: #333333; line-height: 15px;">.main()</span></pre>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb0C2_aaAt0i0Clq-IjDwbHrZp4wtvM9qeNdqbE8i1IdOlU_1r69u11HayGHvIlbVrOSJSn18-lqOOeUcNV_9pb4eAxP6IIzbPVbwtXu-FomcELkWdsa8EehxMLaw4PHsWyiPD3rWuTw3X/s1600/003.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb0C2_aaAt0i0Clq-IjDwbHrZp4wtvM9qeNdqbE8i1IdOlU_1r69u11HayGHvIlbVrOSJSn18-lqOOeUcNV_9pb4eAxP6IIzbPVbwtXu-FomcELkWdsa8EehxMLaw4PHsWyiPD3rWuTw3X/s1600/003.PNG" height="151" width="400" /></a></div>
<br />
<br />
という具合に書けば、あとは、Writeノードのファイルパスがなければ、自動的にそのフォルダ構造をつくってくれます。<br />
その一行の中にある ; (セミコロン)は改行をしめしている。<br />
つまり、本当は、<br />
<br />
<br />
<div>
</div>
<br />
<pre style="-webkit-text-stroke-width: 0px; background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; overflow-x: auto; overflow-y: hidden; padding: 5px; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px;"><span style="color: #333333; line-height: 15px;">import </span><span style="color: #333333; line-height: 15px;">makeDir</span>
<span style="color: #333333;"><span style="line-height: 15px;">makeDir.main()</span></span><span style="color: #333333; line-height: 15px;">
</span></pre>
<br />
って二行を表現している。 プラグインパス内にあるmakeDir.pyを読んできて、そのmakeDir.pyのmain()って関数を実行する makeDir.main() という意味だ。<br />
<br />
もどって、Writeノードのファイルパスに適当なパスを入れてみて、</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSR9SP2Ez5g3Pst5LsHcnTPw5eRY64R8Qnt3gZ2sUu6oUdPXEI8_HwM6aDqB34rWK6AiIVM7iJ0ahaivpQaZyFGTmZGTFjenWXuVzsc6lxuDo0C2CP5SwGF4fs90VUojtJYZzH2q6CGsu9/s1600/004.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSR9SP2Ez5g3Pst5LsHcnTPw5eRY64R8Qnt3gZ2sUu6oUdPXEI8_HwM6aDqB34rWK6AiIVM7iJ0ahaivpQaZyFGTmZGTFjenWXuVzsc6lxuDo0C2CP5SwGF4fs90VUojtJYZzH2q6CGsu9/s1600/004.PNG" height="181" width="400" /></a></div>
<br />
これで、このパスは実際には(このA/B/Cって3つのフォルダが)存在しないのだけど・・・<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpUG3UgZnlcT76If9cSMBtlSxS9Rt4Y-QlYt5DZ6E7JMs3lN46_cJsvFMWPNeWEqjdcovTyvpHWOQ479EJ3QGRjUgxvE5ssrytcqic5h_uxfaoHhqxeHdIBAmUdv4t58pvdYEqAiIKfDYV/s1600/005.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpUG3UgZnlcT76If9cSMBtlSxS9Rt4Y-QlYt5DZ6E7JMs3lN46_cJsvFMWPNeWEqjdcovTyvpHWOQ479EJ3QGRjUgxvE5ssrytcqic5h_uxfaoHhqxeHdIBAmUdv4t58pvdYEqAiIKfDYV/s1600/005.PNG" height="203" width="400" /></a></div>
<br />
レンダリングすると、<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiPMvTlYPnOHle3DpgWP7BTI0yM-y1lvEhUL-sEFPeYFPPYKrTRYHlO5SHOlTCJM98RxqupWhgotgWc5PvTnYdj0CS0eqEFbGF2_IldhstSW6PoXNthM2EMlrWXjYRR7YTa5AbwXB27Kii/s1600/006.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiPMvTlYPnOHle3DpgWP7BTI0yM-y1lvEhUL-sEFPeYFPPYKrTRYHlO5SHOlTCJM98RxqupWhgotgWc5PvTnYdj0CS0eqEFbGF2_IldhstSW6PoXNthM2EMlrWXjYRR7YTa5AbwXB27Kii/s1600/006.PNG" height="203" width="400" /></a></div>
<br /></div>
<div>
バージョンアップ(v001→v002)とかだと結構便利に使えます。ファイルパスのバージョンアップには最適です。<br />
ちなみに、/test.v001/test.v001.%04d.exr だとか、/test_v001/test_v001_%04d.exr ってなファイルパスを含むReadノードやWriteノードを選択した状態で、alt+キーボードの矢印の上下(↑↓)で、バージョンを上げ下げできます。<br />
<br />
また、こういうのはWriteノード作るたびにPythonタブのところに、上記の一行をいれるのは非常に面倒なので、menu.pyに<br />
<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><span style="color: #333333;"><span style="line-height: 15px;">nuke.knobDefault("Write.beforeRender", "</span></span><span style="color: #333333;"><span style="line-height: 15px;">import makeDir;</span></span><span style="color: #333333; line-height: 15px;">makeDir</span><span style="color: #333333; line-height: 15px;">.main()</span><span style="color: #333333; line-height: 15px;">")</span></pre>
<br />
の一行を書き加えておく。そうすると起動時にWriteノードにデフォルトでクダンの一行が書き加わり、今後新しく作るWriteノードにはその処理がなされる。<br />
<br />
ちなみに、WriteノードのPythonタブに書き加えた<br />
<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><span style="color: #333333;"><span style="line-height: 15px;">import makeDir;</span></span><span style="color: #333333; line-height: 15px;">makeDir</span><span style="color: #333333; line-height: 15px;">.main()</span></pre>
<br />
は二行であらわさないといけないから ; (セミコロン)が入っているが、menu.pyに<br />
<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><span style="color: #333333;"><span style="line-height: 15px;">import makeDir</span></span></pre>
<div>
<span style="color: #333333; line-height: 15px;"><br /></span></div>
<div>
<span style="color: #333333; line-height: 15px;">の一行がはいっていれば、</span></div>
<div>
<br /></div>
<div>
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; overflow-x: auto; overflow-y: hidden; padding: 5px;"><span style="color: #333333; line-height: 15px;">makeDir</span><span style="color: #333333; line-height: 15px;">.main()</span></pre>
</div>
<div>
<span style="color: #333333; line-height: 15px;"><br /></span></div>
<div>
<span style="color: #333333; line-height: 15px;">だけでよい。</span></div>
</div>
masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com1tag:blogger.com,1999:blog-738122545213927215.post-50547949935411163432014-09-08T15:04:00.000+09:002014-09-08T15:04:26.800+09:00NaN の話いろいろ作業をしていると[NaN]という数値(?)を持ったピクセルに出くわすことがある。NaN → http://en.wikipedia.org/wiki/NaN<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb8AM4EQCap63yJRgYWRguIBBLVejxrclbYFT5Ht9TTSE7iDjMrezv1UwJOCY-jVeHoe3exVwg4EBekKyzay5wxWmKvSJgmy9SRb6vWuLUQnzvGEu6Gs2woiaYDrJG3nndXABXk9z-V3nB/s1600/Screen+Shot+2014-09-07+at+22.56.15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb8AM4EQCap63yJRgYWRguIBBLVejxrclbYFT5Ht9TTSE7iDjMrezv1UwJOCY-jVeHoe3exVwg4EBekKyzay5wxWmKvSJgmy9SRb6vWuLUQnzvGEu6Gs2woiaYDrJG3nndXABXk9z-V3nB/s1600/Screen+Shot+2014-09-07+at+22.56.15.png" height="440" width="640" /></a></div>
<br />
<br />
原因はいろいろだけど、expressionなどで 0÷0(0割る0) みたいな計算があるとなるし、一見expression等がなくてもGizmoに含まれていることもある。<br />
これがナカナカ厄介で、これをblurなどのピクセル拡張系のノードで処理すると拡大する。
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfZvq_9zrzyBEWZCGpbcLMfN9PxyRZacXLikWV-pIatREbG-S3EWj7U-AeWzLC7dJKDsh0EWE0ncSvQ0Upz27LCjtArAvcA3hdB_5oIpPh_bA_8GdudY742vpOCNNU_a76pLIKpuWP1eLe/s1600/Screen+Shot+2014-09-07+at+22.59.29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfZvq_9zrzyBEWZCGpbcLMfN9PxyRZacXLikWV-pIatREbG-S3EWj7U-AeWzLC7dJKDsh0EWE0ncSvQ0Upz27LCjtArAvcA3hdB_5oIpPh_bA_8GdudY742vpOCNNU_a76pLIKpuWP1eLe/s1600/Screen+Shot+2014-09-07+at+22.59.29.png" height="338" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtcAiEC_mAkl70l0JXlg9lJX-sqv753IAsM3qRqs-ooBC3PkQ8iEWi52JvrUbkj7yjQr108oZr6aMNCcD-OWeYmPSjsR7gnMyRaF_m2yKTeFbwZXWmcKus9TEW-FLqS60gwq4KBbUpZaNl/s1600/Screen+Shot+2014-09-07+at+22.59.10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtcAiEC_mAkl70l0JXlg9lJX-sqv753IAsM3qRqs-ooBC3PkQ8iEWi52JvrUbkj7yjQr108oZr6aMNCcD-OWeYmPSjsR7gnMyRaF_m2yKTeFbwZXWmcKus9TEW-FLqS60gwq4KBbUpZaNl/s1600/Screen+Shot+2014-09-07+at+22.59.10.png" height="338" width="640" /></a></div>
<br />
これを回避する方法がnukepediaにも載っている(http://www.nukepedia.com/expressions/dealing-with-nan-pixels)、この方法だと、広範囲だったり、数ピクセルの間で点在している場合は回避しづらいので、そういう場合はMergeExpressionなどを使って原因となるノードの一つ前のノードをAにコネクトして、<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiducdQi5dxG5RYw6ZRAi1PI_ZI3EwDB89Dvyfvg5UtaJ0rVvepBvj3E8ufSgcgNLPIbnGnQLedHUQy3BuY1WrcbAWsdoAXGwrafCo769nn8R5mSlOsR4HyUCMK6R_Qv09hRw-u_1_P-FN0/s1600/Screen+Shot+2014-09-07+at+23.03.14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiducdQi5dxG5RYw6ZRAi1PI_ZI3EwDB89Dvyfvg5UtaJ0rVvepBvj3E8ufSgcgNLPIbnGnQLedHUQy3BuY1WrcbAWsdoAXGwrafCo769nn8R5mSlOsR4HyUCMK6R_Qv09hRw-u_1_P-FN0/s1600/Screen+Shot+2014-09-07+at+23.03.14.png" height="414" width="640" /></a></div>
<br />
<br />
nukepediaでの手法と同じくisnan()関数をもちいて、
<br />
<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;">isnan(r)?Ar:r</pre>
<br />
とかやれば回避しやすいです。masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-3225651825021115022014-09-02T05:23:00.000+09:002014-09-02T05:23:51.541+09:00nuke.pluginAddPathinit.pyに<br />
<br />
<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;">nuke.pluginAddPath(ディレクトリ)</pre>
<br />
<br />
を加えると、その指定したディレクトリのinit.py, menu.py, ToolSetsフォルダを読みにいく。<br />
ちなみに、<br />
<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;">nuke.pluginAddPath(./Gizmos)</pre>
<br />
とかにしておくと、そのinit.pyの存在するディレクトリにあるGizmosフォルダを追加する。masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-50068449469749150482014-09-01T06:42:00.005+09:002014-09-02T05:27:40.852+09:00viewing LUT に cineon を追加する。init.py に<br />
<br />
<br />
<pre style="background-color: #eeffcc; border-bottom-color: rgb(170, 204, 153); border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-top-width: 1px; color: #333333; line-height: 15px; overflow-x: auto; overflow-y: hidden; padding: 5px;">nuke.ViewerProcess.register("Cineon", nuke.createNode, ("ViewerProcess_1DLUT", "current Cineon"))</pre>
<br />
<br />
を追加。<br />
<div>
<br /></div>masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-53608816821663467302014-08-31T02:50:00.000+09:002014-08-31T02:50:43.321+09:00Grain<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
標準のGrainの式は・・・<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLBMzjVU1gEO5O23L-zgfPs4MNR5vN_czKp0pYtizxYPdogg_yvzc6P0wfS4ozkosIo-UZ7FcuzIKJwgCr7U8T9Y9Zh6mwzQotWGtTmf1C2qa-QAQ3XbPd5OvxK9_Lgpkj-DLMe3P70OnQ/s1600/Screen+Shot+2014-08-30+at+8.09.12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLBMzjVU1gEO5O23L-zgfPs4MNR5vN_czKp0pYtizxYPdogg_yvzc6P0wfS4ozkosIo-UZ7FcuzIKJwgCr7U8T9Y9Zh6mwzQotWGtTmf1C2qa-QAQ3XbPd5OvxK9_Lgpkj-DLMe3P70OnQ/s1600/Screen+Shot+2014-08-30+at+8.09.12.png" height="400" width="640" /></a></div>
<br />
<br />
max(minimum.r,r+(2*Ar-1)*(r*red_m+black.r))<br />
<br />
となっており、noise(fBm)で作成されたほぼ0~1までの乱数がスクリーン上に配布されたモノ(Ar)に対して、<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDfwBdR2OwmvcKw_MeObe5kngLmY9OGixKEya-MTeiBqOEPiPRLC5lNwN_RnRSe3V2eu-jON1I0iG-b4mOY0XV2gvQDT8Ho3JYEm32sNHtDuWstktqaHZr6fJB2_beSLTQQ7F50VRYC33z/s1600/Screen+Shot+2014-08-30+at+9.40.46.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDfwBdR2OwmvcKw_MeObe5kngLmY9OGixKEya-MTeiBqOEPiPRLC5lNwN_RnRSe3V2eu-jON1I0iG-b4mOY0XV2gvQDT8Ho3JYEm32sNHtDuWstktqaHZr6fJB2_beSLTQQ7F50VRYC33z/s1600/Screen+Shot+2014-08-30+at+9.40.46.png" height="328" width="640" /></a></div>
<br />
<br />
(2*Ar-1) とあるので、ここの値はほぼ -1 ~ 1 となる。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL1EkW8r4asPWXG0ndgDpHD0V2Xz6envYMdm2AwsFDgsCn9iCej_qqE3K0GfVIju9CQPXm3KQxewfnbwk1nZ0cGHLP7XrmhxHYfcrMzVqqDRlsa_edHE16MTAbYsWtfknFWYb6A4ZEYdCh/s1600/Screen+Shot+2014-08-30+at+9.43.07.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL1EkW8r4asPWXG0ndgDpHD0V2Xz6envYMdm2AwsFDgsCn9iCej_qqE3K0GfVIju9CQPXm3KQxewfnbwk1nZ0cGHLP7XrmhxHYfcrMzVqqDRlsa_edHE16MTAbYsWtfknFWYb6A4ZEYdCh/s1600/Screen+Shot+2014-08-30+at+9.43.07.png" height="322" width="640" /></a></div>
<br />
<br />
さらに、ソースのピクセル値(r)に対して (r*red_m + black.r) とあるので、これはソースのピクセル値(r)にGrainノードのintensityのところの値(red_m)を掛けて、同じくGrainノードのblackのところの値(black.r)を足している。つまり、(r*red_m + black.r)部分はソースのピクセル値(r)もしくはユーザー指定の強度係数(red_m)のどちらかが 0 であれば black.r のみを返す。<br />
で、この(r*red_m + black.r)部分とさっきの画面全体にばらまかれた -1 ~ 1 の係数を掛けたものをソースのピクセル値に足したもの r+(2*Ar-1)*(r*red_m+black.r) とGrainノードのminmumのところで指定した値 (minmum.r)を比べて大きい方を採用するっての言うのがGrainノードのざっくりとした仕組み。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGwZsYSLUK86NqLNbAkwltE6oDvQIwG-KSAKSDf-Y6YMYbZ5pOSM-F64_9jEu5RLB8IPtEfB3MMjN0wfAJi6bf37nd9z4Y8H6jTDhkqNv2D7czKmNwAL-4PcIN2eNIyJapaVcuCyMuohZI/s1600/Screen+Shot+2014-08-30+at+9.45.32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGwZsYSLUK86NqLNbAkwltE6oDvQIwG-KSAKSDf-Y6YMYbZ5pOSM-F64_9jEu5RLB8IPtEfB3MMjN0wfAJi6bf37nd9z4Y8H6jTDhkqNv2D7czKmNwAL-4PcIN2eNIyJapaVcuCyMuohZI/s1600/Screen+Shot+2014-08-30+at+9.45.32.png" height="362" width="640" /></a></div>
<br />
<br />
上記の面倒くさいともされる式を念頭において、もっとざっくりと見た目中心でいうと、intensityのところで入れた値を元に、ソースピクセル値から適当な数値を足したり引いたりしているが、ソースイメージの黒に近い暗い部分にはその影響は出ない、もしくはほとんど見えないので、black値でその暗い部分にも影響が出るようにする。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYj8l6TXf8XOVHd6rvDo0cC9ALQpRdNZ4Fy9YTqw5vJh1p78Rvzp9ouRnsYFx-ECCSRGI7v6UY1usC6vEqhmmIkpJH7MVJlum3hhDmiSrnvMiX6BV1QZsSTR2tVkpti1ilVhRi4c1NElvA/s1600/Screen+Shot+2014-08-30+at+9.47.34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYj8l6TXf8XOVHd6rvDo0cC9ALQpRdNZ4Fy9YTqw5vJh1p78Rvzp9ouRnsYFx-ECCSRGI7v6UY1usC6vEqhmmIkpJH7MVJlum3hhDmiSrnvMiX6BV1QZsSTR2tVkpti1ilVhRi4c1NElvA/s1600/Screen+Shot+2014-08-30+at+9.47.34.png" height="298" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
black値の用途を暗い部分への影響という風にとらえると、式から判断するににマイナス数値を入れようがプラス数値を入れようがあまり意味合いは変わらない。(2*Ar-1) が -1 ~ 1 なので。<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpm1wfN5EgJ-KLbVGzBNcgqYho12hZtw0LmhtOXMKHILDzWXlFNf9WC9PXQE3Zz0c6cwTC0vYSxleBK5n_Z7ly-VuwwsKerKvW9YZgLWnPnHSVcHE5nz6GC6NIqQxNvSRyDCnz9jX0Kcvf/s1600/Screen+Shot+2014-08-30+at+9.50.09.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpm1wfN5EgJ-KLbVGzBNcgqYho12hZtw0LmhtOXMKHILDzWXlFNf9WC9PXQE3Zz0c6cwTC0vYSxleBK5n_Z7ly-VuwwsKerKvW9YZgLWnPnHSVcHE5nz6GC6NIqQxNvSRyDCnz9jX0Kcvf/s1600/Screen+Shot+2014-08-30+at+9.50.09.png" height="390" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">black値 = 0.06</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1YviMr2hMBzLSzBX3Zy8gla_PFchPbEMDTsYKIqwvD0X1bwZo1yByNQ7mP0sz7HFv22xkBq7lfUEUvWYxAjBLWcbPzQUDoWK5Xbq68EEY_nWvu5a1rYhNwHveJVsfQfrsedyyN94EDO9L/s1600/Screen+Shot+2014-08-30+at+9.54.26.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1YviMr2hMBzLSzBX3Zy8gla_PFchPbEMDTsYKIqwvD0X1bwZo1yByNQ7mP0sz7HFv22xkBq7lfUEUvWYxAjBLWcbPzQUDoWK5Xbq68EEY_nWvu5a1rYhNwHveJVsfQfrsedyyN94EDO9L/s1600/Screen+Shot+2014-08-30+at+9.54.26.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">black値 = -0.06</td></tr>
</tbody></table>
ただし、<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9BNXURNGZDjjiAWQVwpDhu8Xrf_DTJ9YhwwaQ3iZxri6_O3vzl0BcGE1dIRzgBgI3DVO52YXUK7jpbsTRA7tJqdeWMjpYcTO8kPQQvaJTQe0zt8m7MG_PVUfd3n7pNmIY-u_mkJez6WPL/s1600/Screen+Shot+2014-08-30+at+9.56.57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9BNXURNGZDjjiAWQVwpDhu8Xrf_DTJ9YhwwaQ3iZxri6_O3vzl0BcGE1dIRzgBgI3DVO52YXUK7jpbsTRA7tJqdeWMjpYcTO8kPQQvaJTQe0zt8m7MG_PVUfd3n7pNmIY-u_mkJez6WPL/s1600/Screen+Shot+2014-08-30+at+9.56.57.png" height="484" width="640" /></a></div>
<br />
<br />
このように、black値 = -0.06 の方には不思議なバンドがでている。これは、<br />
<br />
(r*red_m+black.r) の部分の値が 0 付近になるあたりことで、r+(2*Ar-1)*(r*red_m+black.r) が結局ほぼ r (元の値/ソースのピクセル値) になることで出てしまう。black値にマイナス値を入れるとこういうことが起こりうる可能性がある。ちなみに、(r*red_m+black.r) の部分の値が 0 というのは ソースのピクセル値(r)とintensity値(red_m)の乗算した結果がblack値のマイナスをとったものと同じ値にななる場合。<br />
<br />
また、intensityに1とかをいれると、ソースピクセル値が0-1に収まっていても、場合によっては2近くの値が出る可能性もあるし、真っ白付近の値なのに、真っ黒付近の値のピクセルが出てしまう可能性もある。<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjpssKldoxtesd1D4FGWUqM_qz9n6blqUyd86IaQDFp4xv8JNKjVoLqYZFEdyUdvxrGxSwqkVF2hIXjZgGcHRlv-ESCpkTU90I2gYrMfwWnIWePWUhmq01lMnBNr8RzxL0aZi3M_YhEJkw/s1600/Screen+Shot+2014-08-30+at+10.20.19.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjpssKldoxtesd1D4FGWUqM_qz9n6blqUyd86IaQDFp4xv8JNKjVoLqYZFEdyUdvxrGxSwqkVF2hIXjZgGcHRlv-ESCpkTU90I2gYrMfwWnIWePWUhmq01lMnBNr8RzxL0aZi3M_YhEJkw/s1600/Screen+Shot+2014-08-30+at+10.20.19.png" height="323" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">curvetoolで右の白い部分のみで計測</td></tr>
</tbody></table>
<br />
さらに、プレートでの暗部がマイナス値の場合でこの暗部にノイズを入れたい場合にも注意が必要で、<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeCjNfXayjHfLaQaTIh3M98xIp4hcBtjAkxPKglhz8SPY8exfTunChqSqQfLgQzsaO-wO0EJwZGA94hm9qyYOOjJJgJRuVZji53tmx5mna5QzX-CiMUXpRQnIptjxJ7DM9oKNCJQHcHpXX/s1600/Screen+Shot+2014-08-30+at+10.26.41.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeCjNfXayjHfLaQaTIh3M98xIp4hcBtjAkxPKglhz8SPY8exfTunChqSqQfLgQzsaO-wO0EJwZGA94hm9qyYOOjJJgJRuVZji53tmx5mna5QzX-CiMUXpRQnIptjxJ7DM9oKNCJQHcHpXX/s1600/Screen+Shot+2014-08-30+at+10.26.41.png" height="342" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">この場合、暗い部分は -0.02</td></tr>
</tbody></table>
<br />
一見、これだけで見ると暗部にノイズが入っているが、オリジナルと比較すると・・・<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPVaNXJJUHsyAEoeGIKlbqfpl-AQdGfsJFJpFEAoBbqpSJN_1t6MoJovkxBY_kgN8bmJM3_cp2Cjz8IotQAK9KrkKX62LYXM7nVRj-C9GNRPKnR0BEeEy5UEWMF4AxkTva64KClO2kmmlg/s1600/Screen+Shot+2014-08-30+at+10.35.25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPVaNXJJUHsyAEoeGIKlbqfpl-AQdGfsJFJpFEAoBbqpSJN_1t6MoJovkxBY_kgN8bmJM3_cp2Cjz8IotQAK9KrkKX62LYXM7nVRj-C9GNRPKnR0BEeEy5UEWMF4AxkTva64KClO2kmmlg/s1600/Screen+Shot+2014-08-30+at+10.35.25.png" height="380" width="640" /></a></div>
<br />
こんな感じになり、大丈夫そうにも見えるが、viewing lut をcineonにしてみると・・・<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhJCNA1c4FJ3YYed6VvQVQvrMa6kdm1YrfCsmmfrTH26u0qMX9DLpiOHH87Y513Tf0opEb7aXAd3eotKS16vLodFe1NR9F9p61mchcTBX41ulfqQ371nF-cs_yolcQDLduLJb4yYlT6mRe/s1600/Screen+Shot+2014-08-30+at+10.45.52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhJCNA1c4FJ3YYed6VvQVQvrMa6kdm1YrfCsmmfrTH26u0qMX9DLpiOHH87Y513Tf0opEb7aXAd3eotKS16vLodFe1NR9F9p61mchcTBX41ulfqQ371nF-cs_yolcQDLduLJb4yYlT6mRe/s1600/Screen+Shot+2014-08-30+at+10.45.52.png" height="640" width="592" /></a></div>
<br />
明らかな差が見えてくる。<br />
これを解消するために、minmum値に元の暗い部分の値、この場合 -0.02 をいれておくと<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguacYc6vTMfin_YvT57pe95tvtpC1XfmeHaQ5s0HFx_Ff_KRulQW-asoDSTq4_D_D3FYtrWwTAahLwxpe4QC05d5j12384qnpv0Nd4HcMOI8EBeNxx2lp0jtVUs9jlqj8qIFDTTPYfFWns/s1600/Screen+Shot+2014-08-30+at+10.47.09.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguacYc6vTMfin_YvT57pe95tvtpC1XfmeHaQ5s0HFx_Ff_KRulQW-asoDSTq4_D_D3FYtrWwTAahLwxpe4QC05d5j12384qnpv0Nd4HcMOI8EBeNxx2lp0jtVUs9jlqj8qIFDTTPYfFWns/s1600/Screen+Shot+2014-08-30+at+10.47.09.png" height="408" width="640" /></a></div>
<br />
<br />
こんな感じで回避できる。masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-74229853896838463592013-01-14T17:06:00.000+09:002013-01-14T17:06:05.624+09:00maskのfringeオプションノード内にある、maskのfringeオプションを使用可にすると、指定したmaskのエッジにのみその効果が適応されます。<br />
たとえば、グリーンでキーアウトしたんだけど、どうしても半透明部分のエッジにグリーンが残るとか。despillするため、hue correctなどでグリーンをキャンセルしたら、白っぽくなりすぎて、今度は背景色に対して浮いてしまったとか・・・<br />
そういう時、このmaskのfringeオプションをもちいるといい感じにいけたりする場合があります。<br />
適当な素材がないので、この部分の説明は省きますが、原理だけ説明を。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxRvG0MlgDJACMN48CrbjAFxKYtHnwcDZ8roKF6UAO060F_nm3hsLfnBgS6Zp5nL96Y9A5OKyovvPhdRPLVS9Nfwig-mr1Gc5gHTp8uPF6Y6YUdS63Kc4KtMw-7mrb55kD_kw7lfuHggxQ/s1600/a001.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="41" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxRvG0MlgDJACMN48CrbjAFxKYtHnwcDZ8roKF6UAO060F_nm3hsLfnBgS6Zp5nL96Y9A5OKyovvPhdRPLVS9Nfwig-mr1Gc5gHTp8uPF6Y6YUdS63Kc4KtMw-7mrb55kD_kw7lfuHggxQ/s400/a001.PNG" width="400" /></a></div>
<br />
たとえば、真っ白のconstantノードにrampノードでアルファとして幅の少しある白から黒のグラデーションを与えます。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPeW1JzZunIe5rM_o31AoIiaXCt7So-PjvtA4CknxgLvRaFeOWvNT2ulGuqhCe3KVfByW4h09T3TOfu9Cl_PutGE1OVtJsV5HSq7f5bT7aikJqafYFzaj5HppIz-wUvqkfjIqVEU95YyPc/s1600/a002.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPeW1JzZunIe5rM_o31AoIiaXCt7So-PjvtA4CknxgLvRaFeOWvNT2ulGuqhCe3KVfByW4h09T3TOfu9Cl_PutGE1OVtJsV5HSq7f5bT7aikJqafYFzaj5HppIz-wUvqkfjIqVEU95YyPc/s400/a002.PNG" width="330" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTjPw15Tx4TpYgvC4Jrn2axzfQzUxg4RZbCuAYYlfirp0VKxvnaVaBdO9Cxt0wkmUEcchB3Tyo6Gp7ZavTNItmeJVs9MHN6kYPvzzWawWymeaiUkFK6gqS0u2XLUIgaLwMzOz3Ar32QDoU/s1600/a003.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTjPw15Tx4TpYgvC4Jrn2axzfQzUxg4RZbCuAYYlfirp0VKxvnaVaBdO9Cxt0wkmUEcchB3Tyo6Gp7ZavTNItmeJVs9MHN6kYPvzzWawWymeaiUkFK6gqS0u2XLUIgaLwMzOz3Ar32QDoU/s400/a003.PNG" width="400" /></a></div>
<br />
こんな感じです。<br />
アルファを見ると<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvqEId_SAW7KN3ZkbGlWALA1bq1NMY4MFyu3qUVTpg3B9tEcBM48YnYdWH55xJcal0Aj6I1eWka78Bm8wD7HNGcd5jAETZk8DiiB1CRykCJ7CrJ0A9uFw3Js_ZUWUDZzsfWiBZP0r6U8te/s1600/a004.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="276" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvqEId_SAW7KN3ZkbGlWALA1bq1NMY4MFyu3qUVTpg3B9tEcBM48YnYdWH55xJcal0Aj6I1eWka78Bm8wD7HNGcd5jAETZk8DiiB1CRykCJ7CrJ0A9uFw3Js_ZUWUDZzsfWiBZP0r6U8te/s400/a004.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
こんな感じです。</div>
<div class="separator" style="clear: both; text-align: left;">
で、ここにcolor correctノードを追加し、maskにアルファを指定してfringeオプションにチェックを入れて、</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxRvG0MlgDJACMN48CrbjAFxKYtHnwcDZ8roKF6UAO060F_nm3hsLfnBgS6Zp5nL96Y9A5OKyovvPhdRPLVS9Nfwig-mr1Gc5gHTp8uPF6Y6YUdS63Kc4KtMw-7mrb55kD_kw7lfuHggxQ/s1600/a001.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="41" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxRvG0MlgDJACMN48CrbjAFxKYtHnwcDZ8roKF6UAO060F_nm3hsLfnBgS6Zp5nL96Y9A5OKyovvPhdRPLVS9Nfwig-mr1Gc5gHTp8uPF6Y6YUdS63Kc4KtMw-7mrb55kD_kw7lfuHggxQ/s400/a001.PNG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
適当に色をいじります。緑にしてみます。</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3taYaJ48WIBToUt8TNDA8z1RpTF525F15PlnGEpUNJXxI-RAQ_XvsDuHi8-hDC8v4OP3xkyNvUjlda4qDUmjmwBJVDHdxIfNYT3ciSvrb0aTn__U3cxKaWg6WNSLivoeJ0d-ylp1l5Lk7/s1600/a005.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3taYaJ48WIBToUt8TNDA8z1RpTF525F15PlnGEpUNJXxI-RAQ_XvsDuHi8-hDC8v4OP3xkyNvUjlda4qDUmjmwBJVDHdxIfNYT3ciSvrb0aTn__U3cxKaWg6WNSLivoeJ0d-ylp1l5Lk7/s400/a005.PNG" width="216" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
と、こんな感じになります。アルファの0-1の幅で真ん中ぐらいにcolor correctの効果のピークがきているようです。</div>
<div class="separator" style="clear: both; text-align: left;">
実際にカラーピックしてみると、</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq1oTB6yD1xcwp-8XKPMRglwmurwZLBUat_cGW85eNXYwFeGLzVzriK6lkRm-XBSQP-4DemI-LOmecrJ-rkHBK0TepU8qVzocEkoJ1Ai50jvW5xbgcqpe8cK0SsPGoVdZNM7NzkSbYNefS/s1600/a006PNG.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq1oTB6yD1xcwp-8XKPMRglwmurwZLBUat_cGW85eNXYwFeGLzVzriK6lkRm-XBSQP-4DemI-LOmecrJ-rkHBK0TepU8qVzocEkoJ1Ai50jvW5xbgcqpe8cK0SsPGoVdZNM7NzkSbYNefS/s320/a006PNG.png" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
こんな感じで、0.5のときに、color correctが100%効いてます。</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
クロマキー等でアルファを作成して、エッジのみを修正したい場合は割りと使えるオプションです。原理がわかれば、アルファにblurを用いてもう少し幅をだすなど、いろいろと利用価値があります。</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com1tag:blogger.com,1999:blog-738122545213927215.post-17940046655692560322012-11-28T00:15:00.000+09:002012-11-28T00:15:29.556+09:00現在アクティブなviewerに選択している複数のnodeをすべてコネクトする(ただし10個まで?需要があったから作ってみました。<br />
<br />
既存ショートカットの ctrl + i を複数のノードを選択している状態で発動させると、新規にviewerノードを作成してそれに選択していたノードがすべてコネクトされる。これを新規のviewerノードではなく、現在のアクティブなviewerでやりたいというリクエスト。<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg4TWI1tP8QVM_92jRk-K7hN3tlSFMrDLiHgyeQMeiK21X0VBe7080du3Ve2nQW-tgBS4f2c4kLd5BaI2odRYZ23a-2ErWzgZ8YJ_yb32eMqOpsUsAE2RLruDJLKpgSVR67_xTa0TEnSIq/s1600/ScreenClipC.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg4TWI1tP8QVM_92jRk-K7hN3tlSFMrDLiHgyeQMeiK21X0VBe7080du3Ve2nQW-tgBS4f2c4kLd5BaI2odRYZ23a-2ErWzgZ8YJ_yb32eMqOpsUsAE2RLruDJLKpgSVR67_xTa0TEnSIq/s320/ScreenClipC.png" width="320" /></a></div>
<br />
<br />
現在のアクティブなviewerはpythonで、<br />
<br />
nuke.activeViewer()<br />
<br />
で表すことができる。ただし、これはノードを表しているのではないので、後ろに.node()をつけて、<br />
<br />
nuke.activeViewer().node()<br />
<br />
で現在アクティブなviewerノードとなる。<br />
あとはこれに、選択したノードすべてを繋ぎたい。「繋ぐ(親ノードを指定)」は、<br />
<br />
setInput(番号, ノード)<br />
<br />
となる。たとえば、Merge1を3番のパイプに繋ぎたい場合は<br />
<br />
nuke.activeViewer().node().setInput(2, nuke.toNode('Merge1'))<br />
<br />
となる。3番だけど0起点だから数字は「2」だ。<br />
ともあれ、実際のスクリプトとしては、<br />
<br />
<br />
selN = nuke.selectedNodes()<br />
curV = nuke.activeViewer().node()<br />
a = 0<br />
for n in selN:<br />
curV.setInput(a, n)<br />
a = a + 1<br />
<br />
見たいな感じで表現できる。<br />
実行してみると・・・<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqxHDgOA1VQFw8C95e8Btq2Hx9seqmnpVa3IsRp4G6FrPymiPFQzjNFe-F5iqdK8BcoUEDVn0EgQ7u10ywv9b2yA3UmKB39K34qLpn5mdCRFEBXReGMPQ0jlEKuhAD-rmB3L7XNWIBYuO1/s1600/ScreenClipA.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqxHDgOA1VQFw8C95e8Btq2Hx9seqmnpVa3IsRp4G6FrPymiPFQzjNFe-F5iqdK8BcoUEDVn0EgQ7u10ywv9b2yA3UmKB39K34qLpn5mdCRFEBXReGMPQ0jlEKuhAD-rmB3L7XNWIBYuO1/s320/ScreenClipA.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">複数あるノードを</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCVhofUPS9QOb7f0YrnGZoKTDB7uaJY6xvXZdo-KBThHNdg9201Sf6Yh7Te-_VrnJWl1SGoLooSLCbHjvyUzbFAXpQ-W28YDdwNfZ3d2Q_4O6bG5c3sL7Hx9p-FzwfswNeHXSxuqiXY97T/s1600/ScreenClipB.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCVhofUPS9QOb7f0YrnGZoKTDB7uaJY6xvXZdo-KBThHNdg9201Sf6Yh7Te-_VrnJWl1SGoLooSLCbHjvyUzbFAXpQ-W28YDdwNfZ3d2Q_4O6bG5c3sL7Hx9p-FzwfswNeHXSxuqiXY97T/s320/ScreenClipB.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">選んで実行すると、</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg4TWI1tP8QVM_92jRk-K7hN3tlSFMrDLiHgyeQMeiK21X0VBe7080du3Ve2nQW-tgBS4f2c4kLd5BaI2odRYZ23a-2ErWzgZ8YJ_yb32eMqOpsUsAE2RLruDJLKpgSVR67_xTa0TEnSIq/s1600/ScreenClipC.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg4TWI1tP8QVM_92jRk-K7hN3tlSFMrDLiHgyeQMeiK21X0VBe7080du3Ve2nQW-tgBS4f2c4kLd5BaI2odRYZ23a-2ErWzgZ8YJ_yb32eMqOpsUsAE2RLruDJLKpgSVR67_xTa0TEnSIq/s320/ScreenClipC.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">カレントビューのviewerノードに繋がる!</td></tr>
</tbody></table>
<div>
<br /></div>
<br />
あとは、関数化してショートカットへ。<br />
<br />
<br />
import nuke<br />
def main():<br />
selN = nuke.selectedNodes()<br />
curV = nuke.activeViewer().node()<br />
a = 0<br />
for n in selN:<br />
curV.setInput(a, n)<br />
a = a + 1<br />
<br />
<br />
として、viewMultiConnect.py って名前で「<b>.</b>nuke」に保存。同じ階層にmenu.pyをつくり、<br />
<br />
<br />
import viewMultiConnect<br />
m = nuke.menu("Nodes")<br />
m.addCommand("viewMultiConnect", "viewMultiConnect.main()", "ctrl+shift+i")<br />
<br />
として保存。(※menu.pyが既存の場合は上記コードを付け加える<br />
<div>
この場合最後の"ctrl+shift+i"がショートカットとなる。</div>
<br />
<br />
<br />
<br />masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com3tag:blogger.com,1999:blog-738122545213927215.post-62768247300202791222012-09-05T12:59:00.003+09:002012-09-05T12:59:49.871+09:00グラフに頂点追加グラフに頂点追加は、ctrl+alt でグラフ上をクリックですよ。masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-2549243276666011532012-08-28T20:15:00.004+09:002012-08-28T20:52:23.819+09:00ノード名変更<br />
a = 0<br />
for n in nuke.selectedNodes():<br />
a = a + 1<br />
n.knob('name').setValue('hoge' + str(a))masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0tag:blogger.com,1999:blog-738122545213927215.post-21135878549322427952012-04-22T07:39:00.000+09:002012-04-22T07:39:53.036+09:00Dobry den!I am glad that you read this my blog!<br />
Thank you!<br />
I would like to know where you are and your impressions about this blog.<br />
Could you please give me some comments as long as that's okay with you?<br />
<br />
Regards.masahiro.teraokahttp://www.blogger.com/profile/10007669095260226292noreply@blogger.com0