Jump to content

Change task status with version status


Alberto GZ

Recommended Posts

Posted

I would like that one specific task changes its status when a version of image is uploaded under this task. Exactly, the task should be to get the same status of the last version if this is avaiable.

Example: I have a task called Preview and its status is Not Started. When I upload a the first version, task status is auto-changed to In Progress. Then, when I set the status of the version to Pending Review, the task status is auto-changed to Pending Review.

Is this possible to do this? Is neccessary using a Event Listener?

Posted

Thank you tokejepsen

I tried this script and it return me failed importing utils. 

I have a lot of doubts to setup event listeners.

I downloaded python-api to c:\ftrack folder in my computer, and I was create session.py with settings to connect with ftrack server using api-key. This works, and it return project list using example .py script in ftrack dev documentation.

But I don't understand how it works. Where should put plugins for event listeners? If I put a .py script in my local computer, what happens when others users in other computers (and in other locations) do an action that should doing another action (case event listener)?

I understand the concept of event listener, and it's very useful for many things that I want to do, but I don't understand how it implements.

I'm not using a local installation of FTrack (Ftrack enterprise?). 

 

 

Posted
Quote

I tried this script and it return me failed importing utils. 

Sorry, I meant the link as an example and not to be used isolated.

I would start by going through the examples Ftrack has documented; http://ftrack-python-api.rtd.ftrack.com/en/latest/handling_events.html.

Quote

But I don't understand how it works. Where should put plugins for event listeners? If I put a .py script in my local computer, what happens when others users in other computers (and in other locations) do an action that should doing another action (case event listener)?

This is very much up to each studio to figure out, as there aren't any standardized way of sharing and using event listeners. The main issue is to make sure people have got all the necessary files and software like Python and the ftrack api. When you have something running locally, I can give some advise on running it on a network for everyone within the network to use and share.

When you are more familiar with how event listeners work, and you can make an event listener that runs on its own, I would take a look at my event listener server; https://github.com/tokejepsen/ftrack-event-server, which will make it easier to handle multiple event listeners.

Quote

I'm not using a local installation of FTrack (Ftrack enterprise?). 

You don't need it for running event listeners :)

Posted

Thanks to your explanation.

So, I understanding I'll should doing local python installation on every computer that needs run any script.py, and would be enough put all .py files for event plugins on only one computer that it have a share folder accessible to the others computers on the local network. Then I guess I will have to set enviroment variable FTRACK_EVENT_PLUGIN_PATH pointing to share folder into each computer.

A couple of questions still in my mind.

Is mandatory set and configure a location, for example pointing to computer that contains eventlisteners .py files, to use event listeners?

Is required FTrack Connect to use event listeners?

I'm thinking essentially in this event listeners:

1. Mirroring status between version status and task status

2. Get the last version uploaded and use to parent task thumbnail. (version file will be store in ftrack.server)

 

Posted

Firstly you need to know that there is a difference between event listeners (event plugins) and connect plugins.
Connect plugins are something like actions, that need to be run through ftrack connect. These enable users to do something in ftrack.
Event plugins can be run on their own, and doesn't require ftrack connect. These respond to events happening in ftrack.

 

Quote

So, I understanding I'll should doing local python installation on every computer that needs run any script.py, and would be enough put all .py files for event plugins on only one computer that it have a share folder accessible to the others computers on the local network. Then I guess I will have to set enviroment variable FTRACK_EVENT_PLUGIN_PATH pointing to share folder into each computer.

Since event plugins can be run from anywhere, you only need to run them from a single computer. You don't need to set any environment variables, as you are just running individual python scripts. For running multiple event plugins on a single computer, I would suggest taking a look at the ftrack event server I posted.

You don't need to have python installed on every computer in any case, as you can have python installed on a network path.

Quote

Is mandatory set and configure a location, for example pointing to computer that contains eventlisteners .py files, to use event listeners?

Yes, you can have your event plugins on a network path and run them from there.

Quote

Is required FTrack Connect to use event listeners?

No :)

Posted

Thanks a lot tokejepsen!

Now I start to have clear some points about configuration to run an Event Listener.

If neccesary is a local storage Location to use any Event Listener plugin, then I should to fight with this before.

Posted

I have been done a scenario storage targeting a local disk (a network shared folder), from web interface.

I can publish files via ftrack-connect and they are target to disk configured for project.

However I still can't try any event listener, cos I don't see how do it.

I have created a folder C:\FTrack\plugins as shared folder in local network, as well I have added this path to the os environment var FTRACK_EVENT_PLUGIN_PATH,though its no neccessary to run an event listener.

I want that task status its changed when an user changes the status of any version, but I'm unable to set folder for event plugins.

Posted

Tokejepsen, I launched version_to_task_statuses.py again, this time I've downloaded utils.py, but nothing seems happen. I have replace in your code statuses names filter. 'render complete' to 'Approved' and 'artist review' to 'Completed'.

I have running cascade_thumbnails.py event and it works. This is built for new api, and your .py uses old api, but both api's can run at same time, isn't it?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...