26.03.2021, 21:13
Hi,
Is it possible to change the icon (or icon set) used by an object in the visualization from the Lua code? I have researched this but can't find a good example so far...
I have a use case where I need to show a specific icon on a single object in my visualization, depending on the value of a Lua code variable (which I can link to a bus-object value or level if needed).
I know each object in the graphical editor has an 'Additional Icon' menu, where you can set the icon shown to be 'X_svg' if the value is '1', 'Y_svg' if it's '2', and so on..
I have about 20 objects where I need this functionality on, and each one will have maybe 40 different individual icons to display depending on its value.
I know it can be done manually, but it's slow and tedious, and not that easy to replicate across different projects and different LMs..
I don't think this is a suitable use case for an animated SVG.. but maybe I'm not thinking about it correctly...
If it's useful, assume I already have these 40 SVG icons loaded into the "Vis. Graphics / Icons" tab, and I already have a Lua table with all their names...
A simple example of setting two or three icons for given values on one visu object would be fine, once I know where to start and the basic concepts, I can probably work on it from there...
Thanks in advance, if anyone could help I'd appreciate it.
Is it possible to change the icon (or icon set) used by an object in the visualization from the Lua code? I have researched this but can't find a good example so far...
I have a use case where I need to show a specific icon on a single object in my visualization, depending on the value of a Lua code variable (which I can link to a bus-object value or level if needed).
I know each object in the graphical editor has an 'Additional Icon' menu, where you can set the icon shown to be 'X_svg' if the value is '1', 'Y_svg' if it's '2', and so on..
I have about 20 objects where I need this functionality on, and each one will have maybe 40 different individual icons to display depending on its value.
I know it can be done manually, but it's slow and tedious, and not that easy to replicate across different projects and different LMs..
I don't think this is a suitable use case for an animated SVG.. but maybe I'm not thinking about it correctly...
If it's useful, assume I already have these 40 SVG icons loaded into the "Vis. Graphics / Icons" tab, and I already have a Lua table with all their names...
A simple example of setting two or three icons for given values on one visu object would be fine, once I know where to start and the basic concepts, I can probably work on it from there...
Thanks in advance, if anyone could help I'd appreciate it.