[BUG]Style Customizer Dataset Gradient

v8.1.35

I have a shape with a custom property that drives a style customizer to update the fill paint. This is what my styles dataset looks like.

I am trying to update the gradient color(s). I cannot edit the fillPaint column at all in the dataset viewer, but I am able to edit the other columns. I try to copy the dataset and edit it in n++.

"#NAMES"
"status","animationIndex","animationDuration","fillPaint"
"#TYPES"
"I","I","I","java.awt.Paint"
"#ROWS","5"
"0","0","1000","com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@651f0ade"
"1","0","1000","com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@2723f246"
"2","0","1000","com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@3576b796"
"3","0","800","com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@36107dbe"
"3","1","800","color(0,255,255,255)"

→ (second gradient updated)

"#NAMES"
"status","animationIndex","animationDuration","fillPaint"
"#TYPES"
"I","I","I","java.awt.Paint"
"#ROWS","5"
"0","0","1000","com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@7e4450d2"
"1","0","1000","com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@5d0869fc"
"2","0","1000","com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@3e18aba5"
"3","0","800","com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@11f7da90"
"3","1","800","color(71,255,255,255)"

But I get this error when pasting it back

ClassCastException: Cannot coerce string value 'com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@5d0869fc' into a color

What’s weird is that this error isn’t thrown on the first gradient, but the one that was updated.

That's a default Java toString() representation of an object, which is fine while the object lives in memory or when it's serialized by Vision, but is not sufficient if you copy out to CSV and paste back in (a necessarily lossy serialization/deserialization operation).

There's no canonical acceptable string format for a complicated gradient paint, so you'll have to do what you're trying to do in some other way; you cannot copy out to clipboard and paste back in.

1 Like

Alright, I’m also trying to figure out how it got in there in the first place…