Blender  V3.3
ED_render.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_ID_enums.h"
11 #include "DNA_vec_types.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
18 struct Depsgraph;
19 struct ID;
20 struct MTex;
21 struct Main;
22 struct Render;
23 struct Scene;
24 struct ScrArea;
25 struct bContext;
26 struct bScreen;
27 struct PreviewImage;
28 struct wmWindow;
29 struct wmWindowManager;
30 
31 /* render_ops.c */
32 
33 void ED_operatortypes_render(void);
34 
35 /* render_update.c */
36 
37 void ED_render_engine_changed(struct Main *bmain, bool update_scene_data);
38 void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *area);
39 void ED_render_view_layer_changed(struct Main *bmain, struct bScreen *screen);
40 
41 /* Callbacks handling data update events coming from depsgraph. */
42 
43 void ED_render_id_flush_update(const struct DEGEditorUpdateContext *update_ctx, struct ID *id);
48 void ED_render_scene_update(const struct DEGEditorUpdateContext *update_ctx, bool updated);
53  struct wmWindow *window,
54  struct ScrArea *area,
55  bool updated);
56 
57 struct Scene *ED_render_job_get_scene(const struct bContext *C);
59 
60 /* Render the preview
61  *
62  * pr_method:
63  * - PR_BUTS_RENDER: preview is rendered for buttons window
64  * - PR_ICON_RENDER: preview is rendered for icons. hopefully fast enough for at least 32x32
65  * - PR_ICON_DEFERRED: No render, we just ensure deferred icon data gets generated.
66  */
67 typedef enum ePreviewRenderMethod {
72 
73 void ED_preview_ensure_dbase(void);
74 void ED_preview_free_dbase(void);
75 
79 bool ED_preview_id_is_supported(const struct ID *id);
80 
81 void ED_preview_shader_job(const struct bContext *C,
82  void *owner,
83  struct ID *id,
84  struct ID *parent,
85  struct MTex *slot,
86  int sizex,
87  int sizey,
88  ePreviewRenderMethod method);
89 void ED_preview_icon_render(const struct bContext *C,
90  struct Scene *scene,
91  struct PreviewImage *prv_img,
92  struct ID *id,
93  enum eIconSizes icon_size);
94 void ED_preview_icon_job(const struct bContext *C,
95  struct PreviewImage *prv_img,
96  struct ID *id,
97  enum eIconSizes icon_size,
98  bool delay);
99 
101 void ED_preview_restart_queue_add(struct ID *id, enum eIconSizes size);
103 
104 void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain);
105 
106 void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, void *slot, rcti *rect);
107 
109 
111 
112 #ifdef __cplusplus
113 }
114 #endif
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
Enumerations for DNA_ID.h.
eIconSizes
Definition: DNA_ID_enums.h:14
void ED_preview_restart_queue_work(const struct bContext *C)
void ED_render_engine_changed(struct Main *bmain, bool update_scene_data)
void ED_render_internal_init(void)
void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, void *slot, rcti *rect)
void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *area)
void ED_operatortypes_render(void)
Definition: render_ops.cc:20
void ED_preview_shader_job(const struct bContext *C, void *owner, struct ID *id, struct ID *parent, struct MTex *slot, int sizex, int sizey, ePreviewRenderMethod method)
void ED_preview_ensure_dbase(void)
void ED_preview_free_dbase(void)
void ED_render_view3d_update(struct Depsgraph *depsgraph, struct wmWindow *window, struct ScrArea *area, bool updated)
bool ED_preview_id_is_supported(const struct ID *id)
void ED_render_id_flush_update(const struct DEGEditorUpdateContext *update_ctx, struct ID *id)
void ED_render_clear_mtex_copybuf(void)
void ED_preview_restart_queue_free(void)
void ED_preview_restart_queue_add(struct ID *id, enum eIconSizes size)
ePreviewRenderMethod
Definition: ED_render.h:67
@ PR_ICON_RENDER
Definition: ED_render.h:69
@ PR_ICON_DEFERRED
Definition: ED_render.h:70
@ PR_BUTS_RENDER
Definition: ED_render.h:68
void ED_preview_icon_render(const struct bContext *C, struct Scene *scene, struct PreviewImage *prv_img, struct ID *id, enum eIconSizes icon_size)
struct Scene * ED_render_job_get_current_scene(const struct bContext *C)
void ED_render_scene_update(const struct DEGEditorUpdateContext *update_ctx, bool updated)
void ED_preview_icon_job(const struct bContext *C, struct PreviewImage *prv_img, struct ID *id, enum eIconSizes icon_size, bool delay)
void ED_render_view_layer_changed(struct Main *bmain, struct bScreen *screen)
void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain)
struct Scene * ED_render_job_get_scene(const struct bContext *C)
#define C
Definition: RandGen.cpp:25
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Scene scene
const Depsgraph * depsgraph
static void area(int d1, int d2, int e1, int e2, float weights[2])
Definition: DNA_ID.h:368
Definition: BKE_main.h:121