Linking asset versionsΒΆ

../../../_images/link_versions.jpg

Asset versions can be liked together to keep track of which version was used in other versions (a dependency). This is useful when making changes to figure out what the change will affect and what has to be redone (for example, a new render).

To link versions together use AssetVersion.addUsesVersions().

First, create two new assets (see Publishing for more details) and an asset version for each:

shot = ftrack.getShot(['dev_tutorial', '001', '010'])

geoAsset = shot.createAsset(name='warriorModel', assetType='geo')
geoVersion = geoAsset.createVersion(comment='First pass.')
geoAsset.publish()

rigAsset = shot.createAsset(name='warriorRig', assetType='rig')
rigVersion = rigAsset.createVersion(comment='First pass.')
rigAsset.publish()

Now link the two together creating a dependency (the rig version used the geo version):

rigVersion.addUsesVersions(versions=[geoVersion])

It is also possible to see all asset versions that are used:

print rigVersion.usesVersions()
print geoVersion.usesVersions()