trackteroid
1.0.0
用於ftrack查詢的聲明性,面向對象的包裝器。強大的功能風格的相互作用與產生的集合。
Trackteroid取決於Ftrack及其Python API,專門為媒體和娛樂行業設計的項目管理和生產跟踪軟件。它通常用於電影,電視,動畫,視覺效果和遊戲領域。
使用PIP安裝和更新:
pip install trackteroid我們已決定圍繞Ftrack Python API構建包裝API,以應對直接與Python API交互時出現的幾個局限性和挑戰。雖然Ftrack Python API具有很大的靈活性,但某些方面可以使開發和維護更加笨拙,直觀。通過創建包裝API,我們旨在克服這些挑戰,並提供更簡化和更加友好的經驗。這是此決定的關鍵原因:
簡化查詢
優化查詢性能
抽像數據庫架構複雜性
增強結果收藏
改進的現場可訪問性
總而言之,Trackeroid試圖通過提供一種更直觀,更有效的方式來與FTRACK平台進行交互,最終加速開發,提高代碼質量並增強整體用戶體驗,以增強開發人員的能力。
帶有曲目...
# Calculate and display the total time duration logged for
# AssetBuild types within specified Shots and Folders.
#
# output:
# Found 9 assetbuilds.
# Found 1 assetbuilds with timelogs.
# {16.0: ['Drone Craft'],
# 'No time tracked yet.': ['Drawer Cabinet 01',
# 'Gothic Commode 01',
# 'Shelf 01',
# 'Side Table 01',
# 'Small Wooden Table 01',
# 'Vintage Wooden Drawer 01',
# 'Wooden Table 01',
# 'Wooden Table 02']}
from pprint import pprint
from trackteroid import (
Query ,
AssetBuild ,
Folder ,
Task ,
Project
)
assetbuild_collection = Query ( AssetBuild ).
by_name ( Project , "sync" , "showroom" ).
by_name ( Folder , "Asset%" , "Delivery 3" ).
get_all (
projections = [
Task . Timelog ,
Task . Timelog . duration
]
)
print (
f"Found { len ( assetbuild_collection ) } assets. n "
f"Found { assetbuild_collection . count ( lambda ac : ac . Task . Timelog ) } assetbuilds with timelogs."
)
pprint (
assetbuild_collection . group_and_map (
lambda abc : abc . Task . Timelog . fold (
0 ,
lambda current , tc : current + tc . duration [ 0 ] / 3600
) or "No time tracked yet." ,
lambda abc : abc . sort (
lambda abc : abc . name
). name
)
)...與Ftrack Python API相反。
# Calculate and display the total time duration logged for
# AssetBuild types within specified Shots and Folders.
#
# output:
# Found 9 assetbuilds.
# Found 1 assetbuilds with timelogs.
# {16.0: ['Drone Craft'],
# 'No time tracked yet.': ['Drawer Cabinet 01',
# 'Gothic Commode 01',
# 'Shelf 01',
# 'Side Table 01',
# 'Small Wooden Table 01',
# 'Vintage Wooden Drawer 01',
# 'Wooden Table 01',
# 'Wooden Table 02']}
from pprint import pprint
import ftrack_api
session = ftrack_api . Session ( auto_connect_event_hub = False , auto_populate = False )
project_names = ( "sync" , "showroom" )
folder_specific = "Delivery 3"
folder_unspecific = "Asset%"
query = (
f"select id, name, assets.name, parent.name, project.name, "
f"assets.versions.task.timelogs, assets.versions.task.timelogs.duration "
f"from AssetBuild where project has (name in { project_names } ) "
f"and parent[Folder] has (name is ' { folder_specific } ' or name like ' { folder_unspecific } ')"
)
assetbuilds_no_duration = [ "No time tracked yet." , []]
assetbuilds_timelog_duration = [ 0 , []]
assetbuilds = session . query ( query ). all ()
for assetbuild in assetbuilds :
has_duration = False
for asset in assetbuild [ "assets" ]:
for version in asset [ "versions" ]:
durations = [ _ [ "duration" ] for _ in version [ "task" ][ "timelogs" ]]
if any ( durations ):
for duration in durations :
assetbuilds_timelog_duration [ 0 ] += duration / 3600
if not has_duration :
has_duration = True
if has_duration :
assetbuilds_timelog_duration [ 1 ]. append ( assetbuild [ "name" ])
else :
assetbuilds_no_duration [ 1 ]. append ( assetbuild [ "name" ])
print (
f"Found { len ( assetbuilds ) } assetbuilds. n "
f"Found { len ( assetbuilds_timelog_duration [ 1 ]) } assetbuilds with timelogs."
)
assetbuilds_no_duration [ 1 ]. sort ()
assetbuilds_timelog_duration [ 1 ]. sort ()
pprint (
dict (
[ assetbuilds_no_duration , assetbuilds_timelog_duration ]
)
)有關使用詳細信息,請參見最新文檔。