how to move or copy all the viewport visibility keyframes to render-visibility channels? I am working with a blender3d animation where I need some objects appear/hide at specific frames. I made all the work using the eye icon (visibility view-port) instead of camera icon (render-visibility) before discovering that they are not the same :(

Aside from animating everything again and hitting my head on the wall for not reading the whole manual, is there some python script or something to move the existing animation keyframes from one channel to the other?
you can use this script to :


clean the render visibility channels
create new render visibility channel from the viewport visibility channel


Note : this is for all object in the current scene



import bpy


# clean all render view channels            
for action in bpy.data.actions :
    for fcurve in action.fcurves :
        if fcurve.data_path == 'hide_render':
              action.fcurves.remove(fcurve)

#create new render view channel and fill it from the viewport view channel
for action in bpy.data.actions :
    for fcurve in action.fcurves :
        if fcurve.data_path == 'hide':
            render_fcurve = action.fcurves.new('hide_render')
            for p in fcurve.keyframe_points :
                render_fcurve.keyframe_points.insert(p.co[0], p.co[1])
                #set the interpolation from BEZIER to CONSTANT
                render_fcurve.keyframe_points[-1].interpolation = 'CONSTANT'
            break