The bake_transform_with_settings method works in 5.6 but not 5.7

Trying to automate the process of baking transforms via python and the identical code above works in 5.6 but not in 5.7.

There are no error messages in the output log.

When running in 5.7, it does create a new Transform track, but just plucks one or two keys at the beginning.

It should also be noted that the def bake_transform(): example found in:

\UE_5.7\Engine\Plugins\MovieScene\SequencerScripting\Content\Python\sequencer_tools_examples.py

Does not work, as it calls a bake_transform method which seems to have gone away in favor of bake_transform_with_settings

Steps to Reproduce

def bake_selected():

    EAS = unreal.EditorActorSubsystem()
    selectedObj = EAS.get_selected_level_actors()

    sequence = unreal.LevelSequenceEditorBlueprintLibrary.get_current_level_sequence()  

    bindings = sequence.get_bindings()

    bake_array = []

    for binding in bindings:
        for sel in selectedObj:
            if binding.get_name() == sel.get_actor_label():
                bake_array.append(binding)

    if len(bake_array) >= 1:
        bakeSettings = unreal.BakingAnimationKeySettings()
        bakeSettings.baking_key_settings = unreal.BakingKeySettings.ALL_FRAMES
        bakeSettings.start_frame = unreal.FrameNumber(sequence.get_playback_start())
        bakeSettings.end_frame  = unreal.FrameNumber(sequence.get_playback_end())
        bakeSettings.reduce_keys = False
        bakeSettings.frame_increment = 1

        # Bake from the playback start to the playback end per frame      
        level_sequence_editor_subsystem = unreal.get_editor_subsystem(unreal.LevelSequenceEditorSubsystem)
        level_sequence_editor_subsystem.bake_transform_with_settings(bake_array,bakeSettings)
        print('Done baking')

Hey there,

Yes there is a bug here. We moved and modified all of the bake transform stuff to the utilities module out of the main sequencer.

You can follow along here: https://issues.unrealengine.com/issue/UE-355639

I’ll get your a work around this week.

Dustin

Ok! Well it’s a pretty easy fix, not even a workaround. We’ve fixed it and it will be in 5.7.2. If you want to implement it.

In ULevelSequenceEditorSubsystem::BakeTransformWithSettings

In the final line:

Change

return FSequencerUtilities::BakeTransform(Sequencer.ToSharedRef(), ObjectBindings, InSettings);to

return FSequencerUtilities::BakeTransform(Sequencer.ToSharedRef(), ObjectBindings, Settings);Note the InSettings->Settings.

Dustin

Confirming that change from InSettings to Settings did indeed work. I’ll stick with this until the 5.7.2, thanks again !

Casey

Will give this a try thank you !!

Sorry, I understand a solution is provided, but how do I implement it properly? Does this mean I need to recompile the engine/plugin? If so, how do I go about doing that? I have tried changing it manually in a file, but no luck.

Thanks in advance.