これはなに?
MAXON Cinema4D(以下C4D)をコマンドライン経由で使うときのメモです。@ OSX
公式ヘルプ
こちら > http://help.maxon.net/jp/#52193
場所
winだと「Commandline.exe」「CINEMA 4D.exe」を使うようです。
OSXでは、「CINEMA 4D.app」
のパッケージを降りて行って、下記の場所にあるやつを使います。
/Applications/MAXON/CINEMA\ 4D\ R{version}/CINEMA\ 4D.app/Contents/MacOS/CINEMA\ 4D
実行
これをターミナルにドラッグアンドドロップしてEnterで実行できます。
普通に実行すると、普通にC4Dが立ち上がります。
nogui
-nogui
オプションをつけることで、コマンドラインでレンダリングとかできます。
つけないと普通にC4D(GUI)が立ち上がります。
これをつけることで、winでいう「Commandline.exe」相当になるという感じでしょうか。
出力先パス指定やレンダリング解像度指定などのオプションが使えるようになります。
例文
winではこうなのが
\path\to\Commandline.exe -render cube.c4d -oimage test.tif
OSXではこう
/Applications(中略)MacOS/CINEMA\ 4D -nogui -render cube.c4d -oimage test.tif
なようです。
cube.c4d
やtest.tif
は適宜フルパスに書き換えます。
ほか
debug
-debug
オプションをつけると、いろいろなログが流れるようになります。起動時にいろんなプラグインを読み込んでいる様子が分かります。
title
-title
オプションをつけると、ウィンドウにタイトルをつけられる。……らしいですがよくわかりませんでした(笑
layout
-layout
+ファイル指定すると、指定したレイアウトで起動できます。レイアウトファイルの置き場所は**「一般設定」ウィンドウの左下の「一般設定フォルダを開く...」**でフォルダを開いて、「library」>「layout」。
.l4dという拡張子のファイルがそれです。
parallel
-parallel
オプションをつけると複数起動できるようになる……らしいですが付けなくても普通に複数立ち上がるぞおおお
と思ったら使ってるバージョンが古かったせいか。
上記ドキュメントには載ってたんですが、-help
(下記)で問い合わせても出てきませんでした。
help
-help
オプションをつけると、コマンドライン経由で起動させるときに使えるオプションが確認できます。
/Applications/MAXON/CINEMA\ 4D\ R14/CINEMA\ 4D.app/Contents/MacOS/CINEMA\ 4D -help
Starting CINEMA 4D 14.042 ...
General Options:
-nogui ... start without user interface
-license [ip [port]] ... specifies the license server
-homedir ... define a custom home write directory
-noopengl ... disable OpenGL and avoid loading OpenGL libraries
-oglversion=xxx ... force a specific OpenGL version. xxx must be 100 * (major version) + (minor version)
-server ... start c4d as a render server
-client ... start c4d as a render client
-title ... set the window title
-layout filename ... use a custom startup layout
-crashtest ... causes an exception to test the built-in signal handler
-nocrashhandler ... suppress use of the application's crash handler
-nogui_nothreads ... special commandline debug mode
-debug ... enable debug output
Startup Directory: /Applications/MAXON/CINEMA 4D R14
Write Directory: /Users/{user}/Library/Preferences/MAXON/CINEMA 4D R14_95696CEA
Preferences Directory: /Users/{user}/Library/Preferences/MAXON/CINEMA 4D R14_95696CEA/prefs
Loaded initscript with success.
Web favourites initialized.
Render Options:
-render filename ... specify a file to render
-frame from [to [step]] ... specify start frame, end frame and frame step. 'to' and 'step' are optional
-oimage imagename ... override the image output path for rendering
-omultipass imagename ... override the multipass output path for rendering
-oformat imageformat ... override the image output format to TIFF/TGA/BMP/IFF/JPG/PICT/PSD/PSB/RLA/RPF/B3D
-oresolution width height ... override output image size
-threads threadcnt ... specify number of threads (0 for auto-detection)
雑感
レンダリング前スクリプトとか後スクリプトとか指定できるかと思いましたが、無いようですね。
/Users/{user}/Library/Preferences/MAXON/CINEMA 4D R{version}/prefs/python/python_init.py
に起動時に実行したいスクリプトを書き込めるので、それを活用せよということでしょうか。あるいはシーン内のPythonオブジェクトなど。
…このinitscriptについて言及のあるドキュメントが全然なくてビビっています。自分のとこに置いてあるやつ、いつ置いたんだ?(笑