API and custom_event_hooks

The HTTP & Python API
Post Reply
chrisg
Posts: 5
Joined: November 28th, 2017, 12:27 am

API and custom_event_hooks

Post by chrisg » June 7th, 2018, 12:41 am

Are API calls able to trigger custom event hooks?

From what i can see from my own experiments, it appears as if they do not. Which leaves a big ol' hole in data integrity if we're using the hooks to do Other Things Elsewhere.

cheers,
chrisg
alt.vfx

User avatar
andrew
Site Admin
Posts: 267
Joined: June 24th, 2014, 8:10 am

Re: API and custom_event_hooks

Post by andrew » June 7th, 2018, 4:47 pm

Hi Chris,

Event hooks are only triggered by internal events that the end user does not have control over or access to. We purposely do not have the API triggering event hooks and left this up to the user coding to the API to call the same function the event hook is using at the appropriate time, ie if you call the addShot API function, then be sure to call whatever function your onShotCreate event hook is calling directly after. Additionally it is possible to call the API from an event hook which could start to create and endless loop of events if they called each other.

Cheers,
Andrew

Post Reply