forked from bartvdbraak/blender
Pampa Project request: FPS in sequencer editor
perhaps ED_scene_draw_fps is actually better to be placed to a better place, but consider this is good for now.
This commit is contained in:
parent
2871b0d7df
commit
bae2b9dea3
@ -328,6 +328,8 @@ float ED_view3d_offset_distance(float mat[4][4], const float ofs[3], const float
|
|||||||
float ED_scene_grid_scale(struct Scene *scene, const char **grid_unit);
|
float ED_scene_grid_scale(struct Scene *scene, const char **grid_unit);
|
||||||
float ED_view3d_grid_scale(struct Scene *scene, struct View3D *v3d, const char **grid_unit);
|
float ED_view3d_grid_scale(struct Scene *scene, struct View3D *v3d, const char **grid_unit);
|
||||||
|
|
||||||
|
void ED_scene_draw_fps(struct Scene *scene, struct rcti *rect);
|
||||||
|
|
||||||
/* view matrix properties utilities */
|
/* view matrix properties utilities */
|
||||||
/* unused */
|
/* unused */
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include "WM_api.h"
|
#include "WM_api.h"
|
||||||
#include "WM_types.h"
|
#include "WM_types.h"
|
||||||
|
|
||||||
|
#include "UI_interface.h"
|
||||||
#include "UI_resources.h"
|
#include "UI_resources.h"
|
||||||
#include "UI_view2d.h"
|
#include "UI_view2d.h"
|
||||||
|
|
||||||
@ -534,6 +535,7 @@ static void sequencer_preview_area_draw(const bContext *C, ARegion *ar)
|
|||||||
ScrArea *sa = CTX_wm_area(C);
|
ScrArea *sa = CTX_wm_area(C);
|
||||||
SpaceSeq *sseq = sa->spacedata.first;
|
SpaceSeq *sseq = sa->spacedata.first;
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
|
wmWindowManager *wm = CTX_wm_manager(C);
|
||||||
int show_split = scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW && sseq->mainb == SEQ_DRAW_IMG_IMBUF;
|
int show_split = scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW && sseq->mainb == SEQ_DRAW_IMG_IMBUF;
|
||||||
|
|
||||||
/* XXX temp fix for wrong setting in sseq->mainb */
|
/* XXX temp fix for wrong setting in sseq->mainb */
|
||||||
@ -554,6 +556,11 @@ static void sequencer_preview_area_draw(const bContext *C, ARegion *ar)
|
|||||||
draw_image_seq(C, scene, ar, sseq, scene->r.cfra, over_cfra - scene->r.cfra, TRUE);
|
draw_image_seq(C, scene, ar, sseq, scene->r.cfra, over_cfra - scene->r.cfra, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_playing(wm)) {
|
||||||
|
rcti rect;
|
||||||
|
ED_region_visible_rect(ar, &rect);
|
||||||
|
ED_scene_draw_fps(scene, &rect);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sequencer_preview_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
|
static void sequencer_preview_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
|
||||||
|
@ -2857,7 +2857,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, Object *camera, int w
|
|||||||
/* NOTE: the info that this uses is updated in ED_refresh_viewport_fps(),
|
/* NOTE: the info that this uses is updated in ED_refresh_viewport_fps(),
|
||||||
* which currently gets called during SCREEN_OT_animation_step.
|
* which currently gets called during SCREEN_OT_animation_step.
|
||||||
*/
|
*/
|
||||||
static void draw_viewport_fps(Scene *scene, rcti *rect)
|
void ED_scene_draw_fps(Scene *scene, rcti *rect)
|
||||||
{
|
{
|
||||||
ScreenFrameRateInfo *fpsi = scene->fps_info;
|
ScreenFrameRateInfo *fpsi = scene->fps_info;
|
||||||
float fps;
|
float fps;
|
||||||
@ -3454,7 +3454,7 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha
|
|||||||
|
|
||||||
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
|
if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
|
||||||
if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_playing(wm)) {
|
if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_playing(wm)) {
|
||||||
draw_viewport_fps(scene, &rect);
|
ED_scene_draw_fps(scene, &rect);
|
||||||
}
|
}
|
||||||
else if (U.uiflag & USER_SHOW_VIEWPORTNAME) {
|
else if (U.uiflag & USER_SHOW_VIEWPORTNAME) {
|
||||||
draw_viewport_name(ar, v3d, &rect);
|
draw_viewport_name(ar, v3d, &rect);
|
||||||
|
Loading…
Reference in New Issue
Block a user