Jump to content

How to add Assetversion back to a new created Task that was mis-deleted before ?


YuChen

Recommended Posts

Hi all,

I mis-delete an "animation" Task but I found all the AssetVersion under it are still alive on Ftrack. I wonder if it's possible to create another "animation" Task and add all AssetVersion objects back to this new animation task (either by GUI or python code) ?

Thanks.

Link to comment
Share on other sites

  • 1 month later...

Hi YuChen,

there is not a way to do this through the web UI but you can accomplish this through the API.
These lines should do the trick:

new_task = session.query('Task where name is "new_task"').one()

for version in session.query('AssetVersion where id in ("<id>", "<id>")').all():
    version['task'] = new_task

session.commit()


where <id> would look something like 0851c76e-90eb-11ed-8a94-62f40cb9d21c. You can get the id from the side panel.

 

version['asset']['parent'] = new_task['parent']

the above should be included in the loop in cases where the task has not been created in the same place on the same parent.

 

regards,
Daniel

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...