UI: show frame rate in movie clip editor

Feature Request from Hjialti.
This commit is contained in:
Jacques Lucke 2018-12-14 15:34:44 +01:00
parent e67f7e922c
commit 233b780635
1 changed files with 6 additions and 0 deletions

View File

@ -534,6 +534,12 @@ void uiTemplateMovieclipInformation(uiLayout *layout, PointerRNA *ptr, const cha
else
ofs += BLI_strncpy_rlen(str + ofs, IFACE_(", RGB byte"), sizeof(str) - ofs);
}
short frs_sec;
float frs_sec_base;
if (IMB_anim_get_fps(clip->anim, &frs_sec, &frs_sec_base, true)) {
ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, IFACE_(", %.2f fps"), (float)frs_sec / frs_sec_base);
}
}
else {
ofs += BLI_strncpy_rlen(str + ofs, IFACE_(", failed to load"), sizeof(str) - ofs);