With Add Spawnable from Class/Object from MovieSceneSequenceExtensions being deprecated in 5.6 in favour of the LevelSequenceEditorSubsystem version, there is no longer the ability to add spawnables to sequences that aren’t currently opened. This is a big issue for me as I need to be able to generate sequences and add spawnable bindings to unopened sequences as part of our mocap pipeline.
Currently I have explored spawning actors, adding them as posessables and converting them to spawnables after the fact. Spawning and adding posessables works fine and doesn’t require the sequence to be open. However converting to spawnable (using the LevelSequencEditorSubsystem) will have no effect if the sequence isn’t open.
When executing the funciton it throws the error “LogLevelSequenceEditor: Error: AddSpawnableFromClass requires that the requested sequence LS_dev01_AA be open in the editor”. Obviously this is by design and I am curious if there are any plans or workarounds to enable adding spawnables to unopened sequences?
Also really need to be able to add spawnables to sequences for my mocap/cinematic workflow. Thank you for posting your workaround, for now we are only dealing with one sequence at a time so it isn’t a huge deal, but it would be much simpler to just add a skeletal mesh as a spawnable instead.
If you’re still trying to add spawnables, I’ve discovered that you can you can simply open and close the level sequence and it won’t visually open in the engine. This is just a stripped down python snippet as an example but I’m running this open close concept on a much larger script that handles fbx import, sequence creation, spawnable adding, track/seciton manipulation, animation baking and I don’t even see the sequencer open
import unreal
sequence = unreal.load_asset("/Game/Developers/Dan/LS_SpawnableTest.LS_SpawnableTest")
asset_bp = unreal.BlueprintEditorLibrary.get_blueprint_asset(unreal.load_asset("/Game/Developers/Dan/BP_SpawnableTestActor.BP_SpawnableTestActor"))
spawnable = unreal.BlueprintEditorLibrary.generated_class(asset_bp)
ls_subsys = unreal.get_editor_subsystem(unreal.LevelSequenceEditorSubsystem)
# Open the level sequence
unreal.LevelSequenceEditorBlueprintLibrary.open_level_sequence(sequence)
# Add spawnable and any other logic you want to run on the sequence
ls_subsys.add_spawnable_from_class(sequence, spawnable)
# Close the sequencer
unreal.LevelSequenceEditorBlueprintLibrary.close_level_sequence()