Blender  V2.93
ED_render.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2005 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_vec_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
33 struct Depsgraph;
34 struct ID;
35 struct MTex;
36 struct Main;
37 struct Render;
38 struct Scene;
39 struct ScrArea;
40 struct bContext;
41 struct bScreen;
42 struct wmWindow;
43 struct wmWindowManager;
44 
45 /* render_ops.c */
46 
47 void ED_operatortypes_render(void);
48 
49 /* render_update.c */
50 
51 void ED_render_engine_changed(struct Main *bmain, const bool update_scene_data);
52 void ED_render_engine_area_exit(struct Main *bmain, struct ScrArea *area);
53 void ED_render_view_layer_changed(struct Main *bmain, struct bScreen *screen);
54 
55 /* Callbacks handling data update events coming from depsgraph. */
56 
57 void ED_render_id_flush_update(const struct DEGEditorUpdateContext *update_ctx, struct ID *id);
58 void ED_render_scene_update(const struct DEGEditorUpdateContext *update_ctx, const bool updated);
60  struct wmWindow *window,
61  struct ScrArea *area,
62  const bool updated);
63 
64 struct Scene *ED_render_job_get_scene(const struct bContext *C);
66 
67 /* Render the preview
68  *
69  * pr_method:
70  * - PR_BUTS_RENDER: preview is rendered for buttons window
71  * - PR_ICON_RENDER: preview is rendered for icons. hopefully fast enough for at least 32x32
72  * - PR_NODE_RENDER: preview is rendered for node editor
73  * - PR_ICON_DEFERRED: No render, we just ensure deferred icon data gets generated.
74  */
75 
76 enum {
81 };
82 
83 void ED_preview_ensure_dbase(void);
84 void ED_preview_free_dbase(void);
85 
86 void ED_preview_shader_job(const struct bContext *C,
87  void *owner,
88  struct ID *id,
89  struct ID *parent,
90  struct MTex *slot,
91  int sizex,
92  int sizey,
93  int method);
94 void ED_preview_icon_render(const struct bContext *C,
95  struct Scene *scene,
96  struct ID *id,
97  unsigned int *rect,
98  int sizex,
99  int sizey);
100 void ED_preview_icon_job(const struct bContext *C,
101  void *owner,
102  struct ID *id,
103  unsigned int *rect,
104  int sizex,
105  int sizey,
106  const bool delay);
107 void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain);
108 
109 void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, void *slot, rcti *rect);
110 
112 
114 
115 #ifdef __cplusplus
116 }
117 #endif
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void ED_preview_icon_job(const struct bContext *C, void *owner, struct ID *id, unsigned int *rect, int sizex, int sizey, const bool delay)
void ED_render_engine_changed(struct Main *bmain, const 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.c:36
void ED_preview_ensure_dbase(void)
void ED_preview_free_dbase(void)
void ED_render_scene_update(const struct DEGEditorUpdateContext *update_ctx, const bool updated)
void ED_render_id_flush_update(const struct DEGEditorUpdateContext *update_ctx, struct ID *id)
void ED_render_clear_mtex_copybuf(void)
void ED_preview_shader_job(const struct bContext *C, void *owner, struct ID *id, struct ID *parent, struct MTex *slot, int sizex, int sizey, int method)
struct Scene * ED_render_job_get_current_scene(const struct bContext *C)
void ED_render_view_layer_changed(struct Main *bmain, struct bScreen *screen)
void ED_preview_icon_render(const struct bContext *C, struct Scene *scene, struct ID *id, unsigned int *rect, int sizex, int sizey)
void ED_render_view3d_update(struct Depsgraph *depsgraph, struct wmWindow *window, struct ScrArea *area, const bool updated)
Definition: render_update.c:69
@ PR_NODE_RENDER
Definition: ED_render.h:79
@ PR_ICON_RENDER
Definition: ED_render.h:78
@ PR_ICON_DEFERRED
Definition: ED_render.h:80
@ PR_BUTS_RENDER
Definition: ED_render.h:77
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:39
Scene scene
const Depsgraph * depsgraph
static void area(int d1, int d2, int e1, int e2, float weights[2])
Definition: DNA_ID.h:273
Definition: BKE_main.h:116