We have noticed that when to render to png the name of resulting frames is not always correct.
Here are the steps to reproduce the problem:
- In Unreal 4.15.1, create a new Blueprint project - Blank - No Starter Content
- Add a cube in the scene
- Click “Cinematics” - “Add Master Sequence” - “Number Of Shots”=3 - “Create Master Sequence”
- In the Sequence Master, reduce each shot to be only 2 frame long.
- In the Sequence Master, click on the Render Icon
- In Render Movie Settings window, set “Output Format” = “image Sequence (png)”
- In Render Movie Settings window, set “Filename Format” = {shot}_{frame}
- In Render Movie Settings window, click “Capture Movie”, “Save Selected”, “Save”
The resulting file names are:
- shot0010_001_0000.png
- shot0010_001_0001.png
- shot0020_001_0002.png
- shot0020_001_0003.png
- shot0020_001_0004.png … We would expect it to be named shot0030_001_0004.png
- shot0030_001_0005.png
- shot0030_001_0006.png … This frame is not part of our shots, so we ignore it
As we can see, there are 3 frames in shot 0020, while in Sequencer we see only two frames for that shot.
It looks to us that the problem may be in ULevelSequencePlayer::TakeFrameSnapshot().
We have locally replaced the following logic:
if (Section->IsActive() && Section->GetRange().Contains(CurrentTime) && (!ActiveShot || Section->GetRowIndex() < ActiveShot->GetRowIndex()))
by
if (Section->IsActive() && (Section->GetRange().GetUpperBoundValue() - CurrentTime > 0.00833f /*half the current framerate*/) && (!ActiveShot || Section->GetRowIndex() < ActiveShot->GetRowIndex()))
and with that modification the files are named as expected.