Skip to content

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented Sep 27, 2025

Objective

Solution

  • Add a dev plugin that can move the camera
  • Add plumbing to CI testing to be able to move the camera and control screen recording
  • Demo can be configured in code or in a configuration file

Testing

  • Add to an example:
let fps = 120; // FPS for the example on your computer

[...]

// Before `DefaultPlugins`:
        .insert_resource(CiTestingConfig {
            events: vec![
                CiTestingEventOnFrame(fps * 1, ci_testing::CiTestingEvent::StartScreenRecording),
                {
                    let transform = Transform::from_xyz(0.7, 0.7, -1.0)
                        .looking_at(Vec3::new(0.0, 0.3, 0.0), Vec3::Y);
                    CiTestingEventOnFrame(
                        fps * 6,
                        ci_testing::CiTestingEvent::MoveCamera {
                            translation: transform.translation,
                            rotation: transform.rotation,
                        },
                    )
                },
                {
                    let transform = Transform::from_xyz(-0.7, 0.7, -1.0)
                        .looking_at(Vec3::new(0.0, 0.3, 0.0), Vec3::Y);
                    CiTestingEventOnFrame(
                        fps * 11,
                        ci_testing::CiTestingEvent::MoveCamera {
                            translation: transform.translation,
                            rotation: transform.rotation,
                        },
                    )
                },
                {
                    let transform = Transform::from_xyz(-0.7, 0.7, 1.0)
                        .looking_at(Vec3::new(0.0, 0.3, 0.0), Vec3::Y);
                    CiTestingEventOnFrame(
                        fps * 16,
                        ci_testing::CiTestingEvent::MoveCamera {
                            translation: transform.translation,
                            rotation: transform.rotation,
                        },
                    )
                },
                {
                    let transform = Transform::from_xyz(0.7, 0.7, 1.0)
                        .looking_at(Vec3::new(0.0, 0.3, 0.0), Vec3::Y);
                    CiTestingEventOnFrame(
                        fps * 21,
                        ci_testing::CiTestingEvent::MoveCamera {
                            translation: transform.translation,
                            rotation: transform.rotation,
                        },
                    )
                },
                CiTestingEventOnFrame(fps * 26, ci_testing::CiTestingEvent::StopScreenRecording),
            ],
            ..default()
        })
  • Run the example with --features bevy_internal/screenrecording,bevy_ci_testing
  • Lay back, enjoy your demo recording

Showcase

load_gltf-1758980570053.h264.mp4

@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-Dev-Tools Tools used to debug Bevy applications. S-Needs-Review Needs reviewer attention (from anyone!) to move forward M-Needs-Release-Note Work that should be called out in the blog due to impact labels Sep 28, 2025
Copy link
Contributor

It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note.

Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes.

@alice-i-cecile alice-i-cecile added this to the 0.18 milestone Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Dev-Tools Tools used to debug Bevy applications. C-Feature A new feature, making something new possible M-Needs-Release-Note Work that should be called out in the blog due to impact S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants