Author Topic: Sharing (external) parameters among multiple devices?  (Read 1333 times)

0 Members and 1 Guest are viewing this topic.

sfriedberg

  • World Machine Guru
  • ****
  • Posts: 64
    • View Profile
Sharing (external) parameters among multiple devices?
« on: August 20, 2014, 06:11:55 PM »
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.

Remnant

  • Author
  • World Machine Guru
  • *****
  • Posts: 2311
    • View Profile
    • http://www.world-machine.com/
Re: Sharing (external) parameters among multiple devices?
« Reply #1 on: August 20, 2014, 06:25:25 PM »
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).
-- Stephen Schmitt
- Creator of World Machine

sfriedberg

  • World Machine Guru
  • ****
  • Posts: 64
    • View Profile
Re: Sharing (external) parameters among multiple devices?
« Reply #2 on: August 20, 2014, 06:45:21 PM »
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.   :D