Blender  V2.93
rna_render.c
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 
21 #include <stdlib.h>
22 
23 #include "DNA_node_types.h"
24 #include "DNA_object_types.h"
25 #include "DNA_scene_types.h"
26 
27 #include "BLI_path_util.h"
28 #include "BLI_utildefines.h"
29 
30 #ifdef WITH_PYTHON
31 # include "BPY_extern.h"
32 #endif
33 
34 #include "DEG_depsgraph.h"
35 
36 #include "BKE_image.h"
37 #include "BKE_scene.h"
38 
39 #include "RNA_define.h"
40 #include "RNA_enum_types.h"
41 
42 #include "rna_internal.h"
43 
44 #include "RE_engine.h"
45 #include "RE_pipeline.h"
46 
47 #include "ED_render.h"
48 
49 /* Deprecated, only provided for API compatibility. */
51  {SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
52  {SCE_PASS_Z, "Z", 0, "Z", ""},
53  {SCE_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
54  {SCE_PASS_AO, "AO", 0, "Ambient Occlusion", ""},
55  {SCE_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
56  {SCE_PASS_VECTOR, "VECTOR", 0, "Vector", ""},
57  {SCE_PASS_INDEXOB, "OBJECT_INDEX", 0, "Object Index", ""},
58  {SCE_PASS_UV, "UV", 0, "UV", ""},
59  {SCE_PASS_MIST, "MIST", 0, "Mist", ""},
60  {SCE_PASS_EMIT, "EMIT", 0, "Emit", ""},
61  {SCE_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
62  {SCE_PASS_INDEXMA, "MATERIAL_INDEX", 0, "Material Index", ""},
63  {SCE_PASS_DIFFUSE_DIRECT, "DIFFUSE_DIRECT", 0, "Diffuse Direct", ""},
64  {SCE_PASS_DIFFUSE_INDIRECT, "DIFFUSE_INDIRECT", 0, "Diffuse Indirect", ""},
65  {SCE_PASS_DIFFUSE_COLOR, "DIFFUSE_COLOR", 0, "Diffuse Color", ""},
66  {SCE_PASS_GLOSSY_DIRECT, "GLOSSY_DIRECT", 0, "Glossy Direct", ""},
67  {SCE_PASS_GLOSSY_INDIRECT, "GLOSSY_INDIRECT", 0, "Glossy Indirect", ""},
68  {SCE_PASS_GLOSSY_COLOR, "GLOSSY_COLOR", 0, "Glossy Color", ""},
69  {SCE_PASS_TRANSM_DIRECT, "TRANSMISSION_DIRECT", 0, "Transmission Direct", ""},
70  {SCE_PASS_TRANSM_INDIRECT, "TRANSMISSION_INDIRECT", 0, "Transmission Indirect", ""},
71  {SCE_PASS_TRANSM_COLOR, "TRANSMISSION_COLOR", 0, "Transmission Color", ""},
72  {SCE_PASS_SUBSURFACE_DIRECT, "SUBSURFACE_DIRECT", 0, "Subsurface Direct", ""},
73  {SCE_PASS_SUBSURFACE_INDIRECT, "SUBSURFACE_INDIRECT", 0, "Subsurface Indirect", ""},
74  {SCE_PASS_SUBSURFACE_COLOR, "SUBSURFACE_COLOR", 0, "Subsurface Color", ""},
75 #ifdef WITH_CYCLES_DEBUG
76  {SCE_PASS_DEBUG, "DEBUG", 0, "Pass used for render engine debugging", ""},
77 #endif
78  {0, NULL, 0, NULL, NULL},
79 };
80 
82  {SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
83  {SCE_PASS_AO, "AO", 0, "Ambient Occlusion", ""},
84  {SCE_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
85  {SCE_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
86  {SCE_PASS_UV, "UV", 0, "UV", ""},
87  {SCE_PASS_ROUGHNESS, "ROUGHNESS", 0, "ROUGHNESS", ""},
88  {SCE_PASS_EMIT, "EMIT", 0, "Emit", ""},
89  {SCE_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
90  {SCE_PASS_DIFFUSE_COLOR, "DIFFUSE", 0, "Diffuse", ""},
91  {SCE_PASS_GLOSSY_COLOR, "GLOSSY", 0, "Glossy", ""},
92  {SCE_PASS_TRANSM_COLOR, "TRANSMISSION", 0, "Transmission", ""},
93  {0, NULL, 0, NULL, NULL},
94 };
95 
96 #ifdef RNA_RUNTIME
97 
98 # include "MEM_guardedalloc.h"
99 
100 # include "RNA_access.h"
101 
102 # include "BKE_context.h"
103 # include "BKE_report.h"
104 
105 # include "GPU_capabilities.h"
106 # include "GPU_shader.h"
107 # include "IMB_colormanagement.h"
108 
109 # include "DEG_depsgraph_query.h"
110 
111 /* RenderEngine Callbacks */
112 
113 static void engine_tag_redraw(RenderEngine *engine)
114 {
115  engine->flag |= RE_ENGINE_DO_DRAW;
116 }
117 
118 static void engine_tag_update(RenderEngine *engine)
119 {
120  engine->flag |= RE_ENGINE_DO_UPDATE;
121 }
122 
123 static bool engine_support_display_space_shader(RenderEngine *UNUSED(engine), Scene *scene)
124 {
126 }
127 
128 static int engine_get_preview_pixel_size(RenderEngine *UNUSED(engine), Scene *scene)
129 {
131 }
132 
133 static void engine_bind_display_space_shader(RenderEngine *UNUSED(engine), Scene *UNUSED(scene))
134 {
137 
138  int img_loc = GPU_shader_get_uniform(shader, "image");
139 
140  GPU_shader_uniform_int(shader, img_loc, 0);
141 }
142 
143 static void engine_unbind_display_space_shader(RenderEngine *UNUSED(engine))
144 {
146 }
147 
148 static void engine_update(RenderEngine *engine, Main *bmain, Depsgraph *depsgraph)
149 {
150  extern FunctionRNA rna_RenderEngine_update_func;
151  PointerRNA ptr;
152  ParameterList list;
153  FunctionRNA *func;
154 
155  RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
156  func = &rna_RenderEngine_update_func;
157 
158  RNA_parameter_list_create(&list, &ptr, func);
159  RNA_parameter_set_lookup(&list, "data", &bmain);
160  RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph);
161  engine->type->rna_ext.call(NULL, &ptr, func, &list);
162 
164 }
165 
166 static void engine_render(RenderEngine *engine, Depsgraph *depsgraph)
167 {
168  extern FunctionRNA rna_RenderEngine_render_func;
169  PointerRNA ptr;
170  ParameterList list;
171  FunctionRNA *func;
172 
173  RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
174  func = &rna_RenderEngine_render_func;
175 
176  RNA_parameter_list_create(&list, &ptr, func);
177  RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph);
178  engine->type->rna_ext.call(NULL, &ptr, func, &list);
179 
181 }
182 
183 static void engine_bake(RenderEngine *engine,
184  struct Depsgraph *depsgraph,
185  struct Object *object,
186  const int pass_type,
187  const int pass_filter,
188  const int width,
189  const int height)
190 {
191  extern FunctionRNA rna_RenderEngine_bake_func;
192  PointerRNA ptr;
193  ParameterList list;
194  FunctionRNA *func;
195 
196  RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
197  func = &rna_RenderEngine_bake_func;
198 
199  RNA_parameter_list_create(&list, &ptr, func);
200  RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph);
201  RNA_parameter_set_lookup(&list, "object", &object);
202  RNA_parameter_set_lookup(&list, "pass_type", &pass_type);
203  RNA_parameter_set_lookup(&list, "pass_filter", &pass_filter);
204  RNA_parameter_set_lookup(&list, "width", &width);
205  RNA_parameter_set_lookup(&list, "height", &height);
206  engine->type->rna_ext.call(NULL, &ptr, func, &list);
207 
209 }
210 
211 static void engine_view_update(RenderEngine *engine,
212  const struct bContext *context,
214 {
215  extern FunctionRNA rna_RenderEngine_view_update_func;
216  PointerRNA ptr;
217  ParameterList list;
218  FunctionRNA *func;
219 
220  RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
221  func = &rna_RenderEngine_view_update_func;
222 
223  RNA_parameter_list_create(&list, &ptr, func);
224  RNA_parameter_set_lookup(&list, "context", &context);
225  RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph);
226  engine->type->rna_ext.call(NULL, &ptr, func, &list);
227 
229 }
230 
231 static void engine_view_draw(RenderEngine *engine,
232  const struct bContext *context,
234 {
235  extern FunctionRNA rna_RenderEngine_view_draw_func;
236  PointerRNA ptr;
237  ParameterList list;
238  FunctionRNA *func;
239 
240  RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
241  func = &rna_RenderEngine_view_draw_func;
242 
243  RNA_parameter_list_create(&list, &ptr, func);
244  RNA_parameter_set_lookup(&list, "context", &context);
245  RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph);
246  engine->type->rna_ext.call(NULL, &ptr, func, &list);
247 
249 }
250 
251 static void engine_update_script_node(RenderEngine *engine,
252  struct bNodeTree *ntree,
253  struct bNode *node)
254 {
255  extern FunctionRNA rna_RenderEngine_update_script_node_func;
256  PointerRNA ptr, nodeptr;
257  ParameterList list;
258  FunctionRNA *func;
259 
260  RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
261  RNA_pointer_create((ID *)ntree, &RNA_Node, node, &nodeptr);
262  func = &rna_RenderEngine_update_script_node_func;
263 
264  RNA_parameter_list_create(&list, &ptr, func);
265  RNA_parameter_set_lookup(&list, "node", &nodeptr);
266  engine->type->rna_ext.call(NULL, &ptr, func, &list);
267 
269 }
270 
271 static void engine_update_render_passes(RenderEngine *engine,
272  struct Scene *scene,
273  struct ViewLayer *view_layer)
274 {
275  extern FunctionRNA rna_RenderEngine_update_render_passes_func;
276  PointerRNA ptr;
277  ParameterList list;
278  FunctionRNA *func;
279 
280  RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
281  func = &rna_RenderEngine_update_render_passes_func;
282 
283  RNA_parameter_list_create(&list, &ptr, func);
284  RNA_parameter_set_lookup(&list, "scene", &scene);
285  RNA_parameter_set_lookup(&list, "renderlayer", &view_layer);
286  engine->type->rna_ext.call(NULL, &ptr, func, &list);
287 
289 }
290 
291 /* RenderEngine registration */
292 
293 static void rna_RenderEngine_unregister(Main *bmain, StructRNA *type)
294 {
296 
297  if (!et) {
298  return;
299  }
300 
301  /* Stop all renders in case we were using this one. */
302  ED_render_engine_changed(bmain, false);
304 
307  BLI_freelinkN(&R_engines, et);
308 }
309 
310 static StructRNA *rna_RenderEngine_register(Main *bmain,
311  ReportList *reports,
312  void *data,
313  const char *identifier,
314  StructValidateFunc validate,
315  StructCallbackFunc call,
317 {
318  RenderEngineType *et, dummyet = {NULL};
319  RenderEngine dummyengine = {NULL};
320  PointerRNA dummyptr;
321  int have_function[8];
322 
323  /* setup dummy engine & engine type to store static properties in */
324  dummyengine.type = &dummyet;
326  RNA_pointer_create(NULL, &RNA_RenderEngine, &dummyengine, &dummyptr);
327 
328  /* validate the python class */
329  if (validate(&dummyptr, data, have_function) != 0) {
330  return NULL;
331  }
332 
333  if (strlen(identifier) >= sizeof(dummyet.idname)) {
334  BKE_reportf(reports,
335  RPT_ERROR,
336  "Registering render engine class: '%s' is too long, maximum length is %d",
337  identifier,
338  (int)sizeof(dummyet.idname));
339  return NULL;
340  }
341 
342  /* check if we have registered this engine type before, and remove it */
343  for (et = R_engines.first; et; et = et->next) {
344  if (STREQ(et->idname, dummyet.idname)) {
345  if (et->rna_ext.srna) {
346  rna_RenderEngine_unregister(bmain, et->rna_ext.srna);
347  }
348  break;
349  }
350  }
351 
352  /* create a new engine type */
353  et = MEM_mallocN(sizeof(RenderEngineType), "python render engine");
354  memcpy(et, &dummyet, sizeof(dummyet));
355 
357  et->rna_ext.data = data;
358  et->rna_ext.call = call;
359  et->rna_ext.free = free;
361 
362  et->update = (have_function[0]) ? engine_update : NULL;
363  et->render = (have_function[1]) ? engine_render : NULL;
364  et->bake = (have_function[2]) ? engine_bake : NULL;
365  et->view_update = (have_function[3]) ? engine_view_update : NULL;
366  et->view_draw = (have_function[4]) ? engine_view_draw : NULL;
367  et->update_script_node = (have_function[5]) ? engine_update_script_node : NULL;
368  et->update_render_passes = (have_function[6]) ? engine_update_render_passes : NULL;
369 
371 
372  return et->rna_ext.srna;
373 }
374 
375 static void **rna_RenderEngine_instance(PointerRNA *ptr)
376 {
377  RenderEngine *engine = ptr->data;
378  return &engine->py_instance;
379 }
380 
381 static StructRNA *rna_RenderEngine_refine(PointerRNA *ptr)
382 {
383  RenderEngine *engine = (RenderEngine *)ptr->data;
384  return (engine->type && engine->type->rna_ext.srna) ? engine->type->rna_ext.srna :
386 }
387 
388 static PointerRNA rna_RenderEngine_render_get(PointerRNA *ptr)
389 {
390  RenderEngine *engine = (RenderEngine *)ptr->data;
391 
392  if (engine->re) {
394 
396  }
397  else {
399  }
400 }
401 
402 static PointerRNA rna_RenderEngine_camera_override_get(PointerRNA *ptr)
403 {
404  RenderEngine *engine = (RenderEngine *)ptr->data;
405  /* TODO(sergey): Shouldn't engine point to an evaluated datablocks already? */
406  if (engine->re) {
407  Object *cam = RE_GetCamera(engine->re);
408  Object *cam_eval = DEG_get_evaluated_object(engine->depsgraph, cam);
409  return rna_pointer_inherit_refine(ptr, &RNA_Object, cam_eval);
410  }
411  else {
413  }
414 }
415 
416 static void rna_RenderEngine_engine_frame_set(RenderEngine *engine, int frame, float subframe)
417 {
418 # ifdef WITH_PYTHON
420 # endif
421 
422  RE_engine_frame_set(engine, frame, subframe);
423 
424 # ifdef WITH_PYTHON
426 # endif
427 }
428 
429 static void rna_RenderResult_views_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
430 {
431  RenderResult *rr = (RenderResult *)ptr->data;
433 }
434 
435 static void rna_RenderResult_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
436 {
437  RenderResult *rr = (RenderResult *)ptr->data;
439 }
440 
441 static void rna_RenderResult_stamp_data_add_field(RenderResult *rr,
442  const char *field,
443  const char *value)
444 {
445  BKE_render_result_stamp_data(rr, field, value);
446 }
447 
448 static void rna_RenderLayer_passes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
449 {
450  RenderLayer *rl = (RenderLayer *)ptr->data;
452 }
453 
454 static int rna_RenderPass_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
455 {
456  RenderPass *rpass = (RenderPass *)ptr->data;
457 
458  length[0] = rpass->rectx * rpass->recty;
459  length[1] = rpass->channels;
460 
461  return length[0] * length[1];
462 }
463 
464 static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values)
465 {
466  RenderPass *rpass = (RenderPass *)ptr->data;
467  memcpy(values, rpass->rect, sizeof(float) * rpass->rectx * rpass->recty * rpass->channels);
468 }
469 
470 void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values)
471 {
472  RenderPass *rpass = (RenderPass *)ptr->data;
473  memcpy(rpass->rect, values, sizeof(float) * rpass->rectx * rpass->recty * rpass->channels);
474 }
475 
476 static RenderPass *rna_RenderPass_find_by_type(RenderLayer *rl, int passtype, const char *view)
477 {
478  return RE_pass_find_by_type(rl, passtype, view);
479 }
480 
481 static RenderPass *rna_RenderPass_find_by_name(RenderLayer *rl, const char *name, const char *view)
482 {
483  return RE_pass_find_by_name(rl, name, view);
484 }
485 
486 #else /* RNA_RUNTIME */
487 
489 {
490  StructRNA *srna;
491  PropertyRNA *prop;
492 
493  FunctionRNA *func;
494  PropertyRNA *parm;
495 
496  static const EnumPropertyItem render_pass_type_items[] = {
497  {SOCK_FLOAT, "VALUE", 0, "Value", ""},
498  {SOCK_VECTOR, "VECTOR", 0, "Vector", ""},
499  {SOCK_RGBA, "COLOR", 0, "Color", ""},
500  {0, NULL, 0, NULL, NULL},
501  };
502 
503  srna = RNA_def_struct(brna, "RenderEngine", NULL);
504  RNA_def_struct_sdna(srna, "RenderEngine");
505  RNA_def_struct_ui_text(srna, "Render Engine", "Render engine");
506  RNA_def_struct_refine_func(srna, "rna_RenderEngine_refine");
508  "rna_RenderEngine_register",
509  "rna_RenderEngine_unregister",
510  "rna_RenderEngine_instance");
511 
512  /* final render callbacks */
513  func = RNA_def_function(srna, "update", NULL);
514  RNA_def_function_ui_description(func, "Export scene data for render");
516  RNA_def_pointer(func, "data", "BlendData", "", "");
517  RNA_def_pointer(func, "depsgraph", "Depsgraph", "", "");
518 
519  func = RNA_def_function(srna, "render", NULL);
520  RNA_def_function_ui_description(func, "Render scene into an image");
522  parm = RNA_def_pointer(func, "depsgraph", "Depsgraph", "", "");
524 
525  func = RNA_def_function(srna, "bake", NULL);
526  RNA_def_function_ui_description(func, "Bake passes");
528  parm = RNA_def_pointer(func, "depsgraph", "Depsgraph", "", "");
530  parm = RNA_def_pointer(func, "object", "Object", "", "");
532  parm = RNA_def_enum(func, "pass_type", rna_enum_bake_pass_type_items, 0, "Pass", "Pass to bake");
534  parm = RNA_def_int(func,
535  "pass_filter",
536  0,
537  0,
538  INT_MAX,
539  "Pass Filter",
540  "Filter to combined, diffuse, glossy and transmission passes",
541  0,
542  INT_MAX);
544  parm = RNA_def_int(func, "width", 0, 0, INT_MAX, "Width", "Image width", 0, INT_MAX);
546  parm = RNA_def_int(func, "height", 0, 0, INT_MAX, "Height", "Image height", 0, INT_MAX);
548 
549  /* viewport render callbacks */
550  func = RNA_def_function(srna, "view_update", NULL);
551  RNA_def_function_ui_description(func, "Update on data changes for viewport render");
553  parm = RNA_def_pointer(func, "context", "Context", "", "");
555  parm = RNA_def_pointer(func, "depsgraph", "Depsgraph", "", "");
557 
558  func = RNA_def_function(srna, "view_draw", NULL);
559  RNA_def_function_ui_description(func, "Draw viewport render");
561  parm = RNA_def_pointer(func, "context", "Context", "", "");
563  parm = RNA_def_pointer(func, "depsgraph", "Depsgraph", "", "");
565 
566  /* shader script callbacks */
567  func = RNA_def_function(srna, "update_script_node", NULL);
568  RNA_def_function_ui_description(func, "Compile shader script node");
570  parm = RNA_def_pointer(func, "node", "Node", "", "");
572 
573  func = RNA_def_function(srna, "update_render_passes", NULL);
574  RNA_def_function_ui_description(func, "Update the render passes that will be generated");
576  parm = RNA_def_pointer(func, "scene", "Scene", "", "");
577  parm = RNA_def_pointer(func, "renderlayer", "ViewLayer", "", "");
578 
579  /* tag for redraw */
580  func = RNA_def_function(srna, "tag_redraw", "engine_tag_redraw");
581  RNA_def_function_ui_description(func, "Request redraw for viewport rendering");
582 
583  /* tag for update */
584  func = RNA_def_function(srna, "tag_update", "engine_tag_update");
585  RNA_def_function_ui_description(func, "Request update call for viewport rendering");
586 
587  func = RNA_def_function(srna, "begin_result", "RE_engine_begin_result");
589  func, "Create render result to write linear floating-point render layers and passes");
590  parm = RNA_def_int(func, "x", 0, 0, INT_MAX, "X", "", 0, INT_MAX);
592  parm = RNA_def_int(func, "y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX);
594  parm = RNA_def_int(func, "w", 0, 0, INT_MAX, "Width", "", 0, INT_MAX);
596  parm = RNA_def_int(func, "h", 0, 0, INT_MAX, "Height", "", 0, INT_MAX);
599  func, "layer", NULL, 0, "Layer", "Single layer to get render result for"); /* NULL ok here */
601  func, "view", NULL, 0, "View", "Single view to get render result for"); /* NULL ok here */
602  parm = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
603  RNA_def_function_return(func, parm);
604 
605  func = RNA_def_function(srna, "update_result", "RE_engine_update_result");
607  func, "Signal that pixels have been updated and can be redrawn in the user interface");
608  parm = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
610 
611  func = RNA_def_function(srna, "end_result", "RE_engine_end_result");
613  "All pixels in the render result have been set and are final");
614  parm = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
617  func, "cancel", 0, "Cancel", "Don't mark tile as done, don't merge results unless forced");
618  RNA_def_boolean(func, "highlight", 0, "Highlight", "Don't mark tile as done yet");
620  func, "do_merge_results", 0, "Merge Results", "Merge results even if cancel=true");
621 
622  func = RNA_def_function(srna, "add_pass", "RE_engine_add_pass");
623  RNA_def_function_ui_description(func, "Add a pass to the render layer");
624  parm = RNA_def_string(
625  func, "name", NULL, 0, "Name", "Name of the Pass, without view or channel tag");
627  parm = RNA_def_int(func, "channels", 0, 0, INT_MAX, "Channels", "", 0, INT_MAX);
629  parm = RNA_def_string(
630  func, "chan_id", NULL, 0, "Channel IDs", "Channel names, one character per channel");
633  func, "layer", NULL, 0, "Layer", "Single layer to add render pass to"); /* NULL ok here */
634 
635  func = RNA_def_function(srna, "get_result", "RE_engine_get_result");
636  RNA_def_function_ui_description(func, "Get final result for non-pixel operations");
637  parm = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
638  RNA_def_function_return(func, parm);
639 
640  func = RNA_def_function(srna, "test_break", "RE_engine_test_break");
642  "Test if the render operation should been canceled, this is a "
643  "fast call that should be used regularly for responsiveness");
644  parm = RNA_def_boolean(func, "do_break", 0, "Break", "");
645  RNA_def_function_return(func, parm);
646 
647  func = RNA_def_function(srna, "active_view_get", "RE_engine_active_view_get");
648  parm = RNA_def_string(func, "view", NULL, 0, "View", "Single view active");
649  RNA_def_function_return(func, parm);
650 
651  func = RNA_def_function(srna, "active_view_set", "RE_engine_active_view_set");
652  parm = RNA_def_string(
653  func, "view", NULL, 0, "View", "Single view to set as active"); /* NULL ok here */
655 
656  func = RNA_def_function(srna, "camera_shift_x", "RE_engine_get_camera_shift_x");
657  parm = RNA_def_pointer(func, "camera", "Object", "", "");
659  RNA_def_boolean(func, "use_spherical_stereo", 0, "Spherical Stereo", "");
660  parm = RNA_def_float(func, "shift_x", 0.0f, 0.0f, FLT_MAX, "Shift X", "", 0.0f, FLT_MAX);
661  RNA_def_function_return(func, parm);
662 
663  func = RNA_def_function(srna, "camera_model_matrix", "RE_engine_get_camera_model_matrix");
664  parm = RNA_def_pointer(func, "camera", "Object", "", "");
666  RNA_def_boolean(func, "use_spherical_stereo", 0, "Spherical Stereo", "");
667  parm = RNA_def_float_matrix(func,
668  "r_model_matrix",
669  4,
670  4,
671  NULL,
672  0.0f,
673  0.0f,
674  "Model Matrix",
675  "Normalized camera model matrix",
676  0.0f,
677  0.0f);
679  RNA_def_function_output(func, parm);
680 
681  func = RNA_def_function(srna, "use_spherical_stereo", "RE_engine_get_spherical_stereo");
682  parm = RNA_def_pointer(func, "camera", "Object", "", "");
684  parm = RNA_def_boolean(func, "use_spherical_stereo", 0, "Spherical Stereo", "");
685  RNA_def_function_return(func, parm);
686 
687  func = RNA_def_function(srna, "update_stats", "RE_engine_update_stats");
688  RNA_def_function_ui_description(func, "Update and signal to redraw render status text");
689  parm = RNA_def_string(func, "stats", NULL, 0, "Stats", "");
691  parm = RNA_def_string(func, "info", NULL, 0, "Info", "");
693 
694  func = RNA_def_function(srna, "frame_set", "rna_RenderEngine_engine_frame_set");
695  RNA_def_function_ui_description(func, "Evaluate scene at a different frame (for motion blur)");
696  parm = RNA_def_int(func, "frame", 0, INT_MIN, INT_MAX, "Frame", "", INT_MIN, INT_MAX);
698  parm = RNA_def_float(func, "subframe", 0.0f, 0.0f, 1.0f, "Subframe", "", 0.0f, 1.0f);
700 
701  func = RNA_def_function(srna, "update_progress", "RE_engine_update_progress");
702  RNA_def_function_ui_description(func, "Update progress percentage of render");
703  parm = RNA_def_float(
704  func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done", 0.0f, 1.0f);
706 
707  func = RNA_def_function(srna, "update_memory_stats", "RE_engine_update_memory_stats");
708  RNA_def_function_ui_description(func, "Update memory usage statistics");
709  RNA_def_float(func,
710  "memory_used",
711  0,
712  0.0f,
713  FLT_MAX,
714  "",
715  "Current memory usage in megabytes",
716  0.0f,
717  FLT_MAX);
719  func, "memory_peak", 0, 0.0f, FLT_MAX, "", "Peak memory usage in megabytes", 0.0f, FLT_MAX);
720 
721  func = RNA_def_function(srna, "report", "RE_engine_report");
722  RNA_def_function_ui_description(func, "Report info, warning or error messages");
723  parm = RNA_def_enum_flag(func, "type", rna_enum_wm_report_items, 0, "Type", "");
725  parm = RNA_def_string(func, "message", NULL, 0, "Report Message", "");
727 
728  func = RNA_def_function(srna, "error_set", "RE_engine_set_error_message");
730  "Set error message displaying after the render is finished");
731  parm = RNA_def_string(func, "message", NULL, 0, "Report Message", "");
733 
734  func = RNA_def_function(srna, "bind_display_space_shader", "engine_bind_display_space_shader");
736  "Bind GLSL fragment shader that converts linear colors to "
737  "display space colors using scene color management settings");
738  parm = RNA_def_pointer(func, "scene", "Scene", "", "");
740 
741  func = RNA_def_function(
742  srna, "unbind_display_space_shader", "engine_unbind_display_space_shader");
744  func, "Unbind GLSL display space shader, must always be called after binding the shader");
745 
746  func = RNA_def_function(
747  srna, "support_display_space_shader", "engine_support_display_space_shader");
749  "Test if GLSL display space shader is supported for the "
750  "combination of graphics card and scene settings");
751  parm = RNA_def_pointer(func, "scene", "Scene", "", "");
753  parm = RNA_def_boolean(func, "supported", 0, "Supported", "");
754  RNA_def_function_return(func, parm);
755 
756  func = RNA_def_function(srna, "get_preview_pixel_size", "engine_get_preview_pixel_size");
758  "Get the pixel size that should be used for preview rendering");
759  parm = RNA_def_pointer(func, "scene", "Scene", "", "");
761  parm = RNA_def_int(func, "pixel_size", 0, 1, 8, "Pixel Size", "", 1, 8);
762  RNA_def_function_return(func, parm);
763 
764  func = RNA_def_function(srna, "free_blender_memory", "RE_engine_free_blender_memory");
765  RNA_def_function_ui_description(func, "Free Blender side memory of render engine");
766 
768 
769  prop = RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE);
771 
772  prop = RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE);
774 
775  prop = RNA_def_property(srna, "camera_override", PROP_POINTER, PROP_NONE);
776  RNA_def_property_pointer_funcs(prop, "rna_RenderEngine_camera_override_get", NULL, NULL, NULL);
777  RNA_def_property_struct_type(prop, "Object");
778 
779  prop = RNA_def_property(srna, "layer_override", PROP_BOOLEAN, PROP_LAYER_MEMBER);
780  RNA_def_property_boolean_sdna(prop, NULL, "layer_override", 1);
781  RNA_def_property_array(prop, 20);
782 
783  prop = RNA_def_property(srna, "tile_x", PROP_INT, PROP_UNSIGNED);
784  RNA_def_property_int_sdna(prop, NULL, "tile_x");
785  prop = RNA_def_property(srna, "tile_y", PROP_INT, PROP_UNSIGNED);
786  RNA_def_property_int_sdna(prop, NULL, "tile_y");
787 
788  prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL);
789  RNA_def_property_int_sdna(prop, NULL, "resolution_x");
791 
792  prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL);
793  RNA_def_property_int_sdna(prop, NULL, "resolution_y");
795 
796  /* Render Data */
797  prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
798  RNA_def_property_struct_type(prop, "RenderSettings");
799  RNA_def_property_pointer_funcs(prop, "rna_RenderEngine_render_get", NULL, NULL, NULL);
800  RNA_def_property_ui_text(prop, "Render Data", "");
801 
802  prop = RNA_def_property(srna, "use_highlight_tiles", PROP_BOOLEAN, PROP_NONE);
804 
805  func = RNA_def_function(srna, "register_pass", "RE_engine_register_pass");
807  func, "Register a render pass that will be part of the render with the current settings");
808  parm = RNA_def_pointer(func, "scene", "Scene", "", "");
810  parm = RNA_def_pointer(func, "view_layer", "ViewLayer", "", "");
812  parm = RNA_def_string(func, "name", NULL, MAX_NAME, "Name", "");
814  parm = RNA_def_int(func, "channels", 1, 1, 8, "Channels", "", 1, 4);
816  parm = RNA_def_string(func, "chanid", NULL, 8, "Channel IDs", "");
818  parm = RNA_def_enum(func, "type", render_pass_type_items, SOCK_FLOAT, "Type", "");
819  RNA_def_property_enum_native_type(parm, "eNodeSocketDatatype");
821 
822  /* registration */
823 
824  prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
825  RNA_def_property_string_sdna(prop, NULL, "type->idname");
827 
828  prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
829  RNA_def_property_string_sdna(prop, NULL, "type->name");
831 
832  prop = RNA_def_property(srna, "bl_use_preview", PROP_BOOLEAN, PROP_NONE);
833  RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW);
836  prop,
837  "Use Preview Render",
838  "Render engine supports being used for rendering previews of materials, lights and worlds");
839 
840  prop = RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE);
843  RNA_def_property_ui_text(prop, "Use Post Processing", "Apply compositing on render results");
844 
845  prop = RNA_def_property(srna, "bl_use_eevee_viewport", PROP_BOOLEAN, PROP_NONE);
849  prop, "Use Eevee Viewport", "Uses Eevee for viewport shading in LookDev shading mode");
850 
851  prop = RNA_def_property(srna, "bl_use_custom_freestyle", PROP_BOOLEAN, PROP_NONE);
855  prop,
856  "Use Custom Freestyle",
857  "Handles freestyle rendering on its own, instead of delegating it to EEVEE");
858 
859  prop = RNA_def_property(srna, "bl_use_gpu_context", PROP_BOOLEAN, PROP_NONE);
863  prop,
864  "Use GPU Context",
865  "Enable OpenGL context for the render method, for engines that render using OpenGL");
866 
867  prop = RNA_def_property(srna, "bl_use_shading_nodes_custom", PROP_BOOLEAN, PROP_NONE);
872  "Use Custom Shading Nodes",
873  "Don't expose Cycles and Eevee shading nodes in the node editor user "
874  "interface, so own nodes can be used instead");
875 
876  prop = RNA_def_property(srna, "bl_use_save_buffers", PROP_BOOLEAN, PROP_NONE);
880  prop, "Use Save Buffers", "Support render to an on disk buffer during rendering");
881 
882  prop = RNA_def_property(srna, "bl_use_spherical_stereo", PROP_BOOLEAN, PROP_NONE);
885  RNA_def_property_ui_text(prop, "Use Spherical Stereo", "Support spherical stereo camera models");
886 
887  prop = RNA_def_property(srna, "bl_use_stereo_viewport", PROP_BOOLEAN, PROP_NONE);
890  RNA_def_property_ui_text(prop, "Use Stereo Viewport", "Support rendering stereo 3D viewport");
891 
893 }
894 
896 {
897  StructRNA *srna;
898  PropertyRNA *prop;
899 
900  FunctionRNA *func;
901  PropertyRNA *parm;
902 
903  srna = RNA_def_struct(brna, "RenderResult", NULL);
905  srna, "Render Result", "Result of rendering, including all layers and passes");
906 
907  func = RNA_def_function(srna, "load_from_file", "RE_result_load_from_file");
909  "Copies the pixels of this render result from an image file");
912  func,
913  "filename",
914  NULL,
915  FILE_MAX,
916  "File Name",
917  "Filename to load into this render tile, must be no smaller than "
918  "the render result");
920 
921  func = RNA_def_function(srna, "stamp_data_add_field", "rna_RenderResult_stamp_data_add_field");
922  RNA_def_function_ui_description(func, "Add engine-specific stamp data to the result");
923  parm = RNA_def_string(func, "field", NULL, 1024, "Field", "Name of the stamp field to add");
925  parm = RNA_def_string(func, "value", NULL, 0, "Value", "Value of the stamp data");
927 
929 
930  prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL);
931  RNA_def_property_int_sdna(prop, NULL, "rectx");
933 
934  prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL);
935  RNA_def_property_int_sdna(prop, NULL, "recty");
937 
938  prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
939  RNA_def_property_struct_type(prop, "RenderLayer");
941  "rna_RenderResult_layers_begin",
942  "rna_iterator_listbase_next",
943  "rna_iterator_listbase_end",
944  "rna_iterator_listbase_get",
945  NULL,
946  NULL,
947  NULL,
948  NULL);
949 
950  prop = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE);
951  RNA_def_property_struct_type(prop, "RenderView");
953  "rna_RenderResult_views_begin",
954  "rna_iterator_listbase_next",
955  "rna_iterator_listbase_end",
956  "rna_iterator_listbase_get",
957  NULL,
958  NULL,
959  NULL,
960  NULL);
961 
963 }
964 
965 static void rna_def_render_view(BlenderRNA *brna)
966 {
967  StructRNA *srna;
968  PropertyRNA *prop;
969 
970  srna = RNA_def_struct(brna, "RenderView", NULL);
971  RNA_def_struct_ui_text(srna, "Render View", "");
972 
974 
975  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
976  RNA_def_property_string_sdna(prop, NULL, "name");
978  RNA_def_struct_name_property(srna, prop);
979 
981 }
982 
983 static void rna_def_render_passes(BlenderRNA *brna, PropertyRNA *cprop)
984 {
985  StructRNA *srna;
986 
987  FunctionRNA *func;
988  PropertyRNA *parm;
989 
990  RNA_def_property_srna(cprop, "RenderPasses");
991  srna = RNA_def_struct(brna, "RenderPasses", NULL);
992  RNA_def_struct_sdna(srna, "RenderLayer");
993  RNA_def_struct_ui_text(srna, "Render Passes", "Collection of render passes");
994 
995  func = RNA_def_function(srna, "find_by_type", "rna_RenderPass_find_by_type");
996  RNA_def_function_ui_description(func, "Get the render pass for a given type and view");
997  parm = RNA_def_enum(
998  func, "pass_type", rna_enum_render_pass_type_items, SCE_PASS_COMBINED, "Pass", "");
1000  parm = RNA_def_string(
1001  func, "view", NULL, 0, "View", "Render view to get pass from"); /* NULL ok here */
1003  parm = RNA_def_pointer(func, "render_pass", "RenderPass", "", "The matching render pass");
1004  RNA_def_function_return(func, parm);
1005 
1006  func = RNA_def_function(srna, "find_by_name", "rna_RenderPass_find_by_name");
1007  RNA_def_function_ui_description(func, "Get the render pass for a given name and view");
1008  parm = RNA_def_string(func, "name", RE_PASSNAME_COMBINED, 0, "Pass", "");
1010  parm = RNA_def_string(
1011  func, "view", NULL, 0, "View", "Render view to get pass from"); /* NULL ok here */
1013  parm = RNA_def_pointer(func, "render_pass", "RenderPass", "", "The matching render pass");
1014  RNA_def_function_return(func, parm);
1015 }
1016 
1018 {
1019  StructRNA *srna;
1020  PropertyRNA *prop;
1021 
1022  FunctionRNA *func;
1023  PropertyRNA *parm;
1024 
1025  srna = RNA_def_struct(brna, "RenderLayer", NULL);
1026  RNA_def_struct_ui_text(srna, "Render Layer", "");
1027 
1028  func = RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file");
1030  "Copies the pixels of this renderlayer from an image file");
1032  parm = RNA_def_string(
1033  func,
1034  "filename",
1035  NULL,
1036  0,
1037  "Filename",
1038  "Filename to load into this render tile, must be no smaller than the renderlayer");
1040  RNA_def_int(func,
1041  "x",
1042  0,
1043  0,
1044  INT_MAX,
1045  "Offset X",
1046  "Offset the position to copy from if the image is larger than the render layer",
1047  0,
1048  INT_MAX);
1049  RNA_def_int(func,
1050  "y",
1051  0,
1052  0,
1053  INT_MAX,
1054  "Offset Y",
1055  "Offset the position to copy from if the image is larger than the render layer",
1056  0,
1057  INT_MAX);
1058 
1060 
1061  rna_def_view_layer_common(brna, srna, false);
1062 
1063  prop = RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE);
1064  RNA_def_property_struct_type(prop, "RenderPass");
1066  "rna_RenderLayer_passes_begin",
1067  "rna_iterator_listbase_next",
1068  "rna_iterator_listbase_end",
1069  "rna_iterator_listbase_get",
1070  NULL,
1071  NULL,
1072  NULL,
1073  NULL);
1074  rna_def_render_passes(brna, prop);
1075 
1077 }
1078 
1080 {
1081  StructRNA *srna;
1082  PropertyRNA *prop;
1083 
1084  srna = RNA_def_struct(brna, "RenderPass", NULL);
1085  RNA_def_struct_ui_text(srna, "Render Pass", "");
1086 
1088 
1089  prop = RNA_def_property(srna, "fullname", PROP_STRING, PROP_NONE);
1090  RNA_def_property_string_sdna(prop, NULL, "fullname");
1092 
1093  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1094  RNA_def_property_string_sdna(prop, NULL, "name");
1096  RNA_def_struct_name_property(srna, prop);
1097 
1098  prop = RNA_def_property(srna, "channel_id", PROP_STRING, PROP_NONE);
1099  RNA_def_property_string_sdna(prop, NULL, "chan_id");
1101 
1102  prop = RNA_def_property(srna, "channels", PROP_INT, PROP_NONE);
1103  RNA_def_property_int_sdna(prop, NULL, "channels");
1105 
1106  prop = RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
1109  RNA_def_property_dynamic_array_funcs(prop, "rna_RenderPass_rect_get_length");
1110  RNA_def_property_float_funcs(prop, "rna_RenderPass_rect_get", "rna_RenderPass_rect_set", NULL);
1111 
1112  prop = RNA_def_property(srna, "view_id", PROP_INT, PROP_NONE);
1113  RNA_def_property_int_sdna(prop, NULL, "view_id");
1115 
1117 }
1118 
1120 {
1121  rna_def_render_engine(brna);
1122  rna_def_render_result(brna);
1123  rna_def_render_view(brna);
1124  rna_def_render_layer(brna);
1125  rna_def_render_pass(brna);
1126 }
1127 
1128 #endif /* RNA_RUNTIME */
void BKE_render_result_stamp_data(struct RenderResult *rr, const char *key, const char *value)
Definition: image.c:2727
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
int BKE_render_preview_pixel_size(const struct RenderData *r)
void BLI_kdtree_nd_() free(KDTree *tree)
Definition: kdtree_impl.h:116
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:281
#define FILE_MAX
#define UNUSED(x)
#define STREQ(a, b)
#define BPy_BEGIN_ALLOW_THREADS
Definition: BPY_extern.h:62
#define BPy_END_ALLOW_THREADS
Definition: BPY_extern.h:66
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
#define MAX_NAME
Definition: DNA_defs.h:62
@ SOCK_VECTOR
@ SOCK_FLOAT
@ SOCK_RGBA
Object is a sort of wrapper for general info.
#define RE_PASSNAME_COMBINED
@ SCE_PASS_NORMAL
@ SCE_PASS_GLOSSY_DIRECT
@ SCE_PASS_AO
@ SCE_PASS_DIFFUSE_COLOR
@ SCE_PASS_UV
@ SCE_PASS_SUBSURFACE_INDIRECT
@ SCE_PASS_TRANSM_DIRECT
@ SCE_PASS_SUBSURFACE_COLOR
@ SCE_PASS_GLOSSY_COLOR
@ SCE_PASS_DIFFUSE_DIRECT
@ SCE_PASS_GLOSSY_INDIRECT
@ SCE_PASS_INDEXMA
@ SCE_PASS_INDEXOB
@ SCE_PASS_TRANSM_INDIRECT
@ SCE_PASS_COMBINED
@ SCE_PASS_Z
@ SCE_PASS_VECTOR
@ SCE_PASS_ROUGHNESS
@ SCE_PASS_DIFFUSE_INDIRECT
@ SCE_PASS_SUBSURFACE_DIRECT
@ SCE_PASS_SHADOW
@ SCE_PASS_TRANSM_COLOR
@ SCE_PASS_MIST
@ SCE_PASS_EMIT
@ SCE_PASS_ENVIRONMENT
void ED_render_engine_changed(struct Main *bmain, const bool update_scene_data)
static AppView * view
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
void GPU_shader_unbind(void)
Definition: gpu_shader.cc:516
int GPU_shader_get_uniform(GPUShader *shader, const char *name)
Definition: gpu_shader.cc:551
struct GPUShader GPUShader
Definition: GPU_shader.h:33
void GPU_shader_uniform_int(GPUShader *shader, int location, int value)
Definition: gpu_shader.cc:629
GPUShader * GPU_shader_get_builtin_shader(eGPUBuiltinShader shader)
void GPU_shader_bind(GPUShader *shader)
Definition: gpu_shader.cc:494
@ GPU_SHADER_2D_IMAGE
Definition: GPU_shader.h:186
bool IMB_colormanagement_support_glsl_draw(const struct ColorManagedViewSettings *view_settings)
Read Guarded memory(de)allocation.
#define RE_USE_CUSTOM_FREESTYLE
Definition: RE_engine.h:67
#define RE_USE_EEVEE_VIEWPORT
Definition: RE_engine.h:61
#define RE_USE_STEREO_VIEWPORT
Definition: RE_engine.h:65
#define RE_ENGINE_DO_UPDATE
Definition: RE_engine.h:73
#define RE_ENGINE_ANIMATION
Definition: RE_engine.h:70
#define RE_USE_SAVE_BUFFERS
Definition: RE_engine.h:62
#define RE_USE_GPU_CONTEXT
Definition: RE_engine.h:66
#define RE_ENGINE_PREVIEW
Definition: RE_engine.h:71
#define RE_ENGINE_HIGHLIGHT_TILES
Definition: RE_engine.h:75
#define RE_USE_PREVIEW
Definition: RE_engine.h:59
#define RE_USE_SPHERICAL_STEREO
Definition: RE_engine.h:64
#define RE_USE_SHADING_NODES_CUSTOM
Definition: RE_engine.h:63
#define RE_USE_POSTPROCESS
Definition: RE_engine.h:60
#define RE_ENGINE_DO_DRAW
Definition: RE_engine.h:72
StructRNA RNA_Node
StructRNA RNA_RenderEngine
StructRNA RNA_Object
StructRNA RNA_RenderSettings
#define RNA_MAX_ARRAY_DIMENSION
Definition: RNA_define.h:42
@ PARM_RNAPTR
Definition: RNA_types.h:339
@ PARM_REQUIRED
Definition: RNA_types.h:337
void(* StructFreeFunc)(void *data)
Definition: RNA_types.h:652
int(* StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_function)
Definition: RNA_types.h:647
@ FUNC_USE_REPORTS
Definition: RNA_types.h:578
@ FUNC_REGISTER_OPTIONAL
Definition: RNA_types.h:587
@ FUNC_ALLOW_WRITE
Definition: RNA_types.h:593
int(* StructCallbackFunc)(struct bContext *C, struct PointerRNA *ptr, struct FunctionRNA *func, ParameterList *list)
Definition: RNA_types.h:648
@ PROP_FLOAT
Definition: RNA_types.h:75
@ PROP_BOOLEAN
Definition: RNA_types.h:73
@ PROP_INT
Definition: RNA_types.h:74
@ PROP_STRING
Definition: RNA_types.h:76
@ PROP_POINTER
Definition: RNA_types.h:78
@ PROP_COLLECTION
Definition: RNA_types.h:79
@ PROP_DYNAMIC
Definition: RNA_types.h:275
@ PROP_EDITABLE
Definition: RNA_types.h:175
@ PROP_REGISTER_OPTIONAL
Definition: RNA_types.h:259
@ PROP_REGISTER
Definition: RNA_types.h:258
@ PROP_LAYER_MEMBER
Definition: RNA_types.h:157
@ PROP_PIXEL
Definition: RNA_types.h:128
@ PROP_NONE
Definition: RNA_types.h:113
@ PROP_UNSIGNED
Definition: RNA_types.h:129
return(oflags[bm->toolflag_index].f &oflag) !=0
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
Definition: btQuaternion.h:895
OperationNode * node
Scene scene
const Depsgraph * depsgraph
bNodeTree * ntree
void RE_engine_frame_set(RenderEngine *engine, int frame, float subframe)
Definition: engine.c:711
void RE_engines_register(RenderEngineType *render_type)
Definition: engine.c:100
RenderData * RE_engine_get_render_data(Render *re)
Definition: engine.c:616
ListBase R_engines
Definition: engine.c:72
struct Object * RE_GetCamera(Render *re)
Definition: initrender.c:169
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
void RE_FreeAllPersistentData(void)
Definition: pipeline.c:679
RenderPass * RE_pass_find_by_type(volatile RenderLayer *rl, int passtype, const char *viewname)
Definition: pipeline.c:2782
RenderPass * RE_pass_find_by_name(volatile RenderLayer *rl, const char *name, const char *viewname)
Definition: pipeline.c:2764
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:146
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
Definition: rna_access.c:1044
ParameterList * RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSED(ptr), FunctionRNA *func)
Definition: rna_access.c:7207
void * RNA_struct_blender_type_get(StructRNA *srna)
Definition: rna_access.c:1039
void RNA_parameter_list_free(ParameterList *parms)
Definition: rna_access.c:7303
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
Definition: rna_access.c:4823
void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, const void *value)
Definition: rna_access.c:7469
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:196
PropertyRNA * RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3747
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3825
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
Definition: rna_define.c:1167
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3795
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4159
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2257
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4302
PropertyRNA * RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3943
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3153
void RNA_define_verify_sdna(bool verify)
Definition: rna_define.c:751
void RNA_def_property_enum_native_type(PropertyRNA *prop, const char *native_enum_type)
Definition: rna_define.c:1875
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1676
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2717
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4262
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3462
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
Definition: rna_define.c:3408
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1259
void RNA_def_function_output(FunctionRNA *UNUSED(func), PropertyRNA *ret)
Definition: rna_define.c:4327
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
Definition: rna_define.c:1957
void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance)
Definition: rna_define.c:1191
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
Definition: rna_define.c:2953
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
Definition: rna_define.c:1629
StructRNA * RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRNA *srnafrom)
Definition: rna_define.c:919
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1067
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1568
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1792
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4337
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1279
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1122
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4332
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1517
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *rna_ext)
Definition: rna_define.c:780
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3373
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1047
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
Definition: rna_define.c:795
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3675
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3585
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3771
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2364
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2348
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1547
void rna_def_view_layer_common(struct BlenderRNA *brna, struct StructRNA *srna, const bool scene)
Definition: rna_scene.c:3980
void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values)
BlenderRNA BLENDER_RNA
const EnumPropertyItem rna_enum_bake_pass_type_items[]
Definition: rna_render.c:81
static void rna_def_render_pass(BlenderRNA *brna)
Definition: rna_render.c:1079
static void rna_def_render_view(BlenderRNA *brna)
Definition: rna_render.c:965
static void rna_def_render_engine(BlenderRNA *brna)
Definition: rna_render.c:488
static void rna_def_render_passes(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_render.c:983
void RNA_def_render(BlenderRNA *brna)
Definition: rna_render.c:1119
const EnumPropertyItem rna_enum_render_pass_type_items[]
Definition: rna_render.c:50
static void rna_def_render_layer(BlenderRNA *brna)
Definition: rna_render.c:1017
static void rna_def_render_result(BlenderRNA *brna)
Definition: rna_render.c:895
const EnumPropertyItem rna_enum_wm_report_items[]
Definition: rna_wm.c:508
struct SELECTID_Context context
Definition: select_engine.c:47
StructRNA * srna
Definition: RNA_types.h:681
StructCallbackFunc call
Definition: RNA_types.h:682
void * data
Definition: RNA_types.h:680
StructFreeFunc free
Definition: RNA_types.h:683
Definition: DNA_ID.h:273
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
void * data
Definition: RNA_types.h:52
void(* render)(struct RenderEngine *engine, struct Depsgraph *depsgraph)
Definition: RE_engine.h:88
void(* view_draw)(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
Definition: RE_engine.h:100
void(* update)(struct RenderEngine *engine, struct Main *bmain, struct Depsgraph *depsgraph)
Definition: RE_engine.h:87
ExtensionRNA rna_ext
Definition: RE_engine.h:114
void(* view_update)(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
Definition: RE_engine.h:97
struct RenderEngineType * next
Definition: RE_engine.h:80
void(* bake)(struct RenderEngine *engine, struct Depsgraph *depsgraph, struct Object *object, const int pass_type, const int pass_filter, const int width, const int height)
Definition: RE_engine.h:89
char idname[64]
Definition: RE_engine.h:83
void(* update_script_node)(struct RenderEngine *engine, struct bNodeTree *ntree, struct bNode *node)
Definition: RE_engine.h:104
void(* update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition: RE_engine.h:107
struct Depsgraph * depsgraph
Definition: RE_engine.h:152
RenderEngineType * type
Definition: RE_engine.h:126
struct Render * re
Definition: RE_engine.h:136
void * py_instance
Definition: RE_engine.h:127
struct Object * camera_override
Definition: RE_engine.h:130
ListBase passes
Definition: RE_pipeline.h:108
int channels
Definition: RE_pipeline.h:79
float * rect
Definition: RE_pipeline.h:82
ListBase views
Definition: RE_pipeline.h:138
ListBase layers
Definition: RE_pipeline.h:135
ColorManagedViewSettings view_settings
struct RenderData r
PointerRNA * ptr
Definition: wm_files.c:3157