カスタマイズガイド (Customization Guide)
すべてのカスタマイズは、ワークスペースディレクトリ内の griptape-nodes-project.yml に記述します。変更したい項目のみを含めれば十分です — それ以外の設定はすべてシステムデフォルトから自動的に継承されます。
出力ディレクトリパスの変更
すべてのノード出力を renders というフォルダに保存するように変更します:
project_template_schema_version: "0.1.0"
name: "My Project"
directories:
outputs:
path_macro: "renders"
これで、{outputs} を使用するすべてのシチュエーションが、outputs の代わりに renders フォルダに保存されるようになります。
入力ディレクトリパスの変更
project_template_schema_version: "0.1.0"
name: "My Project"
directories:
inputs:
path_macro: "source_files"
カスタムディレクトリの追加
クライアントへの納品物用ディレクトリを追加します:
project_template_schema_version: "0.1.0"
name: "My Project"
directories:
deliverables:
path_macro: "client/final"
これで、任意のマクロ内で {deliverables} を変数として利用できるようになります。
カスタムシチュエーションの追加
最終レンダリングを上書きポリシーで納品物ディレクトリに保存するシチュエーションを追加します:
project_template_schema_version: "0.1.0"
name: "My Project"
directories:
deliverables:
path_macro: "client/final"
situations:
save_deliverable:
macro: "{deliverables}/{workflow_name?:_}{file_name_base}.{file_extension}"
policy:
on_collision: overwrite
create_dirs: true
description: "Final deliverable for client"
既存シチュエーションの変更
save_node_output を変更して、ファイル名に常にワークフロー名を含めるようにします:
project_template_schema_version: "0.1.0"
name: "My Project"
situations:
save_node_output:
macro: "{outputs}/{workflow_name:_}{file_name_base}{_index?:03}.{file_extension}"
macro フィールドのみが置き換えられます。ポリシー、フォールバック、および説明文はデフォルト設定から継承されます。
環境変数の追加
マクロ内で使用するカスタム値を定義します:
project_template_schema_version: "0.1.0"
name: "My Project"
environment:
CLIENT_CODE: "ACME"
SEASON: "S03"
ディレクトリパスやシチュエーションマクロ内でこれらを参照します:
directories:
outputs:
path_macro: "{CLIENT_CODE}/{SEASON}/renders"
拡張子によるファイルのルーティング
ファイルの種類ごとに個別のシチュエーションを作成することなく、file_extension_directories を使用して異なる種類のファイルを異なるサブフォルダに自動分類できます。詳細な仕様については 拡張子別ディレクトリ を参照してください。
project_template_schema_version: "0.3.0"
name: "My Project"
file_extension_directories:
png: "images"
jpg: "images"
mp4: "videos"
wav: "audio"
situations:
save_node_output:
macro: "{outputs}/{file_extension_directory?:/}{node_name?:_}{file_name_base}{_index?:03}.{file_extension}"
拡張子はマクロに解決させることも可能です。動画のみを共有ドライブにルーティングし、それ以外をすべて outputs 配下に残すには、ルーティング値がルートを決定できるようにシチュエーションマクロを記述します:
project_template_schema_version: "0.3.0"
name: "My Project"
file_extension_directories:
png: "{outputs}/images"
mp4: "{workspace_dir}/shared/videos"
situations:
save_node_output:
macro: "{file_extension_directory?:/}{node_name?:_}{file_name_base}{_index?:03}.{file_extension}"
OS 環境変数の参照
オペレーティングシステムの環境変数を取得して利用します:
project_template_schema_version: "0.1.0"
name: "My Project"
environment:
SHARED_DRIVE: "$STUDIO_SHARED_STORAGE"
directories:
outputs:
path_macro: "{SHARED_DRIVE}/renders"
OS の環境変数 STUDIO_SHARED_STORAGE が /mnt/studio に設定されている場合、{outputs} は /mnt/studio/renders に解決されます。
設定の全体例
視覚効果 (VFX) 制作プロジェクト向けにカスタマイズされた完全なプロジェクトファイル例です:
project_template_schema_version: "0.1.0"
name: "VFX Pipeline"
description: "Customized layout for VFX production"
environment:
SHOW_CODE: "AURORA"
directories:
inputs:
path_macro: "source"
outputs:
path_macro: "renders"
plates:
path_macro: "source/plates"
deliverables:
path_macro: "deliverables/{SHOW_CODE}"
situations:
save_node_output:
macro: "{outputs}/{workflow_name?:_}{file_name_base}{_index?:03}.{file_extension}"
save_deliverable:
macro: "{deliverables}/{workflow_name?:_}{file_name_base}.{file_extension}"
policy:
on_collision: overwrite
create_dirs: true
fallback: save_file
description: "Final deliverable"