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 ]
)
)有关使用详细信息,请参见最新文档。