Re-setting Human UI sliders with stored data?

I’m building a project that uses lots of sliders for adjusting parameters and I am using Human UI as a way to collect everything, sliders as well as other input devices, in a window. My basic problem is that if I close the Human-UI window or close the Grasshopper program, all my settings that I did in Human-UI are lost, and everything resets to what the sliders in GH are set to. There is no feedback from the UI sliders to the GH sliders. I have learned to store my data values using serialization in C#, but there is no method that I know of to reset the sliders when I read that data back from disc. Here is a GH program I did to try to experiment a little.
try_XML.gh (17.7 KB)
Is there any plan to update the Human UI project? If so, is there a possibility of modifying the slider component to accept input from say a C# component that knows how to look like a GH
slider? Or does anyone know what the GH slider output looks like to the Human-UI slider so that I could emulate it? I’m sure it must know the limits of the slider as well as a set point.

thanks

I think if you utilize the “metahopper decoupled” UI approach, you won’t have this problem. changes to a slider will persist, as it’s actually modifying the slider’s value.

The basic trick is to use a reference to the GH slider to initialize the human UI slider, and then use the value from the value listener to set the GH slider using metahopper. The snippets on food4rhino are probably the most comprehensive documentation of this, it’s sort of a “secret trick.” With this approach you’ll just have to make sure the GH file gets saved (which can be done programmatically).

No, I am “retired” from GH plugin development, working on something new. But I still review and accept pull requests to the Human UI project every now and again.

I think you’ll find this impossible without modifying the Human UI source. It’s specifically looking for instances of the GH_NumberSlider class: https://github.com/andrewheumann/humanui/blob/33c548b1e3d1edb1d181fe5ea16838f031f1cc0e/HumanUI/HumanUI/Components/UI%20Elements/CreateSlider_Component.cs#L115

Mine take whatever value I place on the input as their “stored value”.

Thanks, Andrew. I didn’t know about metahopper. Using it, I’ve kind of got something working. At least the UI sliders do control the GH sliders. There seems to be an odd persistence tho in the UI sliders that I’m not sure I understand. Not sure it matters. I’ll have to play a bit more.