How to bake curves from a custom preview with a gradient node plugged into the shader

I have been using the custom preview tool and gradient tool to create a set of multi coloured curves based off of the strength of their force.

  • The problem i am having is that when i bake the curves from the custom preview, the curves are no longer coloured and just turn black.

  • My question; is it possible to bake curves from the custom preview tool, and have them keep the colour that they were in the custom preview tool?

I can attach the model and script if it helps.

the gradient is applying only to a ‘custom preview’.
to bake with attributes you might need to use an addon for gH like human or elefront.