# Failing to set Control Rig transforms when loading a Level Sequence in a python script 

**URL:** <https://forums.unrealengine.com/t/failing-to-set-control-rig-transforms-when-loading-a-level-sequence-in-a-python-script/2434980>\
**Category:** Editor Scripting\
**Tags:** Python, Execution-Flow, unreal-engine, question\
**Created:** [April 1, 2025, 7:03pm UTC](https://forums.unrealengine.com/t/failing-to-set-control-rig-transforms-when-loading-a-level-sequence-in-a-python-script/2434980 "2025-04-01T19:03:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jam3ivan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jam3ivan](https://forums.unrealengine.com/u/jam3ivan)\
**Post date:** [April 1, 2025, 7:03pm UTC](https://forums.unrealengine.com/t/failing-to-set-control-rig-transforms-when-loading-a-level-sequence-in-a-python-script/2434980/1 "2025-04-01T19:03:15Z")

</div>

Hi all!  
I am trying to do the following:

- Open an existing Level Sequence
- Set transforms to a Control Rig inside the new Level Sequence

I seem to be able to do this in 2 steps, but for some reason it fails when it’s all done in one script. My assumption is that it happens because UI is not updated during the execution of the script. Because once the Level Sequence is open in UI the transforms are easy to set.

Here is an example of the code I am running:

```auto
sequence = unreal.load_asset(source_path)

unreal.LevelSequenceEditorBlueprintLibrary.open_level_sequence(sequence)
unreal.LevelSequenceEditorBlueprintLibrary.refresh_current_level_sequence()

rig_proxy = get_rig_proxy(sequence)

test = unreal.ControlRigSequencerLibrary.set_control_rig_world_transform(
        sequence,
        rig_proxy.control_rig,
        "pelvis_CONTROL",
        unreal.FrameNumber(0) , 
        transform
    )

if test: print(f"Got test transform: {test.rotation.x}, {test.rotation.y}, {test.rotation.z}, {test.rotation.w}")
    else:
        print("Failed to get test transform")

```

I am not sure if there is a way to update the UI while the script is running. And I don’t think that I can run 2 scripts one after another using just python and the thing is supposed to be fully automated.  
I thought that .refresh\_current\_level\_sequence() was supposed to help with that, but it’s not. Timeouts didn’t help as well.

Please advise.
