Jump to content

reverting entities, and event loops


keyframe

Recommended Posts

Heya everyone,

I'm attempting to prevent users from renaming entities in an action subscribed to the ftrack.update event.

In doing so, I set off another ftrack.update event, which calls the action, which sets off another ftrack.update event.

Any clues would be most appreciated.

G

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi Everyone,

here is a workaround for this issue.

I can't guarantee that it works in all situations or that we will not change something in the future causing it to fail.

 

When creating the API session you will use to make the changes you can set the client token header which will be included in update events triggered from that update.

session = ftrack_api.Session()
session._request.headers.update(
    {'ftrack-clienttoken': 'API-EVENT-UPDATER-TOKEN'}
)

Then in your listener you can get clientToken from the data in the event to check if you were the one triggering this event.

Good luck!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...