I'm trying to make an event that runs some code whenever a shot is created, deleted or renamed.
I'm running into 1 problem and 1 annoyance/slowdown which both stem from the same issue of several types, ie sequence, shot and task, all being handled as entityType "task".
- I currently have to use the entityId and query TypedContext and check if entity isinstance session.types['Shot']. This adds an unnecessary 0.3 second query every time the event is run in order to just check if an entity is a shot.
Is this really the most optimized way to figure out if something is a sequence, shot or task? Seems like having a subEntityType attribute in the event data dict that stores what subtype it is would save a lot of querying.
- I'm also running into the problem of once a shot is removed I can no longer query the removed entityId, as it returns None, to check if what was deleted was of type shot or not.
How do I figure out if it was specifically a shot that was just deleted?