Sharing (external) parameters among multiple devices?

I’m considering a plugin (or family of related plugins) with a potentially large list of parameters. The majority of these parameters should be set consistently across instances of the plugin (family), and ideally should be loadable/storable to a file.

Obviously, it’s possible to go into each device instance and load the desired configuration. I’m curious if there is a PDK-supported way to share this data across multiple device instances without the explicit loading step, either completely implicitly behind the scenes, or explicitly in layout by wiring each device to a “configuration master” device. I’m looking for something more structured than simply stuffing data into a global variable.

Hi there,

First, the bad news:

There’s currently no sanctioned, official way to do this in the PDK. So any solution will be a roll-your-own, most likely in code rather than expressed in the WM device world.

The best option I can see is to have your family of devices share a singleton that holds the parameter information that should be held in common. Note that since this will be shared across all device instances, all access mechanisms must be thread-safe as WM may build your devices on any available build thread. You could still have a “Config Master” device that is allowed to set these common globals, while all other devices must only read them.

Honestly however, the ideal scenario is to express this dependency within the World Machine device graph. There is no mechanism to do this right now. This ability (creating “structs” or “arrays” of data packets) is something that I am strongly considering adding as an infrastructure feature, as it can dramatically simplify a few things I have in mind to create in the future, and also would help with this situation (your exhaustive set of parameters could be bundled from the config master into a single “cable” and hooked to each of your devices).

Oh, yeah, that would be lovely. :smiley: