I’d like to store some data in JSONs in order to make it reusable in different projects, widgets etc… E.g. a global storage for base64 svgs. Is there a way to access variables in the custom module directly from the widget code, like with @{} or get()? Currently I’m sending the whole JSON to a variable widget in the GUI, which seems inefficient, since I only need parts of the data.
Additionaly I’m looking for a way, to attach a variable directly to a widget in order to store a ‘pointer’ to the entry in the custom module’s variable. This way, I could have the css code in all widgets the same by referencing the widget’s variable.
Probably I did not fully understand the concept of variables in O-S-C…
The custom module and the client app can only communicate with osc messages, there’s no such thing as shared variables or pointers between the two of them. You could use the osc listener syntax as explained here to send a value from the custom module to the client app.
Note that when it comes to css, writing a theme file is usually the best way to avoid code repetition; it can also be very efficient combined with widget extra css classes. You could keep all your svg in the css file or even as svg files alongside the css file.
Thank you for your answer. I will have a deeper look in to css then.