
이번엔 ShotGrid Toolkit에 엔진과 앱을 직접 등록하는 방법을 알아보자.
현재는 Flow Production Tracking 이라는 이름으로 변경되었으며 Nuke, Maya, Houdini 등 다양한 DCC와 통합하여 파이프라인을 효율적으로 관리할 수 있는 도구이다.
ShotGrid를 사용하다보면 일일이 사용자가 ShotGrid 페이지에 접속하여 Task를 등록 및 확인하거나 Publish할 데이터를 직접 업로드하게 된다.
그러나 Shotgrid Toolkit를 활용하면 프로젝트 파일 및 에셋의 Save, Open, Publish, Load와 같은 작업을 DCC 툴 내에서 수행할 수 있게 되므로 업무를 더 빠르고 효율적으로 처리할 수 있다.
ShotGrid Toolkit은 엔진과 앱을 등록 후 그들을 .yml파일에서 엮어서 사용하게 된다.
먼저, 엔진을 등록하는 방법에 대해 알아보자.
tk-maya, tk-nuke, tk-houdini와 같이 ShotGrid 자체에서 툴킷 엔진을 지원하는 경우, 비교적 간단하게 ShotGrid Toolkit에 엔진을 등록할 수 있다.
추가적으로 공식 지원되는 엔진 목록은 여기에서 확인할 수 있다.
먼저, 각 엔진에 포함된 시작 스크립트(menu.py, userSetup.py)를 터미널에서 인식할 수 있도록 환경변수를 추가한다.
DCC마다 시작 시 호출하는 스크립트의 환경변수가 다르므로 해당 DCC의 공식 문서를 참조하는 것이 좋다.
# example - Nuke
export NUKE_PATH="/Your/Pipeline/Configuration/install/app_store/tk-nuke/v0.14.4/plugins/basic"
tk-maya, tk-nuke, tk-houdini의 경우 app_store에서 엔진을 지원하므로, config/env/includes/engine_locations.yml에 각 엔진을 추가하여 등록할 수 있다.
# engine_locations.yml
engines.tk-maya.location:
type: app_store
name: tk-maya
version: v0.12.0
engines.tk-nuke.location:
type: app_store
name: tk-nuke
version: v0.14.4
engines.tk-houdini.location:
type: app_store
name: tk-houdini
version: v1.9.1
config/env/includes/settings에 각 엔진 별 yml 파일 생성각 엔진에서 사용하고자 하는 앱을 .yml 파일에 작성한다.
주의해야 할 점은 앱의 경우 ShotGrid Context 별로 지정할 수 있기 때문에, Context 별로 설정을 만들어주어야 한다는 것이다.
아래는 tk-nuke.yml의 작성 예시이다.
includes:
# - ../app_locations.yml
- ../engine_locations.yml
# - ./tk-multi-loader2.yml
# - ./tk-multi-publish2.yml
- ./tk-multi-workfiles2.yml
# asset_step
settings.tk-nuke.asset_step:
apps:
# tk-multi-about:
# location: "@apps.tk-multi-about.location"
# tk-multi-loader2: "@settings.tk-multi-loader2.nuke"
# tk-multi-publish2: "@settings.tk-multi-publish2.nuke.asset_step"
tk-multi-workfiles2: "@settings.tk-multi-workfiles2.nuke.asset_step"
menu_favourites:
- {app_instance: tk-multi-workfiles2, name: File Open...}
- {app_instance: tk-multi-workfiles2, name: File Save...}
# - {app_instance: tk-multi-publish2, name: Publish...}
# - {app_instance: tk-multi-loader2, name: Load}
location: '@engines.tk-nuke.location'
tk-mari의 경우, 다른 DCC와 다르게 엔진 디렉토리에 startup.py가 제공되지 않아 ShotGrid Desktop App에서 Mari를 실행할 수 없다.
그렇기 때문에 별도로 startup.py를 작성하여 ShotGrid Desktop App에서 Mari가 작동하도록 했다.
startup.py의 경우 tk-nuke의 startup.py를 기반으로 작성했다.
tk-mari : https://github.com/junopark00/tk-mariMari를 시작할 때 init.py를 인식하도록 MARI_SCRIPT_PATH 환경변수에 해당 경로를 추가한다.
export MARI_SCRIPT_PATH="$MARI_SCRIPT_PATH:/tk-mari/startup"
tk-mari의 경우 커스텀 과정을 거쳤기 때문에 app_store에서 엔진을 가져오는 것이 아닌 dev 혹은 git을 통해 엔진을 등록한다.
이때 주의할 점은 engine.py가 존재하는 디렉토리 경로를 path에 추가해야 한다.
# dev
engines.tk-mari.location:
type: dev
name: tk-mari
path: "/home/juno/workspace/engines/tk-mari"
# git
engines.tk-mari.location:
type: git
name: tk-mari
version: v1.4.1
path: "github.com/junopark00/tk-mari.git"
config/env/includes/settings에 각 엔진 별 yml 파일 생성위와 유사한 방법으로 tk-mari.yml을 작성한다. Mari의 경우 전용 앱인 tk-mari-projectmanager도 추가한다.
includes:
#- ../app_locations.yml
- ../engine_locations.yml
- ./tk-multi-loader2.yml
- ./tk-multi-publish2.yml
#- ./tk-multi-screeningroom.yml
#- ./tk-multi-shotgunpanel.yml
#- ./tk-multi-snapshot.yml
- ./tk-multi-workfiles2.yml
- ./tk-mari-project-manager.yml
# asset_step
settings.mari.asset_step:
apps:
tk-multi-loader2: "@apps.tk-multi-loader2"
tk-multi-publish2: "@apps.tk-multi-publish2"
tk-multi-workfiles2: "@settings.tk-multi-workfiles2.mari"
tk-mari-projectmanager: "@settings.tk-mari-projectmanager"
menu_favourites:
- {app_instance: tk-multi-workfiles2, name: File Open...}
- {app_instance: tk-multi-workfiles2, name: File Save...}
- {app_instance: tk-multi-loader2, name: Load}
- {app_instance: tk-multi-publish2, name: Publish...}
location: "@engines.tk-mari.location"
Katana와 Clarisse처럼 ShotGrid에서 공식적으로 엔진을 지원하지 않는 경우 엔진을 직접 개발하거나 기존에 다른 사람이 만들어 둔 엔진을 이용해야 한다.
엔진을 구성하는 스크립트에는 startup.py, menu_generation.py, engine.py 등이 있으며 특히 menu_generation.py의 경우 DCC 내에 ShotGrid Toolkit 메뉴를 생성하는 스크립트이므로 각 DCC의 메뉴와 관련된 API가 사용된다.
tk-katana: https://github.com/junopark00/tk-katanatk-clarisse: https://github.com/junopark00/tk-clarisseKatana
Katana의 경우 resource 디렉토리를 인식할 수 있도록 KATANA_RESOURCES 환경 변수에 해당 경로를 추가한다.
export KATANA_RESOURCES="$KATANA_RESOURCES:/tk-katana/resources/Katana"
Clarisse
Clarisse는 export를 통해 환경 변수를 등록하는 것이 아닌 ~/.isotropix 디렉토리에 존재하는 clarisse.env 파일에 환경변수들을 등록해야 한다.
해당 엔진의 경우 Python3 기반으로 작성되었으므로 IX_PYTHON3HOME, IX_PYTHON3PATH를 추가하면 된다.
# ~/.isotropix/clarisse/5.0/clarisse.env
IX_PYTHON2HOME=/usr/local:/usr
IX_PYTHON2PATH=/your/python2/libs/path
IX_PYTHON3HOME=/usr/local:/usr
IX_PYTHON3PATH=/your/python3/libs/path
ILISE_SERVER=Your_IP:port
IX_SHELF_CONFIG_FILE=$IX_PYTHON_API_PATH/shelves/shelf.cfg
IX_SHELF_SCRIPT_PATH=
IX_SHELF_ICON_PATH=
IX_MENU_CONFIG_FILE=$IX_PYTHON_API_PATH/menus/init_menus.py
IX_MENU_SCRIPT_PATH=
IX_MENU_ICON_PATH=
IX_RESOLUTION_PRESET=
CLARISSE_STARTUP_SCRIPT=
# Add LD_LIBRARY_PATH if you need.
tk-katana와 tk-clarisse 또한 직접 작성된 엔진이므로 dev 혹은 git을 통해 엔진을 등록한다.
# dev
engines.tk-katana.location:
type: dev
name: tk-katana
path: "/home/juno/workspace/engines/tk-katana"
# git
engines.tk-clarisse.location:
type: git
name: tk-clarisse
version: v1.4.1
path: "github.com/junopark00/tk-clarisse.git"
config/env/includes/settings에 각 엔진 별 yml 파일 생성위와 유사한 방법으로 tk-katana.yml와 tk-clarisse.yml을 작성한다.
# tk-katana.yml
includes:
# - ../app_locations.yml
- ../engine_locations.yml
# - ./tk-multi-loader2.yml
# - ./tk-multi-publish2.yml
- ./tk-multi-workfiles2.yml
# asset_step
settings.tk-katana.asset_step:
apps:
# tk-multi-about:
# location: "@apps.tk-multi-about.location"
# tk-multi-loader2: "@settings.tk-multi-loader2.katana"
# tk-multi-publish2: "@settings.tk-multi-publish2.katana.asset_step"
tk-multi-workfiles2: "@settings.tk-multi-workfiles2.katana.asset_step"
menu_favourites:
- {app_instance: tk-multi-workfiles2, name: File Open...}
- {app_instance: tk-multi-workfiles2, name: File Save...}
# - {app_instance: tk-multi-publish2, name: Publish...}
# - {app_instance: tk-multi-loader2, name: Load}
location: '@engines.tk-katana.location'
# tk-clarisse.yml
includes:
# - ../app_locations.yml
- ../engine_locations.yml
# - ./tk-multi-loader2.yml
# - ./tk-multi-publish2.yml
- ./tk-multi-workfiles2.yml
# asset_step
settings.tk-clarisse.asset_step:
apps:
# tk-multi-about:
# location: "@apps.tk-multi-about.location"
# tk-multi-loader2: "@settings.tk-multi-loader2.clarisse"
# tk-multi-publish2: "@settings.tk-multi-publish2.clarisse.asset_step"
tk-multi-workfiles2: "@settings.tk-multi-workfiles2.clarisse.asset_step"
menu_favourites:
- {app_instance: tk-multi-workfiles2, name: File Open...}
- {app_instance: tk-multi-workfiles2, name: File Save...}
# - {app_instance: tk-multi-publish2, name: Publish...}
# - {app_instance: tk-multi-loader2, name: Load}
location: '@engines.tk-clarisse.location'
엔진 등록과 관련된 파일 작성이 끝나면 pipeline_configuraion 최상단 디렉토리에 존재하는 tank 명령어를 통해 엔진을 로드 혹은 다운로드 할 수 있다.
다양한
Tank명령어에 대한 정보는 여기에서 확인
$] ./tank cache_apps
...
Engine tk-katana - OK!
App tk-multi-workfiles2 (Engine tk-katana) - OK!
Engine tk-clarisse - OK!
App tk-multi-workfiles2 (Engine tk-clarisse) - OK!
Framework tk-framework-widget_v0.2.x - OK!
Framework tk-framework-adobe_v1.x.x - OK!
Framework tk-framework-qtwidgets_v2.x.x - OK!
Framework tk-framework-shotgunutils_v4.x.x - OK!
Framework tk-framework-shotgunutils_v5.x.x - OK!
Framework tk-framework-adminui_v0.x.x - OK!
Framework tk-framework-widget_v1.x.x - OK!
Framework tk-framework-desktopserver_v1.x.x - OK!
Framework tk-framework-desktopclient_v0.x.x - OK!
Framework tk-framework-alias_v1.x.x - OK!
Framework tk-framework-aliastranslations_v0.x.x - OK!
Framework tk-framework-lmv_v0.x.x - OK!
Framework tk-framework-lmv_v1.x.x - OK!
Cache apps completed! 0 items downloaded.
ShotGrid에서 기본적으로 제공하는 앱에는 tk-multi-workfiles2와 같이 DCC의 구분없이 사용할 수 있는 멀티 앱,
tk-mari-projectmanager와 같이 특정 DCC에 적용할 수 있는 전용 앱이 있다.
필요하다면 직접 앱을 제작하여 적용할 수도 있다.
ShotGrid Toolkit에 앱을 등록하기 위해서는 app_locations.yml에 해당 앱에 대한 위치를 지정해주어야 한다.
type이 app_store로 설정하고 version 정보를 작성해야 한다.type을 dev로 설정하고 path에 앱 경로를 작성하면 된다.type을 git으로 설정하고 path에 리포지토리 주소를 작성하면 된다.아래는 app_locations.yml의 예시이다.
# app_store
apps.tk-multi-launchapp.location:
type: app_store
name: tk-multi-launchapp
version: v0.13.0
# dev
apps.tk-custom-app.location:
type: dev
name: tk-custom-app
path: "/home/juno/workspace/tk-custom-app"
# git
apps.tk-custom-app/location:
type: git
name: tk-custom-app
path: "https://github.com/junopark00/tk-custom-app"
ShotGrid Toolkit은 templates.yml이라는 파일에 의해 DCC에서 작업을 진행하거나 앱에서 사용될 디렉토리를 생성하게 된다.
이에 따라 디렉토리 스키마를 구성하고 디렉토리 경로에 대한 정보를 templates.yml에 추가함으로써 앱이 로컬 경로를 활용할 수 있게 된다.
스키마 구성에 대한 자세한 정보는 디스크에 폴더 만들기 부분을 참고
아래는 templates.yml 예시의 일부분이다.
keys:
Sequence:
type: str
Shot:
type: str
Step:
type: str
sg_asset_type:
type: str
Asset:
type: str
name:
type: str
filter_by: alphanumeric
iteration:
type: int
version:
type: int
format_spec: "03"
version_four:
type: int
format_spec: "04"
alias: version
timestamp:
type: str
width:
type: int
height:
type: int
segment_name:
type: str
# (중략)
paths:
shot_root: sequences/{Sequence}/{Shot}/{Step}
asset_root: assets/{sg_asset_type}/{Asset}/{Step}
sequence_root: sequences/{Sequence}
#
# Nuke
#
# define the location of a work area
shot_work_area_nuke:
definition: '@shot_root/work/nuke'
# define the location of a publish area
shot_publish_area_nuke:
definition: '@shot_root/publish/nuke'
# The location of WIP script files
nuke_shot_work:
definition: '@shot_root/work/nuke/{name}.v{version}.nk'
# The location of backups of WIP files
# The location of published nuke script files
nuke_shot_publish:
definition: '@shot_root/publish/nuke/{name}.v{version}.nk'
# (하략)
이처럼 templates.py에는 어떤 경로에 어떤 확장자명으로 파일을 저장 혹은 내보낼지 결정하는 중요한 내용이 포함되어 있으므로,
스키마와 일치하는지, 오타는 없는지 검토할 필요가 있다.
templates.py 작성에 대한 자세한 내용은 템플릿 구성 부분을 참고
대부분의 앱에서는 DCC와 Context에 따라 다른 정보를 받아오기 때문에, 이와 관련된 설정들을 .yml파일에 작성해야 한다.
config/env/includes/settings 디렉토리에 tk-multi-workfiles2.yml, tk-multi-publish2.yml와 같은 파일을 추가하고,
각 DCC에 부여된 Task에서 사용하는 Context마다 설정을 추가해야한다.
이에 대한 자세한 내용은 앱 및 엔진 구성 부분을 참고
includes:
- ../app_locations.yml
settings.tk-multi-workfiles2: &settings_tk-multi-workfiles2
entities:
- caption: Assets
entity_type: Asset
hierarchy: [sg_asset_type, code]
filters:
sub_hierarchy:
entity_type: Task
filters:
link_field: entity
hierarchy: [step]
- caption: Shots
entity_type: Shot
filters:
hierarchy: [sg_sequence, code]
sub_hierarchy:
entity_type: Task
filters:
link_field: entity
hierarchy: [step]
location: "@apps.tk-multi-workfiles2.location"
# launches at startup.
settings.tk-multi-workfiles2.launch_at_startup:
launch_at_startup: true
entities:
- caption: Assets
entity_type: Asset
hierarchy: [sg_asset_type, code]
filters:
sub_hierarchy:
entity_type: Task
filters:
link_field: entity
hierarchy: [step]
- caption: Shots
entity_type: Shot
filters:
hierarchy: [sg_sequence, code]
sub_hierarchy:
entity_type: Task
filters:
link_field: entity
hierarchy: [step]
location: "@apps.tk-multi-workfiles2.location"
# ---- nuke
# asset_step
settings.tk-multi-workfiles2.nuke.asset_step:
template_publish: nuke_asset_publish
template_publish_area: asset_publish_area_nuke
template_work: nuke_asset_work
template_work_area: asset_work_area_nuke
entities:
- caption: Assets
entity_type: Asset
hierarchy: [sg_asset_type, code]
filters:
sub_hierarchy:
entity_type: Task
filters:
link_field: entity
hierarchy: [step]
- caption: Shots
entity_type: Shot
filters:
hierarchy: [sg_sequence, code]
sub_hierarchy:
entity_type: Task
filters:
link_field: entity
hierarchy: [step]
location: "@apps.tk-multi-workfiles2.location"
# (하략)
이처럼 앱 설정 파일에는 각 DCC 및 Context 별로 앱에 어떤 형식으로 정보를 전달할지가 작성되어야 한다.
작성이 끝나면 pipeline_configuraion 최상단 디렉토리에 존재하는 tank 명령어를 통해 앱을 로드 혹은 다운로드 할 수 있다.
다양한
Tank명령어에 대한 정보는 여기에서 확인
$] ./tank cache_apps
...
Engine tk-katana - OK!
App tk-multi-workfiles2 (Engine tk-katana) - OK!
Engine tk-clarisse - OK!
App tk-multi-workfiles2 (Engine tk-clarisse) - OK!
Framework tk-framework-widget_v0.2.x - OK!
Framework tk-framework-adobe_v1.x.x - OK!
Framework tk-framework-qtwidgets_v2.x.x - OK!
Framework tk-framework-shotgunutils_v4.x.x - OK!
Framework tk-framework-shotgunutils_v5.x.x - OK!
Framework tk-framework-adminui_v0.x.x - OK!
Framework tk-framework-widget_v1.x.x - OK!
Framework tk-framework-desktopserver_v1.x.x - OK!
Framework tk-framework-desktopclient_v0.x.x - OK!
Framework tk-framework-alias_v1.x.x - OK!
Framework tk-framework-aliastranslations_v0.x.x - OK!
Framework tk-framework-lmv_v0.x.x - OK!
Framework tk-framework-lmv_v1.x.x - OK!
Cache apps completed! 0 items downloaded.
지금까지 ShotGrid Toolkit에 엔진과 앱을 등록하는 방법을 간단하게나마 정리해보았다.
엔진이나 앱 개발의 자세한 내용은 추후 추가 예정이다.