Custom hook for app tk-multi-setframerange

Hi Kevin!

A few things to note here:

  • First off, the tk-multi-setframerange app actually didn’t have any hooks until the most recent version, v0.4.0, so make sure you have the latest.
  • Secondly, the Default Config is a sparse configuration, meaning that, in order to keep things concise, settings that aren’t different from the default value are not explicitly included in the config. This section of the Environment Configuration Reference tells you how to discover the settings for a given app, and specifically for tk-multi-setframerange, you can see in the app’s manifest that the setting you want is hook_frame_operation.
  • Having said all that, there’s one more bit of nuance here: In the Default Config, we typically have a file for every app engine in config/env/includes/settings/, and include a block from that file into every environment where it’s defined. In the case of setframerange, we’ve taken a shortcut, since its settings were so simple, and are bringing in the location descriptor for the app from config/env/includes/app_locations.yml (as you discovered).
  • To keep things consistent, what you’d probably want to do is:
    • Create a config/env/includes/settings/tk-multi-setframerange.yml, using another app’s analogous file as a model (tk-multi-breakdown is a good one to use – it’s similarly very simple)
    • Include the hook setting, pointing to your custom hook, in that file
    • Change references to tk-multi-setframerange throughout your environment configuration to point to this file instead of app_locations.yml.

If you’re new to the organization of config/env/* or need more explanation of concepts like manifest, descriptor, includes, sparse config, the Environment Configuration Reference explains all of these.

If you’re still stuck, let me know – I can give more specifics. =)

3 Likes