Deklarative, objektorientierte Wrapper für Ftrack-Abfragen. Leistungsstarke Interaktionen im funktionalen Stil mit resultierenden Sammlungen.
Trackteroid ist auf Ftrack und seine Python -API abhängig, eine Projektmanagement- und Produktions -Tracking -Software, die speziell für die Medien- und Unterhaltungsbranche entwickelt wurde. Es wird häufig in den Feldern von Film, Fernsehen, Animation, visuellen Effekten und Spielen verwendet.
Installieren und aktualisieren Sie mit PIP:
pip install trackteroidWir haben beschlossen, eine API für die Frack Python -API um eine Verpackungs -API zu bauen, um mehrere Einschränkungen und Herausforderungen anzugehen, die bei der direkten Interaktion mit der Python -API auftreten. Während die Ftrack -Python -API viel Flexibilität bietet, gibt es bestimmte Aspekte, die Entwicklung und Wartung umweltfreundlicher und weniger intuitiver machen können. Durch die Schaffung einer Packing-API möchten wir diese Herausforderungen bewältigen und ein optimierteres und entwicklerfreundlicheres Erlebnis bieten. Hier sind die Hauptgründe für diese Entscheidung:
Vereinfachung der Abfrage
Optimierung der Abfrageleistung
Abstracting -Datenbankschema -Komplexität
Verbesserung der resultierenden Sammlungen
Verbesserte Feldzugrunde
In summary Trackeroid versucht Entwickler zu stärken, indem er eine intuitivere und effizientere Möglichkeit bietet, mit der FTRACK -Plattform zu interagieren, letztendlich die Entwicklung zu beschleunigen, die Codequalität zu verbessern und das gesamte Benutzererlebnis zu verbessern.
Mit Trackteroid ...
# 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
)
)... im Gegensatz zur 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 ]
)
)In der neuesten Dokumentation finden Sie Nutzungsdetails.