How to get the current camera from a camera cut track using Python?

I’ve got a level sequence with multiple cameras on a camera cut track. I’d like to create a python script to select the camera that the camera cut track is using on a given frame. So, if on frame 1000 the camera cut track is looking through CAM_5, the script would select CAM_5. Is this possible?

Here’s a snippet of what I’ve got so far:

    self.sequence = unreal.LevelSequenceEditorBlueprintLibrary.get_current_level_sequence()
    self.FrameRate =  float( self.sequence.get_display_rate().numerator / self.sequence.get_display_rate().denominator)

    all_tracks = self.sequence.get_master_tracks()
    CameraCutTrack = None
    for Track in all_tracks:
        if str(Track).count("MovieSceneCameraCutTrack"):
            CameraCutTrack = Track
    if CameraCutTrack != None:
        Sections = CameraCutTrack.get_sections()
        for Section in Sections:                    
            ID = Section.get_camera_binding_id()  ## how do i get from this to the real camera?
1 Like

You can get the objects for that binding with:

unreal.LevelSequenceEditorBlueprintLibrary.get_bound_objects(ID)

Pefect thanks!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.