Python - creating a class for UMG HUD selection UE4-27

Hello, I have several Widget Blueprints, which are simple non-interactive overlays which I want to burn onto the output of a cinematic camera (one at a time). In fact this is possible using the OffWorldLive cameras, since there is a setting for rendering UMG, and I can control this fine using the UE4.27 GUI.

I need to be able to control this via python. So far I have been able to copy and restore the setting using python, but I do not know how to change this setting without copying the setting first. Can someone help? I am new to python and unreal.

Thanks


import unreal
lst_actors = unreal.EditorLevelLibrary.get_all_level_actors()
indices = [i for i, s in enumerate(lst_actors) if 'CineCamCapture1' in s.get_actor_label()]
actor = lst_actors[indices[0]]
lst_child_components = actor.root_component.get_children_components(True)
t = lst_child_components[3]
print(t)
# LogPython: <Object '/Game/ModularBuildingSet/Demo_Scene.Demo_Scene:PersistentLevel.OWLCineCamCapture_1.OWLCaptureComponent' (0x0000023EDFCCF900) Class 'OWLCaptureComponent'>
y = t.widget_type
print(y)
# LogPython:  <Object '/Game/ModularBuildingSet/hud_widget_0.hud_widget_0_C' (0x0000020559E91600) Class 'WidgetBlueprintGeneratedClass'>
# manually adjust widget_type in UE4 GUI to a different widget (OK). 
t.widget_type = y
# restores widget_type setting to original setting (OK)
#
print(t.get_class())
# LogPython: <Object '/Script/OWLCamera.OWLCaptureComponent' (0x0000014BC9C08680) Class 'Class'>
print(y.get_class())
# LogPython: <Object '/Script/UMG.WidgetBlueprintGeneratedClass' (0x0000014B883BA700) Class 'Class'>
#
# ****
# ****  But How to generate (or modify) y to point to a different hud widget, e.g. /Game/ModularBuildingSet/hud_widget_1.hud_widget_1_C ?