Animation: Add duration display to frame range settings #104882

Merged
Christoph Lendenfeld merged 13 commits from ChrisLend/blender:scene_frame_count into main 2023-03-23 10:18:50 +01:00

This patch adds an option to the Status Bar: Scene Duration

This shows the duration of the current scene in frames and timecode
Duration: <timecode> (Frame <current frame>/<total frames>)
The timecode follows the formatting defined in the user preferences.

image


PR in response to https://blender.community/c/rightclickselect/0LDy/?sorting=hot

This patch adds an option to the Status Bar: `Scene Duration` This shows the duration of the current scene in frames and timecode `Duration: <timecode> (Frame <current frame>/<total frames>)` The timecode follows the formatting defined in the user preferences. ![image](/attachments/de5bbb4c-2d15-46f5-8e08-ff9a953ad4dc) ------ PR in response to https://blender.community/c/rightclickselect/0LDy/?sorting=hot
2.5 KiB
Christoph Lendenfeld added the
Module
Animation & Rigging
label 2023-02-17 15:29:42 +01:00

It would be best to re-create/re-submit this PR because it contains submodule changes (see the Files Changed section). Not only should that not have been the case but submodules were recently removed in the repo: https://lists.blender.org/pipermail/bf-committers/2023-February/051486.html

It would be best to re-create/re-submit this PR because it contains submodule changes (see the Files Changed section). Not only should that not have been the case but submodules were recently removed in the repo: https://lists.blender.org/pipermail/bf-committers/2023-February/051486.html
First-time contributor

Hi Chris, I'm the one who did the request on RCS, thanks for tackling this!
I guess it's my turn to eat my hat: I always had the Amaranth add-on, but never enabled (and knew about) the addon's option for adding timeline extra info, and to my surprise the add-on was already doing exactly what I was looking for, in the status bar.

timeline.png

Now, I think it's great this can be natively implemented in Blender, and I have to say that even though I proposed to put the info in the Output properties, I actually like a lot how is done in Amaranth: no need to go into tabs/panel and open a sub-menu, the info it's just there in the status bar, with the option of disabling just like the other infos. Maybe you can take the add-on's way as inspiration?

Hi Chris, I'm the one who did the request on RCS, thanks for tackling this! I guess it's my turn to eat my hat: I always had the Amaranth add-on, but never enabled (and knew about) the addon's option for adding timeline extra info, and to my surprise the add-on was already doing exactly what I was looking for, in the status bar. ![timeline.png](/attachments/c90127dc-69c2-4d62-b9e3-bb98b8bf3aa4) Now, I think it's great this can be natively implemented in Blender, and I have to say that even though I proposed to put the info in the Output properties, I actually like a lot how is done in Amaranth: no need to go into tabs/panel and open a sub-menu, the info it's just there in the status bar, with the option of disabling just like the other infos. Maybe you can take the add-on's way as inspiration?
Christoph Lendenfeld force-pushed scene_frame_count from 8ebc196bee to 81ee0b6628 2023-03-03 15:15:15 +01:00 Compare
Christoph Lendenfeld added 1 commit 2023-03-03 15:18:01 +01:00
Author
Member

@Slowwkidd I've updated the patch to put the info in the status bar. I think it looks much cleaner there. Thanks for the suggestion.

Looks like this now
image

@Slowwkidd I've updated the patch to put the info in the status bar. I think it looks much cleaner there. Thanks for the suggestion. Looks like this now ![image](/attachments/04d5cbec-ce8c-425d-ae45-14d812e007bc)
3.4 KiB
Christoph Lendenfeld changed title from WIP: Add duration display to frame range settings to Animation: Add duration display to frame range settings 2023-03-03 15:21:20 +01:00
Christoph Lendenfeld requested review from Sybren A. Stüvel 2023-03-03 15:21:31 +01:00
Sybren A. Stüvel added this to the Animation & Rigging project 2023-03-03 15:24:22 +01:00
Christoph Lendenfeld requested review from Luciano Muñoz Sessarego 2023-03-03 15:26:19 +01:00
Christoph Lendenfeld requested review from Jason schleifer 2023-03-03 15:26:36 +01:00

I love this idea, but the ordering of the text makes it difficult to understand that Frame Count relates to the length of the shot.. Right now it shows up like:

Frame Count: 202 | Duration: 00:08:42 | 3.6.0 Alpha

If we change the order because we're reading left to right, it's a bit clearer to me:

Duration: 00:08:42 | Frame Count: 202 | 3.6.0 Alpha

-Jason

I love this idea, but the ordering of the text makes it difficult to understand that Frame Count relates to the length of the shot.. Right now it shows up like: `Frame Count: 202 | Duration: 00:08:42 | 3.6.0 Alpha` If we change the order because we're reading left to right, it's a bit clearer to me: `Duration: 00:08:42 | Frame Count: 202 | 3.6.0 Alpha` -Jason
First-time contributor

This is great @ChrisLend! The only thing I'm wondering, as far as I can see the duration is in minutes:seconds:milliseconds, right? I would rather put it as the compact SMPTE timecode:
hours (only if necessary):minutes:seconds:frames

Or, it could follow the TimeCode Style set in the Preferences.

This is great @ChrisLend! The only thing I'm wondering, as far as I can see the duration is in **minutes:seconds:milliseconds**, right? I would rather put it as the compact SMPTE timecode: **hours (only if necessary):minutes:seconds:frames** Or, it could follow the *TimeCode Style* set in the Preferences.
Author
Member

@Slowwkidd So I'd like it to be mm:ss:ff but I am unsure how that works with the frame rates 29.97 and 59.94
That's why I chose the safe option of going with ms

@Slowwkidd So I'd like it to be mm:ss:ff but I am unsure how that works with the frame rates 29.97 and 59.94 That's why I chose the safe option of going with ms
Christoph Lendenfeld added 2 commits 2023-03-04 15:39:38 +01:00
Author
Member

I changed the order and also changed it to Scene Duration just to make it clear

About SMPTE timecode I see there is a drop frame convention for 29.97 frame rates
https://en.wikipedia.org/wiki/SMPTE_timecode

I changed the order and also changed it to `Scene Duration` just to make it clear About SMPTE timecode I see there is a drop frame convention for 29.97 frame rates https://en.wikipedia.org/wiki/SMPTE_timecode
Sybren A. Stüvel requested changes 2023-03-07 16:31:44 +01:00
Sybren A. Stüvel left a comment
Member

👍 for the feature, just a few notes on the implementation.

:+1: for the feature, just a few notes on the implementation.
@ -651,0 +654,4 @@
}
const int frame_count = (scene->r.efra - scene->r.sfra) + 1;
const float fps = (((float)scene->r.frs_sec) / (float)scene->r.frs_sec_base);
const float duration = frame_count / fps;

These two lines could be replaced with the FRA2TIME(frame_count) macro.

These two lines could be replaced with the `FRA2TIME(frame_count)` macro.
ChrisLend marked this conversation as resolved
@ -651,0 +657,4 @@
const float duration = frame_count / fps;
const int duration_mins = (int)(duration / 60);
const float duration_secs = duration - (duration_mins * 60);
ofs += BLI_snprintf_rlen(info + ofs,

Would it be worth it to use BLI_timecode_string_from_time() here to get the duration string?

Would it be worth it to use `BLI_timecode_string_from_time()` here to get the duration string?
ChrisLend marked this conversation as resolved
Member

Nice to see this progress!

In Frame Count, it'd be useful to see the current frame relative to the frame range, so you know you're for example in the first or last frame of the range. It'd also make it so the label can be "Frame" instead of "Frame Count".
e.g. Frame: 1/250.

it could follow the TimeCode Style set in the Preferences.

I think it should use this preference so it matches the animation/VSE editor's timeline, keeping them unified across editors and status bar.

Nice to see this progress! In `Frame Count`, it'd be useful to see the current frame relative to the frame range, so you know you're for example in the first or last frame of the range. It'd also make it so the label can be "Frame" instead of "Frame Count". e.g. `Frame: 1/250`. > it could follow the *TimeCode Style* set in the Preferences. I think it should use this preference so it matches the animation/VSE editor's timeline, keeping them unified across editors and status bar.
Pablo Vazquez added the
Interest
User Interface
label 2023-03-07 17:19:19 +01:00
Member

Note that I have absolutely no authority or knowledge in this area; I don't do any video editing so I don't know what I'm talking about here.

But I'm just wondering if there is any way of reducing the amount of text, just because the status bar formatting can get a bit weird as the program width narrows. Some shorter alternatives, along with the current proposal at the end:

  • Frames: 202 (00:08:42)
  • Duration: 00:08:42 (202 Frames)
  • Duration: 00:08:42 | Frames: 202
  • Scene Duration: 00:08:42 | Frame Count: 202
Note that I have absolutely no authority or knowledge in this area; I don't do any video editing so I don't know what I'm talking about here. But I'm just wondering if there is any way of reducing the amount of text, just because the status bar formatting can get a bit weird as the program width narrows. Some shorter alternatives, along with the current proposal at the end: * Frames: 202 (00:08:42) * Duration: 00:08:42 (202 Frames) * Duration: 00:08:42 | Frames: 202 * Scene Duration: 00:08:42 | Frame Count: 202

Personally I like the explicitness of "Scene Duration". There are so many things with 'durations' in Blender that I feel this adds clarity. After all, each FCurve, Action, NLA strip and NLA track have a duration, and so do the scene preview range and the VSE.

Sure, the status bar is in a rather global place, so it's unlikely to be the current FCurve or NLA strip. The distinction between the scene range, VSE, and scene preview range is still relevant there, I feel.

Personally I like the explicitness of "Scene Duration". There are so many things with 'durations' in Blender that I feel this adds clarity. After all, each FCurve, Action, NLA strip and NLA track have a duration, and so do the scene preview range and the VSE. Sure, the status bar is in a rather global place, so it's unlikely to be the current FCurve or NLA strip. The distinction between the scene range, VSE, and scene preview range is still relevant there, I feel.
Member

Personally I like the explicitness of "Scene Duration"...

For sure. And the most important thing is that is shows exactly what you want in an explicit way. I was just hoping there was a shorter way to express it. But no matter. It is an option so the user can turn off other items if they run out of space.

> Personally I like the explicitness of "Scene Duration"... For sure. And the most important thing is that is shows exactly what you want in an explicit way. I was just *hoping* there was a shorter way to express it. But no matter. It is an option so the user can turn off other items if they run out of space.
First-time contributor

I was just hoping there was a shorter way to express it.

I like some of your proposals!
Although less explicit, it could be something like this:

Scene Duration: 00:08:42 (1/202 Frames)

> I was just hoping there was a shorter way to express it. I like some of your proposals! Although less explicit, it could be something like this: Scene Duration: 00:08:42 (1/202 Frames)
Member

Another thing to at least consider is the order within the rest of the status bar text. This PR appends this new item near the end of the line, which seems reasonable. But as an optional specialized item you could argue that it should get higher visibility than more generic items. If this is important it could be first and therefore easier to spot.

Another thing to at least *consider* is the order within the rest of the status bar text. This PR appends this new item near the end of the line, which seems reasonable. But as an optional *specialized* item you could argue that it should get higher visibility than more generic items. If this is important it could be first and therefore easier to spot.

Is it possible we have also playback "frame rate" , I sense that the overlay sometime causes overhead and its really hard to know whether that is affecting the playback rate since you cant see what at what fps is the playback working when the overlays are off

Is it possible we have also playback "frame rate" , I sense that the overlay sometime causes overhead and its really hard to know whether that is affecting the playback rate since you cant see what at what fps is the playback working when the overlays are off
Member

Is it possible we have also playback "frame rate"

Probably for another patch. But yes, I brought this up some time ago when the status bar was introduced. Fps are not (at least currently) tied to a specific viewport (you could say the same about the current frame since it's a scene property, but it is useful to see it become yellow when there's a keyframe in that frame).

The VSE also has its own fps indicator, moving it to the status bar improves consistency.

> Is it possible we have also playback "frame rate" Probably for another patch. But yes, I brought this up some time ago when the status bar was introduced. Fps are not (at least currently) tied to a specific viewport (you could say the same about the current frame since it's a scene property, but it is useful to see it become yellow when there's a keyframe in that frame). The VSE also has its own fps indicator, moving it to the status bar improves consistency.

Sure, the status bar is in a rather global place, so it's unlikely to be the current FCurve or NLA strip. The distinction between the scene range, VSE, and scene preview range is still relevant there, I feel.

I'd vote for leaving out "Scene". It doesn't help distinguish from "Scene Preview Range" because that's still about the scene. And the video sequencer uses the same frame range as the scene. So I don't understand how this helps.

> Sure, the status bar is in a rather global place, so it's unlikely to be the current FCurve or NLA strip. The distinction between the scene range, VSE, and scene preview range is still relevant there, I feel. I'd vote for leaving out "Scene". It doesn't help distinguish from "Scene Preview Range" because that's still about the scene. And the video sequencer uses the same frame range as the scene. So I don't understand how this helps.
Christoph Lendenfeld added 2 commits 2023-03-09 11:25:16 +01:00
Author
Member

Based on your feedback I changed the text
image

  • I've chosen to remove "Scene" from "Scene Duration" in the status bar, but the label in the popup I've left "Scene Duration". My reasoning is that there is nothing else in the status bar describing a duration, so once the user has clicked on it they will know what it is.
    image
  • instead of e.g. (4/25 Frames) I swapped it around so it reads (Frame 4/25). The reason being that the playhead can be outside the scene frame range making the number negative or larger than the total amount of frames and it reads better in those cases.
  • it uses the timecode style set in the preferences. I think that has a bug with 29.97 fps but since it already exists in Blender it is nothing to worry about in this patch. I will investigate and file a bug
Based on your feedback I changed the text ![image](/attachments/fda9d971-304e-49ea-ad76-55d053422135) * I've chosen to remove "Scene" from "Scene Duration" in the status bar, but the label in the popup I've left "Scene Duration". My reasoning is that there is nothing else in the status bar describing a duration, so once the user has clicked on it they will know what it is. ![image](/attachments/db60f933-fa06-4601-9814-20a626d0352a) * instead of e.g. `(4/25 Frames)` I swapped it around so it reads `(Frame 4/25)`. The reason being that the playhead can be outside the scene frame range making the number negative or larger than the total amount of frames and it reads better in those cases. * it uses the timecode style set in the preferences. I think that has a bug with 29.97 fps but since it already exists in Blender it is nothing to worry about in this patch. I will investigate and file a bug
7.1 KiB
2.7 KiB
Christoph Lendenfeld requested review from Sybren A. Stüvel 2023-03-09 11:36:18 +01:00

image

"Scene Duration" and "Scene Statistics" should be next to each other.

> ![image](/attachments/db60f933-fa06-4601-9814-20a626d0352a) "Scene Duration" and "Scene Statistics" should be next to each other.
Author
Member

moved the location in the popup menu
also moved in the status bar to reflect that

moved the location in the popup menu also moved in the status bar to reflect that
Christoph Lendenfeld added 1 commit 2023-03-09 11:53:18 +01:00
Sybren A. Stüvel approved these changes 2023-03-09 15:18:10 +01:00
Member

Yes, I am the guy who was going on about keeping the text as succinct as possible, but I think you should consider adding spaces in the Frame range. So changing from this:

Duration: 00:09:16 (Frame 7/232)

to this:

Duration: 00:09:16 (Frame 7 / 232)

On some fonts the forward slash can have a less steep angle and can be the same height as the letters, making it possible to quickly mistake for number 1.

No worries if you don't agree; I think it most important that you get what you think looks best for your use. Note though that if you only agree a little bit, it is now safe to use other Unicode spacing characters like thin space and hair space. Although I'd just use regular space because my eyes are old.

Yes, I am the guy who was going on about keeping the text as succinct as possible, but I think you should *consider* adding spaces in the Frame range. So changing from this: ``` Duration: 00:09:16 (Frame 7/232) ``` to this: ``` Duration: 00:09:16 (Frame 7 / 232) ``` On some fonts the forward slash can have a less steep angle and can be the same height as the letters, making it possible to quickly mistake for number 1. No worries if you don't agree; I think it most important that you get what you think looks best for your use. Note though that if you only agree a little bit, it is now safe to use other Unicode spacing characters like [thin space](https://www.compart.com/en/unicode/U+2009) and [hair space](https://www.compart.com/en/unicode/U+200A). Although I'd just use regular space because my eyes are old.
Christoph Lendenfeld added 2 commits 2023-03-10 11:45:43 +01:00
Author
Member

Added a space as @Harley suggested

Added a space as @Harley suggested
Luciano Muñoz Sessarego approved these changes 2023-03-10 18:29:20 +01:00
First-time contributor

Is it possible we have also playback "frame rate"

Nice idea! I did a quick mockup, maybe will be considered for a future patch:

When not playing animation
fps_3.png

When playing animation: option 1 / option 2
fps.png fps_2.png

I think you should consider adding spaces in the Frame range

I agree, but at this point this should be done for all status bar info, otherwise frame range would be the only one:
slasj.png

> Is it possible we have also playback "frame rate" Nice idea! I did a quick mockup, maybe will be considered for a future patch: When not playing animation ![fps_3.png](/attachments/9aa4ad20-1179-4e0d-ad08-2609eb82dfbd) When playing animation: option 1 / option 2 ![fps.png](/attachments/c501eae2-03ee-409e-b0f9-0d75b45fdd55) ![fps_2.png](/attachments/2f1f64f7-4831-4361-bc9a-b846cca6d9ca) > I think you should consider adding spaces in the Frame range I agree, but at this point this should be done for all status bar info, otherwise frame range would be the only one: ![slasj.png](/attachments/bdd04bb6-eed3-47ed-8cf4-df762b82f511)
4.0 KiB
3.7 KiB
4.3 KiB
9.2 KiB
Christoph Lendenfeld added 2 commits 2023-03-16 09:26:53 +01:00
Author
Member

@Slowwkidd @Harley
good catch about the spaces between current frame and total frames
I reverted that change to have no spaces to keep thing consistent

@Slowwkidd @Harley good catch about the spaces between current frame and total frames I reverted that change to have no spaces to keep thing consistent
Christoph Lendenfeld added 1 commit 2023-03-23 10:01:25 +01:00
Christoph Lendenfeld merged commit 84e170c563 into main 2023-03-23 10:18:50 +01:00
Christoph Lendenfeld deleted branch scene_frame_count 2023-03-23 10:18:51 +01:00
Sybren A. Stüvel removed this from the Animation & Rigging project 2023-03-24 16:08:02 +01:00
Sybren A. Stüvel added this to the 3.6 LTS milestone 2023-03-24 16:08:05 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#104882
No description provided.