LoginSignup
0
0

More than 5 years have passed since last update.

Anorld Renderer でコマンドラインからレンダリング

Last updated at Posted at 2015-12-06

なにをする記事?

「Arnold Rnederer」を使って、コマンドラインからレンダリング。

使うもの

  • Arnold Renderer
  • .ass ファイル
  • ターミナルとkick

Arnold

Solid Angle 社の開発するレンダラーです。
ハリウッド御用達。国内でも事例がある(増えつつある)ようです。
アーティストフレンドリな使用感と多少低速ながら高品位な仕上がり、安定動作などに定評があります。
国内事例としてはMarzaさんの「キャプテンハーロック」のほか、
宮本監督(今年のプリキュア劇場版のフルCG中編でも大活躍!)のブログにも記事があります。
http://arnold.jp.net/news/アーノルドユーザー様のブログ紹介/

arnold_ui.png
▲ Arnold for MayaでのArnold関連UI

レンダラ本体と、各アプリケーションにプラグインして使うブリッジ、という構成になっています。
ブリッジは現時点で「Maya」「Softimage」「Houdini」「Cinema4D」「Katana」用があります。
それぞれ「mtoa」とは「htoa」とかそういうネーミングなので、3dsMax用ができたら命名規則がくずれるとハラハラしています。

こちら(▼)からダウンロードしてインストールします。
ウォーターマークがつきますがおためし無料。
https://www.solidangle.com/arnold/download/

今回使ったバージョンは、Arnold = 4.2.6.1、ブリッジ(MtoA) = 1.2.2.0

.assファイル

Arnoldがレンダリングするためのファイル。「Arnold Scene Source」でアス。
https://support.solidangle.com/pages/viewpage.action?pageId=8390079

要は、ブリッジがシーン内容をassに変換しレンダラへ渡してレンダリングする、という構成。
今回 .ass ファイルは、SolidAngleが用意しているサンプルを使います。
https://support.solidangle.com/display/ARP/.ass+File+Examples

ターミナルとkick

OSはOSX10.10.5。(ターミナルは2.5.3。一応)

コマンドラインからArnoldにレンダリングさせるツールを「kick」と言います。特徴的な名前です。
Arnoldをインストールすると下記の場所に置かれます。

{mtoaイントールフォルダ}/{バージョン}/bin/kick

このツールを使って、.assファイルをレンダリングします。
assをkickする。もうお分りですね?(←これが言いたかっただけ)

実行

とりあえずヘルプ

/Applications/solidangle/mtoa/2015/bin/kick -h

結果:

kick-h

Arnold 4.2.6.1 darwin clang-3.6.0 oiio-1.5.13 rlm-11.2.2 2015/04/28 09:54:06

Usage:
  kick [option] [option] [option] ...

Options:
  -i <s>          Input .ass file
  -o <s>          Output filename
  -of <s>         Output format (none jpg tiff8 tiff16 tiff32)
  -r <n n>        Image resolution
  -sr <f>         Scale resolution <f> times in each dimension
  -rg <n n n n>   Render region (minx miny maxx maxy)
  -as <n>         Anti-aliasing samples
  -af <s> <f>     Anti-aliasing filter and width (box disk gaussian ...)
  -asc <f>        Anti-aliasing sample clamp
  -c <s>          Active camera
  -sh <f f>       Motion blur shutter (start end)
  -fov <f>        Camera FOV
  -e <f>          Camera Exposure
  -ar <f>         Aspect ratio
  -g <f>          Output gamma
  -tg <f>         Texture gamma
  -lg <f>         Light source gamma
  -sg <f>         Shader gamma
  -t <n>          Threads
  -bs <n>         Bucket size
  -bc <s>         Bucket scanning (top bottom left right random woven spiral hilbert)
  -td <n>         Total ray depth
  -rfl <n>        Reflection depth
  -rfr <n>        Refraction depth
  -dif <n>        Diffuse depth
  -glo <n>        Glossy depth
  -ds <n>         Diffuse samples
  -gs <n>         Glossy samples
  -d <s.s>        Disable (ignore) a specific node or node.parameter
  -it             Ignore texture maps
  -is             Ignore shaders
  -ib             Ignore background shaders
  -ia             Ignore atmosphere shaders
  -il             Ignore lights
  -id             Ignore shadows
  -isd            Ignore mesh subdivision
  -idisp          Ignore displacement
  -ibump          Ignore bump-mapping
  -imb            Ignore motion blur
  -idof           Ignore depth of field
  -isss           Ignore sub-surface scattering
  -idirect        Ignore direct lighting
  -flat           Flat shading
  -sd <n>         Max subdivisions
  -interactive [m|q]  Run kick in interactive mode (experimental)
           'm' -- Maya controls (default)
           'q' -- Quake (WASD) controls
  -v <n>          Verbose level (0..6)
  -nw <n>         Maximum number of warnings
  -log            Enable log file
  -logfile <s>    Enable log file and write to the specified file path
  -dw             Disable render window (recommended for batch rendering)
  -dp             Disable progressive rendering (recommended for batch rendering)
  -l <s>          Add search path for plugin libraries
  -nodes [n|t]    List all installed nodes, sorted by Name or Type
  -info [n|u] <s> List information for a given node, sorted by Name or Unsorted
  -tree <s>       Print the shading tree for a given node
  -repeat <n>     Repeat the render n times (useful for debugging)
  -turn <n>       Render n frames rotating the camera around the lookat point
  -resave <s>     Re-save .ass scene to filename
  -db             Disable binary encoding when re-saving .ass files
  -forceexpand    Force single-threaded expansion of procedural geometry before rendering or re-saving
  -nstdin         Ignore input from stdin
  -set <s.s> <s>  Set the value of a node parameter (-set name.parameter value)
  -cm <s>         Set the value of ai_default_reflection_shader.color_mode (use with -is)
  -sm <s>         Set the value of ai_default_reflection_shader.shade_mode (use with -is)
  -om <s>         Set the value of ai_default_reflection_shader.overlay_mode (use with -is)
  -nokeypress     Don't wait for keypress after rendering
  -sl             Skip license check (assume license is not available)
  -licensecheck   Check the connection with the license servers and list installed licenses
  -utest          Run unit tests
  -av             Print Arnold version number
  -notices        Display copyright notices
  -h, --help      Show this help message

where <n>=integer, <f>=float, <s>=string

Example:
  kick -i teapot.ass -r 640 480 -g 2.2 -o teapot.tif

(c) 2001-2009 Marcos Fajardo and (c) 2009-2015 Solid Angle SL, www.solidangle.com
Acknowledgements: armengol ben brian cliff colman erco francisco quarkx rene scot sergio xray yiotis

-i / -o

-iで読み込むassファイルを指定します。省略可。
-oで書き出し先を指定します。
-ofでファイルフォーマットを指定します。つけなかったら、-oでどんな拡張子にしててもtifになるようです。

-r レンダリングサイズの指定

-r 640 480

みたいな感じでレンダリングサイズを指定します。

-dw

レンダリングウインドウを隠します。
これをつけなかったらレンダリングウインドウが立ち上がって、レンダリングの様子を見せてくれます。
また、有効にした場合プログレッシブレンダリングも自動でOFFになるようです。

とりあえずやってみた

コーネルボックスのサンプル、cornell.assを使いました。

/path/to/kick -i /path/to/cornell.ass -o /path/to/output/cornell.tif -interactive q

-interactive qはIPR用のオプションかな?と思ったんですが、どうなんでしょう。experimental(実験的)て書いてありますね。

kick.png
▲レンダリングの様子。

kick-ass

00:00:00     9MB         | log started Sat Dec  5 10:52:12 2015
00:00:00     9MB         | Arnold 4.2.6.1 darwin clang-3.6.0 oiio-1.5.13 rlm-11.2.2 2015/04/28 09:54:06
00:00:00     9MB         | running on ito-MBPR.local with pid 3195
00:00:00     9MB         |  1 x Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz (4 cores, 8 logical) with 16384MB
00:00:00     9MB         |  OS X 10.10.5 "Yosemite", Darwin kernel 14.5.0
00:00:00     9MB         |  
00:00:00     9MB         | [kick] command: /path/to/kick -i /path/to/cornell.ass -o /path/to/output/cornell.tif  -interactive q
00:00:00     9MB         | loading plugins from . ...
00:00:00     9MB         | no plugins loaded
00:00:00     9MB         | [ass] loading /path/to/cornell.ass ...
00:00:00     9MB         | [ass] read 2006 bytes, 17 nodes in 0:00.00
00:00:00     9MB         |  
00:00:00    10MB         | [rlm] checkout of "arnold 20150428" in progress ...
00:00:02    10MB WARNING | [rlm] error checking out license for arnold (version 20150428):
00:00:02    10MB WARNING | [rlm]  * No license for product (-1)
00:00:02    10MB         | 
00:00:02    18MB         |  
00:00:02    18MB         | there are 1 light and 7 objects:
00:00:02    18MB         |       1 persp_camera
00:00:02    18MB         |       1 quad_light
00:00:02    18MB         |       1 utility
00:00:02    18MB         |       6 standard
00:00:02    18MB         |       1 driver_tiff
00:00:02    18MB         |       1 gaussian_filter
00:00:02    18MB         |       1 sphere
00:00:02    18MB         |       5 polymesh
00:00:02    18MB         |       1 list_aggregate
00:00:02    18MB         |       1 driver_kick
00:00:02    18MB         |  
00:00:02    18MB         | rendering image at 640 x 480, -3 AA samples, 3 GI samples, 1 GI bounces
00:00:02    18MB         |  initializing 20 nodes ...
00:00:02    18MB         |   creating root object list ...
00:00:02    18MB         |   scene bounds: (-2 -2 -2) -> (2 2 8)
00:00:02    18MB         |  node initialization done in 0:00.00 (single-threaded)
00:00:02    18MB         |  updating 21 nodes ...
00:00:02    18MB         |  node update done in 0:00.00 (single-threaded)
00:00:02    18MB         |  [aov] registered driver: "kick_display" (driver_kick)
00:00:02    18MB         |  [aov]  * "RGBA" of type RGBA filtered by "filter" (gaussian_filter)
00:00:02    18MB         |  [aov] done preparing 1 AOV for 1 output to 1 driver (0 deep AOVs)
00:00:02    32MB         |  starting 8 bucket workers of size 64x64 ...
00:00:02    34MB         |  bucket workers done in 0:00.04
00:00:02    35MB         | render done
00:00:02    35MB         |  
00:00:02    35MB         | rendering image at 640 x 480, -2 AA samples, 3 GI samples, 1 GI bounces
00:00:02    35MB         |  updating 21 nodes ...
00:00:02    35MB         |  node update done in 0:00.00 (single-threaded)
00:00:02    35MB         |  [aov] registered driver: "kick_display" (driver_kick)
00:00:02    35MB         |  [aov]  * "RGBA" of type RGBA filtered by "filter" (gaussian_filter)
00:00:02    35MB         |  [aov] done preparing 1 AOV for 1 output to 1 driver (0 deep AOVs)
00:00:02    35MB         |  starting 8 bucket workers of size 64x64 ...
00:00:02    38MB         |  bucket workers done in 0:00.13
00:00:02    38MB         | render done
00:00:02    38MB         |  
00:00:02    38MB         | rendering image at 640 x 480, -1 AA samples, 3 GI samples, 1 GI bounces
00:00:02    38MB         |  updating 21 nodes ...
00:00:02    38MB         |  node update done in 0:00.00 (single-threaded)
00:00:02    38MB         |  [aov] registered driver: "kick_display" (driver_kick)
00:00:02    38MB         |  [aov]  * "RGBA" of type RGBA filtered by "filter" (gaussian_filter)
00:00:02    38MB         |  [aov] done preparing 1 AOV for 1 output to 1 driver (0 deep AOVs)
00:00:02    38MB         |  starting 8 bucket workers of size 64x64 ...
00:00:02    45MB         |  bucket workers done in 0:00.44
00:00:02    45MB         | render done
00:00:02    45MB         |  
00:00:02    45MB         | rendering image at 640 x 480, 1 AA samples, 3 GI samples, 1 GI bounces
00:00:02    45MB         |  updating 21 nodes ...
00:00:02    45MB         |  node update done in 0:00.00 (single-threaded)
00:00:02    45MB         |  [aov] registered driver: "kick_display" (driver_kick)
00:00:02    45MB         |  [aov]  * "RGBA" of type RGBA filtered by "filter" (gaussian_filter)
00:00:02    45MB         |  [aov] done preparing 1 AOV for 1 output to 1 driver (0 deep AOVs)
00:00:02    45MB         |  starting 8 bucket workers of size 64x64 ...
00:00:04    47MB         |  bucket workers done in 0:01.55
00:00:04    47MB         | render done
00:00:04    47MB         |  
00:00:04    47MB         | rendering image at 640 x 480, 4 AA samples, 3 GI samples, 1 GI bounces
00:00:04    47MB         |  updating 21 nodes ...
00:00:04    47MB         |  node update done in 0:00.00 (single-threaded)
00:00:04    47MB         |  [aov] registered driver: "kick_display" (driver_kick)
00:00:04    47MB         |  [aov]  * "RGBA" of type RGBA filtered by "filter" (gaussian_filter)
00:00:04    47MB         |  [aov] done preparing 1 AOV for 1 output to 1 driver (0 deep AOVs)
00:00:04    47MB         |  starting 8 bucket workers of size 64x64 ...
00:00:28    62MB         |  bucket workers done in 0:24.08
00:00:28    62MB         | render done
00:00:52    62MB         |  
00:00:52    62MB         | releasing resources
00:00:52    55MB         | Arnold shutdown

レンダリングウインドウを閉じたら、「Arnold shutdown」がプリントされます。

ウインドウ出さないパターン

-dwを指定します。

/path/to/kick /path/to/cornell.ass -dw -o /path/to/output/cornell.exr

ついでに「-i省略」とか、「exrと書きつつ-of指定しない」などもやってみてます。

kick-dw

00:00:00     9MB         | log started Sat Dec  5 10:42:59 2015
00:00:00     9MB         | Arnold 4.2.6.1 darwin clang-3.6.0 oiio-1.5.13 rlm-11.2.2 2015/04/28 09:54:06
00:00:00     9MB         | running on ito-MBPR.local with pid 1595
00:00:00     9MB         |  1 x Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz (4 cores, 8 logical) with 16384MB
00:00:00     9MB         |  OS X 10.10.5 "Yosemite", Darwin kernel 14.5.0
00:00:00     9MB         |  
00:00:00     9MB         | [kick] command: /path/to/kick /path/to/cornell.ass -dw -o /path/to/output/cornell.exr
00:00:00     9MB         | loading plugins from . ...
00:00:00     9MB         | no plugins loaded
00:00:00     9MB         | [ass] loading /path/to/cornell.ass ...
00:00:00     9MB         | [ass] read 2006 bytes, 17 nodes in 0:00.00
00:00:00     9MB WARNING | [kick] trying to overwrite the original '.tif' driver with a '.exr' driver, renamed as a '.tif' file
00:00:00     9MB WARNING | [kick] skipping progressive render since there are no window display outputs
00:00:00     9MB         |  
00:00:00    10MB         | [rlm] checkout of "arnold 20150428" in progress ...
00:00:02    10MB WARNING | [rlm] error checking out license for arnold (version 20150428):
00:00:02    10MB WARNING | [rlm]  * No license for product (-1)
00:00:02    10MB         | 
00:00:02    18MB         |  
00:00:02    18MB         | there are 1 light and 7 objects:
00:00:02    18MB         |       1 persp_camera
00:00:02    18MB         |       1 quad_light
00:00:02    18MB         |       1 utility
00:00:02    18MB         |       6 standard
00:00:02    18MB         |       1 driver_tiff
00:00:02    18MB         |       1 gaussian_filter
00:00:02    18MB         |       1 sphere
00:00:02    18MB         |       5 polymesh
00:00:02    18MB         |       1 list_aggregate
00:00:02    18MB         |  
00:00:02    18MB         | rendering image at 640 x 480, 4 AA samples, 3 GI samples, 1 GI bounces
00:00:02    18MB         |  initializing 19 nodes ...
00:00:02    18MB         |   creating root object list ...
00:00:02    18MB         |   scene bounds: (-2 -2 -2) -> (2 2 8)
00:00:02    18MB         |  node initialization done in 0:00.00 (single-threaded)
00:00:02    18MB         |  updating 20 nodes ...
00:00:02    18MB         |  node update done in 0:00.00 (single-threaded)
00:00:02    18MB         |  [aov] registered driver: "testrender" (driver_tiff)
00:00:02    18MB         |  [aov]  * "RGBA" of type RGBA filtered by "filter" (gaussian_filter)
00:00:02    18MB         |  [aov] done preparing 1 AOV for 1 output to 1 driver (0 deep AOVs)
00:00:02    20MB         |  starting 8 bucket workers of size 64x64 ...
00:00:25    34MB         |  bucket workers done in 0:23.68
00:00:25    34MB         |  [driver_tiff] writing file `/path/to/output/cornell.tif'
00:00:25    33MB         | render done
00:00:25    33MB         |  
00:00:25    33MB         | releasing resources
00:00:25    26MB         | Arnold shutdown

実行時、書き出し先の拡張子を「.exr」にしてましたが、最後の方でちゃんと(?)「.tif」になってます。
ウインドウありと違って、こちらはファイルへの書き込みが終わったところでshutdownされます。

まとめ

レンダリングウィンドウありと比べて、-dw でウインドウ切ってると、所要時間も使用メモリも半分でした。
-interactive qのアレなのか。
ここに書いてあるからちゃんと読め!って話ですね。

参考

Command Line Rendering (kick)
https://support.solidangle.com/pages/viewpage.action?pageId=8390077

Arnold Scene Source (ass)
https://support.solidangle.com/pages/viewpage.action?pageId=8390079

.ass File Examples
https://support.solidangle.com/display/ARP/.ass+File+Examples

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0