Blender  V3.3
rna_scene.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdlib.h>
8 
9 #include "DNA_brush_types.h"
10 #include "DNA_collection_types.h"
11 #include "DNA_gpencil_types.h"
12 #include "DNA_layer_types.h"
13 #include "DNA_linestyle_types.h"
14 #include "DNA_modifier_types.h"
15 #include "DNA_particle_types.h"
16 #include "DNA_rigidbody_types.h"
17 #include "DNA_scene_types.h"
18 #include "DNA_screen_types.h" /* TransformOrientation */
19 #include "DNA_userdef_types.h"
20 #include "DNA_view3d_types.h"
21 #include "DNA_world_types.h"
22 
23 #include "IMB_colormanagement.h"
24 #include "IMB_imbuf_types.h"
25 
26 #include "BLI_listbase.h"
27 #include "BLI_math.h"
28 
29 #include "BLT_translation.h"
30 
31 #include "BKE_armature.h"
32 #include "BKE_editmesh.h"
33 #include "BKE_idtype.h"
34 #include "BKE_paint.h"
35 #include "BKE_volume.h"
36 
37 #include "ED_gpencil.h"
38 #include "ED_object.h"
39 #include "ED_uvedit.h"
40 
41 #include "RNA_define.h"
42 #include "RNA_enum_types.h"
43 
44 #include "rna_internal.h"
45 
46 /* Include for Bake Options */
47 #include "RE_engine.h"
48 #include "RE_pipeline.h"
49 
50 #ifdef WITH_FFMPEG
51 # include "BKE_writeffmpeg.h"
52 # include "ffmpeg_compat.h"
53 # include <libavcodec/avcodec.h>
54 # include <libavformat/avformat.h>
55 #endif
56 
57 #include "ED_render.h"
58 #include "ED_transform.h"
59 
60 #include "WM_api.h"
61 #include "WM_types.h"
62 
63 #include "BLI_threads.h"
64 
65 #include "DEG_depsgraph.h"
66 
67 #ifdef WITH_OPENEXR
68 const EnumPropertyItem rna_enum_exr_codec_items[] = {
69  {R_IMF_EXR_CODEC_NONE, "NONE", 0, "None", ""},
70  {R_IMF_EXR_CODEC_PXR24, "PXR24", 0, "Pxr24 (lossy)", ""},
71  {R_IMF_EXR_CODEC_ZIP, "ZIP", 0, "ZIP (lossless)", ""},
72  {R_IMF_EXR_CODEC_PIZ, "PIZ", 0, "PIZ (lossless)", ""},
73  {R_IMF_EXR_CODEC_RLE, "RLE", 0, "RLE (lossless)", ""},
74  {R_IMF_EXR_CODEC_ZIPS, "ZIPS", 0, "ZIPS (lossless)", ""},
75  {R_IMF_EXR_CODEC_B44, "B44", 0, "B44 (lossy)", ""},
76  {R_IMF_EXR_CODEC_B44A, "B44A", 0, "B44A (lossy)", ""},
77  {R_IMF_EXR_CODEC_DWAA, "DWAA", 0, "DWAA (lossy)", ""},
78  {R_IMF_EXR_CODEC_DWAB, "DWAB", 0, "DWAB (lossy)", ""},
79  {0, NULL, 0, NULL, NULL},
80 };
81 #endif
82 
83 #ifndef RNA_RUNTIME
86  "LAPLACIAN",
87  0,
88  "Laplacian",
89  "Use Laplacian method for relaxation"},
90  {UV_SCULPT_TOOL_RELAX_HC, "HC", 0, "HC", "Use HC method for relaxation"},
91  {0, NULL, 0, NULL, NULL},
92 };
93 #endif
94 
96  {SCE_SNAP_SOURCE_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
97  {SCE_SNAP_SOURCE_CENTER, "CENTER", 0, "Center", "Snap transformation center onto target"},
98  {SCE_SNAP_SOURCE_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
99  {SCE_SNAP_SOURCE_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
100  {0, NULL, 0, NULL, NULL},
101 };
102 
104  {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
105  {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
106  {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
108  "INVERSE_SQUARE",
109  ICON_INVERSESQUARECURVE,
110  "Inverse Square",
111  "Inverse Square falloff"},
112  {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
113  {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
114  {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Constant falloff"},
115  {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", "Random falloff"},
116  {0, NULL, 0, NULL, NULL},
117 };
118 
119 /* subset of the enum - only curves, missing random and const */
121  {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
122  {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
123  {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
124  {PROP_INVSQUARE, "INVERSE_SQUARE", ICON_ROOTCURVE, "Inverse Square", "Inverse Square falloff"},
125  {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
126  {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
127  {0, NULL, 0, NULL, NULL},
128 };
129 
130 /* keep for operators, not used here */
132  {SCE_SELECT_VERTEX, "VERT", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
133  {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
134  {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
135  {0, NULL, 0, NULL, NULL},
136 };
137 
139  {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
140  {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
141  {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
142  {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
143  {0, NULL, 0, NULL, NULL},
144 };
145 
148  "INCREMENT",
149  ICON_SNAP_INCREMENT,
150  "Increment",
151  "Snap to increments of grid"},
152  {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
153  {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"},
155  "FACE", /* TODO(@gfxcoder): replace with "FACE_RAYCAST" as "FACE" is not descriptive. */
156  ICON_SNAP_FACE,
157  "Face Project",
158  "Snap by projecting onto faces"},
160  "FACE_NEAREST",
161  ICON_SNAP_FACE_NEAREST,
162  "Face Nearest",
163  "Snap to nearest point on faces"},
164  {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"},
166  "EDGE_MIDPOINT",
167  ICON_SNAP_MIDPOINT,
168  "Edge Center",
169  "Snap to the middle of edges"},
171  "EDGE_PERPENDICULAR",
172  ICON_SNAP_PERPENDICULAR,
173  "Edge Perpendicular",
174  "Snap to the nearest point on an edge"},
175  {0, NULL, 0, NULL, NULL},
176 };
177 
179  {SCE_SNAP_MODE_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"},
180  {SCE_SNAP_MODE_NODE_X, "NODE_X", ICON_NODE_SIDE, "Node X", "Snap to left/right node border"},
181  {SCE_SNAP_MODE_NODE_Y, "NODE_Y", ICON_NODE_TOP, "Node Y", "Snap to top/bottom node border"},
183  "NODE_XY",
184  ICON_NODE_CORNER,
185  "Node X / Y",
186  "Snap to any node border"},
187  {0, NULL, 0, NULL, NULL},
188 };
189 
190 #ifndef RNA_RUNTIME
193  "INCREMENT",
194  ICON_SNAP_INCREMENT,
195  "Increment",
196  "Snap to increments of grid"},
197  {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
198  {0, NULL, 0, NULL, NULL},
199 };
200 
203  "OFF",
204  0,
205  "No Anti-Aliasing",
206  "Scene will be rendering without any anti-aliasing"},
208  "FXAA",
209  0,
210  "Single Pass Anti-Aliasing",
211  "Scene will be rendered using a single pass anti-aliasing method (FXAA)"},
213  "5",
214  0,
215  "5 Samples",
216  "Scene will be rendered using 5 anti-aliasing samples"},
218  "8",
219  0,
220  "8 Samples",
221  "Scene will be rendered using 8 anti-aliasing samples"},
223  "11",
224  0,
225  "11 Samples",
226  "Scene will be rendered using 11 anti-aliasing samples"},
228  "16",
229  0,
230  "16 Samples",
231  "Scene will be rendered using 16 anti-aliasing samples"},
233  "32",
234  0,
235  "32 Samples",
236  "Scene will be rendered using 32 anti-aliasing samples"},
237  {0, NULL, 0, NULL, NULL},
238 };
239 #endif
240 
243  "REFIT",
244  0,
245  "Refit",
246  "Incrementally refit the curve (high quality)"},
248  "SPLIT",
249  0,
250  "Split",
251  "Split the curve until the tolerance is met (fast)"},
252  {0, NULL, 0, NULL, NULL},
253 };
254 
255 /* workaround for duplicate enums,
256  * have each enum line as a define then conditionally set it or not
257  */
258 
259 #define R_IMF_ENUM_BMP \
260  {R_IMF_IMTYPE_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"},
261 #define R_IMF_ENUM_IRIS \
262  {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in SGI IRIS format"},
263 #define R_IMF_ENUM_PNG \
264  {R_IMF_IMTYPE_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"},
265 #define R_IMF_ENUM_JPEG \
266  {R_IMF_IMTYPE_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"},
267 #define R_IMF_ENUM_TAGA \
268  {R_IMF_IMTYPE_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"},
269 #define R_IMF_ENUM_TAGA_RAW \
270  {R_IMF_IMTYPE_RAWTGA, \
271  "TARGA_RAW", \
272  ICON_FILE_IMAGE, \
273  "Targa Raw", \
274  "Output image in uncompressed Targa format"},
275 
276 #if 0 /* UNUSED (so far) */
277 # ifdef WITH_DDS
278 # define R_IMF_ENUM_DDS \
279  {R_IMF_IMTYPE_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"},
280 # else
281 # define R_IMF_ENUM_DDS
282 # endif
283 #endif
284 
285 #ifdef WITH_OPENJPEG
286 # define R_IMF_ENUM_JPEG2K \
287  {R_IMF_IMTYPE_JP2, \
288  "JPEG2000", \
289  ICON_FILE_IMAGE, \
290  "JPEG 2000", \
291  "Output image in JPEG 2000 format"},
292 #else
293 # define R_IMF_ENUM_JPEG2K
294 #endif
295 
296 #ifdef WITH_CINEON
297 # define R_IMF_ENUM_CINEON \
298  {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"},
299 # define R_IMF_ENUM_DPX \
300  {R_IMF_IMTYPE_DPX, "DPX", ICON_FILE_IMAGE, "DPX", "Output image in DPX format"},
301 #else
302 # define R_IMF_ENUM_CINEON
303 # define R_IMF_ENUM_DPX
304 #endif
305 
306 #ifdef WITH_OPENEXR
307 # define R_IMF_ENUM_EXR_MULTILAYER \
308  {R_IMF_IMTYPE_MULTILAYER, \
309  "OPEN_EXR_MULTILAYER", \
310  ICON_FILE_IMAGE, \
311  "OpenEXR MultiLayer", \
312  "Output image in multilayer OpenEXR format"},
313 # define R_IMF_ENUM_EXR \
314  {R_IMF_IMTYPE_OPENEXR, \
315  "OPEN_EXR", \
316  ICON_FILE_IMAGE, \
317  "OpenEXR", \
318  "Output image in OpenEXR format"},
319 #else
320 # define R_IMF_ENUM_EXR_MULTILAYER
321 # define R_IMF_ENUM_EXR
322 #endif
323 
324 #ifdef WITH_HDR
325 # define R_IMF_ENUM_HDR \
326  {R_IMF_IMTYPE_RADHDR, \
327  "HDR", \
328  ICON_FILE_IMAGE, \
329  "Radiance HDR", \
330  "Output image in Radiance HDR format"},
331 #else
332 # define R_IMF_ENUM_HDR
333 #endif
334 
335 #ifdef WITH_TIFF
336 # define R_IMF_ENUM_TIFF \
337  {R_IMF_IMTYPE_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"},
338 #else
339 # define R_IMF_ENUM_TIFF
340 #endif
341 
342 #ifdef WITH_WEBP
343 # define R_IMF_ENUM_WEBP \
344  {R_IMF_IMTYPE_WEBP, "WEBP", ICON_FILE_IMAGE, "WebP", "Output image in WebP format"},
345 #else
346 # define R_IMF_ENUM_WEBP
347 #endif
348 
349 #define IMAGE_TYPE_ITEMS_IMAGE_ONLY \
350  R_IMF_ENUM_BMP \
351  /* DDS save not supported yet R_IMF_ENUM_DDS */ \
352  R_IMF_ENUM_IRIS \
353  R_IMF_ENUM_PNG \
354  R_IMF_ENUM_JPEG \
355  R_IMF_ENUM_JPEG2K \
356  R_IMF_ENUM_TAGA \
357  R_IMF_ENUM_TAGA_RAW \
358  RNA_ENUM_ITEM_SEPR_COLUMN, R_IMF_ENUM_CINEON R_IMF_ENUM_DPX R_IMF_ENUM_EXR_MULTILAYER \
359  R_IMF_ENUM_EXR R_IMF_ENUM_HDR R_IMF_ENUM_TIFF R_IMF_ENUM_WEBP
360 
361 #ifdef RNA_RUNTIME
362 static const EnumPropertyItem image_only_type_items[] = {
363 
365 
366  {0, NULL, 0, NULL, NULL},
367 };
368 #endif
369 
371  RNA_ENUM_ITEM_HEADING(N_("Image"), NULL),
372 
374 
375  RNA_ENUM_ITEM_HEADING(N_("Movie"), NULL),
377  "AVI_JPEG",
378  ICON_FILE_MOVIE,
379  "AVI JPEG",
380  "Output video in AVI JPEG format"},
381  {R_IMF_IMTYPE_AVIRAW, "AVI_RAW", ICON_FILE_MOVIE, "AVI Raw", "Output video in AVI Raw format"},
382 #ifdef WITH_FFMPEG
384  "FFMPEG",
385  ICON_FILE_MOVIE,
386  "FFmpeg Video",
387  "The most versatile way to output video files"},
388 #endif
389  {0, NULL, 0, NULL, NULL},
390 };
391 
394  "BW",
395  0,
396  "BW",
397  "Images get saved in 8-bit grayscale (only PNG, JPEG, TGA, TIF)"},
398  {R_IMF_PLANES_RGB, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
400  "RGBA",
401  0,
402  "RGBA",
403  "Images are saved with RGB and Alpha data (if supported)"},
404  {0, NULL, 0, NULL, NULL},
405 };
406 
407 #ifdef RNA_RUNTIME
408 # define IMAGE_COLOR_MODE_BW rna_enum_image_color_mode_items[0]
409 # define IMAGE_COLOR_MODE_RGB rna_enum_image_color_mode_items[1]
410 # define IMAGE_COLOR_MODE_RGBA rna_enum_image_color_mode_items[2]
411 #endif
412 
414  /* 1 (monochrome) not used */
415  {R_IMF_CHAN_DEPTH_8, "8", 0, "8", "8-bit color channels"},
416  {R_IMF_CHAN_DEPTH_10, "10", 0, "10", "10-bit color channels"},
417  {R_IMF_CHAN_DEPTH_12, "12", 0, "12", "12-bit color channels"},
418  {R_IMF_CHAN_DEPTH_16, "16", 0, "16", "16-bit color channels"},
419  /* 24 not used */
420  {R_IMF_CHAN_DEPTH_32, "32", 0, "32", "32-bit color channels"},
421  {0, NULL, 0, NULL, NULL},
422 };
423 
425  {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
426  {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
427  {0, NULL, 0, NULL, NULL},
428 };
429 
431  {R_BAKE_POSX, "POS_X", 0, "+X", ""},
432  {R_BAKE_POSY, "POS_Y", 0, "+Y", ""},
433  {R_BAKE_POSZ, "POS_Z", 0, "+Z", ""},
434  {R_BAKE_NEGX, "NEG_X", 0, "-X", ""},
435  {R_BAKE_NEGY, "NEG_Y", 0, "-Y", ""},
436  {R_BAKE_NEGZ, "NEG_Z", 0, "-Z", ""},
437  {0, NULL, 0, NULL, NULL},
438 };
439 
442  "ADJACENT_FACES",
443  0,
444  "Adjacent Faces",
445  "Use pixels from adjacent faces across UV seams"},
446  {R_BAKE_EXTEND, "EXTEND", 0, "Extend", "Extend border pixels outwards"},
447  {0, NULL, 0, NULL, NULL},
448 };
449 
452  "IMAGE_TEXTURES",
453  0,
454  "Image Textures",
455  "Bake to image data-blocks associated with active image texture nodes in materials"},
457  "VERTEX_COLORS",
458  0,
459  "Active Color Attribute",
460  "Bake to the active color attribute on meshes"},
461  {0, NULL, 0, NULL, NULL},
462 };
463 
466  "INTERNAL",
467  0,
468  "Internal",
469  "Save the baking map in an internal image data-block"},
470  {R_BAKE_SAVE_EXTERNAL, "EXTERNAL", 0, "External", "Save the baking map in an external file"},
471  {0, NULL, 0, NULL, NULL},
472 };
473 
474 #define R_IMF_VIEWS_ENUM_IND \
475  {R_IMF_VIEWS_INDIVIDUAL, \
476  "INDIVIDUAL", \
477  0, \
478  "Individual", \
479  "Individual files for each view with the prefix as defined by the scene views"},
480 #define R_IMF_VIEWS_ENUM_S3D \
481  {R_IMF_VIEWS_STEREO_3D, "STEREO_3D", 0, "Stereo 3D", "Single file with an encoded stereo pair"},
482 #define R_IMF_VIEWS_ENUM_MV \
483  {R_IMF_VIEWS_MULTIVIEW, "MULTIVIEW", 0, "Multi-View", "Single file with all the views"},
484 
487 };
488 
491 };
492 
495 };
496 
497 #undef R_IMF_VIEWS_ENUM_IND
498 #undef R_IMF_VIEWS_ENUM_S3D
499 #undef R_IMF_VIEWS_ENUM_MV
500 
503  "ANAGLYPH",
504  0,
505  "Anaglyph",
506  "Render views for left and right eyes as two differently filtered colors in a single image "
507  "(anaglyph glasses are required)"},
509  "INTERLACE",
510  0,
511  "Interlace",
512  "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
513  "required)"},
515  "TIMESEQUENTIAL",
516  0,
517  "Time Sequential",
518  "Render alternate eyes (also known as page flip, quad buffer support in the graphic card is "
519  "required)"},
521  "SIDEBYSIDE",
522  0,
523  "Side-by-Side",
524  "Render views for left and right eyes side-by-side"},
526  "TOPBOTTOM",
527  0,
528  "Top-Bottom",
529  "Render views for left and right eyes one above another"},
530  {0, NULL, 0, NULL, NULL},
531 };
532 
534  {S3D_ANAGLYPH_REDCYAN, "RED_CYAN", 0, "Red-Cyan", ""},
535  {S3D_ANAGLYPH_GREENMAGENTA, "GREEN_MAGENTA", 0, "Green-Magenta", ""},
536  {S3D_ANAGLYPH_YELLOWBLUE, "YELLOW_BLUE", 0, "Yellow-Blue", ""},
537  {0, NULL, 0, NULL, NULL},
538 };
539 
541  {S3D_INTERLACE_ROW, "ROW_INTERLEAVED", 0, "Row Interleaved", ""},
542  {S3D_INTERLACE_COLUMN, "COLUMN_INTERLEAVED", 0, "Column Interleaved", ""},
543  {S3D_INTERLACE_CHECKERBOARD, "CHECKERBOARD_INTERLEAVED", 0, "Checkerboard Interleaved", ""},
544  {0, NULL, 0, NULL, NULL},
545 };
546 
548  {R_BAKE_PASS_FILTER_NONE, "NONE", 0, "None", ""},
549  {R_BAKE_PASS_FILTER_EMIT, "EMIT", 0, "Emit", ""},
550  {R_BAKE_PASS_FILTER_DIRECT, "DIRECT", 0, "Direct", ""},
551  {R_BAKE_PASS_FILTER_INDIRECT, "INDIRECT", 0, "Indirect", ""},
552  {R_BAKE_PASS_FILTER_COLOR, "COLOR", 0, "Color", ""},
553  {R_BAKE_PASS_FILTER_DIFFUSE, "DIFFUSE", 0, "Diffuse", ""},
554  {R_BAKE_PASS_FILTER_GLOSSY, "GLOSSY", 0, "Glossy", ""},
555  {R_BAKE_PASS_FILTER_TRANSM, "TRANSMISSION", 0, "Transmission", ""},
556  {0, NULL, 0, NULL, NULL},
557 };
558 
560  {AOV_TYPE_COLOR, "COLOR", 0, "Color", ""},
561  {AOV_TYPE_VALUE, "VALUE", 0, "Value", ""},
562  {0, NULL, 0, NULL, NULL},
563 };
564 
567  "BOUNDING_BOX_CENTER",
568  ICON_PIVOT_BOUNDBOX,
569  "Bounding Box Center",
570  "Pivot around bounding box center of selected object(s)"},
571  {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
573  "INDIVIDUAL_ORIGINS",
574  ICON_PIVOT_INDIVIDUAL,
575  "Individual Origins",
576  "Pivot around each object's own origin"},
578  "MEDIAN_POINT",
579  ICON_PIVOT_MEDIAN,
580  "Median Point",
581  "Pivot around the median point of selected objects"},
583  "ACTIVE_ELEMENT",
584  ICON_PIVOT_ACTIVE,
585  "Active Element",
586  "Pivot around active object"},
587  {0, NULL, 0, NULL, NULL},
588 };
589 
590 /* Icons could be made a consistent set of images. */
593  "GLOBAL",
594  ICON_ORIENTATION_GLOBAL,
595  "Global",
596  "Align the transformation axes to world space"},
598  "LOCAL",
599  ICON_ORIENTATION_LOCAL,
600  "Local",
601  "Align the transformation axes to the selected objects' local space"},
603  "NORMAL",
604  ICON_ORIENTATION_NORMAL,
605  "Normal",
606  "Align the transformation axes to average normal of selected elements "
607  "(bone Y axis for pose mode)"},
609  "GIMBAL",
610  ICON_ORIENTATION_GIMBAL,
611  "Gimbal",
612  "Align each axis to the Euler rotation axis as used for input"},
614  "VIEW",
615  ICON_ORIENTATION_VIEW,
616  "View",
617  "Align the transformation axes to the window"},
619  "CURSOR",
620  ICON_ORIENTATION_CURSOR,
621  "Cursor",
622  "Align the transformation axes to the 3D cursor"},
623  // {V3D_ORIENT_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
624  {0, NULL, 0, NULL, NULL},
625 };
626 
627 #ifdef RNA_RUNTIME
628 
629 # include "BLI_string_utils.h"
630 
631 # include "DNA_anim_types.h"
632 # include "DNA_cachefile_types.h"
633 # include "DNA_color_types.h"
634 # include "DNA_mesh_types.h"
635 # include "DNA_node_types.h"
636 # include "DNA_object_types.h"
637 # include "DNA_text_types.h"
638 # include "DNA_workspace_types.h"
639 
640 # include "RNA_access.h"
641 
642 # include "MEM_guardedalloc.h"
643 
644 # include "BKE_animsys.h"
645 # include "BKE_brush.h"
646 # include "BKE_collection.h"
647 # include "BKE_colortools.h"
648 # include "BKE_context.h"
649 # include "BKE_freestyle.h"
650 # include "BKE_global.h"
651 # include "BKE_gpencil.h"
652 # include "BKE_idprop.h"
653 # include "BKE_image.h"
654 # include "BKE_image_format.h"
655 # include "BKE_layer.h"
656 # include "BKE_main.h"
657 # include "BKE_mesh.h"
658 # include "BKE_node.h"
659 # include "BKE_pointcache.h"
660 # include "BKE_scene.h"
661 # include "BKE_screen.h"
662 # include "BKE_unit.h"
663 
664 # include "NOD_composite.h"
665 
666 # include "ED_image.h"
667 # include "ED_info.h"
668 # include "ED_keyframing.h"
669 # include "ED_mesh.h"
670 # include "ED_node.h"
671 # include "ED_scene.h"
672 # include "ED_view3d.h"
673 
674 # include "DEG_depsgraph_build.h"
675 # include "DEG_depsgraph_query.h"
676 
677 # include "SEQ_relations.h"
678 # include "SEQ_sequencer.h"
679 # include "SEQ_sound.h"
680 
681 # ifdef WITH_FREESTYLE
682 # include "FRS_freestyle.h"
683 # endif
684 
685 static void rna_ToolSettings_snap_mode_set(struct PointerRNA *ptr, int value)
686 {
687  ToolSettings *ts = (ToolSettings *)ptr->data;
688  if (value != 0) {
689  ts->snap_mode = value;
690  }
691 }
692 
693 /* Grease Pencil update cache */
694 static void rna_GPencil_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr))
695 {
696  if (scene != NULL) {
698  }
699 }
700 
701 static void rna_Gpencil_extend_selection(bContext *C, PointerRNA *UNUSED(ptr))
702 {
703  /* Extend selection to all points in all selected strokes. */
704  ViewLayer *view_layer = CTX_data_view_layer(C);
705  Object *ob = OBACT(view_layer);
706  if ((ob) && (ob->type == OB_GPENCIL)) {
707  bGPdata *gpd = (bGPdata *)ob->data;
708  CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
709  if ((gps->flag & GP_STROKE_SELECT) && (gps->totpoints > 1)) {
710  bGPDspoint *pt;
711  for (int i = 0; i < gps->totpoints; i++) {
712  pt = &gps->points[i];
713  pt->flag |= GP_SPOINT_SELECT;
714  }
715  }
716  }
717  CTX_DATA_END;
718 
721  }
722 }
723 
724 static void rna_Gpencil_selectmode_update(bContext *C, PointerRNA *ptr)
725 {
726  ToolSettings *ts = (ToolSettings *)ptr->data;
727  /* If the mode is not Stroke, don't extend selection. */
729  return;
730  }
731 
732  rna_Gpencil_extend_selection(C, ptr);
733 }
734 
735 static void rna_Gpencil_mask_point_update(bContext *UNUSED(C), PointerRNA *ptr)
736 {
737  ToolSettings *ts = (ToolSettings *)ptr->data;
738 
741 }
742 
743 static void rna_Gpencil_mask_stroke_update(bContext *C, PointerRNA *ptr)
744 {
745  ToolSettings *ts = (ToolSettings *)ptr->data;
746 
749 
750  rna_Gpencil_extend_selection(C, ptr);
751 }
752 
753 static void rna_Gpencil_mask_segment_update(bContext *UNUSED(C), PointerRNA *ptr)
754 {
755  ToolSettings *ts = (ToolSettings *)ptr->data;
756 
759 }
760 
761 static void rna_Gpencil_vertex_mask_point_update(bContext *C, PointerRNA *ptr)
762 {
763  ToolSettings *ts = (ToolSettings *)ptr->data;
764 
767 
769 }
770 
771 static void rna_Gpencil_vertex_mask_stroke_update(bContext *C, PointerRNA *ptr)
772 {
773  ToolSettings *ts = (ToolSettings *)ptr->data;
774 
777 
778  rna_Gpencil_extend_selection(C, ptr);
779 
781 }
782 
783 static void rna_Gpencil_vertex_mask_segment_update(bContext *C, PointerRNA *ptr)
784 {
785  ToolSettings *ts = (ToolSettings *)ptr->data;
786 
789 
791 }
792 
793 /* Read-only Iterator of all the scene objects. */
794 
795 static void rna_Scene_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
796 {
797  Scene *scene = (Scene *)ptr->data;
798  iter->internal.custom = MEM_callocN(sizeof(BLI_Iterator), __func__);
799 
801  iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
802 }
803 
804 static void rna_Scene_objects_next(CollectionPropertyIterator *iter)
805 {
807  iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
808 }
809 
810 static void rna_Scene_objects_end(CollectionPropertyIterator *iter)
811 {
813  MEM_freeN(iter->internal.custom);
814 }
815 
816 static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
817 {
818  Object *ob = ((BLI_Iterator *)iter->internal.custom)->current;
819  return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ob);
820 }
821 
822 /* End of read-only Iterator of all the scene objects. */
823 
824 static void rna_Scene_set_set(PointerRNA *ptr,
825  PointerRNA value,
826  struct ReportList *UNUSED(reports))
827 {
828  Scene *scene = (Scene *)ptr->data;
829  Scene *set = (Scene *)value.data;
830  Scene *nested_set;
831 
832  for (nested_set = set; nested_set; nested_set = nested_set->set) {
833  if (nested_set == scene) {
834  return;
835  }
836  /* prevent eternal loops, set can point to next, and next to set, without problems usually */
837  if (nested_set->set == set) {
838  return;
839  }
840  }
841 
842  id_lib_extern((ID *)set);
843  scene->set = set;
844 }
845 
846 void rna_Scene_set_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
847 {
848  Scene *scene = (Scene *)ptr->owner_id;
849 
851  DEG_id_tag_update_ex(bmain, &scene->id, 0);
852  if (scene->set != NULL) {
853  /* Objects which are pulled into main scene's depsgraph needs to have
854  * their base flags updated.
855  */
856  DEG_id_tag_update_ex(bmain, &scene->set->id, 0);
857  }
858 }
859 
860 static void rna_Scene_camera_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr)
861 {
862  wmWindowManager *wm = bmain->wm.first;
863  Scene *scene = (Scene *)ptr->data;
864 
868 }
869 
870 static void rna_Scene_fps_update(Main *bmain, Scene *UNUSED(active_scene), PointerRNA *ptr)
871 {
872  Scene *scene = (Scene *)ptr->owner_id;
874  /* NOTE: Tag via dependency graph will take care of all the updates ion the evaluated domain,
875  * however, changes in FPS actually modifies an original skip length,
876  * so this we take care about here. */
878 }
879 
880 static void rna_Scene_listener_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
881 {
883 }
884 
885 static void rna_Scene_volume_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
886 {
887  Scene *scene = (Scene *)ptr->owner_id;
889 }
890 
891 static const char *rna_Scene_statistics_string_get(Scene *scene,
892  Main *bmain,
893  ReportList *reports,
894  ViewLayer *view_layer)
895 {
896  if (!BKE_scene_has_view_layer(scene, view_layer)) {
897  BKE_reportf(reports,
898  RPT_ERROR,
899  "View Layer '%s' not found in scene '%s'",
900  view_layer->name,
901  scene->id.name + 2);
902  return "";
903  }
904 
905  return ED_info_statistics_string(bmain, scene, view_layer);
906 }
907 
908 static void rna_Scene_framelen_update(Main *UNUSED(bmain),
909  Scene *UNUSED(active_scene),
910  PointerRNA *ptr)
911 {
912  Scene *scene = (Scene *)ptr->owner_id;
913  scene->r.framelen = (float)scene->r.framapto / (float)scene->r.images;
914 }
915 
916 static void rna_Scene_frame_current_set(PointerRNA *ptr, int value)
917 {
918  Scene *data = (Scene *)ptr->data;
919 
920  /* if negative frames aren't allowed, then we can't use them */
921  FRAMENUMBER_MIN_CLAMP(value);
922  data->r.cfra = value;
923 }
924 
925 static float rna_Scene_frame_float_get(PointerRNA *ptr)
926 {
927  Scene *data = (Scene *)ptr->data;
928  return (float)data->r.cfra + data->r.subframe;
929 }
930 
931 static void rna_Scene_frame_float_set(PointerRNA *ptr, float value)
932 {
933  Scene *data = (Scene *)ptr->data;
934  /* if negative frames aren't allowed, then we can't use them */
935  FRAMENUMBER_MIN_CLAMP(value);
936  data->r.cfra = (int)value;
937  data->r.subframe = value - data->r.cfra;
938 }
939 
940 static float rna_Scene_frame_current_final_get(PointerRNA *ptr)
941 {
942  Scene *scene = (Scene *)ptr->data;
943 
944  return BKE_scene_frame_to_ctime(scene, (float)scene->r.cfra);
945 }
946 
947 static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
948 {
949  Scene *data = (Scene *)ptr->data;
950  /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
951  CLAMP(value, MINFRAME, MAXFRAME);
952  data->r.sfra = value;
953 
954  if (value > data->r.efra) {
955  data->r.efra = MIN2(value, MAXFRAME);
956  }
957 }
958 
959 static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
960 {
961  Scene *data = (Scene *)ptr->data;
962  CLAMP(value, MINFRAME, MAXFRAME);
963  data->r.efra = value;
964 
965  if (data->r.sfra > value) {
966  data->r.sfra = MAX2(value, MINFRAME);
967  }
968 }
969 
970 static void rna_Scene_use_preview_range_set(PointerRNA *ptr, bool value)
971 {
972  Scene *data = (Scene *)ptr->data;
973 
974  if (value) {
975  /* copy range from scene if not set before */
976  if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
977  data->r.psfra = data->r.sfra;
978  data->r.pefra = data->r.efra;
979  }
980 
981  data->r.flag |= SCER_PRV_RANGE;
982  }
983  else {
984  data->r.flag &= ~SCER_PRV_RANGE;
985  }
986 }
987 
988 static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
989 {
990  Scene *data = (Scene *)ptr->data;
991 
992  /* check if enabled already */
993  if ((data->r.flag & SCER_PRV_RANGE) == 0) {
994  /* set end of preview range to end frame, then clamp as per normal */
995  /* TODO: or just refuse to set instead? */
996  data->r.pefra = data->r.efra;
997  }
998  CLAMP(value, MINAFRAME, MAXFRAME);
999  data->r.psfra = value;
1000 
1001  if (value > data->r.pefra) {
1002  data->r.pefra = MIN2(value, MAXFRAME);
1003  }
1004 }
1005 
1006 static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
1007 {
1008  Scene *data = (Scene *)ptr->data;
1009 
1010  /* check if enabled already */
1011  if ((data->r.flag & SCER_PRV_RANGE) == 0) {
1012  /* set start of preview range to start frame, then clamp as per normal */
1013  /* TODO: or just refuse to set instead? */
1014  data->r.psfra = data->r.sfra;
1015  }
1016  CLAMP(value, MINAFRAME, MAXFRAME);
1017  data->r.pefra = value;
1018 
1019  if (data->r.psfra > value) {
1020  data->r.psfra = MAX2(value, MINAFRAME);
1021  }
1022 }
1023 
1024 static void rna_Scene_show_subframe_update(Main *UNUSED(bmain),
1025  Scene *UNUSED(current_scene),
1026  PointerRNA *ptr)
1027 {
1028  Scene *scene = (Scene *)ptr->owner_id;
1029  scene->r.subframe = 0.0f;
1030 }
1031 
1032 static void rna_Scene_frame_update(Main *UNUSED(bmain),
1033  Scene *UNUSED(current_scene),
1034  PointerRNA *ptr)
1035 {
1036  Scene *scene = (Scene *)ptr->owner_id;
1039 }
1040 
1041 static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
1042 {
1043  Scene *scene = (Scene *)ptr->data;
1045 }
1046 
1047 static void rna_Scene_active_keying_set_set(PointerRNA *ptr,
1048  PointerRNA value,
1049  struct ReportList *UNUSED(reports))
1050 {
1051  Scene *scene = (Scene *)ptr->data;
1052  KeyingSet *ks = (KeyingSet *)value.data;
1053 
1055 }
1056 
1057 /* get KeyingSet index stuff for list of Keying Sets editing UI
1058  * - active_keyingset-1 since 0 is reserved for 'none'
1059  * - don't clamp, otherwise can never set builtin's types as active...
1060  */
1061 static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
1062 {
1063  Scene *scene = (Scene *)ptr->data;
1064  return scene->active_keyingset - 1;
1065 }
1066 
1067 /* get KeyingSet index stuff for list of Keying Sets editing UI
1068  * - value+1 since 0 is reserved for 'none'
1069  */
1070 static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
1071 {
1072  Scene *scene = (Scene *)ptr->data;
1073  scene->active_keyingset = value + 1;
1074 }
1075 
1076 /* XXX: evil... builtin_keyingsets is defined in keyingsets.c! */
1077 /* TODO: make API function to retrieve this... */
1079 
1080 static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1081 {
1082  Scene *scene = (Scene *)ptr->data;
1083 
1084  /* start going over the scene KeyingSets first, while we still have pointer to it
1085  * but only if we have any Keying Sets to use...
1086  */
1087  if (scene->keyingsets.first) {
1089  }
1090  else {
1092  }
1093 }
1094 
1095 static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
1096 {
1097  ListBaseIterator *internal = &iter->internal.listbase;
1098  KeyingSet *ks = (KeyingSet *)internal->link;
1099 
1100  /* If we've run out of links in Scene list,
1101  * jump over to the builtins list unless we're there already. */
1102  if ((ks->next == NULL) && (ks != builtin_keyingsets.last)) {
1103  internal->link = (Link *)builtin_keyingsets.first;
1104  }
1105  else {
1106  internal->link = (Link *)ks->next;
1107  }
1108 
1109  iter->valid = (internal->link != NULL);
1110 }
1111 
1112 static char *rna_SceneEEVEE_path(const PointerRNA *UNUSED(ptr))
1113 {
1114  return BLI_strdup("eevee");
1115 }
1116 
1117 static char *rna_SceneGpencil_path(const PointerRNA *UNUSED(ptr))
1118 {
1119  return BLI_strdup("grease_pencil_settings");
1120 }
1121 
1122 static int rna_RenderSettings_stereoViews_skip(CollectionPropertyIterator *iter,
1123  void *UNUSED(data))
1124 {
1125  ListBaseIterator *internal = &iter->internal.listbase;
1126  SceneRenderView *srv = (SceneRenderView *)internal->link;
1127 
1129  return 0;
1130  }
1131 
1132  return 1;
1133 };
1134 
1135 static void rna_RenderSettings_stereoViews_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1136 {
1137  RenderData *rd = (RenderData *)ptr->data;
1138  rna_iterator_listbase_begin(iter, &rd->views, rna_RenderSettings_stereoViews_skip);
1139 }
1140 
1141 static char *rna_RenderSettings_path(const PointerRNA *UNUSED(ptr))
1142 {
1143  return BLI_strdup("render");
1144 }
1145 
1146 static char *rna_BakeSettings_path(const PointerRNA *UNUSED(ptr))
1147 {
1148  return BLI_strdup("render.bake");
1149 }
1150 
1151 static char *rna_ImageFormatSettings_path(const PointerRNA *ptr)
1152 {
1154  ID *id = ptr->owner_id;
1155 
1156  switch (GS(id->name)) {
1157  case ID_SCE: {
1158  Scene *scene = (Scene *)id;
1159 
1160  if (&scene->r.im_format == imf) {
1161  return BLI_strdup("render.image_settings");
1162  }
1163  else if (&scene->r.bake.im_format == imf) {
1164  return BLI_strdup("render.bake.image_settings");
1165  }
1166  return BLI_strdup("..");
1167  }
1168  case ID_NT: {
1169  bNodeTree *ntree = (bNodeTree *)id;
1170  bNode *node;
1171 
1172  for (node = ntree->nodes.first; node; node = node->next) {
1173  if (node->type == CMP_NODE_OUTPUT_FILE) {
1174  if (&((NodeImageMultiFile *)node->storage)->format == imf) {
1175  return BLI_sprintfN("nodes['%s'].format", node->name);
1176  }
1177  else {
1178  bNodeSocket *sock;
1179 
1180  for (sock = node->inputs.first; sock; sock = sock->next) {
1181  NodeImageMultiFileSocket *sockdata = sock->storage;
1182  if (&sockdata->format == imf) {
1183  return BLI_sprintfN(
1184  "nodes['%s'].file_slots['%s'].format", node->name, sockdata->path);
1185  }
1186  }
1187  }
1188  }
1189  }
1190  return BLI_strdup("..");
1191  }
1192  default:
1193  return BLI_strdup("..");
1194  }
1195 }
1196 
1197 static int rna_RenderSettings_threads_get(PointerRNA *ptr)
1198 {
1199  RenderData *rd = (RenderData *)ptr->data;
1200  return BKE_render_num_threads(rd);
1201 }
1202 
1203 static int rna_RenderSettings_threads_mode_get(PointerRNA *ptr)
1204 {
1205  RenderData *rd = (RenderData *)ptr->data;
1206  int override = BLI_system_num_threads_override_get();
1207 
1208  if (override > 0) {
1209  return R_FIXED_THREADS;
1210  }
1211  else {
1212  return (rd->mode & R_FIXED_THREADS);
1213  }
1214 }
1215 
1216 static bool rna_RenderSettings_is_movie_format_get(PointerRNA *ptr)
1217 {
1218  RenderData *rd = (RenderData *)ptr->data;
1219  return BKE_imtype_is_movie(rd->im_format.imtype);
1220 }
1221 
1222 static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
1223 {
1225  ID *id = ptr->owner_id;
1226  imf->imtype = value;
1227 
1228  const bool is_render = (id && GS(id->name) == ID_SCE);
1229  /* see note below on why this is */
1230  const char chan_flag = BKE_imtype_valid_channels(imf->imtype, true) |
1231  (is_render ? IMA_CHAN_FLAG_BW : 0);
1232 
1233  /* ensure depth and color settings match */
1234  if (((imf->planes == R_IMF_PLANES_BW) && !(chan_flag & IMA_CHAN_FLAG_BW)) ||
1235  ((imf->planes == R_IMF_PLANES_RGBA) && !(chan_flag & IMA_CHAN_FLAG_ALPHA))) {
1236  imf->planes = R_IMF_PLANES_RGB;
1237  }
1238 
1239  /* ensure usable depth */
1240  {
1241  const int depth_ok = BKE_imtype_valid_depths(imf->imtype);
1242  if ((imf->depth & depth_ok) == 0) {
1243  /* set first available depth */
1244  char depth_ls[] = {
1252  0,
1253  };
1254  int i;
1255 
1256  for (i = 0; depth_ls[i]; i++) {
1257  if (depth_ok & depth_ls[i]) {
1258  imf->depth = depth_ls[i];
1259  break;
1260  }
1261  }
1262  }
1263  }
1264 
1265  if (id && GS(id->name) == ID_SCE) {
1266  Scene *scene = (Scene *)ptr->owner_id;
1267  RenderData *rd = &scene->r;
1268 # ifdef WITH_FFMPEG
1269  BKE_ffmpeg_image_type_verify(rd, imf);
1270 # endif
1271  (void)rd;
1272  }
1273 }
1274 
1275 static const EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf(bContext *UNUSED(C),
1276  PointerRNA *ptr,
1277  PropertyRNA *UNUSED(prop),
1278  bool *UNUSED(r_free))
1279 {
1280  ID *id = ptr->owner_id;
1281  if (id && GS(id->name) == ID_SCE) {
1283  }
1284  else {
1285  return image_only_type_items;
1286  }
1287 }
1288 
1289 static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext *UNUSED(C),
1290  PointerRNA *ptr,
1291  PropertyRNA *UNUSED(prop),
1292  bool *r_free)
1293 {
1295  ID *id = ptr->owner_id;
1296  const bool is_render = (id && GS(id->name) == ID_SCE);
1297 
1298  /* NOTE(campbell): we need to act differently for render
1299  * where 'BW' will force grayscale even if the output format writes
1300  * as RGBA, this is age old blender convention and not sure how useful
1301  * it really is but keep it for now. */
1302  char chan_flag = BKE_imtype_valid_channels(imf->imtype, true) |
1303  (is_render ? IMA_CHAN_FLAG_BW : 0);
1304 
1305 # ifdef WITH_FFMPEG
1306  /* a WAY more crappy case than B&W flag: depending on codec, file format MIGHT support
1307  * alpha channel. for example MPEG format with h264 codec can't do alpha channel, but
1308  * the same MPEG format with QTRLE codec can easily handle alpha channel.
1309  * not sure how to deal with such cases in a nicer way (sergey) */
1310  if (is_render) {
1311  Scene *scene = (Scene *)ptr->owner_id;
1312  RenderData *rd = &scene->r;
1313 
1314  if (BKE_ffmpeg_alpha_channel_is_supported(rd)) {
1315  chan_flag |= IMA_CHAN_FLAG_ALPHA;
1316  }
1317  }
1318 # endif
1319 
1320  if (chan_flag == (IMA_CHAN_FLAG_BW | IMA_CHAN_FLAG_RGB | IMA_CHAN_FLAG_ALPHA)) {
1322  }
1323  else {
1324  int totitem = 0;
1325  EnumPropertyItem *item = NULL;
1326 
1327  if (chan_flag & IMA_CHAN_FLAG_BW) {
1328  RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_BW);
1329  }
1330  if (chan_flag & IMA_CHAN_FLAG_RGB) {
1331  RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB);
1332  }
1333  if (chan_flag & IMA_CHAN_FLAG_ALPHA) {
1334  RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA);
1335  }
1336 
1337  RNA_enum_item_end(&item, &totitem);
1338  *r_free = true;
1339 
1340  return item;
1341  }
1342 }
1343 
1344 static const EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext *UNUSED(C),
1345  PointerRNA *ptr,
1346  PropertyRNA *UNUSED(prop),
1347  bool *r_free)
1348 {
1350 
1351  if (imf == NULL) {
1353  }
1354  else {
1355  const int depth_ok = BKE_imtype_valid_depths(imf->imtype);
1356  const int is_float = ELEM(
1358 
1359  const EnumPropertyItem *item_8bit = &rna_enum_image_color_depth_items[0];
1360  const EnumPropertyItem *item_10bit = &rna_enum_image_color_depth_items[1];
1361  const EnumPropertyItem *item_12bit = &rna_enum_image_color_depth_items[2];
1362  const EnumPropertyItem *item_16bit = &rna_enum_image_color_depth_items[3];
1363  const EnumPropertyItem *item_32bit = &rna_enum_image_color_depth_items[4];
1364 
1365  int totitem = 0;
1366  EnumPropertyItem *item = NULL;
1367  EnumPropertyItem tmp = {0, "", 0, "", ""};
1368 
1369  if (depth_ok & R_IMF_CHAN_DEPTH_8) {
1370  RNA_enum_item_add(&item, &totitem, item_8bit);
1371  }
1372 
1373  if (depth_ok & R_IMF_CHAN_DEPTH_10) {
1374  RNA_enum_item_add(&item, &totitem, item_10bit);
1375  }
1376 
1377  if (depth_ok & R_IMF_CHAN_DEPTH_12) {
1378  RNA_enum_item_add(&item, &totitem, item_12bit);
1379  }
1380 
1381  if (depth_ok & R_IMF_CHAN_DEPTH_16) {
1382  if (is_float) {
1383  tmp = *item_16bit;
1384  tmp.name = "Float (Half)";
1385  RNA_enum_item_add(&item, &totitem, &tmp);
1386  }
1387  else {
1388  RNA_enum_item_add(&item, &totitem, item_16bit);
1389  }
1390  }
1391 
1392  if (depth_ok & R_IMF_CHAN_DEPTH_32) {
1393  if (is_float) {
1394  tmp = *item_32bit;
1395  tmp.name = "Float (Full)";
1396  RNA_enum_item_add(&item, &totitem, &tmp);
1397  }
1398  else {
1399  RNA_enum_item_add(&item, &totitem, item_32bit);
1400  }
1401  }
1402 
1403  RNA_enum_item_end(&item, &totitem);
1404  *r_free = true;
1405 
1406  return item;
1407  }
1408 }
1409 
1410 static const EnumPropertyItem *rna_ImageFormatSettings_views_format_itemf(
1411  bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
1412 {
1414 
1415  if (imf == NULL) {
1417  }
1418  else if (imf->imtype == R_IMF_IMTYPE_OPENEXR) {
1420  }
1421  else if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) {
1423  }
1424  else {
1426  }
1427 }
1428 
1429 # ifdef WITH_OPENEXR
1430 /* OpenEXR */
1431 
1432 static const EnumPropertyItem *rna_ImageFormatSettings_exr_codec_itemf(bContext *UNUSED(C),
1433  PointerRNA *ptr,
1434  PropertyRNA *UNUSED(prop),
1435  bool *r_free)
1436 {
1438 
1439  EnumPropertyItem *item = NULL;
1440  int i = 1, totitem = 0;
1441 
1442  if (imf->depth == 16) {
1443  return rna_enum_exr_codec_items; /* All compression types are defined for half-float. */
1444  }
1445 
1446  for (i = 0; i < R_IMF_EXR_CODEC_MAX; i++) {
1448  continue; /* B44 and B44A are not defined for 32 bit floats */
1449  }
1450 
1451  RNA_enum_item_add(&item, &totitem, &rna_enum_exr_codec_items[i]);
1452  }
1453 
1454  RNA_enum_item_end(&item, &totitem);
1455  *r_free = true;
1456 
1457  return item;
1458 }
1459 
1460 # endif
1461 
1462 static bool rna_ImageFormatSettings_has_linear_colorspace_get(PointerRNA *ptr)
1463 {
1466 }
1467 
1468 static void rna_ImageFormatSettings_color_management_set(PointerRNA *ptr, int value)
1469 {
1471 
1472  if (imf->color_management != value) {
1473  imf->color_management = value;
1474 
1475  /* Copy from scene when enabling override. */
1477  ID *owner_id = ptr->owner_id;
1478  if (owner_id && GS(owner_id->name) == ID_NT) {
1479  /* For compositing nodes, find the corresponding scene. */
1480  const IDTypeInfo *type_info = BKE_idtype_get_info_from_id(owner_id);
1481  owner_id = type_info->owner_get(G_MAIN, owner_id, NULL);
1482  }
1483  if (owner_id && GS(owner_id->name) == ID_SCE) {
1485  }
1486  }
1487  }
1488 }
1489 
1490 static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
1491 {
1492  RenderData *rd = (RenderData *)ptr->data;
1493  char ext[8];
1494  ext[0] = '\0';
1496  return strlen(ext);
1497 }
1498 
1499 static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
1500 {
1501  RenderData *rd = (RenderData *)ptr->data;
1502  str[0] = '\0';
1504 }
1505 
1506 # ifdef WITH_FFMPEG
1507 static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, bool value)
1508 {
1509  Scene *scene = (Scene *)ptr->owner_id;
1510  RenderData *rd = &scene->r;
1511 
1512  if (value) {
1514  }
1515  else {
1517  }
1518 }
1519 # endif
1520 
1521 static int rna_RenderSettings_active_view_index_get(PointerRNA *ptr)
1522 {
1523  RenderData *rd = (RenderData *)ptr->data;
1524  return rd->actview;
1525 }
1526 
1527 static void rna_RenderSettings_active_view_index_set(PointerRNA *ptr, int value)
1528 {
1529  RenderData *rd = (RenderData *)ptr->data;
1530  rd->actview = value;
1531 }
1532 
1533 static void rna_RenderSettings_active_view_index_range(
1534  PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
1535 {
1536  RenderData *rd = (RenderData *)ptr->data;
1537 
1538  *min = 0;
1539  *max = max_ii(0, BLI_listbase_count(&rd->views) - 1);
1540 }
1541 
1542 static PointerRNA rna_RenderSettings_active_view_get(PointerRNA *ptr)
1543 {
1544  RenderData *rd = (RenderData *)ptr->data;
1545  SceneRenderView *srv = BLI_findlink(&rd->views, rd->actview);
1546 
1547  return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderView, srv);
1548 }
1549 
1550 static void rna_RenderSettings_active_view_set(PointerRNA *ptr,
1551  PointerRNA value,
1552  struct ReportList *UNUSED(reports))
1553 {
1554  RenderData *rd = (RenderData *)ptr->data;
1555  SceneRenderView *srv = (SceneRenderView *)value.data;
1556  const int index = BLI_findindex(&rd->views, srv);
1557  if (index != -1) {
1558  rd->actview = index;
1559  }
1560 }
1561 
1562 static SceneRenderView *rna_RenderView_new(ID *id, RenderData *UNUSED(rd), const char *name)
1563 {
1564  Scene *scene = (Scene *)id;
1566 
1568 
1569  return srv;
1570 }
1571 
1572 static void rna_RenderView_remove(
1573  ID *id, RenderData *UNUSED(rd), Main *UNUSED(bmain), ReportList *reports, PointerRNA *srv_ptr)
1574 {
1575  SceneRenderView *srv = srv_ptr->data;
1576  Scene *scene = (Scene *)id;
1577 
1578  if (!BKE_scene_remove_render_view(scene, srv)) {
1579  BKE_reportf(reports,
1580  RPT_ERROR,
1581  "Render view '%s' could not be removed from scene '%s'",
1582  srv->name,
1583  scene->id.name + 2);
1584  return;
1585  }
1586 
1587  RNA_POINTER_INVALIDATE(srv_ptr);
1588 
1590 }
1591 
1592 static void rna_RenderSettings_views_format_set(PointerRNA *ptr, int value)
1593 {
1594  RenderData *rd = (RenderData *)ptr->data;
1595 
1597  /* make sure the actview is visible */
1598  if (rd->actview > 1) {
1599  rd->actview = 1;
1600  }
1601  }
1602 
1603  rd->views_format = value;
1604 }
1605 
1606 static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
1607 {
1608  RenderData *rd = (RenderData *)ptr->data;
1610 
1611  if (type) {
1612  BLI_strncpy_utf8(rd->engine, type->idname, sizeof(rd->engine));
1614  }
1615 }
1616 
1617 static const EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *UNUSED(C),
1618  PointerRNA *UNUSED(ptr),
1619  PropertyRNA *UNUSED(prop),
1620  bool *r_free)
1621 {
1623  EnumPropertyItem *item = NULL;
1624  EnumPropertyItem tmp = {0, "", 0, "", ""};
1625  int a = 0, totitem = 0;
1626 
1627  for (type = R_engines.first; type; type = type->next, a++) {
1628  tmp.value = a;
1629  tmp.identifier = type->idname;
1630  tmp.name = type->name;
1631  RNA_enum_item_add(&item, &totitem, &tmp);
1632  }
1633 
1634  RNA_enum_item_end(&item, &totitem);
1635  *r_free = true;
1636 
1637  return item;
1638 }
1639 
1640 static int rna_RenderSettings_engine_get(PointerRNA *ptr)
1641 {
1642  RenderData *rd = (RenderData *)ptr->data;
1644  int a = 0;
1645 
1646  for (type = R_engines.first; type; type = type->next, a++) {
1647  if (STREQ(type->idname, rd->engine)) {
1648  return a;
1649  }
1650  }
1651 
1652  return 0;
1653 }
1654 
1655 static void rna_RenderSettings_engine_update(Main *bmain,
1656  Scene *UNUSED(unused),
1657  PointerRNA *UNUSED(ptr))
1658 {
1659  ED_render_engine_changed(bmain, true);
1660 }
1661 
1662 static void rna_Scene_update_render_engine(Main *bmain)
1663 {
1664  ED_render_engine_changed(bmain, true);
1665 }
1666 
1667 static bool rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
1668 {
1669  return (BLI_listbase_count(&R_engines) > 1);
1670 }
1671 
1672 static bool rna_RenderSettings_use_spherical_stereo_get(PointerRNA *ptr)
1673 {
1674  Scene *scene = (Scene *)ptr->owner_id;
1676 }
1677 
1679 {
1680  Scene *scene = (Scene *)ptr->owner_id;
1681 
1682  DEG_id_tag_update(&scene->id, 0);
1683 }
1684 
1685 static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1686 {
1687  Scene *screen = (Scene *)ptr->owner_id;
1688 
1689  rna_Scene_glsl_update(bmain, scene, ptr);
1691  DEG_relations_tag_update(bmain);
1692 }
1693 
1694 static void rna_Scene_mesh_quality_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
1695 {
1696  Scene *scene = (Scene *)ptr->owner_id;
1697 
1701  }
1702  }
1704 
1705  rna_Scene_glsl_update(bmain, scene, ptr);
1706 }
1707 
1709 {
1710  Scene *scene = (Scene *)ptr->owner_id;
1711 
1712  DEG_id_tag_update(&scene->id, 0);
1713 }
1714 
1715 void rna_Scene_use_freestyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1716 {
1717  Scene *scene = (Scene *)ptr->owner_id;
1718 
1719  DEG_id_tag_update(&scene->id, 0);
1720 
1721  if (scene->nodetree) {
1723  }
1724 }
1725 
1727  Scene *UNUSED(scene),
1728  PointerRNA *UNUSED(ptr))
1729 {
1730 # ifdef WITH_FREESTYLE
1732 # endif
1733 }
1734 
1735 void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value)
1736 {
1737  Scene *scene = (Scene *)ptr->owner_id;
1738  ViewLayer *view_layer = (ViewLayer *)ptr->data;
1740  BKE_view_layer_rename(G_MAIN, scene, view_layer, value);
1741 }
1742 
1743 static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value)
1744 {
1745  Scene *scene = (Scene *)ptr->owner_id;
1747  BLI_strncpy_utf8(rv->name, value, sizeof(rv->name));
1749  rv,
1750  DATA_("RenderView"),
1751  '.',
1752  offsetof(SceneRenderView, name),
1753  sizeof(rv->name));
1754 }
1755 
1757 {
1758  Scene *scene = (Scene *)ptr->owner_id;
1759  rna_Scene_glsl_update(bmain, scene, ptr);
1760  DEG_relations_tag_update(bmain);
1761 }
1762 
1763 void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
1764 {
1765  Scene *scene = (Scene *)ptr->owner_id;
1766 
1767  if (scene->nodetree) {
1769  }
1770 
1771  ViewLayer *view_layer = NULL;
1772  if (ptr->type == &RNA_ViewLayer) {
1773  view_layer = (ViewLayer *)ptr->data;
1774  }
1775  else if (ptr->type == &RNA_AOV) {
1776  ViewLayerAOV *aov = (ViewLayerAOV *)ptr->data;
1777  view_layer = BKE_view_layer_find_with_aov(scene, aov);
1778  }
1779  else if (ptr->type == &RNA_Lightgroup) {
1780  ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
1781  view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
1782  }
1783 
1784  if (view_layer) {
1785  RenderEngineType *engine_type = RE_engines_find(scene->r.engine);
1786  if (engine_type->update_render_passes) {
1787  RenderEngine *engine = RE_engine_create(engine_type);
1788  if (engine) {
1789  BKE_view_layer_verify_aov(engine, scene, view_layer);
1790  }
1791  RE_engine_free(engine);
1792  engine = NULL;
1793  }
1794  }
1795 
1796  rna_Scene_glsl_update(bmain, activescene, ptr);
1797 }
1798 
1799 static char *rna_ViewLayerEEVEE_path(const PointerRNA *ptr)
1800 {
1801  const ViewLayerEEVEE *view_layer_eevee = (ViewLayerEEVEE *)ptr->data;
1802  const ViewLayer *view_layer = (ViewLayer *)((uint8_t *)view_layer_eevee -
1803  offsetof(ViewLayer, eevee));
1804  char rna_path[sizeof(view_layer->name) * 3];
1805 
1806  const size_t view_layer_path_len = rna_ViewLayer_path_buffer_get(
1807  view_layer, rna_path, sizeof(rna_path));
1808 
1809  BLI_strncpy(rna_path + view_layer_path_len, ".eevee", sizeof(rna_path) - view_layer_path_len);
1810 
1811  return BLI_strdup(rna_path);
1812 }
1813 
1814 static char *rna_SceneRenderView_path(const PointerRNA *ptr)
1815 {
1816  const SceneRenderView *srv = (SceneRenderView *)ptr->data;
1817  char srv_name_esc[sizeof(srv->name) * 2];
1818  BLI_str_escape(srv_name_esc, srv->name, sizeof(srv_name_esc));
1819  return BLI_sprintfN("render.views[\"%s\"]", srv_name_esc);
1820 }
1821 
1822 static void rna_Scene_use_nodes_update(bContext *C, PointerRNA *ptr)
1823 {
1824  Scene *scene = (Scene *)ptr->data;
1825  if (scene->use_nodes && scene->nodetree == NULL) {
1827  }
1829 }
1830 
1831 static void rna_Physics_relations_update(Main *bmain,
1832  Scene *UNUSED(scene),
1833  PointerRNA *UNUSED(ptr))
1834 {
1835  DEG_relations_tag_update(bmain);
1836 }
1837 
1838 static void rna_Physics_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
1839 {
1840  Scene *scene = (Scene *)ptr->owner_id;
1843  }
1845 
1847 }
1848 
1849 static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const bool *value)
1850 {
1851  ToolSettings *ts = (ToolSettings *)ptr->data;
1852  int flag = (value[0] ? SCE_SELECT_VERTEX : 0) | (value[1] ? SCE_SELECT_EDGE : 0) |
1853  (value[2] ? SCE_SELECT_FACE : 0);
1854 
1855  if (flag) {
1856  ts->selectmode = flag;
1857 
1858  /* Update select mode in all the workspaces in mesh edit mode. */
1859  wmWindowManager *wm = G_MAIN->wm.first;
1860  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
1861  ViewLayer *view_layer = WM_window_get_active_view_layer(win);
1862 
1863  if (view_layer && view_layer->basact) {
1864  Mesh *me = BKE_mesh_from_object(view_layer->basact->object);
1865  if (me && me->edit_mesh && me->edit_mesh->selectmode != flag) {
1866  me->edit_mesh->selectmode = flag;
1868  }
1869  }
1870  }
1871  }
1872 }
1873 
1874 static void rna_Scene_editmesh_select_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
1875 {
1876  ViewLayer *view_layer = CTX_data_view_layer(C);
1877  Mesh *me = NULL;
1878 
1879  if (view_layer->basact) {
1880  me = BKE_mesh_from_object(view_layer->basact->object);
1881  if (me && me->edit_mesh == NULL) {
1882  me = NULL;
1883  }
1884  }
1885 
1886  if (me) {
1889  }
1890 }
1891 
1892 static void rna_Scene_uv_select_mode_update(bContext *C, PointerRNA *UNUSED(ptr))
1893 {
1894  /* Makes sure that the UV selection states are consistent with the current UV select mode and
1895  * sticky mode. */
1897 }
1898 
1899 static void object_simplify_update(Object *ob)
1900 {
1901  ModifierData *md;
1902  ParticleSystem *psys;
1903 
1904  if ((ob->id.tag & LIB_TAG_DOIT) == 0) {
1905  return;
1906  }
1907 
1908  ob->id.tag &= ~LIB_TAG_DOIT;
1909 
1910  for (md = ob->modifiers.first; md; md = md->next) {
1911  if (ELEM(md->type,
1916  }
1917  }
1918 
1919  for (psys = ob->particlesystem.first; psys; psys = psys->next) {
1920  psys->recalc |= ID_RECALC_PSYS_CHILD;
1921  }
1922 
1923  if (ob->instance_collection) {
1925  object_simplify_update(ob_collection);
1926  }
1928  }
1929 
1930  if (ob->type == OB_VOLUME) {
1932  }
1933 }
1934 
1935 static void rna_Scene_use_simplify_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
1936 {
1937  Scene *sce = (Scene *)ptr->owner_id;
1938  Scene *sce_iter;
1939  Base *base;
1940 
1942  FOREACH_SCENE_OBJECT_BEGIN (sce, ob) {
1943  object_simplify_update(ob);
1944  }
1946 
1947  for (SETLOOPER_SET_ONLY(sce, sce_iter, base)) {
1948  object_simplify_update(base->object);
1949  }
1950 
1953  DEG_id_tag_update(&sce->id, 0);
1954 }
1955 
1956 static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1957 {
1958  Scene *sce = (Scene *)ptr->owner_id;
1959 
1960  if (sce->r.mode & R_SIMPLIFY) {
1961  rna_Scene_use_simplify_update(bmain, scene, ptr);
1962  }
1963 }
1964 
1965 static void rna_Scene_use_persistent_data_update(Main *UNUSED(bmain),
1966  Scene *UNUSED(scene),
1967  PointerRNA *ptr)
1968 {
1969  Scene *scene = (Scene *)ptr->owner_id;
1970 
1971  if (!(scene->r.mode & R_PERSISTENT_DATA)) {
1973  }
1974 }
1975 
1976 /* Scene.transform_orientation_slots */
1977 static void rna_Scene_transform_orientation_slots_begin(CollectionPropertyIterator *iter,
1978  PointerRNA *ptr)
1979 {
1980  Scene *scene = (Scene *)ptr->owner_id;
1981  TransformOrientationSlot *orient_slot = &scene->orientation_slots[0];
1983  iter, orient_slot, sizeof(*orient_slot), ARRAY_SIZE(scene->orientation_slots), 0, NULL);
1984 }
1985 
1986 static int rna_Scene_transform_orientation_slots_length(PointerRNA *UNUSED(ptr))
1987 {
1988  return ARRAY_SIZE(((Scene *)NULL)->orientation_slots);
1989 }
1990 
1991 static bool rna_Scene_use_audio_get(PointerRNA *ptr)
1992 {
1993  Scene *scene = (Scene *)ptr->data;
1994  return (scene->audio.flag & AUDIO_MUTE) != 0;
1995 }
1996 
1997 static void rna_Scene_use_audio_set(PointerRNA *ptr, bool value)
1998 {
1999  Scene *scene = (Scene *)ptr->data;
2000 
2001  if (value) {
2002  scene->audio.flag |= AUDIO_MUTE;
2003  }
2004  else {
2005  scene->audio.flag &= ~AUDIO_MUTE;
2006  }
2007 }
2008 
2009 static void rna_Scene_use_audio_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
2010 {
2012 }
2013 
2014 static int rna_Scene_sync_mode_get(PointerRNA *ptr)
2015 {
2016  Scene *scene = (Scene *)ptr->data;
2017  if (scene->audio.flag & AUDIO_SYNC) {
2018  return AUDIO_SYNC;
2019  }
2020  return scene->flag & SCE_FRAME_DROP;
2021 }
2022 
2023 static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
2024 {
2025  Scene *scene = (Scene *)ptr->data;
2026 
2027  if (value == AUDIO_SYNC) {
2028  scene->audio.flag |= AUDIO_SYNC;
2029  }
2030  else if (value == SCE_FRAME_DROP) {
2031  scene->audio.flag &= ~AUDIO_SYNC;
2033  }
2034  else {
2035  scene->audio.flag &= ~AUDIO_SYNC;
2036  scene->flag &= ~SCE_FRAME_DROP;
2037  }
2038 }
2039 
2040 static void rna_View3DCursor_rotation_mode_set(PointerRNA *ptr, int value)
2041 {
2042  View3DCursor *cursor = ptr->data;
2043 
2044  /* use API Method for conversions... */
2046  cursor->rotation_euler,
2047  cursor->rotation_axis,
2048  &cursor->rotation_angle,
2049  cursor->rotation_mode,
2050  (short)value);
2051 
2052  /* finally, set the new rotation type */
2053  cursor->rotation_mode = value;
2054 }
2055 
2056 static void rna_View3DCursor_rotation_axis_angle_get(PointerRNA *ptr, float *value)
2057 {
2058  View3DCursor *cursor = ptr->data;
2059  value[0] = cursor->rotation_angle;
2060  copy_v3_v3(&value[1], cursor->rotation_axis);
2061 }
2062 
2063 static void rna_View3DCursor_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
2064 {
2065  View3DCursor *cursor = ptr->data;
2066  cursor->rotation_angle = value[0];
2067  copy_v3_v3(cursor->rotation_axis, &value[1]);
2068 }
2069 
2070 static void rna_View3DCursor_matrix_get(PointerRNA *ptr, float *values)
2071 {
2072  const View3DCursor *cursor = ptr->data;
2073  BKE_scene_cursor_to_mat4(cursor, (float(*)[4])values);
2074 }
2075 
2076 static void rna_View3DCursor_matrix_set(PointerRNA *ptr, const float *values)
2077 {
2078  View3DCursor *cursor = ptr->data;
2079  float unit_mat[4][4];
2080  normalize_m4_m4(unit_mat, (const float(*)[4])values);
2081  BKE_scene_cursor_from_mat4(cursor, unit_mat, false);
2082 }
2083 
2084 static char *rna_TransformOrientationSlot_path(const PointerRNA *ptr)
2085 {
2086  const Scene *scene = (Scene *)ptr->owner_id;
2087  const TransformOrientationSlot *orientation_slot = ptr->data;
2088 
2089  if (!ELEM(NULL, scene, orientation_slot)) {
2090  for (int i = 0; i < ARRAY_SIZE(scene->orientation_slots); i++) {
2091  if (&scene->orientation_slots[i] == orientation_slot) {
2092  return BLI_sprintfN("transform_orientation_slots[%d]", i);
2093  }
2094  }
2095  }
2096 
2097  /* Should not happen, but in case, just return default path. */
2099  return BLI_strdup("transform_orientation_slots[0]");
2100 }
2101 
2102 static char *rna_View3DCursor_path(const PointerRNA *UNUSED(ptr))
2103 {
2104  return BLI_strdup("cursor");
2105 }
2106 
2107 static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[], int frame)
2108 {
2109  TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
2110  marker->flag = SELECT;
2111  marker->frame = frame;
2112  BLI_strncpy_utf8(marker->name, name, sizeof(marker->name));
2113  BLI_addtail(&scene->markers, marker);
2114 
2117 
2118  return marker;
2119 }
2120 
2121 static void rna_TimeLine_remove(Scene *scene, ReportList *reports, PointerRNA *marker_ptr)
2122 {
2123  TimeMarker *marker = marker_ptr->data;
2124  if (BLI_remlink_safe(&scene->markers, marker) == false) {
2125  BKE_reportf(reports,
2126  RPT_ERROR,
2127  "Timeline marker '%s' not found in scene '%s'",
2128  marker->name,
2129  scene->id.name + 2);
2130  return;
2131  }
2132 
2133  MEM_freeN(marker);
2134  RNA_POINTER_INVALIDATE(marker_ptr);
2135 
2138 }
2139 
2140 static void rna_TimeLine_clear(Scene *scene)
2141 {
2143 
2146 }
2147 
2148 static KeyingSet *rna_Scene_keying_set_new(Scene *sce,
2149  ReportList *reports,
2150  const char idname[],
2151  const char name[])
2152 {
2153  KeyingSet *ks = NULL;
2154 
2155  /* call the API func, and set the active keyingset index */
2156  ks = BKE_keyingset_add(&sce->keyingsets, idname, name, KEYINGSET_ABSOLUTE, 0);
2157 
2158  if (ks) {
2160  return ks;
2161  }
2162  else {
2163  BKE_report(reports, RPT_ERROR, "Keying set could not be added");
2164  return NULL;
2165  }
2166 }
2167 
2168 static void rna_UnifiedPaintSettings_update(bContext *C, PointerRNA *UNUSED(ptr))
2169 {
2171  ViewLayer *view_layer = CTX_data_view_layer(C);
2172  Brush *br = BKE_paint_brush(BKE_paint_get_active(scene, view_layer));
2174 }
2175 
2176 static void rna_UnifiedPaintSettings_size_set(PointerRNA *ptr, int value)
2177 {
2178  UnifiedPaintSettings *ups = ptr->data;
2179 
2180  /* scale unprojected radius so it stays consistent with brush size */
2182  ups->size = value;
2183 }
2184 
2185 static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, float value)
2186 {
2187  UnifiedPaintSettings *ups = ptr->data;
2188 
2189  /* scale brush size so it stays consistent with unprojected_radius */
2190  BKE_brush_scale_size(&ups->size, value, ups->unprojected_radius);
2191  ups->unprojected_radius = value;
2192 }
2193 
2194 static void rna_UnifiedPaintSettings_radius_update(bContext *C, PointerRNA *ptr)
2195 {
2196  /* changing the unified size should invalidate the overlay but also update the brush */
2198  rna_UnifiedPaintSettings_update(C, ptr);
2199 }
2200 
2201 static char *rna_UnifiedPaintSettings_path(const PointerRNA *UNUSED(ptr))
2202 {
2203  return BLI_strdup("tool_settings.unified_paint_settings");
2204 }
2205 
2206 static char *rna_CurvePaintSettings_path(const PointerRNA *UNUSED(ptr))
2207 {
2208  return BLI_strdup("tool_settings.curve_paint_settings");
2209 }
2210 
2211 static char *rna_SequencerToolSettings_path(const PointerRNA *UNUSED(ptr))
2212 {
2213  return BLI_strdup("tool_settings.sequencer_tool_settings");
2214 }
2215 
2216 /* generic function to recalc geometry */
2217 static void rna_EditMesh_update(bContext *C, PointerRNA *UNUSED(ptr))
2218 {
2219  ViewLayer *view_layer = CTX_data_view_layer(C);
2220  Mesh *me = NULL;
2221 
2222  if (view_layer->basact) {
2223  me = BKE_mesh_from_object(view_layer->basact->object);
2224  if (me && me->edit_mesh == NULL) {
2225  me = NULL;
2226  }
2227  }
2228 
2229  if (me) {
2232  }
2233 }
2234 
2235 static char *rna_MeshStatVis_path(const PointerRNA *UNUSED(ptr))
2236 {
2237  return BLI_strdup("tool_settings.statvis");
2238 }
2239 
2240 /* NOTE: without this, when Multi-Paint is activated/deactivated, the colors
2241  * will not change right away when multiple bones are selected, this function
2242  * is not for general use and only for the few cases where changing scene
2243  * settings and NOT for general purpose updates, possibly this should be
2244  * given its own notifier. */
2245 static void rna_Scene_update_active_object_data(bContext *C, PointerRNA *UNUSED(ptr))
2246 {
2247  ViewLayer *view_layer = CTX_data_view_layer(C);
2248  Object *ob = OBACT(view_layer);
2249 
2250  if (ob) {
2253  }
2254 }
2255 
2256 static void rna_SceneCamera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
2257 {
2258  Scene *scene = (Scene *)ptr->owner_id;
2259  Object *camera = scene->camera;
2260 
2262 
2263  if (camera && (camera->type == OB_CAMERA)) {
2265  }
2266 }
2267 
2268 static void rna_SceneSequencer_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
2269 {
2271 }
2272 
2273 static char *rna_ToolSettings_path(const PointerRNA *UNUSED(ptr))
2274 {
2275  return BLI_strdup("tool_settings");
2276 }
2277 
2279 {
2280  FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
2281 
2282  return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineStyle, lineset->linestyle);
2283 }
2284 
2286  PointerRNA value,
2287  struct ReportList *UNUSED(reports))
2288 {
2289  FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
2290 
2291  if (lineset->linestyle) {
2292  id_us_min(&lineset->linestyle->id);
2293  }
2294  lineset->linestyle = (FreestyleLineStyle *)value.data;
2295  id_us_plus(&lineset->linestyle->id);
2296 }
2297 
2299  FreestyleSettings *config,
2300  Main *bmain,
2301  const char *name)
2302 {
2303  Scene *scene = (Scene *)id;
2304  FreestyleLineSet *lineset = BKE_freestyle_lineset_add(bmain, (FreestyleConfig *)config, name);
2305 
2306  DEG_id_tag_update(&scene->id, 0);
2308 
2309  return lineset;
2310 }
2311 
2313  FreestyleSettings *config,
2314  ReportList *reports,
2315  PointerRNA *lineset_ptr)
2316 {
2317  FreestyleLineSet *lineset = lineset_ptr->data;
2318  Scene *scene = (Scene *)id;
2319 
2320  if (!BKE_freestyle_lineset_delete((FreestyleConfig *)config, lineset)) {
2321  BKE_reportf(reports, RPT_ERROR, "Line set '%s' could not be removed", lineset->name);
2322  return;
2323  }
2324 
2325  RNA_POINTER_INVALIDATE(lineset_ptr);
2326 
2327  DEG_id_tag_update(&scene->id, 0);
2329 }
2330 
2332 {
2333  FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2335  return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineSet, lineset);
2336 }
2337 
2339  PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
2340 {
2341  FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2342 
2343  *min = 0;
2344  *max = max_ii(0, BLI_listbase_count(&config->linesets) - 1);
2345 }
2346 
2348 {
2349  FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2351 }
2352 
2354 {
2355  FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2357 }
2358 
2360 {
2361  Scene *scene = (Scene *)id;
2363 
2364  DEG_id_tag_update(&scene->id, 0);
2366 
2367  return module;
2368 }
2369 
2371  FreestyleSettings *config,
2372  ReportList *reports,
2373  PointerRNA *module_ptr)
2374 {
2375  Scene *scene = (Scene *)id;
2376  FreestyleModuleConfig *module = module_ptr->data;
2377 
2379  if (module->script) {
2380  BKE_reportf(reports,
2381  RPT_ERROR,
2382  "Style module '%s' could not be removed",
2383  module->script->id.name + 2);
2384  }
2385  else {
2386  BKE_report(reports, RPT_ERROR, "Style module could not be removed");
2387  }
2388  return;
2389  }
2390 
2391  RNA_POINTER_INVALIDATE(module_ptr);
2392 
2393  DEG_id_tag_update(&scene->id, 0);
2395 }
2396 
2397 static void rna_Stereo3dFormat_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
2398 {
2399  ID *id = ptr->owner_id;
2400 
2401  if (id && GS(id->name) == ID_IM) {
2402  Image *ima = (Image *)id;
2403  ImBuf *ibuf;
2404  void *lock;
2405 
2406  if (!BKE_image_is_stereo(ima)) {
2407  return;
2408  }
2409 
2410  ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
2411 
2412  if (ibuf) {
2413  BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_FREE);
2414  }
2415  BKE_image_release_ibuf(ima, ibuf, lock);
2416  }
2417 }
2418 
2419 static ViewLayer *rna_ViewLayer_new(ID *id, Scene *UNUSED(sce), Main *bmain, const char *name)
2420 {
2421  Scene *scene = (Scene *)id;
2422  ViewLayer *view_layer = BKE_view_layer_add(scene, name, NULL, VIEWLAYER_ADD_NEW);
2423 
2424  DEG_id_tag_update(&scene->id, 0);
2425  DEG_relations_tag_update(bmain);
2427 
2428  return view_layer;
2429 }
2430 
2431 static void rna_ViewLayer_remove(
2432  ID *id, Scene *UNUSED(sce), Main *bmain, ReportList *reports, PointerRNA *sl_ptr)
2433 {
2434  Scene *scene = (Scene *)id;
2435  ViewLayer *view_layer = sl_ptr->data;
2436 
2437  if (ED_scene_view_layer_delete(bmain, scene, view_layer, reports)) {
2438  RNA_POINTER_INVALIDATE(sl_ptr);
2439  }
2440 }
2441 
2443  PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
2444 {
2445  ViewLayer *view_layer = (ViewLayer *)ptr->data;
2446 
2447  *min = 0;
2448  *max = max_ii(0, BLI_listbase_count(&view_layer->aovs) - 1);
2449 }
2450 
2452 {
2453  ViewLayer *view_layer = (ViewLayer *)ptr->data;
2454  return BLI_findindex(&view_layer->aovs, view_layer->active_aov);
2455 }
2456 
2458 {
2459  ViewLayer *view_layer = (ViewLayer *)ptr->data;
2460  ViewLayerAOV *aov = BLI_findlink(&view_layer->aovs, value);
2461  view_layer->active_aov = aov;
2462 }
2463 
2465  PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
2466 {
2467  ViewLayer *view_layer = (ViewLayer *)ptr->data;
2468 
2469  *min = 0;
2470  *max = max_ii(0, BLI_listbase_count(&view_layer->lightgroups) - 1);
2471 }
2472 
2474 {
2475  ViewLayer *view_layer = (ViewLayer *)ptr->data;
2476  return BLI_findindex(&view_layer->lightgroups, view_layer->active_lightgroup);
2477 }
2478 
2480 {
2481  ViewLayer *view_layer = (ViewLayer *)ptr->data;
2482  ViewLayerLightgroup *lightgroup = BLI_findlink(&view_layer->lightgroups, value);
2483  view_layer->active_lightgroup = lightgroup;
2484 }
2485 
2486 static void rna_ViewLayerLightgroup_name_get(PointerRNA *ptr, char *value)
2487 {
2488  ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
2489  BLI_strncpy(value, lightgroup->name, sizeof(lightgroup->name));
2490 }
2491 
2492 static int rna_ViewLayerLightgroup_name_length(PointerRNA *ptr)
2493 {
2494  ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
2495  return strlen(lightgroup->name);
2496 }
2497 
2498 static void rna_ViewLayerLightgroup_name_set(PointerRNA *ptr, const char *value)
2499 {
2500  ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
2501  Scene *scene = (Scene *)ptr->owner_id;
2502  ViewLayer *view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
2503 
2504  BKE_view_layer_rename_lightgroup(scene, view_layer, lightgroup, value);
2505 }
2506 
2507 /* Fake value, used internally (not saved to DNA). */
2508 # define V3D_ORIENT_DEFAULT -1
2509 
2510 static int rna_TransformOrientationSlot_type_get(PointerRNA *ptr)
2511 {
2512  Scene *scene = (Scene *)ptr->owner_id;
2513  TransformOrientationSlot *orient_slot = ptr->data;
2514  if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2515  if ((orient_slot->flag & SELECT) == 0) {
2516  return V3D_ORIENT_DEFAULT;
2517  }
2518  }
2519  return BKE_scene_orientation_slot_get_index(orient_slot);
2520 }
2521 
2522 void rna_TransformOrientationSlot_type_set(PointerRNA *ptr, int value)
2523 {
2524  Scene *scene = (Scene *)ptr->owner_id;
2525  TransformOrientationSlot *orient_slot = ptr->data;
2526 
2527  if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2528  if (value == V3D_ORIENT_DEFAULT) {
2529  orient_slot->flag &= ~SELECT;
2530  return;
2531  }
2532  else {
2533  orient_slot->flag |= SELECT;
2534  }
2535  }
2536 
2537  BKE_scene_orientation_slot_set_index(orient_slot, value);
2538 }
2539 
2540 static PointerRNA rna_TransformOrientationSlot_get(PointerRNA *ptr)
2541 {
2542  Scene *scene = (Scene *)ptr->owner_id;
2543  TransformOrientationSlot *orient_slot = ptr->data;
2544  TransformOrientation *orientation;
2545  if (orient_slot->type < V3D_ORIENT_CUSTOM) {
2546  orientation = NULL;
2547  }
2548  else {
2549  orientation = BKE_scene_transform_orientation_find(scene, orient_slot->index_custom);
2550  }
2551  return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, orientation);
2552 }
2553 
2554 static const EnumPropertyItem *rna_TransformOrientation_impl_itemf(Scene *scene,
2555  const bool include_default,
2556  bool *r_free)
2557 {
2558  EnumPropertyItem tmp = {0, "", 0, "", ""};
2559  EnumPropertyItem *item = NULL;
2560  int i = V3D_ORIENT_CUSTOM, totitem = 0;
2561 
2562  if (include_default) {
2563  tmp.identifier = "DEFAULT";
2564  tmp.name = "Default";
2565  tmp.description = "Use the scene orientation";
2566  tmp.value = V3D_ORIENT_DEFAULT;
2567  tmp.icon = ICON_OBJECT_ORIGIN;
2568  RNA_enum_item_add(&item, &totitem, &tmp);
2569  tmp.icon = 0;
2570 
2571  RNA_enum_item_add_separator(&item, &totitem);
2572  }
2573 
2575 
2576  const ListBase *transform_orientations = scene ? &scene->transform_spaces : NULL;
2577 
2578  if (transform_orientations && (BLI_listbase_is_empty(transform_orientations) == false)) {
2579  RNA_enum_item_add_separator(&item, &totitem);
2580 
2581  LISTBASE_FOREACH (TransformOrientation *, ts, transform_orientations) {
2582  tmp.identifier = ts->name;
2583  tmp.name = ts->name;
2584  tmp.value = i++;
2585  RNA_enum_item_add(&item, &totitem, &tmp);
2586  }
2587  }
2588 
2589  RNA_enum_item_end(&item, &totitem);
2590  *r_free = true;
2591 
2592  return item;
2593 }
2595  PointerRNA *ptr,
2596  PropertyRNA *UNUSED(prop),
2597  bool *r_free)
2598 {
2599  if (C == NULL) {
2601  }
2602 
2603  Scene *scene;
2604  if (ptr->owner_id && (GS(ptr->owner_id->name) == ID_SCE)) {
2605  scene = (Scene *)ptr->owner_id;
2606  }
2607  else {
2608  scene = CTX_data_scene(C);
2609  }
2610  return rna_TransformOrientation_impl_itemf(scene, false, r_free);
2611 }
2612 
2613 const EnumPropertyItem *rna_TransformOrientation_with_scene_itemf(bContext *C,
2614  PointerRNA *ptr,
2615  PropertyRNA *UNUSED(prop),
2616  bool *r_free)
2617 {
2618  if (C == NULL) {
2620  }
2621 
2622  Scene *scene = (Scene *)ptr->owner_id;
2623  TransformOrientationSlot *orient_slot = ptr->data;
2624  bool include_default = (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]);
2625  return rna_TransformOrientation_impl_itemf(scene, include_default, r_free);
2626 }
2627 
2628 # undef V3D_ORIENT_DEFAULT
2629 
2630 static const EnumPropertyItem *rna_UnitSettings_itemf_wrapper(const int system,
2631  const int type,
2632  bool *r_free)
2633 {
2634  const void *usys;
2635  int len;
2636  BKE_unit_system_get(system, type, &usys, &len);
2637 
2638  EnumPropertyItem *items = NULL;
2639  int totitem = 0;
2640 
2641  EnumPropertyItem adaptive = {0};
2642  adaptive.identifier = "ADAPTIVE";
2643  adaptive.name = N_("Adaptive");
2644  adaptive.value = USER_UNIT_ADAPTIVE;
2645  RNA_enum_item_add(&items, &totitem, &adaptive);
2646 
2647  for (int i = 0; i < len; i++) {
2648  if (!BKE_unit_is_suppressed(usys, i)) {
2649  EnumPropertyItem tmp = {0};
2650  tmp.identifier = BKE_unit_identifier_get(usys, i);
2651  tmp.name = BKE_unit_display_name_get(usys, i);
2652  tmp.value = i;
2653  RNA_enum_item_add(&items, &totitem, &tmp);
2654  }
2655  }
2656 
2657  RNA_enum_item_end(&items, &totitem);
2658  *r_free = true;
2659 
2660  return items;
2661 }
2662 
2663 const EnumPropertyItem *rna_UnitSettings_length_unit_itemf(bContext *UNUSED(C),
2664  PointerRNA *ptr,
2665  PropertyRNA *UNUSED(prop),
2666  bool *r_free)
2667 {
2668  UnitSettings *units = ptr->data;
2669  return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_LENGTH, r_free);
2670 }
2671 
2672 const EnumPropertyItem *rna_UnitSettings_mass_unit_itemf(bContext *UNUSED(C),
2673  PointerRNA *ptr,
2674  PropertyRNA *UNUSED(prop),
2675  bool *r_free)
2676 {
2677  UnitSettings *units = ptr->data;
2678  return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_MASS, r_free);
2679 }
2680 
2681 const EnumPropertyItem *rna_UnitSettings_time_unit_itemf(bContext *UNUSED(C),
2682  PointerRNA *ptr,
2683  PropertyRNA *UNUSED(prop),
2684  bool *r_free)
2685 {
2686  UnitSettings *units = ptr->data;
2687  return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TIME, r_free);
2688 }
2689 
2690 const EnumPropertyItem *rna_UnitSettings_temperature_unit_itemf(bContext *UNUSED(C),
2691  PointerRNA *ptr,
2692  PropertyRNA *UNUSED(prop),
2693  bool *r_free)
2694 {
2695  UnitSettings *units = ptr->data;
2696  return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TEMPERATURE, r_free);
2697 }
2698 
2699 static void rna_UnitSettings_system_update(Main *UNUSED(bmain),
2700  Scene *scene,
2701  PointerRNA *UNUSED(ptr))
2702 {
2703  UnitSettings *unit = &scene->unit;
2704  if (unit->system == USER_UNIT_NONE) {
2706  unit->mass_unit = USER_UNIT_ADAPTIVE;
2707  }
2708  else {
2711  }
2712 }
2713 
2714 static char *rna_UnitSettings_path(const PointerRNA *UNUSED(ptr))
2715 {
2716  return BLI_strdup("unit_settings");
2717 }
2718 
2719 static char *rna_FFmpegSettings_path(const PointerRNA *UNUSED(ptr))
2720 {
2721  return BLI_strdup("render.ffmpeg");
2722 }
2723 
2724 # ifdef WITH_FFMPEG
2725 /* FFMpeg Codec setting update hook. */
2726 static void rna_FFmpegSettings_codec_update(Main *UNUSED(bmain),
2727  Scene *UNUSED(scene),
2728  PointerRNA *ptr)
2729 {
2730  FFMpegCodecData *codec_data = (FFMpegCodecData *)ptr->data;
2731  if (!ELEM(codec_data->codec,
2732  AV_CODEC_ID_H264,
2733  AV_CODEC_ID_MPEG4,
2734  AV_CODEC_ID_VP9,
2735  AV_CODEC_ID_DNXHD)) {
2736  /* Constant Rate Factor (CRF) setting is only available for H264,
2737  * MPEG4 and WEBM/VP9 codecs. So changing encoder quality mode to
2738  * CBR as CRF is not supported.
2739  */
2740  codec_data->constant_rate_factor = FFM_CRF_NONE;
2741  }
2742 }
2743 # endif
2744 
2745 #else
2746 
2747 /* Grease Pencil Interpolation tool settings */
2749 {
2750  StructRNA *srna;
2751  PropertyRNA *prop;
2752 
2753  srna = RNA_def_struct(brna, "GPencilInterpolateSettings", NULL);
2754  RNA_def_struct_sdna(srna, "GP_Interpolate_Settings");
2756  "Grease Pencil Interpolate Settings",
2757  "Settings for Grease Pencil interpolation tools");
2758 
2759  /* custom curvemap */
2760  prop = RNA_def_property(srna, "interpolation_curve", PROP_POINTER, PROP_NONE);
2761  RNA_def_property_pointer_sdna(prop, NULL, "custom_ipo");
2762  RNA_def_property_struct_type(prop, "CurveMapping");
2764  prop,
2765  "Interpolation Curve",
2766  "Custom curve to control 'sequence' interpolation between Grease Pencil frames");
2767 }
2768 
2770 {
2771  StructRNA *srna;
2772  PropertyRNA *prop;
2773 
2774  srna = RNA_def_struct(brna, "TransformOrientation", NULL);
2775 
2776  prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
2777  RNA_def_property_float_sdna(prop, NULL, "mat");
2780 
2781  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2782  RNA_def_struct_name_property(srna, prop);
2783  RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation");
2785 }
2786 
2788 {
2789  StructRNA *srna;
2790  PropertyRNA *prop;
2791 
2792  srna = RNA_def_struct(brna, "TransformOrientationSlot", NULL);
2793  RNA_def_struct_sdna(srna, "TransformOrientationSlot");
2794  RNA_def_struct_path_func(srna, "rna_TransformOrientationSlot_path");
2795  RNA_def_struct_ui_text(srna, "Orientation Slot", "");
2796 
2797  /* Orientations */
2798  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
2801  "rna_TransformOrientationSlot_type_get",
2802  "rna_TransformOrientationSlot_type_set",
2803  "rna_TransformOrientation_with_scene_itemf");
2804  RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
2806 
2807  prop = RNA_def_property(srna, "custom_orientation", PROP_POINTER, PROP_NONE);
2808  RNA_def_property_struct_type(prop, "TransformOrientation");
2809  RNA_def_property_pointer_funcs(prop, "rna_TransformOrientationSlot_get", NULL, NULL, NULL);
2810  RNA_def_property_ui_text(prop, "Current Transform Orientation", "");
2811 
2812  /* flag */
2813  prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
2814  RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
2815  RNA_def_property_ui_text(prop, "Use", "Use scene orientation instead of a custom setting");
2817 }
2818 
2820 {
2821  StructRNA *srna;
2822  PropertyRNA *prop;
2823 
2824  srna = RNA_def_struct(brna, "View3DCursor", NULL);
2825  RNA_def_struct_sdna(srna, "View3DCursor");
2826  RNA_def_struct_path_func(srna, "rna_View3DCursor_path");
2827  RNA_def_struct_ui_text(srna, "3D Cursor", "");
2828  RNA_def_struct_ui_icon(srna, ICON_CURSOR);
2830 
2831  prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ_LENGTH);
2833  RNA_def_property_float_sdna(prop, NULL, "location");
2834  RNA_def_property_ui_text(prop, "Location", "");
2835  RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
2837 
2838  prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
2840  RNA_def_property_float_sdna(prop, NULL, "rotation_quaternion");
2842  prop, "Quaternion Rotation", "Rotation in quaternions (keep normalized)");
2844 
2845  prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
2847  RNA_def_property_array(prop, 4);
2849  "rna_View3DCursor_rotation_axis_angle_get",
2850  "rna_View3DCursor_rotation_axis_angle_set",
2851  NULL);
2854  prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
2856 
2857  prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
2859  RNA_def_property_float_sdna(prop, NULL, "rotation_euler");
2860  RNA_def_property_ui_text(prop, "Euler Rotation", "3D rotation");
2862 
2863  prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
2865  RNA_def_property_enum_sdna(prop, NULL, "rotation_mode");
2867  RNA_def_property_enum_funcs(prop, NULL, "rna_View3DCursor_rotation_mode_set", NULL);
2868  RNA_def_property_ui_text(prop, "Rotation Mode", "");
2870 
2871  /* Matrix access to avoid having to check current rotation mode. */
2872  prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
2874  RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */
2876  prop, "Transform Matrix", "Matrix combining location and rotation of the cursor");
2878  prop, "rna_View3DCursor_matrix_get", "rna_View3DCursor_matrix_set", NULL);
2880 }
2881 
2883 {
2884  StructRNA *srna;
2885  PropertyRNA *prop;
2886 
2887  /* the construction of this enum is quite special - everything is stored as bitflags,
2888  * with 1st position only for on/off (and exposed as boolean), while others are mutually
2889  * exclusive options but which will only have any effect when autokey is enabled
2890  */
2891  static const EnumPropertyItem auto_key_items[] = {
2892  {AUTOKEY_MODE_NORMAL & ~AUTOKEY_ON, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
2893  {AUTOKEY_MODE_EDITKEYS & ~AUTOKEY_ON, "REPLACE_KEYS", 0, "Replace", ""},
2894  {0, NULL, 0, NULL, NULL},
2895  };
2896 
2897  static const EnumPropertyItem draw_groupuser_items[] = {
2898  {OB_DRAW_GROUPUSER_NONE, "NONE", 0, "None", ""},
2900  "ACTIVE",
2901  0,
2902  "Active",
2903  "Show vertices with no weights in the active group"},
2904  {OB_DRAW_GROUPUSER_ALL, "ALL", 0, "All", "Show vertices with no weights in any group"},
2905  {0, NULL, 0, NULL, NULL},
2906  };
2907 
2908  static const EnumPropertyItem vertex_group_select_items[] = {
2909  {WT_VGROUP_ALL, "ALL", 0, "All", "All Vertex Groups"},
2911  "BONE_DEFORM",
2912  0,
2913  "Deform",
2914  "Vertex Groups assigned to Deform Bones"},
2916  "OTHER_DEFORM",
2917  0,
2918  "Other",
2919  "Vertex Groups assigned to non Deform Bones"},
2920  {0, NULL, 0, NULL, NULL},
2921  };
2922 
2923  static const EnumPropertyItem gpencil_stroke_placement_items[] = {
2925  "ORIGIN",
2926  ICON_OBJECT_ORIGIN,
2927  "Origin",
2928  "Draw stroke at Object origin"},
2930  "CURSOR",
2931  ICON_PIVOT_CURSOR,
2932  "3D Cursor",
2933  "Draw stroke at 3D cursor location"},
2935  "SURFACE",
2936  ICON_SNAP_FACE,
2937  "Surface",
2938  "Stick stroke to surfaces"},
2940  "STROKE",
2941  ICON_STROKE,
2942  "Stroke",
2943  "Stick stroke to other strokes"},
2944  {0, NULL, 0, NULL, NULL},
2945  };
2946 
2947  static const EnumPropertyItem gpencil_stroke_snap_items[] = {
2948  {0, "NONE", 0, "All Points", "Snap to all points"},
2950  "ENDS",
2951  0,
2952  "End Points",
2953  "Snap to first and last points and interpolate"},
2954  {GP_PROJECT_DEPTH_STROKE_FIRST, "FIRST", 0, "First Point", "Snap to first point"},
2955  {0, NULL, 0, NULL, NULL},
2956  };
2957 
2958  static const EnumPropertyItem gpencil_selectmode_items[] = {
2959  {GP_SELECTMODE_POINT, "POINT", ICON_GP_SELECT_POINTS, "Point", "Select only points"},
2961  "STROKE",
2962  ICON_GP_SELECT_STROKES,
2963  "Stroke",
2964  "Select all stroke points"},
2966  "SEGMENT",
2967  ICON_GP_SELECT_BETWEEN_STROKES,
2968  "Segment",
2969  "Select all stroke points between other strokes"},
2970  {0, NULL, 0, NULL, NULL},
2971  };
2972 
2973  static const EnumPropertyItem annotation_stroke_placement_view2d_items[] = {
2975  "IMAGE",
2976  ICON_IMAGE_DATA,
2977  "Image",
2978  "Stick stroke to the image"},
2979  /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
2980  {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
2981  {0, NULL, 0, NULL, NULL},
2982  };
2983 
2984  static const EnumPropertyItem annotation_stroke_placement_view3d_items[] = {
2986  "CURSOR",
2987  ICON_PIVOT_CURSOR,
2988  "3D Cursor",
2989  "Draw stroke at 3D cursor location"},
2990  /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
2991  {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
2993  "SURFACE",
2994  ICON_FACESEL,
2995  "Surface",
2996  "Stick stroke to surfaces"},
2997  {0, NULL, 0, NULL, NULL},
2998  };
2999 
3000  static const EnumPropertyItem uv_sticky_mode_items[] = {
3002  "DISABLED",
3003  ICON_STICKY_UVS_DISABLE,
3004  "Disabled",
3005  "Sticky vertex selection disabled"},
3006  {SI_STICKY_LOC,
3007  "SHARED_LOCATION",
3008  ICON_STICKY_UVS_LOC,
3009  "Shared Location",
3010  "Select UVs that are at the same location and share a mesh vertex"},
3012  "SHARED_VERTEX",
3013  ICON_STICKY_UVS_VERT,
3014  "Shared Vertex",
3015  "Select UVs that share a mesh vertex, whether or not they are at the same location"},
3016  {0, NULL, 0, NULL, NULL},
3017  };
3018 
3019  srna = RNA_def_struct(brna, "ToolSettings", NULL);
3020  RNA_def_struct_path_func(srna, "rna_ToolSettings_path");
3021  RNA_def_struct_ui_text(srna, "Tool Settings", "");
3022 
3023  prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
3024  RNA_def_property_struct_type(prop, "Sculpt");
3025  RNA_def_property_ui_text(prop, "Sculpt", "");
3026 
3027  prop = RNA_def_property(srna, "curves_sculpt", PROP_POINTER, PROP_NONE);
3028  RNA_def_property_struct_type(prop, "CurvesSculpt");
3029  RNA_def_property_ui_text(prop, "Curves Sculpt", "");
3030 
3031  prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
3033  RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
3035  "Weight Paint Auto-Normalize",
3036  "Ensure all bone-deforming vertex groups add up "
3037  "to 1.0 while weight painting");
3038  RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3039 
3040  prop = RNA_def_property(srna, "use_lock_relative", PROP_BOOLEAN, PROP_NONE);
3042  RNA_def_property_boolean_sdna(prop, NULL, "wpaint_lock_relative", 1);
3044  "Weight Paint Lock-Relative",
3045  "Display bone-deforming groups as if all locked deform groups "
3046  "were deleted, and the remaining ones were re-normalized");
3047  RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3048 
3049  prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
3051  RNA_def_property_boolean_sdna(prop, NULL, "multipaint", 1);
3053  "Weight Paint Multi-Paint",
3054  "Paint across the weights of all selected bones, "
3055  "maintaining their relative influence");
3056  RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3057 
3058  prop = RNA_def_property(srna, "vertex_group_user", PROP_ENUM, PROP_NONE);
3060  RNA_def_property_enum_sdna(prop, NULL, "weightuser");
3061  RNA_def_property_enum_items(prop, draw_groupuser_items);
3062  RNA_def_property_ui_text(prop, "Mask Non-Group Vertices", "Display unweighted vertices");
3063  RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3064 
3065  prop = RNA_def_property(srna, "vertex_group_subset", PROP_ENUM, PROP_NONE);
3067  RNA_def_property_enum_sdna(prop, NULL, "vgroupsubset");
3068  RNA_def_property_enum_items(prop, vertex_group_select_items);
3069  RNA_def_property_ui_text(prop, "Subset", "Filter Vertex groups for Display");
3070  RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3071 
3072  prop = RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
3073  RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
3074  RNA_def_property_ui_text(prop, "Vertex Paint", "");
3075 
3076  prop = RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
3077  RNA_def_property_pointer_sdna(prop, NULL, "wpaint");
3078  RNA_def_property_ui_text(prop, "Weight Paint", "");
3079 
3080  prop = RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
3081  RNA_def_property_pointer_sdna(prop, NULL, "imapaint");
3082  RNA_def_property_ui_text(prop, "Image Paint", "");
3083 
3084  prop = RNA_def_property(srna, "paint_mode", PROP_POINTER, PROP_NONE);
3085  RNA_def_property_pointer_sdna(prop, NULL, "paint_mode");
3086  RNA_def_property_ui_text(prop, "Paint Mode", "");
3087 
3088  prop = RNA_def_property(srna, "uv_sculpt", PROP_POINTER, PROP_NONE);
3089  RNA_def_property_pointer_sdna(prop, NULL, "uvsculpt");
3090  RNA_def_property_ui_text(prop, "UV Sculpt", "");
3091 
3092  prop = RNA_def_property(srna, "gpencil_paint", PROP_POINTER, PROP_NONE);
3093  RNA_def_property_pointer_sdna(prop, NULL, "gp_paint");
3094  RNA_def_property_ui_text(prop, "Grease Pencil Paint", "");
3095 
3096  prop = RNA_def_property(srna, "gpencil_vertex_paint", PROP_POINTER, PROP_NONE);
3097  RNA_def_property_pointer_sdna(prop, NULL, "gp_vertexpaint");
3098  RNA_def_property_ui_text(prop, "Grease Pencil Vertex Paint", "");
3099 
3100  prop = RNA_def_property(srna, "gpencil_sculpt_paint", PROP_POINTER, PROP_NONE);
3101  RNA_def_property_pointer_sdna(prop, NULL, "gp_sculptpaint");
3102  RNA_def_property_ui_text(prop, "Grease Pencil Sculpt Paint", "");
3103 
3104  prop = RNA_def_property(srna, "gpencil_weight_paint", PROP_POINTER, PROP_NONE);
3105  RNA_def_property_pointer_sdna(prop, NULL, "gp_weightpaint");
3106  RNA_def_property_ui_text(prop, "Grease Pencil Weight Paint", "");
3107 
3108  prop = RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
3109  RNA_def_property_pointer_sdna(prop, NULL, "particle");
3110  RNA_def_property_ui_text(prop, "Particle Edit", "");
3111 
3112  prop = RNA_def_property(srna, "uv_sculpt_lock_borders", PROP_BOOLEAN, PROP_NONE);
3113  RNA_def_property_boolean_sdna(prop, NULL, "uv_sculpt_settings", UV_SCULPT_LOCK_BORDERS);
3114  RNA_def_property_ui_text(prop, "Lock Borders", "Disable editing of boundary edges");
3115 
3116  prop = RNA_def_property(srna, "uv_sculpt_all_islands", PROP_BOOLEAN, PROP_NONE);
3117  RNA_def_property_boolean_sdna(prop, NULL, "uv_sculpt_settings", UV_SCULPT_ALL_ISLANDS);
3118  RNA_def_property_ui_text(prop, "Sculpt All Islands", "Brush operates on all islands");
3119 
3120  prop = RNA_def_property(srna, "uv_relax_method", PROP_ENUM, PROP_NONE);
3121  RNA_def_property_enum_sdna(prop, NULL, "uv_relax_method");
3123  RNA_def_property_ui_text(prop, "Relaxation Method", "Algorithm used for UV relaxation");
3124 
3125  prop = RNA_def_property(srna, "lock_object_mode", PROP_BOOLEAN, PROP_NONE);
3128  "Lock Object Modes",
3129  "Restrict selection to objects using the same mode as the active "
3130  "object, to prevent accidental mode switch when selecting");
3132 
3133  static const EnumPropertyItem workspace_tool_items[] = {
3134  {SCE_WORKSPACE_TOOL_DEFAULT, "DEFAULT", 0, "Active Tool", ""},
3135  {SCE_WORKSPACE_TOOL_FALLBACK, "FALLBACK", 0, "Select", ""},
3136  {0, NULL, 0, NULL, NULL},
3137  };
3138 
3139  prop = RNA_def_property(srna, "workspace_tool_type", PROP_ENUM, PROP_NONE);
3140  RNA_def_property_enum_sdna(prop, NULL, "workspace_tool_type");
3141  RNA_def_property_enum_items(prop, workspace_tool_items);
3143  RNA_def_property_ui_text(prop, "Drag", "Action when dragging in the viewport");
3144 
3145  /* Transform */
3146  prop = RNA_def_property(srna, "use_proportional_edit", PROP_BOOLEAN, PROP_NONE);
3147  RNA_def_property_boolean_sdna(prop, NULL, "proportional_edit", PROP_EDIT_USE);
3148  RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional edit mode");
3149  RNA_def_property_ui_icon(prop, ICON_PROP_ON, 0);
3150  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3151 
3152  prop = RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
3153  RNA_def_property_boolean_sdna(prop, NULL, "proportional_objects", 0);
3155  prop, "Proportional Editing Objects", "Proportional editing object mode");
3156  RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3157  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3158 
3159  prop = RNA_def_property(srna, "use_proportional_projected", PROP_BOOLEAN, PROP_NONE);
3160  RNA_def_property_boolean_sdna(prop, NULL, "proportional_edit", PROP_EDIT_PROJECTED);
3162  prop, "Projected from View", "Proportional Editing using screen space locations");
3163  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3164 
3165  prop = RNA_def_property(srna, "use_proportional_connected", PROP_BOOLEAN, PROP_NONE);
3166  RNA_def_property_boolean_sdna(prop, NULL, "proportional_edit", PROP_EDIT_CONNECTED);
3168  prop, "Connected Only", "Proportional Editing using connected geometry only");
3169  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3170 
3171  prop = RNA_def_property(srna, "use_proportional_edit_mask", PROP_BOOLEAN, PROP_NONE);
3172  RNA_def_property_boolean_sdna(prop, NULL, "proportional_mask", 0);
3173  RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing mask mode");
3174  RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3175  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3176 
3177  prop = RNA_def_property(srna, "use_proportional_action", PROP_BOOLEAN, PROP_NONE);
3178  RNA_def_property_boolean_sdna(prop, NULL, "proportional_action", 0);
3180  prop, "Proportional Editing Actions", "Proportional editing in action editor");
3181  RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3182  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3183 
3184  prop = RNA_def_property(srna, "use_proportional_fcurve", PROP_BOOLEAN, PROP_NONE);
3185  RNA_def_property_boolean_sdna(prop, NULL, "proportional_fcurve", 0);
3187  prop, "Proportional Editing FCurves", "Proportional editing in FCurve editor");
3188  RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3189  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3190 
3191  prop = RNA_def_property(srna, "lock_markers", PROP_BOOLEAN, PROP_NONE);
3192  RNA_def_property_boolean_sdna(prop, NULL, "lock_markers", 0);
3193  RNA_def_property_ui_text(prop, "Lock Markers", "Prevent marker editing");
3194 
3195  prop = RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
3196  RNA_def_property_enum_sdna(prop, NULL, "prop_mode");
3199  prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
3200  /* Abusing id_curve :/ */
3202  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3203 
3204  prop = RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
3205  RNA_def_property_float_sdna(prop, NULL, "proportional_size");
3207  prop, "Proportional Size", "Display size for proportional editing circle");
3208  RNA_def_property_range(prop, 0.00001, 5000.0);
3209 
3210  prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE);
3211  RNA_def_property_float_sdna(prop, NULL, "doublimit");
3212  RNA_def_property_ui_text(prop, "Merge Threshold", "Threshold distance for Auto Merge");
3213  RNA_def_property_range(prop, 0.0, 1.0);
3214  RNA_def_property_ui_range(prop, 0.0, 0.1, 0.01, 6);
3215 
3216  /* Pivot Point */
3217  prop = RNA_def_property(srna, "transform_pivot_point", PROP_ENUM, PROP_NONE);
3218  RNA_def_property_enum_sdna(prop, NULL, "transform_pivot_point");
3220  RNA_def_property_ui_text(prop, "Transform Pivot Point", "Pivot center for rotation/scaling");
3222 
3223  prop = RNA_def_property(srna, "use_transform_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
3224  RNA_def_property_boolean_sdna(prop, NULL, "transform_flag", SCE_XFORM_AXIS_ALIGN);
3226  prop,
3227  "Only Locations",
3228  "Only transform object locations, without affecting rotation or scaling");
3230 
3231  prop = RNA_def_property(srna, "use_transform_data_origin", PROP_BOOLEAN, PROP_NONE);
3232  RNA_def_property_boolean_sdna(prop, NULL, "transform_flag", SCE_XFORM_DATA_ORIGIN);
3234  prop, "Transform Origins", "Transform object origins, while leaving the shape in place");
3236 
3237  prop = RNA_def_property(srna, "use_transform_skip_children", PROP_BOOLEAN, PROP_NONE);
3240  prop, "Transform Parents", "Transform the parents, leaving the children in place");
3242 
3243  prop = RNA_def_property(srna, "use_transform_correct_face_attributes", PROP_BOOLEAN, PROP_NONE);
3246  "Correct Face Attributes",
3247  "Correct data such as UV's and color attributes when transforming");
3249 
3250  prop = RNA_def_property(srna, "use_transform_correct_keep_connected", PROP_BOOLEAN, PROP_NONE);
3252  prop, NULL, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED);
3254  prop,
3255  "Keep Connected",
3256  "During the Face Attributes correction, merge attributes connected to the same vertex");
3258 
3259  prop = RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
3260  RNA_def_property_boolean_sdna(prop, NULL, "automerge", AUTO_MERGE);
3262  prop, "Auto Merge Vertices", "Automatically merge vertices moved to the same location");
3263  RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3264  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3265 
3266  prop = RNA_def_property(srna, "use_mesh_automerge_and_split", PROP_BOOLEAN, PROP_NONE);
3268  RNA_def_property_ui_text(prop, "Split Edges & Faces", "Automatically split edges and faces");
3269  RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3270  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3271 
3272  prop = RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
3273  RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP);
3274  RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
3275  RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3276  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3277 
3278  prop = RNA_def_property(srna, "use_snap_node", PROP_BOOLEAN, PROP_NONE);
3279  RNA_def_property_boolean_sdna(prop, NULL, "snap_flag_node", SCE_SNAP);
3280  RNA_def_property_ui_text(prop, "Snap", "Snap Node during transform");
3281  RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3282  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3283 
3284  prop = RNA_def_property(srna, "use_snap_sequencer", PROP_BOOLEAN, PROP_NONE);
3285  RNA_def_property_boolean_sdna(prop, NULL, "snap_flag_seq", SCE_SNAP);
3286  RNA_def_property_ui_text(prop, "Use Snapping", "Snap to strip edges or current frame");
3287  RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3289  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* Publish message-bus. */
3290 
3291  prop = RNA_def_property(srna, "use_snap_uv", PROP_BOOLEAN, PROP_NONE);
3292  RNA_def_property_boolean_sdna(prop, NULL, "snap_uv_flag", SCE_SNAP);
3293  RNA_def_property_ui_text(prop, "Snap", "Snap UV during transform");
3294  RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3295  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3296 
3297  prop = RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
3298  RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE);
3300  prop, "Align Rotation to Target", "Align rotation with the snapping target");
3301  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3302 
3303  prop = RNA_def_property(srna, "use_snap_grid_absolute", PROP_BOOLEAN, PROP_NONE);
3306  prop,
3307  "Absolute Grid Snap",
3308  "Absolute grid alignment while translating (based on the pivot center)");
3309  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3310 
3311  prop = RNA_def_property(srna, "snap_elements", PROP_ENUM, PROP_NONE);
3312  RNA_def_property_enum_bitflag_sdna(prop, NULL, "snap_mode");
3314  RNA_def_property_enum_funcs(prop, NULL, "rna_ToolSettings_snap_mode_set", NULL);
3316  RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
3317  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3318 
3319  prop = RNA_def_property(srna, "snap_face_nearest_steps", PROP_INT, PROP_FACTOR);
3320  RNA_def_property_int_sdna(prop, NULL, "snap_face_nearest_steps");
3321  RNA_def_property_range(prop, 1, 100);
3323  prop,
3324  "Face Nearest Steps",
3325  "Number of steps to break transformation into for face nearest snapping");
3326 
3327  prop = RNA_def_property(srna, "use_snap_to_same_target", PROP_BOOLEAN, PROP_NONE);
3330  prop,
3331  "Snap to Same Target",
3332  "Snap only to target that source was initially near (Face Nearest Only)");
3333 
3334  /* node editor uses own set of snap modes */
3335  prop = RNA_def_property(srna, "snap_node_element", PROP_ENUM, PROP_NONE);
3336  RNA_def_property_enum_bitflag_sdna(prop, NULL, "snap_node_mode");
3338  RNA_def_property_ui_text(prop, "Snap Node Element", "Type of element to snap to");
3339  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3340 
3341  /* image editor uses own set of snap modes */
3342  prop = RNA_def_property(srna, "snap_uv_element", PROP_ENUM, PROP_NONE);
3343  RNA_def_property_enum_bitflag_sdna(prop, NULL, "snap_uv_mode");
3345  RNA_def_property_ui_text(prop, "Snap UV Element", "Type of element to snap to");
3346  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3347 
3348  prop = RNA_def_property(srna, "use_snap_uv_grid_absolute", PROP_BOOLEAN, PROP_NONE);
3349  RNA_def_property_boolean_sdna(prop, NULL, "snap_uv_flag", SCE_SNAP_ABS_GRID);
3351  prop,
3352  "Absolute Grid Snap",
3353  "Absolute grid alignment while translating (based on the pivot center)");
3354  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3355 
3356  /* TODO(@gfxcoder): Rename `snap_target` to `snap_source` to avoid previous ambiguity of "target"
3357  * (now, "source" is geometry to be moved and "target" is geometry to which moved geometry is
3358  * snapped). */
3359  prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
3360  RNA_def_property_enum_sdna(prop, NULL, "snap_target");
3362  RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
3363  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3364 
3365  prop = RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
3368  prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
3369  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3370 
3371  prop = RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
3374  "Project Individual Elements",
3375  "Project individual elements on the surface of other objects");
3376  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3377 
3378  prop = RNA_def_property(srna, "use_snap_backface_culling", PROP_BOOLEAN, PROP_NONE);
3380  RNA_def_property_ui_text(prop, "Backface Culling", "Exclude back facing geometry from snapping");
3381  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3382 
3383  /* TODO(@gfxcoder): Rename `use_snap_self` to `use_snap_active`, because active is correct but
3384  * self is not (breaks API). This only makes a difference when more than one mesh is edited. */
3385  prop = RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
3388  prop, "Snap onto Active", "Snap onto itself only if enabled (Edit Mode Only)");
3389  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3390 
3391  prop = RNA_def_property(srna, "use_snap_edit", PROP_BOOLEAN, PROP_NONE);
3394  prop, "Snap onto Edited", "Snap onto non-active objects in Edit Mode (Edit Mode Only)");
3395  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3396 
3397  prop = RNA_def_property(srna, "use_snap_nonedit", PROP_BOOLEAN, PROP_NONE);
3400  prop, "Snap onto Non-edited", "Snap onto objects not in Edit Mode (Edit Mode Only)");
3401  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3402 
3403  prop = RNA_def_property(srna, "use_snap_selectable", PROP_BOOLEAN, PROP_NONE);
3406  prop, "Snap onto Selectable Only", "Snap only onto objects that are selectable");
3407  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3408 
3409  prop = RNA_def_property(srna, "use_snap_translate", PROP_BOOLEAN, PROP_NONE);
3411  prop, NULL, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_TRANSLATE);
3413  prop, "Use Snap for Translation", "Move is affected by snapping settings");
3414  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3415 
3416  prop = RNA_def_property(srna, "use_snap_rotate", PROP_BOOLEAN, PROP_NONE);
3418  prop, NULL, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_ROTATE);
3419  RNA_def_property_boolean_default(prop, false);
3421  prop, "Use Snap for Rotation", "Rotate is affected by the snapping settings");
3422  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3423 
3424  prop = RNA_def_property(srna, "use_snap_scale", PROP_BOOLEAN, PROP_NONE);
3426  prop, NULL, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_SCALE);
3427  RNA_def_property_boolean_default(prop, false);
3428  RNA_def_property_ui_text(prop, "Use Snap for Scale", "Scale is affected by snapping settings");
3429  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3430 
3431  /* Grease Pencil */
3432  prop = RNA_def_property(srna, "use_gpencil_draw_additive", PROP_BOOLEAN, PROP_NONE);
3435  "Use Additive Drawing",
3436  "When creating new frames, the strokes from the previous/active frame "
3437  "are included as the basis for the new one");
3439 
3440  prop = RNA_def_property(srna, "use_gpencil_draw_onback", PROP_BOOLEAN, PROP_NONE);
3443  prop,
3444  "Draw Strokes on Back",
3445  "When draw new strokes, the new stroke is drawn below of all strokes in the layer");
3447 
3448  prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE);
3451  prop, "Compact List", "Show compact list of color instead of thumbnails");
3453 
3454  prop = RNA_def_property(srna, "use_gpencil_weight_data_add", PROP_BOOLEAN, PROP_NONE);
3457  "Add weight data for new strokes",
3458  "When creating new strokes, the weight data is added according to the "
3459  "current vertex group and weight, "
3460  "if no vertex group selected, weight is not added");
3462 
3463  prop = RNA_def_property(srna, "use_gpencil_automerge_strokes", PROP_BOOLEAN, PROP_NONE);
3465  RNA_def_property_boolean_default(prop, false);
3466  RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3468  prop,
3469  "Automerge",
3470  "Join by distance last drawn stroke with previous strokes in the active layer");
3473 
3474  prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE);
3475  RNA_def_property_pointer_sdna(prop, NULL, "gp_sculpt");
3476  RNA_def_property_struct_type(prop, "GPencilSculptSettings");
3478  prop, "Grease Pencil Sculpt", "Settings for stroke sculpting tools and brushes");
3479 
3480  prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE);
3481  RNA_def_property_pointer_sdna(prop, NULL, "gp_interpolate");
3482  RNA_def_property_struct_type(prop, "GPencilInterpolateSettings");
3484  prop, "Grease Pencil Interpolate", "Settings for Grease Pencil Interpolation tools");
3485 
3486  /* Grease Pencil - 3D View Stroke Placement */
3487  prop = RNA_def_property(srna, "gpencil_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
3488  RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_v3d_align");
3489  RNA_def_property_enum_items(prop, gpencil_stroke_placement_items);
3490  RNA_def_property_ui_text(prop, "Stroke Placement (3D View)", "");
3492 
3493  prop = RNA_def_property(srna, "gpencil_stroke_snap_mode", PROP_ENUM, PROP_NONE);
3494  RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_v3d_align");
3495  RNA_def_property_enum_items(prop, gpencil_stroke_snap_items);
3496  RNA_def_property_ui_text(prop, "Stroke Snap", "");
3498 
3499  prop = RNA_def_property(srna, "use_gpencil_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
3501  prop, NULL, "gpencil_v3d_align", GP_PROJECT_DEPTH_STROKE_ENDPOINTS);
3503  prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");
3505 
3506  /* Grease Pencil - Select mode Edit */
3507  prop = RNA_def_property(srna, "gpencil_selectmode_edit", PROP_ENUM, PROP_NONE);
3508  RNA_def_property_enum_sdna(prop, NULL, "gpencil_selectmode_edit");
3509  RNA_def_property_enum_items(prop, gpencil_selectmode_items);
3510  RNA_def_property_ui_text(prop, "Select Mode", "");
3513  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_selectmode_update");
3514 
3515  /* Grease Pencil - Select mode Sculpt */
3516  prop = RNA_def_property(srna, "use_gpencil_select_mask_point", PROP_BOOLEAN, PROP_NONE);
3518  prop, NULL, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_POINT);
3519  RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points");
3520  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
3523  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_point_update");
3524 
3525  prop = RNA_def_property(srna, "use_gpencil_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
3527  prop, NULL, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_STROKE);
3528  RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke");
3529  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
3532  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_stroke_update");
3533 
3534  prop = RNA_def_property(srna, "use_gpencil_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
3536  prop, NULL, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_SEGMENT);
3538  prop, "Selection Mask", "Only sculpt selected stroke points between other strokes");
3539  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
3542  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_segment_update");
3543 
3544  /* Grease Pencil - Select mode Vertex Paint */
3545  prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_point", PROP_BOOLEAN, PROP_NONE);
3547  prop, NULL, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_POINT);
3548  RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected stroke points");
3549  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
3553  prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_point_update");
3554 
3555  prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
3557  prop, NULL, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_STROKE);
3558  RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected stroke");
3559  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
3563  prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_stroke_update");
3564 
3565  prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
3567  prop, NULL, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_SEGMENT);
3569  prop, "Selection Mask", "Only paint selected stroke points between other strokes");
3570  RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
3574  prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_segment_update");
3575 
3576  /* Annotations - 2D Views Stroke Placement */
3577  prop = RNA_def_property(srna, "annotation_stroke_placement_view2d", PROP_ENUM, PROP_NONE);
3578  RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_v2d_align");
3579  RNA_def_property_enum_items(prop, annotation_stroke_placement_view2d_items);
3580  RNA_def_property_ui_text(prop, "Stroke Placement (2D View)", "");
3582 
3583  /* Annotations - 3D View Stroke Placement */
3584  /* XXX: Do we need to decouple the stroke_endpoints setting too? */
3585  prop = RNA_def_property(srna, "annotation_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
3586  RNA_def_property_enum_bitflag_sdna(prop, NULL, "annotate_v3d_align");
3587  RNA_def_property_enum_items(prop, annotation_stroke_placement_view3d_items);
3590  "Annotation Stroke Placement (3D View)",
3591  "How annotation strokes are orientated in 3D space");
3593 
3594  /* Annotations - Stroke Thickness */
3595  prop = RNA_def_property(srna, "annotation_thickness", PROP_INT, PROP_PIXEL);
3596  RNA_def_property_int_sdna(prop, NULL, "annotate_thickness");
3597  RNA_def_property_range(prop, 1, 10);
3598  RNA_def_property_ui_text(prop, "Annotation Stroke Thickness", "Thickness of annotation strokes");
3599  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
3600 
3601  /* Auto Keying */
3602  prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
3603  RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
3605  prop, "Auto Keying", "Automatic keyframe insertion for Objects, Bones and Masks");
3606  RNA_def_property_ui_icon(prop, ICON_REC, 0);
3607 
3608  prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
3609  RNA_def_property_enum_bitflag_sdna(prop, NULL, "autokey_mode");
3610  RNA_def_property_enum_items(prop, auto_key_items);
3612  "Auto-Keying Mode",
3613  "Mode of automatic keyframe insertion for Objects, Bones and Masks");
3614 
3615  prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
3618  prop,
3619  "Layered",
3620  "Add a new NLA Track + Strip for every loop/pass made over the animation "
3621  "to allow non-destructive tweaking");
3622 
3623  prop = RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
3626  "Auto Keyframe Insert Keying Set",
3627  "Automatic keyframe insertion using active Keying Set only");
3628  RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0);
3629 
3630  prop = RNA_def_property(srna, "use_keyframe_cycle_aware", PROP_BOOLEAN, PROP_NONE);
3633  prop,
3634  "Cycle-Aware Keying",
3635  "For channels with cyclic extrapolation, keyframe insertion is automatically "
3636  "remapped inside the cycle time range, and keeps ends in sync. Curves newly added to "
3637  "actions with a Manual Frame Range and Cyclic Animation are automatically made cyclic");
3638 
3639  /* Keyframing */
3640  prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE);
3641  RNA_def_property_enum_sdna(prop, NULL, "keyframe_type");
3644  prop, "New Keyframe Type", "Type of keyframes to create when inserting keyframes");
3645 
3646  /* UV */
3647  prop = RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
3648  RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
3650  RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
3652  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_select_mode_update");
3653 
3654  prop = RNA_def_property(srna, "uv_sticky_select_mode", PROP_ENUM, PROP_NONE);
3655  RNA_def_property_enum_sdna(prop, NULL, "uv_sticky");
3656  RNA_def_property_enum_items(prop, uv_sticky_mode_items);
3658  prop, "Sticky Selection Mode", "Method for extending UV vertex selection");
3660 
3661  prop = RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
3664  prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
3665  RNA_def_property_ui_icon(prop, ICON_UV_SYNC_SELECT, 0);
3667 
3668  prop = RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
3671  prop, "UV Local View", "Display only faces with the currently displayed image assigned");
3673 
3674  /* Mesh */
3675  prop = RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
3676  RNA_def_property_boolean_sdna(prop, NULL, "selectmode", 1);
3677  RNA_def_property_array(prop, 3);
3678  RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_editmesh_select_mode_set");
3679  RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
3681  RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
3682 
3683  prop = RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
3684  RNA_def_property_float_sdna(prop, NULL, "vgroup_weight");
3685  RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
3686 
3687  prop = RNA_def_property(srna, "use_edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
3688  RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
3689  RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edge seams recalculates UV unwrap");
3690 
3691  prop = RNA_def_property(srna, "normal_vector", PROP_FLOAT, PROP_XYZ);
3692  RNA_def_property_ui_text(prop, "Normal Vector", "Normal Vector used to copy, add or multiply");
3693  RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, 3);
3694 
3695  /* Unified Paint Settings */
3696  prop = RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
3698  RNA_def_property_struct_type(prop, "UnifiedPaintSettings");
3699  RNA_def_property_ui_text(prop, "Unified Paint Settings", NULL);
3700 
3701  /* Curve Paint Settings */
3702  prop = RNA_def_property(srna, "curve_paint_settings", PROP_POINTER, PROP_NONE);
3704  RNA_def_property_struct_type(prop, "CurvePaintSettings");
3705  RNA_def_property_ui_text(prop, "Curve Paint Settings", NULL);
3706 
3707  /* Mesh Statistics */
3708  prop = RNA_def_property(srna, "statvis", PROP_POINTER, PROP_NONE);
3710  RNA_def_property_struct_type(prop, "MeshStatVis");
3711  RNA_def_property_ui_text(prop, "Mesh Statistics Visualization", NULL);
3712 
3713  /* CurveProfile */
3714  prop = RNA_def_property(srna, "custom_bevel_profile_preset", PROP_POINTER, PROP_NONE);
3715  RNA_def_property_pointer_sdna(prop, NULL, "custom_bevel_profile_preset");
3716  RNA_def_property_struct_type(prop, "CurveProfile");
3717  RNA_def_property_ui_text(prop, "Curve Profile Widget", "Used for defining a profile's path");
3718 
3719  /* Sequencer tool settings */
3720  prop = RNA_def_property(srna, "sequencer_tool_settings", PROP_POINTER, PROP_NONE);
3722  RNA_def_property_struct_type(prop, "SequencerToolSettings");
3723  RNA_def_property_ui_text(prop, "Sequencer Tool Settings", NULL);
3724 }
3725 
3727 {
3728  StructRNA *srna;
3729  PropertyRNA *prop;
3730 
3731  static const EnumPropertyItem scale_fit_methods[] = {
3732  {SEQ_SCALE_TO_FIT, "FIT", 0, "Scale to Fit", "Scale image to fit within the canvas"},
3733  {SEQ_SCALE_TO_FILL, "FILL", 0, "Scale to Fill", "Scale image to completely fill the canvas"},
3734  {SEQ_STRETCH_TO_FILL, "STRETCH", 0, "Stretch to Fill", "Stretch image to fill the canvas"},
3736  "ORIGINAL",
3737  0,
3738  "Use Original Size",
3739  "Keep image at its original size"},
3740  {0, NULL, 0, NULL, NULL},
3741  };
3742 
3743  static const EnumPropertyItem scale_overlap_modes[] = {
3744  {SEQ_OVERLAP_EXPAND, "EXPAND", 0, "Expand", "Move strips so transformed strips fits"},
3746  "OVERWRITE",
3747  0,
3748  "Overwrite",
3749  "Trim or split strips to resolve overlap"},
3751  "SHUFFLE",
3752  0,
3753  "Shuffle",
3754  "Move transformed strips to nearest free space to resolve overlap"},
3755  {0, NULL, 0, NULL, NULL},
3756  };
3757 
3758  static const EnumPropertyItem pivot_points[] = {
3759  {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
3760  {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
3761  {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
3763  "INDIVIDUAL_ORIGINS",
3764  ICON_PIVOT_INDIVIDUAL,
3765  "Individual Origins",
3766  "Pivot around each selected island's own median point"},
3767  {0, NULL, 0, NULL, NULL},
3768 
3769  };
3770  srna = RNA_def_struct(brna, "SequencerToolSettings", NULL);
3771  RNA_def_struct_path_func(srna, "rna_SequencerToolSettings_path");
3772  RNA_def_struct_ui_text(srna, "Sequencer Tool Settings", "");
3773 
3774  /* Add strip settings. */
3775  prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_NONE);
3777  RNA_def_property_ui_text(prop, "Fit Method", "Scale fit method");
3778 
3779  /* Transform snapping. */
3780  prop = RNA_def_property(srna, "snap_to_current_frame", PROP_BOOLEAN, PROP_NONE);
3782  RNA_def_property_ui_text(prop, "Current Frame", "Snap to current frame");
3783  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3784 
3785  prop = RNA_def_property(srna, "snap_to_hold_offset", PROP_BOOLEAN, PROP_NONE);
3787  RNA_def_property_ui_text(prop, "Hold Offset", "Snap to strip hold offsets");
3788  RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
3789 
3790  prop = RNA_def_property(srna, "snap_ignore_muted", PROP_BOOLEAN, PROP_NONE);
3792  RNA_def_property_ui_text(prop, "Ignore Muted Strips", "Don't snap to hidden strips");
3793 
3794  prop = RNA_def_property(srna, "snap_ignore_sound", PROP_BOOLEAN, PROP_NONE);
3796  RNA_def_property_ui_text(prop, "Ignore Sound Strips", "Don't snap to sound strips");
3797 
3798  prop = RNA_def_property(srna, "use_snap_current_frame_to_strips", PROP_BOOLEAN, PROP_NONE);
3801  prop, "Snap Current Frame to Strips", "Snap current frame to strip start or end");
3802 
3803  prop = RNA_def_property(srna, "snap_distance", PROP_INT, PROP_PIXEL);
3804  RNA_def_property_int_sdna(prop, NULL, "snap_distance");
3805  RNA_def_property_int_default(prop, 15);
3806  RNA_def_property_ui_range(prop, 0, 50, 1, 1);
3807  RNA_def_property_ui_text(prop, "Snapping Distance", "Maximum distance for snapping in pixels");
3808 
3809  /* Transform overlap handling. */
3810  prop = RNA_def_property(srna, "overlap_mode", PROP_ENUM, PROP_NONE);
3811  RNA_def_property_enum_items(prop, scale_overlap_modes);
3812  RNA_def_property_ui_text(prop, "Overlap Mode", "How to resolve overlap after transformation");
3813 
3814  prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
3815  RNA_def_property_enum_items(prop, pivot_points);
3816  RNA_def_property_ui_text(prop, "Pivot Point", "Rotation or scaling pivot point");
3817 }
3818 
3820 {
3821  StructRNA *srna;
3822  PropertyRNA *prop;
3823 
3824  static const EnumPropertyItem brush_size_unit_items[] = {
3825  {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
3827  "SCENE",
3828  0,
3829  "Scene",
3830  "Measure brush size relative to the scene"},
3831  {0, NULL, 0, NULL, NULL},
3832  };
3833 
3834  srna = RNA_def_struct(brna, "UnifiedPaintSettings", NULL);
3835  RNA_def_struct_path_func(srna, "rna_UnifiedPaintSettings_path");
3837  srna, "Unified Paint Settings", "Overrides for some of the active brush's settings");
3838 
3839  /* high-level flags to enable or disable unified paint settings */
3840  prop = RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE);
3843  "Use Unified Radius",
3844  "Instead of per-brush radius, the radius is shared across brushes");
3845 
3846  prop = RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE);
3849  "Use Unified Strength",
3850  "Instead of per-brush strength, the strength is shared across brushes");
3851 
3852  prop = RNA_def_property(srna, "use_unified_weight", PROP_BOOLEAN, PROP_NONE);
3855  "Use Unified Weight",
3856  "Instead of per-brush weight, the weight is shared across brushes");
3857 
3858  prop = RNA_def_property(srna, "use_unified_color", PROP_BOOLEAN, PROP_NONE);
3861  prop, "Use Unified Color", "Instead of per-brush color, the color is shared across brushes");
3862 
3863  /* unified paint settings that override the equivalent settings
3864  * from the active brush */
3865  prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
3866  RNA_def_property_int_funcs(prop, NULL, "rna_UnifiedPaintSettings_size_set", NULL);
3870  RNA_def_property_ui_text(prop, "Radius", "Radius of the brush");
3871  RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_radius_update");
3872 
3873  prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
3875  prop, NULL, "rna_UnifiedPaintSettings_unprojected_radius_set", NULL);
3877  RNA_def_property_range(prop, 0.001, FLT_MAX);
3878  RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
3879  RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
3880  RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_radius_update");
3881 
3882  prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
3883  RNA_def_property_float_sdna(prop, NULL, "alpha");
3885  RNA_def_property_range(prop, 0.0f, 10.0f);
3886  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3888  prop, "Strength", "How powerful the effect of the brush is when applied");
3889  RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
3890 
3891  prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
3892  RNA_def_property_float_sdna(prop, NULL, "weight");
3894  RNA_def_property_range(prop, 0.0f, 1.0f);
3895  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
3896  RNA_def_property_ui_text(prop, "Weight", "Weight to assign in vertex groups");
3897  RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
3898 
3899  prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
3901  RNA_def_property_range(prop, 0.0, 1.0);
3902  RNA_def_property_float_sdna(prop, NULL, "rgb");
3903  RNA_def_property_ui_text(prop, "Color", "");
3904  RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
3905 
3906  prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR_GAMMA);
3908  RNA_def_property_range(prop, 0.0, 1.0);
3909  RNA_def_property_float_sdna(prop, NULL, "secondary_rgb");
3910  RNA_def_property_ui_text(prop, "Secondary Color", "");
3911  RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
3912 
3913  prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
3915  RNA_def_property_enum_items(prop, brush_size_unit_items);
3917  prop, "Radius Unit", "Measure brush size relative to the view or the scene");
3918 }
3919 
3921 {
3922  StructRNA *srna;
3923  PropertyRNA *prop;
3924 
3925  srna = RNA_def_struct(brna, "CurvePaintSettings", NULL);
3926  RNA_def_struct_path_func(srna, "rna_CurvePaintSettings_path");
3927  RNA_def_struct_ui_text(srna, "Curve Paint Settings", "");
3928 
3929  static const EnumPropertyItem curve_type_items[] = {
3930  {CU_POLY, "POLY", 0, "Poly", ""},
3931  {CU_BEZIER, "BEZIER", 0, "Bezier", ""},
3932  {0, NULL, 0, NULL, NULL},
3933  };
3934 
3935  prop = RNA_def_property(srna, "curve_type", PROP_ENUM, PROP_NONE);
3936  RNA_def_property_enum_sdna(prop, NULL, "curve_type");
3938  RNA_def_property_ui_text(prop, "Type", "Type of curve to use for new strokes");
3939 
3940  prop = RNA_def_property(srna, "use_corners_detect", PROP_BOOLEAN, PROP_NONE);
3942  RNA_def_property_ui_text(prop, "Detect Corners", "Detect corners and use non-aligned handles");
3943 
3944  prop = RNA_def_property(srna, "use_pressure_radius", PROP_BOOLEAN, PROP_NONE);
3946  RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
3947  RNA_def_property_ui_text(prop, "Use Pressure", "Map tablet pressure to curve radius");
3948 
3949  prop = RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
3951  RNA_def_property_ui_text(prop, "Only First", "Use the start of the stroke for the depth");
3952 
3953  prop = RNA_def_property(srna, "use_offset_absolute", PROP_BOOLEAN, PROP_NONE);
3956  prop, "Absolute Offset", "Apply a fixed offset (don't scale by the radius)");
3957 
3958  prop = RNA_def_property(srna, "error_threshold", PROP_INT, PROP_PIXEL);
3959  RNA_def_property_range(prop, 1, 100);
3960  RNA_def_property_ui_text(prop, "Tolerance", "Allow deviation for a smoother, less precise line");
3961 
3962  prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_PIXEL);
3963  RNA_def_property_enum_sdna(prop, NULL, "fit_method");
3965  RNA_def_property_ui_text(prop, "Method", "Curve fitting method");
3966 
3967  prop = RNA_def_property(srna, "corner_angle", PROP_FLOAT, PROP_ANGLE);
3968  RNA_def_property_range(prop, 0, M_PI);
3969  RNA_def_property_ui_text(prop, "Corner Angle", "Angles above this are considered corners");
3970 
3971  prop = RNA_def_property(srna, "radius_min", PROP_FLOAT, PROP_NONE);
3972  RNA_def_property_range(prop, 0.0, 100.0);
3973  RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
3975  prop,
3976  "Radius Min",
3977  "Minimum radius when the minimum pressure is applied (also the minimum when tapering)");
3978 
3979  prop = RNA_def_property(srna, "radius_max", PROP_FLOAT, PROP_NONE);
3980  RNA_def_property_range(prop, 0.0, 100.0);
3981  RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
3983  prop,
3984  "Radius Max",
3985  "Radius to use when the maximum pressure is applied (or when a tablet isn't used)");
3986 
3987  prop = RNA_def_property(srna, "radius_taper_start", PROP_FLOAT, PROP_NONE);
3988  RNA_def_property_range(prop, 0.0, 1.0);
3989  RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
3991  prop, "Radius Min", "Taper factor for the radius of each point along the curve");
3992 
3993  prop = RNA_def_property(srna, "radius_taper_end", PROP_FLOAT, PROP_NONE);
3994  RNA_def_property_range(prop, 0.0, 10.0);
3995  RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
3997  prop, "Radius Max", "Taper factor for the radius of each point along the curve");
3998 
3999  prop = RNA_def_property(srna, "surface_offset", PROP_FLOAT, PROP_NONE);
4000  RNA_def_property_range(prop, -10.0, 10.0);
4001  RNA_def_property_ui_range(prop, -1.0f, 1.0, 1, 2);
4002  RNA_def_property_ui_text(prop, "Offset", "Offset the stroke from the surface");
4003 
4004  static const EnumPropertyItem depth_mode_items[] = {
4005  {CURVE_PAINT_PROJECT_CURSOR, "CURSOR", 0, "Cursor", ""},
4006  {CURVE_PAINT_PROJECT_SURFACE, "SURFACE", 0, "Surface", ""},
4007  {0, NULL, 0, NULL, NULL},
4008  };
4009 
4010  prop = RNA_def_property(srna, "depth_mode", PROP_ENUM, PROP_NONE);
4011  RNA_def_property_enum_sdna(prop, NULL, "depth_mode");
4012  RNA_def_property_enum_items(prop, depth_mode_items);
4013  RNA_def_property_ui_text(prop, "Depth", "Method of projecting depth");
4014 
4015  static const EnumPropertyItem surface_plane_items[] = {
4017  "NORMAL_VIEW",
4018  0,
4019  "Normal/View",
4020  "Display perpendicular to the surface"},
4022  "NORMAL_SURFACE",
4023  0,
4024  "Normal/Surface",
4025  "Display aligned to the surface"},
4026  {CURVE_PAINT_SURFACE_PLANE_VIEW, "VIEW", 0, "View", "Display aligned to the viewport"},
4027  {0, NULL, 0, NULL, NULL},
4028  };
4029 
4030  prop = RNA_def_property(srna, "surface_plane", PROP_ENUM, PROP_NONE);
4031  RNA_def_property_enum_sdna(prop, NULL, "surface_plane");
4032  RNA_def_property_enum_items(prop, surface_plane_items);
4033  RNA_def_property_ui_text(prop, "Plane", "Plane for projected stroke");
4034 }
4035 
4036 static void rna_def_statvis(BlenderRNA *brna)
4037 {
4038  StructRNA *srna;
4039  PropertyRNA *prop;
4040 
4041  static const EnumPropertyItem stat_type[] = {
4042  {SCE_STATVIS_OVERHANG, "OVERHANG", 0, "Overhang", ""},
4043  {SCE_STATVIS_THICKNESS, "THICKNESS", 0, "Thickness", ""},
4044  {SCE_STATVIS_INTERSECT, "INTERSECT", 0, "Intersect", ""},
4045  {SCE_STATVIS_DISTORT, "DISTORT", 0, "Distortion", ""},
4046  {SCE_STATVIS_SHARP, "SHARP", 0, "Sharp", ""},
4047  {0, NULL, 0, NULL, NULL},
4048  };
4049 
4050  srna = RNA_def_struct(brna, "MeshStatVis", NULL);
4051  RNA_def_struct_path_func(srna, "rna_MeshStatVis_path");
4052  RNA_def_struct_ui_text(srna, "Mesh Visualize Statistics", "");
4053 
4054  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4055  RNA_def_property_enum_items(prop, stat_type);
4056  RNA_def_property_ui_text(prop, "Type", "Type of data to visualize/check");
4058  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4059 
4060  /* overhang */
4061  prop = RNA_def_property(srna, "overhang_min", PROP_FLOAT, PROP_ANGLE);
4062  RNA_def_property_float_sdna(prop, NULL, "overhang_min");
4063  RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4064  RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4065  RNA_def_property_ui_text(prop, "Overhang Min", "Minimum angle to display");
4067  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4068 
4069  prop = RNA_def_property(srna, "overhang_max", PROP_FLOAT, PROP_ANGLE);
4070  RNA_def_property_float_sdna(prop, NULL, "overhang_max");
4071  RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4072  RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4073  RNA_def_property_ui_text(prop, "Overhang Max", "Maximum angle to display");
4075  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4076 
4077  prop = RNA_def_property(srna, "overhang_axis", PROP_ENUM, PROP_NONE);
4078  RNA_def_property_enum_sdna(prop, NULL, "overhang_axis");
4080  RNA_def_property_ui_text(prop, "Axis", "");
4082  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4083 
4084  /* thickness */
4085  prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_DISTANCE);
4086  RNA_def_property_float_sdna(prop, NULL, "thickness_min");
4087  RNA_def_property_range(prop, 0.0f, 1000.0);
4088  RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4089  RNA_def_property_ui_text(prop, "Thickness Min", "Minimum for measuring thickness");
4091  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4092 
4093  prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_DISTANCE);
4094  RNA_def_property_float_sdna(prop, NULL, "thickness_max");
4095  RNA_def_property_range(prop, 0.0f, 1000.0);
4096  RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4097  RNA_def_property_ui_text(prop, "Thickness Max", "Maximum for measuring thickness");
4099  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4100 
4101  prop = RNA_def_property(srna, "thickness_samples", PROP_INT, PROP_UNSIGNED);
4102  RNA_def_property_int_sdna(prop, NULL, "thickness_samples");
4103  RNA_def_property_range(prop, 1, 32);
4104  RNA_def_property_ui_text(prop, "Samples", "Number of samples to test per face");
4106  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4107 
4108  /* distort */
4109  prop = RNA_def_property(srna, "distort_min", PROP_FLOAT, PROP_ANGLE);
4110  RNA_def_property_float_sdna(prop, NULL, "distort_min");
4111  RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4112  RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4113  RNA_def_property_ui_text(prop, "Distort Min", "Minimum angle to display");
4115  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4116 
4117  prop = RNA_def_property(srna, "distort_max", PROP_FLOAT, PROP_ANGLE);
4118  RNA_def_property_float_sdna(prop, NULL, "distort_max");
4119  RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4120  RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4121  RNA_def_property_ui_text(prop, "Distort Max", "Maximum angle to display");
4123  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4124 
4125  /* sharp */
4126  prop = RNA_def_property(srna, "sharp_min", PROP_FLOAT, PROP_ANGLE);
4127  RNA_def_property_float_sdna(prop, NULL, "sharp_min");
4128  RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
4129  RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
4130  RNA_def_property_ui_text(prop, "Distort Min", "Minimum angle to display");
4132  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4133 
4134  prop = RNA_def_property(srna, "sharp_max", PROP_FLOAT, PROP_ANGLE);
4135  RNA_def_property_float_sdna(prop, NULL, "sharp_max");
4136  RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
4137  RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
4138  RNA_def_property_ui_text(prop, "Distort Max", "Maximum angle to display");
4140  RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4141 }
4142 
4144 {
4145  StructRNA *srna;
4146  PropertyRNA *prop;
4147 
4148  static const EnumPropertyItem unit_systems[] = {
4149  {USER_UNIT_NONE, "NONE", 0, "None", ""},
4150  {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
4151  {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
4152  {0, NULL, 0, NULL, NULL},
4153  };
4154 
4155  static const EnumPropertyItem rotation_units[] = {
4156  {0, "DEGREES", 0, "Degrees", "Use degrees for measuring angles and rotations"},
4157  {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
4158  {0, NULL, 0, NULL, NULL},
4159  };
4160 
4161  srna = RNA_def_struct(brna, "UnitSettings", NULL);
4162  RNA_def_struct_ui_text(srna, "Unit Settings", "");
4163  RNA_def_struct_nested(brna, srna, "Scene");
4164  RNA_def_struct_path_func(srna, "rna_UnitSettings_path");
4165 
4166  /* Units */
4167  prop = RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
4168  RNA_def_property_enum_items(prop, unit_systems);
4170  prop, "Unit System", "The unit system to use for user interface controls");
4171  RNA_def_property_update(prop, NC_WINDOW, "rna_UnitSettings_system_update");
4172 
4173  prop = RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
4174  RNA_def_property_enum_items(prop, rotation_units);
4176  prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
4178 
4179  prop = RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
4181  prop,
4182  "Unit Scale",
4183  "Scale to use when converting between blender units and dimensions."
4184  " When working at microscopic or astronomical scale, a small or large unit scale"
4185  " respectively can be used to avoid numerical precision problems");
4186  RNA_def_property_range(prop, 1e-9f, 1e+9f);
4187  RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 6);
4189 
4190  prop = RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
4192  RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs (e.g. 1m 0cm)");
4194 
4195  prop = RNA_def_property(srna, "length_unit", PROP_ENUM, PROP_NONE);
4197  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_UnitSettings_length_unit_itemf");
4198  RNA_def_property_ui_text(prop, "Length Unit", "Unit that will be used to display length values");
4200 
4201  prop = RNA_def_property(srna, "mass_unit", PROP_ENUM, PROP_NONE);
4203  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_UnitSettings_mass_unit_itemf");
4204  RNA_def_property_ui_text(prop, "Mass Unit", "Unit that will be used to display mass values");
4206 
4207  prop = RNA_def_property(srna, "time_unit", PROP_ENUM, PROP_NONE);
4209  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_UnitSettings_time_unit_itemf");
4210  RNA_def_property_ui_text(prop, "Time Unit", "Unit that will be used to display time values");
4212 
4213  prop = RNA_def_property(srna, "temperature_unit", PROP_ENUM, PROP_NONE);
4215  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_UnitSettings_temperature_unit_itemf");
4217  prop, "Temperature Unit", "Unit that will be used to display temperature values");
4219 }
4220 
4222 {
4223  StructRNA *srna;
4224  PropertyRNA *prop;
4225  srna = RNA_def_struct(brna, "ViewLayerEEVEE", NULL);
4226  RNA_def_struct_path_func(srna, "rna_ViewLayerEEVEE_path");
4227  RNA_def_struct_ui_text(srna, "Eevee Settings", "View layer settings for Eevee");
4228 
4229  prop = RNA_def_property(srna, "use_pass_volume_direct", PROP_BOOLEAN, PROP_NONE);
4231  RNA_def_property_ui_text(prop, "Volume Light", "Deliver volume direct light pass");
4232  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4233 
4234  prop = RNA_def_property(srna, "use_pass_bloom", PROP_BOOLEAN, PROP_NONE);
4236  RNA_def_property_ui_text(prop, "Bloom", "Deliver bloom pass");
4237  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4238 }
4239 
4241 {
4242  StructRNA *srna;
4243  /* PropertyRNA *prop; */
4244 
4245  FunctionRNA *func;
4246  PropertyRNA *parm;
4247 
4248  RNA_def_property_srna(cprop, "AOVs");
4249  srna = RNA_def_struct(brna, "AOVs", NULL);
4250  RNA_def_struct_sdna(srna, "ViewLayer");
4251  RNA_def_struct_ui_text(srna, "List of AOVs", "Collection of AOVs");
4252 
4253  func = RNA_def_function(srna, "add", "BKE_view_layer_add_aov");
4254  parm = RNA_def_pointer(func, "aov", "AOV", "", "Newly created AOV");
4255  RNA_def_function_return(func, parm);
4256 }
4257 
4259 {
4260  StructRNA *srna;
4261  PropertyRNA *prop;
4262  srna = RNA_def_struct(brna, "AOV", NULL);
4263  RNA_def_struct_sdna(srna, "ViewLayerAOV");
4264  RNA_def_struct_ui_text(srna, "Shader AOV", "");
4265 
4266  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4267  RNA_def_property_string_sdna(prop, NULL, "name");
4269  RNA_def_property_ui_text(prop, "Name", "Name of the AOV");
4270  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4271  RNA_def_struct_name_property(srna, prop);
4272 
4273  prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
4275  RNA_def_property_ui_text(prop, "Valid", "Is the name of the AOV conflicting");
4276 
4277  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4278  RNA_def_property_enum_sdna(prop, NULL, "type");
4281  RNA_def_property_ui_text(prop, "Type", "Data type of the AOV");
4282  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4283 }
4284 
4286 {
4287  StructRNA *srna;
4288  /* PropertyRNA *prop; */
4289 
4290  FunctionRNA *func;
4291  PropertyRNA *parm;
4292 
4293  RNA_def_property_srna(cprop, "Lightgroups");
4294  srna = RNA_def_struct(brna, "Lightgroups", NULL);
4295  RNA_def_struct_sdna(srna, "ViewLayer");
4296  RNA_def_struct_ui_text(srna, "List of Lightgroups", "Collection of Lightgroups");
4297 
4298  func = RNA_def_function(srna, "add", "BKE_view_layer_add_lightgroup");
4299  parm = RNA_def_pointer(func, "lightgroup", "Lightgroup", "", "Newly created Lightgroup");
4300  RNA_def_function_return(func, parm);
4301  parm = RNA_def_string(func, "name", NULL, 0, "Name", "Name of newly created lightgroup");
4302 }
4303 
4305 {
4306  StructRNA *srna;
4307  PropertyRNA *prop;
4308  srna = RNA_def_struct(brna, "Lightgroup", NULL);
4309  RNA_def_struct_sdna(srna, "ViewLayerLightgroup");
4310  RNA_def_struct_ui_text(srna, "Light Group", "");
4311 
4312  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4315  "rna_ViewLayerLightgroup_name_get",
4316  "rna_ViewLayerLightgroup_name_length",
4317  "rna_ViewLayerLightgroup_name_set");
4318  RNA_def_property_ui_text(prop, "Name", "Name of the Lightgroup");
4319  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4320  RNA_def_struct_name_property(srna, prop);
4321 }
4322 
4323 void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool scene)
4324 {
4325  PropertyRNA *prop;
4326 
4327  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4328  if (scene) {
4329  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ViewLayer_name_set");
4330  }
4331  else {
4332  RNA_def_property_string_sdna(prop, NULL, "name");
4333  }
4334  RNA_def_property_ui_text(prop, "Name", "View layer name");
4335  RNA_def_struct_name_property(srna, prop);
4336  if (scene) {
4338  }
4339  else {
4341  }
4342 
4343  if (scene) {
4344  prop = RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
4345  RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
4346  RNA_def_property_struct_type(prop, "Material");
4350  prop, "Material Override", "Material to override all other materials in this view layer");
4352  prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_material_override_update");
4353 
4354  prop = RNA_def_property(srna, "samples", PROP_INT, PROP_UNSIGNED);
4356  "Samples",
4357  "Override number of render samples for this view layer, "
4358  "0 will use the scene setting");
4360 
4361  prop = RNA_def_property(srna, "pass_alpha_threshold", PROP_FLOAT, PROP_FACTOR);
4363  prop,
4364  "Alpha Threshold",
4365  "Z, Index, normal, UV and vector passes are only affected by surfaces with "
4366  "alpha transparency equal to or higher than this threshold");
4368 
4369  prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
4371  RNA_def_property_struct_type(prop, "ViewLayerEEVEE");
4372  RNA_def_property_ui_text(prop, "Eevee Settings", "View layer settings for Eevee");
4373 
4374  prop = RNA_def_property(srna, "aovs", PROP_COLLECTION, PROP_NONE);
4375  RNA_def_property_collection_sdna(prop, NULL, "aovs", NULL);
4376  RNA_def_property_struct_type(prop, "AOV");
4377  RNA_def_property_ui_text(prop, "Shader AOV", "");
4378  rna_def_view_layer_aovs(brna, prop);
4379 
4380  prop = RNA_def_property(srna, "active_aov", PROP_POINTER, PROP_NONE);
4381  RNA_def_property_struct_type(prop, "AOV");
4383  RNA_def_property_ui_text(prop, "Shader AOV", "Active AOV");
4384 
4385  prop = RNA_def_property(srna, "active_aov_index", PROP_INT, PROP_UNSIGNED);
4387  "rna_ViewLayer_active_aov_index_get",
4388  "rna_ViewLayer_active_aov_index_set",
4389  "rna_ViewLayer_active_aov_index_range");
4390  RNA_def_property_ui_text(prop, "Active AOV Index", "Index of active aov");
4392 
4393  prop = RNA_def_property(srna, "lightgroups", PROP_COLLECTION, PROP_NONE);
4394  RNA_def_property_collection_sdna(prop, NULL, "lightgroups", NULL);
4395  RNA_def_property_struct_type(prop, "Lightgroup");
4396  RNA_def_property_ui_text(prop, "Light Groups", "");
4397  rna_def_view_layer_lightgroups(brna, prop);
4398 
4399  prop = RNA_def_property(srna, "active_lightgroup", PROP_POINTER, PROP_NONE);
4400  RNA_def_property_struct_type(prop, "Lightgroup");
4402  RNA_def_property_ui_text(prop, "Light Groups", "Active Lightgroup");
4403 
4404  prop = RNA_def_property(srna, "active_lightgroup_index", PROP_INT, PROP_UNSIGNED);
4406  "rna_ViewLayer_active_lightgroup_index_get",
4407  "rna_ViewLayer_active_lightgroup_index_set",
4408  "rna_ViewLayer_active_lightgroup_index_range");
4409  RNA_def_property_ui_text(prop, "Active Lightgroup Index", "Index of active lightgroup");
4411 
4412  prop = RNA_def_property(srna, "use_pass_cryptomatte_object", PROP_BOOLEAN, PROP_NONE);
4415  prop,
4416  "Cryptomatte Object",
4417  "Render cryptomatte object pass, for isolating objects in compositing");
4418  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4419 
4420  prop = RNA_def_property(srna, "use_pass_cryptomatte_material", PROP_BOOLEAN, PROP_NONE);
4423  prop,
4424  "Cryptomatte Material",
4425  "Render cryptomatte material pass, for isolating materials in compositing");
4426  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4427 
4428  prop = RNA_def_property(srna, "use_pass_cryptomatte_asset", PROP_BOOLEAN, PROP_NONE);
4431  prop,
4432  "Cryptomatte Asset",
4433  "Render cryptomatte asset pass, for isolating groups of objects with the same parent");
4434  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4435 
4436  prop = RNA_def_property(srna, "pass_cryptomatte_depth", PROP_INT, PROP_NONE);
4437  RNA_def_property_int_sdna(prop, NULL, "cryptomatte_levels");
4439  RNA_def_property_range(prop, 2.0, 16.0);
4441  prop, "Cryptomatte Levels", "Sets how many unique objects can be distinguished per pixel");
4442  RNA_def_property_ui_range(prop, 2.0, 16.0, 2.0, 0.0);
4443  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4444 
4445  prop = RNA_def_property(srna, "use_pass_cryptomatte_accurate", PROP_BOOLEAN, PROP_NONE);
4449  prop, "Cryptomatte Accurate", "Generate a more accurate cryptomatte pass");
4450  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4451  }
4452 
4453  prop = RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
4455  RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
4456  if (scene) {
4458  }
4459  else {
4461  }
4462  prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
4463  RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
4464  RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
4465  if (scene) {
4466  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
4467  }
4468  else {
4470  }
4471 
4472  prop = RNA_def_property(srna, "use_ao", PROP_BOOLEAN, PROP_NONE);
4473  RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_AO);
4474  RNA_def_property_ui_text(prop, "Ambient Occlusion", "Render Ambient Occlusion in this Layer");
4475  if (scene) {
4476  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
4477  }
4478  else {
4480  }
4481 
4482  prop = RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
4484  RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
4485  if (scene) {
4487  }
4488  else {
4490  }
4491 
4492  prop = RNA_def_property(srna, "use_volumes", PROP_BOOLEAN, PROP_NONE);
4494  RNA_def_property_ui_text(prop, "Volumes", "Render volumes in this Layer");
4495  if (scene) {
4497  }
4498  else {
4500  }
4501 
4502  prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
4505  prop, "Motion Blur", "Render motion blur in this Layer, if enabled in the scene");
4506  if (scene) {
4508  }
4509  else {
4511  }
4512 
4513  /* passes */
4514  prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
4516  RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
4517  if (scene) {
4518  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4519  }
4520  else {
4522  }
4523 
4524  prop = RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
4525  RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
4526  RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
4527  if (scene) {
4528  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4529  }
4530  else {
4532  }
4533 
4534  prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
4536  RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
4537  if (scene) {
4538  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4539  }
4540  else {
4542  }
4543 
4544  prop = RNA_def_property(srna, "use_pass_position", PROP_BOOLEAN, PROP_NONE);
4546  RNA_def_property_ui_text(prop, "Position", "Deliver position pass");
4547  if (scene) {
4548  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4549  }
4550  else {
4552  }
4553 
4554  prop = RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
4556  RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
4557  if (scene) {
4558  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4559  }
4560  else {
4562  }
4563 
4564  prop = RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
4565  RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
4566  RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
4567  if (scene) {
4568  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4569  }
4570  else {
4572  }
4573 
4574  prop = RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
4575  RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST);
4576  RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0 to 1.0)");
4577  if (scene) {
4578  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4579  }
4580  else {
4582  }
4583 
4584  prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
4586  RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
4587  if (scene) {
4588  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4589  }
4590  else {
4592  }
4593 
4594  prop = RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
4596  RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
4597  if (scene) {
4598  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4599  }
4600  else {
4602  }
4603 
4604  prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
4606  RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
4607  if (scene) {
4608  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4609  }
4610  else {
4612  }
4613 
4614  prop = RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
4615  RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
4616  RNA_def_property_ui_text(prop, "Ambient Occlusion", "Deliver Ambient Occlusion pass");
4617  if (scene) {
4618  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4619  }
4620  else {
4622  }
4623 
4624  prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
4625  RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT);
4626  RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
4627  if (scene) {
4628  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4629  }
4630  else {
4632  }
4633 
4634  prop = RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
4636  RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
4637  if (scene) {
4638  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4639  }
4640  else {
4642  }
4643 
4644  prop = RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
4646  RNA_def_property_ui_text(prop, "Diffuse Direct", "Deliver diffuse direct pass");
4647  if (scene) {
4648  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4649  }
4650  else {
4652  }
4653 
4654  prop = RNA_def_property(srna, "use_pass_diffuse_indirect", PROP_BOOLEAN, PROP_NONE);
4656  RNA_def_property_ui_text(prop, "Diffuse Indirect", "Deliver diffuse indirect pass");
4657  if (scene) {
4658  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4659  }
4660  else {
4662  }
4663 
4664  prop = RNA_def_property(srna, "use_pass_diffuse_color", PROP_BOOLEAN, PROP_NONE);
4666  RNA_def_property_ui_text(prop, "Diffuse Color", "Deliver diffuse color pass");
4667  if (scene) {
4668  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4669  }
4670  else {
4672  }
4673 
4674  prop = RNA_def_property(srna, "use_pass_glossy_direct", PROP_BOOLEAN, PROP_NONE);
4676  RNA_def_property_ui_text(prop, "Glossy Direct", "Deliver glossy direct pass");
4677  if (scene) {
4678  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4679  }
4680  else {
4682  }
4683 
4684  prop = RNA_def_property(srna, "use_pass_glossy_indirect", PROP_BOOLEAN, PROP_NONE);
4686  RNA_def_property_ui_text(prop, "Glossy Indirect", "Deliver glossy indirect pass");
4687  if (scene) {
4688  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4689  }
4690  else {
4692  }
4693 
4694  prop = RNA_def_property(srna, "use_pass_glossy_color", PROP_BOOLEAN, PROP_NONE);
4696  RNA_def_property_ui_text(prop, "Glossy Color", "Deliver glossy color pass");
4697  if (scene) {
4698  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4699  }
4700  else {
4702  }
4703 
4704  prop = RNA_def_property(srna, "use_pass_transmission_direct", PROP_BOOLEAN, PROP_NONE);
4706  RNA_def_property_ui_text(prop, "Transmission Direct", "Deliver transmission direct pass");
4707  if (scene) {
4708  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4709  }
4710  else {
4712  }
4713 
4714  prop = RNA_def_property(srna, "use_pass_transmission_indirect", PROP_BOOLEAN, PROP_NONE);
4716  RNA_def_property_ui_text(prop, "Transmission Indirect", "Deliver transmission indirect pass");
4717  if (scene) {
4718  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4719  }
4720  else {
4722  }
4723 
4724  prop = RNA_def_property(srna, "use_pass_transmission_color", PROP_BOOLEAN, PROP_NONE);
4726  RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass");
4727  if (scene) {
4728  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4729  }
4730  else {
4732  }
4733 
4734  prop = RNA_def_property(srna, "use_pass_subsurface_direct", PROP_BOOLEAN, PROP_NONE);
4736  RNA_def_property_ui_text(prop, "Subsurface Direct", "Deliver subsurface direct pass");
4737  if (scene) {
4738  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4739  }
4740  else {
4742  }
4743 
4744  prop = RNA_def_property(srna, "use_pass_subsurface_indirect", PROP_BOOLEAN, PROP_NONE);
4746  RNA_def_property_ui_text(prop, "Subsurface Indirect", "Deliver subsurface indirect pass");
4747  if (scene) {
4748  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4749  }
4750  else {
4752  }
4753 
4754  prop = RNA_def_property(srna, "use_pass_subsurface_color", PROP_BOOLEAN, PROP_NONE);
4756  RNA_def_property_ui_text(prop, "Subsurface Color", "Deliver subsurface color pass");
4757  if (scene) {
4758  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4759  }
4760  else {
4762  }
4763 }
4764 
4766 {
4767  StructRNA *srna;
4768  FunctionRNA *func;
4769  PropertyRNA *parm;
4770 
4771  RNA_def_property_srna(cprop, "FreestyleModules");
4772  srna = RNA_def_struct(brna, "FreestyleModules", NULL);
4773  RNA_def_struct_sdna(srna, "FreestyleSettings");
4775  srna, "Style Modules", "A list of style modules (to be applied from top to bottom)");
4776 
4777  func = RNA_def_function(srna, "new", "rna_FreestyleSettings_module_add");
4779  "Add a style module to scene render layer Freestyle settings");
4781  parm = RNA_def_pointer(
4782  func, "module", "FreestyleModuleSettings", "", "Newly created style module");
4783  RNA_def_function_return(func, parm);
4784 
4785  func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_module_remove");
4787  func, "Remove a style module from scene render layer Freestyle settings");
4789  parm = RNA_def_pointer(func, "module", "FreestyleModuleSettings", "", "Style module to remove");
4792 }
4793 
4795 {
4796  StructRNA *srna;
4797  PropertyRNA *prop;
4798  FunctionRNA *func;
4799  PropertyRNA *parm;
4800 
4801  RNA_def_property_srna(cprop, "Linesets");
4802  srna = RNA_def_struct(brna, "Linesets", NULL);
4803  RNA_def_struct_sdna(srna, "FreestyleSettings");
4805  srna, "Line Sets", "Line sets for associating lines and style parameters");
4806 
4807  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
4808  RNA_def_property_struct_type(prop, "FreestyleLineSet");
4810  prop, "rna_FreestyleSettings_active_lineset_get", NULL, NULL, NULL);
4811  RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed");
4813 
4814  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
4816  "rna_FreestyleSettings_active_lineset_index_get",
4817  "rna_FreestyleSettings_active_lineset_index_set",
4818  "rna_FreestyleSettings_active_lineset_index_range");
4819  RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
4821 
4822  func = RNA_def_function(srna, "new", "rna_FreestyleSettings_lineset_add");
4823  RNA_def_function_ui_description(func, "Add a line set to scene render layer Freestyle settings");
4825  parm = RNA_def_string(func, "name", "LineSet", 0, "", "New name for the line set (not unique)");
4827  parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Newly created line set");
4828  RNA_def_function_return(func, parm);
4829 
4830  func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_lineset_remove");
4832  "Remove a line set from scene render layer Freestyle settings");
4834  parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Line set to remove");
4837 }
4838 
4840 {
4841  StructRNA *srna;
4842  PropertyRNA *prop;
4843 
4844  static const EnumPropertyItem edge_type_negation_items[] = {
4845  {0,
4846  "INCLUSIVE",
4847  0,
4848  "Inclusive",
4849  "Select feature edges satisfying the given edge type conditions"},
4851  "EXCLUSIVE",
4852  0,
4853  "Exclusive",
4854  "Select feature edges not satisfying the given edge type conditions"},
4855  {0, NULL, 0, NULL, NULL},
4856  };
4857 
4858  static const EnumPropertyItem edge_type_combination_items[] = {
4859  {0,
4860  "OR",
4861  0,
4862  "Logical OR",
4863  "Select feature edges satisfying at least one of edge type conditions"},
4865  "AND",
4866  0,
4867  "Logical AND",
4868  "Select feature edges satisfying all edge type conditions"},
4869  {0, NULL, 0, NULL, NULL},
4870  };
4871 
4872  static const EnumPropertyItem collection_negation_items[] = {
4873  {0,
4874  "INCLUSIVE",
4875  0,
4876  "Inclusive",
4877  "Select feature edges belonging to some object in the group"},
4879  "EXCLUSIVE",
4880  0,
4881  "Exclusive",
4882  "Select feature edges not belonging to any object in the group"},
4883  {0, NULL, 0, NULL, NULL},
4884  };
4885 
4886  static const EnumPropertyItem face_mark_negation_items[] = {
4887  {0,
4888  "INCLUSIVE",
4889  0,
4890  "Inclusive",
4891  "Select feature edges satisfying the given face mark conditions"},
4893  "EXCLUSIVE",
4894  0,
4895  "Exclusive",
4896  "Select feature edges not satisfying the given face mark conditions"},
4897  {0, NULL, 0, NULL, NULL},
4898  };
4899 
4900  static const EnumPropertyItem face_mark_condition_items[] = {
4901  {0, "ONE", 0, "One Face", "Select a feature edge if either of its adjacent faces is marked"},
4903  "BOTH",
4904  0,
4905  "Both Faces",
4906  "Select a feature edge if both of its adjacent faces are marked"},
4907  {0, NULL, 0, NULL, NULL},
4908  };
4909 
4910  static const EnumPropertyItem freestyle_ui_mode_items[] = {
4912  "SCRIPT",
4913  0,
4914  "Python Scripting",
4915  "Advanced mode for using style modules written in Python"},
4917  "EDITOR",
4918  0,
4919  "Parameter Editor",
4920  "Basic mode for interactive style parameter editing"},
4921  {0, NULL, 0, NULL, NULL},
4922  };
4923 
4924  static const EnumPropertyItem visibility_items[] = {
4925  {FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible feature edges"},
4926  {FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden feature edges"},
4928  "RANGE",
4929  0,
4930  "Quantitative Invisibility",
4931  "Select feature edges within a range of quantitative invisibility (QI) values"},
4932  {0, NULL, 0, NULL, NULL},
4933  };
4934 
4935  /* FreestyleLineSet */
4936 
4937  srna = RNA_def_struct(brna, "FreestyleLineSet", NULL);
4939  srna, "Freestyle Line Set", "Line set for associating lines and style parameters");
4940 
4941  /* access to line style settings is redirected through functions
4942  * to allow proper id-buttons functionality
4943  */
4944  prop = RNA_def_property(srna, "linestyle", PROP_POINTER, PROP_NONE);
4945  RNA_def_property_struct_type(prop, "FreestyleLineStyle");
4948  "rna_FreestyleLineSet_linestyle_get",
4949  "rna_FreestyleLineSet_linestyle_set",
4950  NULL,
4951  NULL);
4952  RNA_def_property_ui_text(prop, "Line Style", "Line style settings");
4953  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
4954 
4955  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4956  RNA_def_property_string_sdna(prop, NULL, "name");
4957  RNA_def_property_ui_text(prop, "Line Set Name", "Line set name");
4959  RNA_def_struct_name_property(srna, prop);
4960 
4961  prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
4964  prop, "Render", "Enable or disable this line set during stroke rendering");
4965  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
4966 
4967  prop = RNA_def_property(srna, "select_by_visibility", PROP_BOOLEAN, PROP_NONE);
4970  prop, "Selection by Visibility", "Select feature edges based on visibility");
4971  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
4972 
4973  prop = RNA_def_property(srna, "select_by_edge_types", PROP_BOOLEAN, PROP_NONE);
4976  prop, "Selection by Edge Types", "Select feature edges based on edge types");
4977  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
4978 
4979  prop = RNA_def_property(srna, "select_by_collection", PROP_BOOLEAN, PROP_NONE);
4982  prop, "Selection by Collection", "Select feature edges based on a collection of objects");
4983  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
4984 
4985  prop = RNA_def_property(srna, "select_by_image_border", PROP_BOOLEAN, PROP_NONE);
4988  "Selection by Image Border",
4989  "Select feature edges by image border (less memory consumption)");
4990  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
4991 
4992  prop = RNA_def_property(srna, "select_by_face_marks", PROP_BOOLEAN, PROP_NONE);
4994  RNA_def_property_ui_text(prop, "Selection by Face Marks", "Select feature edges by face marks");
4995  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
4996 
4997  prop = RNA_def_property(srna, "edge_type_negation", PROP_ENUM, PROP_NONE);
4998  RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
4999  RNA_def_property_enum_items(prop, edge_type_negation_items);
5001  prop,
5002  "Edge Type Negation",
5003  "Specify either inclusion or exclusion of feature edges selected by edge types");
5004  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5005 
5006  prop = RNA_def_property(srna, "edge_type_combination", PROP_ENUM, PROP_NONE);
5007  RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
5008  RNA_def_property_enum_items(prop, edge_type_combination_items);
5010  prop,
5011  "Edge Type Combination",
5012  "Specify a logical combination of selection conditions on feature edge types");
5013  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5014 
5015  prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
5016  RNA_def_property_pointer_sdna(prop, NULL, "group");
5017  RNA_def_property_struct_type(prop, "Collection");
5020  prop, "Collection", "A collection of objects based on which feature edges are selected");
5021  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5022 
5023  prop = RNA_def_property(srna, "collection_negation", PROP_ENUM, PROP_NONE);
5024  RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
5025  RNA_def_property_enum_items(prop, collection_negation_items);
5027  "Collection Negation",
5028  "Specify either inclusion or exclusion of feature edges belonging to a "
5029  "collection of objects");
5030  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5031 
5032  prop = RNA_def_property(srna, "face_mark_negation", PROP_ENUM, PROP_NONE);
5033  RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
5034  RNA_def_property_enum_items(prop, face_mark_negation_items);
5036  prop,
5037  "Face Mark Negation",
5038  "Specify either inclusion or exclusion of feature edges selected by face marks");
5039  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5040 
5041  prop = RNA_def_property(srna, "face_mark_condition", PROP_ENUM, PROP_NONE);
5042  RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
5043  RNA_def_property_enum_items(prop, face_mark_condition_items);
5045  "Face Mark Condition",
5046  "Specify a feature edge selection condition based on face marks");
5047  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5048 
5049  prop = RNA_def_property(srna, "select_silhouette", PROP_BOOLEAN, PROP_NONE);
5052  prop,
5053  "Silhouette",
5054  "Select silhouettes (edges at the boundary of visible and hidden faces)");
5055  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5056 
5057  prop = RNA_def_property(srna, "select_border", PROP_BOOLEAN, PROP_NONE);
5059  RNA_def_property_ui_text(prop, "Border", "Select border edges (open mesh edges)");
5060  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5061 
5062  prop = RNA_def_property(srna, "select_crease", PROP_BOOLEAN, PROP_NONE);
5065  "Crease",
5066  "Select crease edges (those between two faces making an angle smaller "
5067  "than the Crease Angle)");
5068  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5069 
5070  prop = RNA_def_property(srna, "select_ridge_valley", PROP_BOOLEAN, PROP_NONE);
5073  prop,
5074  "Ridge & Valley",
5075  "Select ridges and valleys (boundary lines between convex and concave areas of surface)");
5076  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5077 
5078  prop = RNA_def_property(srna, "select_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
5081  prop, "Suggestive Contour", "Select suggestive contours (almost silhouette/contour edges)");
5082  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5083 
5084  prop = RNA_def_property(srna, "select_material_boundary", PROP_BOOLEAN, PROP_NONE);
5086  RNA_def_property_ui_text(prop, "Material Boundary", "Select edges at material boundaries");
5087  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5088 
5089  prop = RNA_def_property(srna, "select_contour", PROP_BOOLEAN, PROP_NONE);
5091  RNA_def_property_ui_text(prop, "Contour", "Select contours (outer silhouettes of each object)");
5092  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5093 
5094  prop = RNA_def_property(srna, "select_external_contour", PROP_BOOLEAN, PROP_NONE);
5097  prop,
5098  "External Contour",
5099  "Select external contours (outer silhouettes of occluding and occluded objects)");
5100  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5101 
5102  prop = RNA_def_property(srna, "select_edge_mark", PROP_BOOLEAN, PROP_NONE);
5105  prop, "Edge Mark", "Select edge marks (edges annotated by Freestyle edge marks)");
5106  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5107 
5108  prop = RNA_def_property(srna, "exclude_silhouette", PROP_BOOLEAN, PROP_NONE);
5109  RNA_def_property_boolean_sdna(prop, NULL, "exclude_edge_types", FREESTYLE_FE_SILHOUETTE);
5110  RNA_def_property_ui_text(prop, "Silhouette", "Exclude silhouette edges");
5111  RNA_def_property_ui_icon(prop, ICON_X, 0);
5112  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5113 
5114  prop = RNA_def_property(srna, "exclude_border", PROP_BOOLEAN, PROP_NONE);
5115  RNA_def_property_boolean_sdna(prop, NULL, "exclude_edge_types", FREESTYLE_FE_BORDER);
5116  RNA_def_property_ui_text(prop, "Border", "Exclude border edges");
5117  RNA_def_property_ui_icon(prop, ICON_X, 0);
5118  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5119 
5120  prop = RNA_def_property(srna, "exclude_crease", PROP_BOOLEAN, PROP_NONE);
5121  RNA_def_property_boolean_sdna(prop, NULL, "exclude_edge_types", FREESTYLE_FE_CREASE);
5122  RNA_def_property_ui_text(prop, "Crease", "Exclude crease edges");
5123  RNA_def_property_ui_icon(prop, ICON_X, 0);
5124  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5125 
5126  prop = RNA_def_property(srna, "exclude_ridge_valley", PROP_BOOLEAN, PROP_NONE);
5127  RNA_def_property_boolean_sdna(prop, NULL, "exclude_edge_types", FREESTYLE_FE_RIDGE_VALLEY);
5128  RNA_def_property_ui_text(prop, "Ridge & Valley", "Exclude ridges and valleys");
5129  RNA_def_property_ui_icon(prop, ICON_X, 0);
5130  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5131 
5132  prop = RNA_def_property(srna, "exclude_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
5134  RNA_def_property_ui_text(prop, "Suggestive Contour", "Exclude suggestive contours");
5135  RNA_def_property_ui_icon(prop, ICON_X, 0);
5136  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5137 
5138  prop = RNA_def_property(srna, "exclude_material_boundary", PROP_BOOLEAN, PROP_NONE);
5140  RNA_def_property_ui_text(prop, "Material Boundary", "Exclude edges at material boundaries");
5141  RNA_def_property_ui_icon(prop, ICON_X, 0);
5142  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5143 
5144  prop = RNA_def_property(srna, "exclude_contour", PROP_BOOLEAN, PROP_NONE);
5145  RNA_def_property_boolean_sdna(prop, NULL, "exclude_edge_types", FREESTYLE_FE_CONTOUR);
5146  RNA_def_property_ui_text(prop, "Contour", "Exclude contours");
5147  RNA_def_property_ui_icon(prop, ICON_X, 0);
5148  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5149 
5150  prop = RNA_def_property(srna, "exclude_external_contour", PROP_BOOLEAN, PROP_NONE);
5152  RNA_def_property_ui_text(prop, "External Contour", "Exclude external contours");
5153  RNA_def_property_ui_icon(prop, ICON_X, 0);
5154  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5155 
5156  prop = RNA_def_property(srna, "exclude_edge_mark", PROP_BOOLEAN, PROP_NONE);
5157  RNA_def_property_boolean_sdna(prop, NULL, "exclude_edge_types", FREESTYLE_FE_EDGE_MARK);
5158  RNA_def_property_ui_text(prop, "Edge Mark", "Exclude edge marks");
5159  RNA_def_property_ui_icon(prop, ICON_X, 0);
5160  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5161 
5162  prop = RNA_def_property(srna, "visibility", PROP_ENUM, PROP_NONE);
5163  RNA_def_property_enum_sdna(prop, NULL, "qi");
5164  RNA_def_property_enum_items(prop, visibility_items);
5166  prop, "Visibility", "Determine how to use visibility for feature edge selection");
5167  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5168 
5169  prop = RNA_def_property(srna, "qi_start", PROP_INT, PROP_UNSIGNED);
5170  RNA_def_property_int_sdna(prop, NULL, "qi_start");
5171  RNA_def_property_range(prop, 0, INT_MAX);
5172  RNA_def_property_ui_text(prop, "Start", "First QI value of the QI range");
5173  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5174 
5175  prop = RNA_def_property(srna, "qi_end", PROP_INT, PROP_UNSIGNED);
5176  RNA_def_property_int_sdna(prop, NULL, "qi_end");
5177  RNA_def_property_range(prop, 0, INT_MAX);
5178  RNA_def_property_ui_text(prop, "End", "Last QI value of the QI range");
5179  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5180 
5181  /* FreestyleModuleSettings */
5182 
5183  srna = RNA_def_struct(brna, "FreestyleModuleSettings", NULL);
5184  RNA_def_struct_sdna(srna, "FreestyleModuleConfig");
5186  srna, "Freestyle Module", "Style module configuration for specifying a style module");
5187 
5188  prop = RNA_def_property(srna, "script", PROP_POINTER, PROP_NONE);
5189  RNA_def_property_struct_type(prop, "Text");
5191  RNA_def_property_ui_text(prop, "Style Module", "Python script to define a style module");
5192  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5193 
5194  prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
5195  RNA_def_property_boolean_sdna(prop, NULL, "is_displayed", 1);
5197  prop, "Use", "Enable or disable this style module during stroke rendering");
5198  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5199 
5200  /* FreestyleSettings */
5201 
5202  srna = RNA_def_struct(brna, "FreestyleSettings", NULL);
5203  RNA_def_struct_sdna(srna, "FreestyleConfig");
5204  RNA_def_struct_nested(brna, srna, "ViewLayer");
5206  srna, "Freestyle Settings", "Freestyle settings for a ViewLayer data-block");
5207 
5208  prop = RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
5209  RNA_def_property_collection_sdna(prop, NULL, "modules", NULL);
5210  RNA_def_property_struct_type(prop, "FreestyleModuleSettings");
5212  prop, "Style Modules", "A list of style modules (to be applied from top to bottom)");
5213  rna_def_freestyle_modules(brna, prop);
5214 
5215  prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
5216  RNA_def_property_enum_sdna(prop, NULL, "mode");
5217  RNA_def_property_enum_items(prop, freestyle_ui_mode_items);
5218  RNA_def_property_ui_text(prop, "Control Mode", "Select the Freestyle control mode");
5219  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5220 
5221  prop = RNA_def_property(srna, "use_culling", PROP_BOOLEAN, PROP_NONE);
5223  RNA_def_property_ui_text(prop, "Culling", "If enabled, out-of-view edges are ignored");
5224  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5225 
5226  prop = RNA_def_property(srna, "use_suggestive_contours", PROP_BOOLEAN, PROP_NONE);
5228  RNA_def_property_ui_text(prop, "Suggestive Contours", "Enable suggestive contours");
5229  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5230 
5231  prop = RNA_def_property(srna, "use_ridges_and_valleys", PROP_BOOLEAN, PROP_NONE);
5233  RNA_def_property_ui_text(prop, "Ridges and Valleys", "Enable ridges and valleys");
5234  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5235 
5236  prop = RNA_def_property(srna, "use_material_boundaries", PROP_BOOLEAN, PROP_NONE);
5238  RNA_def_property_ui_text(prop, "Material Boundaries", "Enable material boundaries");
5239  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5240 
5241  prop = RNA_def_property(srna, "use_smoothness", PROP_BOOLEAN, PROP_NONE);
5244  prop, "Face Smoothness", "Take face smoothness into account in view map calculation");
5245  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5246 
5247  prop = RNA_def_property(srna, "use_view_map_cache", PROP_BOOLEAN, PROP_NONE);
5250  prop,
5251  "View Map Cache",
5252  "Keep the computed view map and avoid recalculating it if mesh geometry is unchanged");
5254  prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_view_map_cache_update");
5255 
5256  prop = RNA_def_property(srna, "as_render_pass", PROP_BOOLEAN, PROP_NONE);
5259  prop,
5260  "As Render Pass",
5261  "Renders Freestyle output to a separate pass instead of overlaying it on the Combined pass");
5262  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5263 
5264  prop = RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
5265  RNA_def_property_float_sdna(prop, NULL, "sphere_radius");
5266  RNA_def_property_float_default(prop, 1.0);
5267  RNA_def_property_range(prop, 0.0, 1000.0);
5268  RNA_def_property_ui_text(prop, "Sphere Radius", "Sphere radius for computing curvatures");
5269  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5270 
5271  prop = RNA_def_property(srna, "kr_derivative_epsilon", PROP_FLOAT, PROP_NONE);
5272  RNA_def_property_float_default(prop, 0.0);
5273  RNA_def_property_float_sdna(prop, NULL, "dkr_epsilon");
5274  RNA_def_property_range(prop, -1000.0, 1000.0);
5276  prop, "Kr Derivative Epsilon", "Kr derivative epsilon for computing suggestive contours");
5277  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5278 
5279  prop = RNA_def_property(srna, "crease_angle", PROP_FLOAT, PROP_ANGLE);
5280  RNA_def_property_float_sdna(prop, NULL, "crease_angle");
5281  RNA_def_property_range(prop, 0.0, DEG2RAD(180.0));
5282  RNA_def_property_ui_text(prop, "Crease Angle", "Angular threshold for detecting crease edges");
5283  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5284 
5285  prop = RNA_def_property(srna, "linesets", PROP_COLLECTION, PROP_NONE);
5286  RNA_def_property_collection_sdna(prop, NULL, "linesets", NULL);
5287  RNA_def_property_struct_type(prop, "FreestyleLineSet");
5288  RNA_def_property_ui_text(prop, "Line Sets", "");
5289  rna_def_freestyle_linesets(brna, prop);
5290 }
5291 
5292 static void rna_def_bake_data(BlenderRNA *brna)
5293 {
5294  StructRNA *srna;
5295  PropertyRNA *prop;
5296 
5297  srna = RNA_def_struct(brna, "BakeSettings", NULL);
5298  RNA_def_struct_sdna(srna, "BakeData");
5299  RNA_def_struct_nested(brna, srna, "RenderSettings");
5300  RNA_def_struct_ui_text(srna, "Bake Data", "Bake data for a Scene data-block");
5301  RNA_def_struct_path_func(srna, "rna_BakeSettings_path");
5302 
5303  prop = RNA_def_property(srna, "cage_object", PROP_POINTER, PROP_NONE);
5305  prop,
5306  "Cage Object",
5307  "Object to use as cage "
5308  "instead of calculating the cage from the active object with cage extrusion");
5311 
5312  prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
5313  RNA_def_property_ui_text(prop, "File Path", "Image filepath to use when saving externally");
5315 
5316  prop = RNA_def_property(srna, "width", PROP_INT, PROP_PIXEL);
5317  RNA_def_property_range(prop, 4, 10000);
5318  RNA_def_property_ui_text(prop, "Width", "Horizontal dimension of the baking map");
5320 
5321  prop = RNA_def_property(srna, "height", PROP_INT, PROP_PIXEL);
5322  RNA_def_property_range(prop, 4, 10000);
5323  RNA_def_property_ui_text(prop, "Height", "Vertical dimension of the baking map");
5325 
5326  prop = RNA_def_property(srna, "margin", PROP_INT, PROP_PIXEL);
5327  RNA_def_property_range(prop, 0, SHRT_MAX);
5328  RNA_def_property_ui_range(prop, 0, 64, 1, 1);
5329  RNA_def_property_ui_text(prop, "Margin", "Extends the baked result as a post process filter");
5331 
5332  prop = RNA_def_property(srna, "margin_type", PROP_ENUM, PROP_NONE);
5334  RNA_def_property_ui_text(prop, "Margin Type", "Algorithm to extend the baked result");
5336 
5337  prop = RNA_def_property(srna, "max_ray_distance", PROP_FLOAT, PROP_DISTANCE);
5338  RNA_def_property_range(prop, 0.0, FLT_MAX);
5339  RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
5341  "Max Ray Distance",
5342  "The maximum ray distance for matching points between the active and "
5343  "selected objects. If zero, there is no limit");
5345 
5346  prop = RNA_def_property(srna, "cage_extrusion", PROP_FLOAT, PROP_DISTANCE);
5347  RNA_def_property_range(prop, 0.0, FLT_MAX);
5348  RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
5350  prop,
5351  "Cage Extrusion",
5352  "Inflate the active object by the specified distance for baking. This helps matching to "
5353  "points nearer to the outside of the selected object meshes");
5355 
5356  prop = RNA_def_property(srna, "normal_space", PROP_ENUM, PROP_NONE);
5357  RNA_def_property_enum_bitflag_sdna(prop, NULL, "normal_space");
5359  RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
5361 
5362  prop = RNA_def_property(srna, "normal_r", PROP_ENUM, PROP_NONE);
5363  RNA_def_property_enum_bitflag_sdna(prop, NULL, "normal_swizzle[0]");
5365  RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in red channel");
5367 
5368  prop = RNA_def_property(srna, "normal_g", PROP_ENUM, PROP_NONE);
5369  RNA_def_property_enum_bitflag_sdna(prop, NULL, "normal_swizzle[1]");
5371  RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in green channel");
5373 
5374  prop = RNA_def_property(srna, "normal_b", PROP_ENUM, PROP_NONE);
5375  RNA_def_property_enum_bitflag_sdna(prop, NULL, "normal_swizzle[2]");
5377  RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in blue channel");
5379 
5380  prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
5382  RNA_def_property_pointer_sdna(prop, NULL, "im_format");
5383  RNA_def_property_struct_type(prop, "ImageFormatSettings");
5384  RNA_def_property_ui_text(prop, "Image Format", "");
5385 
5386  prop = RNA_def_property(srna, "target", PROP_ENUM, PROP_NONE);
5388  RNA_def_property_ui_text(prop, "Target", "Where to output the baked map");
5390 
5391  prop = RNA_def_property(srna, "save_mode", PROP_ENUM, PROP_NONE);
5392  RNA_def_property_enum_bitflag_sdna(prop, NULL, "save_mode");
5394  RNA_def_property_ui_text(prop, "Save Mode", "Where to save baked image textures");
5396 
5397  /* flags */
5398  prop = RNA_def_property(srna, "use_selected_to_active", PROP_BOOLEAN, PROP_NONE);
5401  "Selected to Active",
5402  "Bake shading on the surface of selected objects to the active object");
5404 
5405  prop = RNA_def_property(srna, "use_clear", PROP_BOOLEAN, PROP_NONE);
5407  RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking (internal only)");
5409 
5410  prop = RNA_def_property(srna, "use_split_materials", PROP_BOOLEAN, PROP_NONE);
5413  prop, "Split Materials", "Split external images per material (external only)");
5415 
5416  prop = RNA_def_property(srna, "use_automatic_name", PROP_BOOLEAN, PROP_NONE);
5419  prop,
5420  "Automatic Name",
5421  "Automatically name the output file with the pass type (external only)");
5423 
5424  prop = RNA_def_property(srna, "use_cage", PROP_BOOLEAN, PROP_NONE);
5426  RNA_def_property_ui_text(prop, "Cage", "Cast rays to active object from a cage");
5428 
5429  /* custom passes flags */
5430  prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
5432  RNA_def_property_ui_text(prop, "Emit", "Add emission contribution");
5433 
5434  prop = RNA_def_property(srna, "use_pass_direct", PROP_BOOLEAN, PROP_NONE);
5436  RNA_def_property_ui_text(prop, "Direct", "Add direct lighting contribution");
5438 
5439  prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
5441  RNA_def_property_ui_text(prop, "Indirect", "Add indirect lighting contribution");
5443 
5444  prop = RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
5446  RNA_def_property_ui_text(prop, "Color", "Color the pass");
5448 
5449  prop = RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
5451  RNA_def_property_ui_text(prop, "Diffuse", "Add diffuse contribution");
5453 
5454  prop = RNA_def_property(srna, "use_pass_glossy", PROP_BOOLEAN, PROP_NONE);
5456  RNA_def_property_ui_text(prop, "Glossy", "Add glossy contribution");
5458 
5459  prop = RNA_def_property(srna, "use_pass_transmission", PROP_BOOLEAN, PROP_NONE);
5461  RNA_def_property_ui_text(prop, "Transmission", "Add transmission contribution");
5463 
5464  prop = RNA_def_property(srna, "pass_filter", PROP_ENUM, PROP_NONE);
5465  RNA_def_property_enum_sdna(prop, NULL, "pass_filter");
5468  RNA_def_property_ui_text(prop, "Pass Filter", "Passes to include in the active baking pass");
5470 }
5471 
5472 static void rna_def_view_layers(BlenderRNA *brna, PropertyRNA *cprop)
5473 {
5474  StructRNA *srna;
5475  FunctionRNA *func;
5476  PropertyRNA *parm;
5477 
5478  RNA_def_property_srna(cprop, "ViewLayers");
5479  srna = RNA_def_struct(brna, "ViewLayers", NULL);
5480  RNA_def_struct_sdna(srna, "Scene");
5481  RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
5482 
5483  func = RNA_def_function(srna, "new", "rna_ViewLayer_new");
5484  RNA_def_function_ui_description(func, "Add a view layer to scene");
5486  parm = RNA_def_string(
5487  func, "name", "ViewLayer", 0, "", "New name for the view layer (not unique)");
5489  parm = RNA_def_pointer(func, "result", "ViewLayer", "", "Newly created view layer");
5490  RNA_def_function_return(func, parm);
5491 
5492  func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove");
5493  RNA_def_function_ui_description(func, "Remove a view layer");
5495  parm = RNA_def_pointer(func, "layer", "ViewLayer", "", "View layer to remove");
5498 }
5499 
5500 /* Render Views - MultiView */
5502 {
5503  StructRNA *srna;
5504  PropertyRNA *prop;
5505 
5506  srna = RNA_def_struct(brna, "SceneRenderView", NULL);
5508  srna, "Scene Render View", "Render viewpoint for 3D stereo and multiview rendering");
5509  RNA_def_struct_ui_icon(srna, ICON_RESTRICT_RENDER_OFF);
5510  RNA_def_struct_path_func(srna, "rna_SceneRenderView_path");
5511 
5512  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5513  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderView_name_set");
5514  RNA_def_property_ui_text(prop, "Name", "Render view name");
5515  RNA_def_struct_name_property(srna, prop);
5517 
5518  prop = RNA_def_property(srna, "file_suffix", PROP_STRING, PROP_NONE);
5519  RNA_def_property_string_sdna(prop, NULL, "suffix");
5520  RNA_def_property_ui_text(prop, "File Suffix", "Suffix added to the render images for this view");
5522 
5523  prop = RNA_def_property(srna, "camera_suffix", PROP_STRING, PROP_NONE);
5524  RNA_def_property_string_sdna(prop, NULL, "suffix");
5526  prop,
5527  "Camera Suffix",
5528  "Suffix to identify the cameras to use, and added to the render images for this view");
5530 
5531  prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
5534  RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render view");
5536 }
5537 
5538 static void rna_def_render_views(BlenderRNA *brna, PropertyRNA *cprop)
5539 {
5540  StructRNA *srna;
5541  PropertyRNA *prop;
5542 
5543  FunctionRNA *func;
5544  PropertyRNA *parm;
5545 
5546  RNA_def_property_srna(cprop, "RenderViews");
5547  srna = RNA_def_struct(brna, "RenderViews", NULL);
5548  RNA_def_struct_sdna(srna, "RenderData");
5549  RNA_def_struct_ui_text(srna, "Render Views", "Collection of render views");
5550 
5551  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
5552  RNA_def_property_int_sdna(prop, NULL, "actview");
5554  "rna_RenderSettings_active_view_index_get",
5555  "rna_RenderSettings_active_view_index_set",
5556  "rna_RenderSettings_active_view_index_range");
5557  RNA_def_property_ui_text(prop, "Active View Index", "Active index in render view array");
5559 
5560  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
5561  RNA_def_property_struct_type(prop, "SceneRenderView");
5563  "rna_RenderSettings_active_view_get",
5564  "rna_RenderSettings_active_view_set",
5565  NULL,
5566  NULL);
5568  RNA_def_property_ui_text(prop, "Active Render View", "Active Render View");
5570 
5571  func = RNA_def_function(srna, "new", "rna_RenderView_new");
5572  RNA_def_function_ui_description(func, "Add a render view to scene");
5574  parm = RNA_def_string(func, "name", "RenderView", 0, "", "New name for the marker (not unique)");
5576  parm = RNA_def_pointer(func, "result", "SceneRenderView", "", "Newly created render view");
5577  RNA_def_function_return(func, parm);
5578 
5579  func = RNA_def_function(srna, "remove", "rna_RenderView_remove");
5580  RNA_def_function_ui_description(func, "Remove a render view");
5582  parm = RNA_def_pointer(func, "view", "SceneRenderView", "", "Render view to remove");
5585 }
5586 
5588 {
5589  StructRNA *srna;
5590  PropertyRNA *prop;
5591 
5592  /* rna_enum_stereo3d_display_items, without (S3D_DISPLAY_PAGEFLIP) */
5593  static const EnumPropertyItem stereo3d_display_items[] = {
5595  "ANAGLYPH",
5596  0,
5597  "Anaglyph",
5598  "Render views for left and right eyes as two differently filtered colors in a single image "
5599  "(anaglyph glasses are required)"},
5601  "INTERLACE",
5602  0,
5603  "Interlace",
5604  "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
5605  "required)"},
5607  "SIDEBYSIDE",
5608  0,
5609  "Side-by-Side",
5610  "Render views for left and right eyes side-by-side"},
5612  "TOPBOTTOM",
5613  0,
5614  "Top-Bottom",
5615  "Render views for left and right eyes one above another"},
5616  {0, NULL, 0, NULL, NULL},
5617  };
5618 
5619  srna = RNA_def_struct(brna, "Stereo3dFormat", NULL);
5620  RNA_def_struct_sdna(srna, "Stereo3dFormat");
5622  RNA_def_struct_ui_text(srna, "Stereo Output", "Settings for stereo output");
5623 
5624  prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
5625  RNA_def_property_enum_sdna(prop, NULL, "display_mode");
5626  RNA_def_property_enum_items(prop, stereo3d_display_items);
5627  RNA_def_property_ui_text(prop, "Stereo Mode", "");
5628  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
5629 
5630  prop = RNA_def_property(srna, "anaglyph_type", PROP_ENUM, PROP_NONE);
5632  RNA_def_property_ui_text(prop, "Anaglyph Type", "");
5633  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
5634 
5635  prop = RNA_def_property(srna, "interlace_type", PROP_ENUM, PROP_NONE);
5637  RNA_def_property_ui_text(prop, "Interlace Type", "");
5638  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
5639 
5640  prop = RNA_def_property(srna, "use_interlace_swap", PROP_BOOLEAN, PROP_BOOLEAN);
5642  RNA_def_property_ui_text(prop, "Swap Left/Right", "Swap left and right stereo channels");
5643  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
5644 
5645  prop = RNA_def_property(srna, "use_sidebyside_crosseyed", PROP_BOOLEAN, PROP_BOOLEAN);
5647  RNA_def_property_ui_text(prop, "Cross-Eyed", "Right eye should see left image and vice versa");
5648  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
5649 
5650  prop = RNA_def_property(srna, "use_squeezed_frame", PROP_BOOLEAN, PROP_BOOLEAN);
5652  RNA_def_property_ui_text(prop, "Squeezed Frame", "Combine both views in a squeezed image");
5653  RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
5654 }
5655 
5656 /* use for render output and image save operator,
5657  * NOTE: there are some cases where the members act differently when this is
5658  * used from a scene, video formats can only be selected for render output
5659  * for example, this is checked by seeing if the ptr->owner_id is a Scene id */
5660 
5662 {
5663 
5664 # ifdef WITH_OPENJPEG
5665  static const EnumPropertyItem jp2_codec_items[] = {
5666  {R_IMF_JP2_CODEC_JP2, "JP2", 0, "JP2", ""},
5667  {R_IMF_JP2_CODEC_J2K, "J2K", 0, "J2K", ""},
5668  {0, NULL, 0, NULL, NULL},
5669  };
5670 # endif
5671 
5672 # ifdef WITH_TIFF
5673  static const EnumPropertyItem tiff_codec_items[] = {
5674  {R_IMF_TIFF_CODEC_NONE, "NONE", 0, "None", ""},
5675  {R_IMF_TIFF_CODEC_DEFLATE, "DEFLATE", 0, "Deflate", ""},
5676  {R_IMF_TIFF_CODEC_LZW, "LZW", 0, "LZW", ""},
5677  {R_IMF_TIFF_CODEC_PACKBITS, "PACKBITS", 0, "Pack Bits", ""},
5678  {0, NULL, 0, NULL, NULL},
5679  };
5680 # endif
5681 
5682  static const EnumPropertyItem color_management_items[] = {
5683  {R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE, "FOLLOW_SCENE", 0, "Follow Scene", ""},
5684  {R_IMF_COLOR_MANAGEMENT_OVERRIDE, "OVERRIDE", 0, "Override", ""},
5685  {0, NULL, 0, NULL, NULL},
5686  };
5687 
5688  StructRNA *srna;
5689  PropertyRNA *prop;
5690 
5692 
5693  srna = RNA_def_struct(brna, "ImageFormatSettings", NULL);
5694  RNA_def_struct_sdna(srna, "ImageFormatData");
5695  RNA_def_struct_nested(brna, srna, "Scene");
5696  RNA_def_struct_path_func(srna, "rna_ImageFormatSettings_path");
5697  RNA_def_struct_ui_text(srna, "Image Format", "Settings for image formats");
5698 
5699  prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
5700  RNA_def_property_enum_sdna(prop, NULL, "imtype");
5703  NULL,
5704  "rna_ImageFormatSettings_file_format_set",
5705  "rna_ImageFormatSettings_file_format_itemf");
5706  RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
5708 
5709  prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
5710  RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
5712  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageFormatSettings_color_mode_itemf");
5714  prop,
5715  "Color Mode",
5716  "Choose BW for saving grayscale images, RGB for saving red, green and blue channels, "
5717  "and RGBA for saving red, green, blue and alpha channels");
5719 
5720  prop = RNA_def_property(srna, "color_depth", PROP_ENUM, PROP_NONE);
5721  RNA_def_property_enum_bitflag_sdna(prop, NULL, "depth");
5723  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageFormatSettings_color_depth_itemf");
5724  RNA_def_property_ui_text(prop, "Color Depth", "Bit depth per channel");
5726 
5727  /* was 'file_quality' */
5728  prop = RNA_def_property(srna, "quality", PROP_INT, PROP_PERCENTAGE);
5729  RNA_def_property_int_sdna(prop, NULL, "quality");
5730  RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
5732  prop, "Quality", "Quality for image formats that support lossy compression");
5734 
5735  /* was shared with file_quality */
5736  prop = RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE);
5737  RNA_def_property_int_sdna(prop, NULL, "compress");
5738  RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
5740  "Compression",
5741  "Amount of time to determine best compression: "
5742  "0 = no compression with fast file output, "
5743  "100 = maximum lossless compression with slow file output");
5745 
5746  /* flag */
5747  prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE);
5750  prop, "Z Buffer", "Save the z-depth per pixel (32-bit unsigned integer z-buffer)");
5752 
5753  prop = RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE);
5756  prop, "Preview", "When rendering animations, save JPG preview images in same directory");
5758 
5759  /* format specific */
5760 
5761 # ifdef WITH_OPENEXR
5762  /* OpenEXR */
5763 
5764  prop = RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
5765  RNA_def_property_enum_sdna(prop, NULL, "exr_codec");
5766  RNA_def_property_enum_items(prop, rna_enum_exr_codec_items);
5767  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageFormatSettings_exr_codec_itemf");
5768  RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
5770 # endif
5771 
5772 # ifdef WITH_OPENJPEG
5773  /* Jpeg 2000 */
5774  prop = RNA_def_property(srna, "use_jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
5777  prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
5779 
5780  prop = RNA_def_property(srna, "use_jpeg2k_cinema_preset", PROP_BOOLEAN, PROP_NONE);
5782  RNA_def_property_ui_text(prop, "Cinema", "Use Openjpeg Cinema Preset");
5784 
5785  prop = RNA_def_property(srna, "use_jpeg2k_cinema_48", PROP_BOOLEAN, PROP_NONE);
5787  RNA_def_property_ui_text(prop, "Cinema (48)", "Use Openjpeg Cinema Preset (48fps)");
5789 
5790  prop = RNA_def_property(srna, "jpeg2k_codec", PROP_ENUM, PROP_NONE);
5791  RNA_def_property_enum_sdna(prop, NULL, "jp2_codec");
5792  RNA_def_property_enum_items(prop, jp2_codec_items);
5793  RNA_def_property_ui_text(prop, "Codec", "Codec settings for Jpeg2000");
5795 # endif
5796 
5797 # ifdef WITH_TIFF
5798  /* TIFF */
5799  prop = RNA_def_property(srna, "tiff_codec", PROP_ENUM, PROP_NONE);
5800  RNA_def_property_enum_sdna(prop, NULL, "tiff_codec");
5801  RNA_def_property_enum_items(prop, tiff_codec_items);
5802  RNA_def_property_ui_text(prop, "Compression", "Compression mode for TIFF");
5804 # endif
5805 
5806  /* Cineon and DPX */
5807 
5808  prop = RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
5810  RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
5812 
5813  prop = RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
5814  RNA_def_property_int_sdna(prop, NULL, "cineon_black");
5815  RNA_def_property_range(prop, 0, 1024);
5816  RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint");
5818 
5819  prop = RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
5820  RNA_def_property_int_sdna(prop, NULL, "cineon_white");
5821  RNA_def_property_range(prop, 0, 1024);
5822  RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint");
5824 
5825  prop = RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
5826  RNA_def_property_float_sdna(prop, NULL, "cineon_gamma");
5827  RNA_def_property_range(prop, 0.0f, 10.0f);
5828  RNA_def_property_ui_text(prop, "G", "Log conversion gamma");
5830 
5831  /* multiview */
5832  prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
5833  RNA_def_property_enum_sdna(prop, NULL, "views_format");
5835  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageFormatSettings_views_format_itemf");
5836  RNA_def_property_ui_text(prop, "Views Format", "Format of multiview media");
5838 
5839  prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
5840  RNA_def_property_pointer_sdna(prop, NULL, "stereo3d_format");
5842  RNA_def_property_struct_type(prop, "Stereo3dFormat");
5843  RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3D");
5844 
5845  /* color management */
5846  prop = RNA_def_property(srna, "color_management", PROP_ENUM, PROP_NONE);
5847  RNA_def_property_enum_items(prop, color_management_items);
5849  prop, "Color Management", "Which color management settings to use for file saving");
5850  RNA_def_property_enum_funcs(prop, NULL, "rna_ImageFormatSettings_color_management_set", NULL);
5852 
5853  prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
5854  RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
5856  prop, "View Settings", "Color management settings applied on image before saving");
5857 
5858  prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
5859  RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
5861  prop, "Display Settings", "Settings of device saved image would be displayed on");
5862 
5863  prop = RNA_def_property(srna, "linear_colorspace_settings", PROP_POINTER, PROP_NONE);
5864  RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
5865  RNA_def_property_ui_text(prop, "Color Space Settings", "Output color space settings");
5866 
5867  prop = RNA_def_property(srna, "has_linear_colorspace", PROP_BOOLEAN, PROP_NONE);
5868  RNA_def_property_boolean_funcs(prop, "rna_ImageFormatSettings_has_linear_colorspace_get", NULL);
5871  prop, "Has Linear Color Space", "File format expects linear color space");
5872 }
5873 
5875 {
5876  StructRNA *srna;
5877  PropertyRNA *prop;
5878 
5879 # ifdef WITH_FFMPEG
5880  /* Container types */
5881  static const EnumPropertyItem ffmpeg_format_items[] = {
5882  {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
5883  {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
5884  {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
5885  {FFMPEG_AVI, "AVI", 0, "AVI", ""},
5886  {FFMPEG_MOV, "QUICKTIME", 0, "QuickTime", ""},
5887  {FFMPEG_DV, "DV", 0, "DV", ""},
5888  {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
5889  {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
5890  {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
5891  {FFMPEG_WEBM, "WEBM", 0, "WebM", ""},
5892  {0, NULL, 0, NULL, NULL},
5893  };
5894 
5895  static const EnumPropertyItem ffmpeg_codec_items[] = {
5896  {AV_CODEC_ID_NONE, "NONE", 0, "No Video", "Disables video output, for audio-only renders"},
5897  {AV_CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""},
5898  {AV_CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
5899  {AV_CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
5900  {AV_CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
5901  {AV_CODEC_ID_H264, "H264", 0, "H.264", ""},
5902  {AV_CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
5903  {AV_CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
5904  {AV_CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
5905  {AV_CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4 (divx)", ""},
5906  {AV_CODEC_ID_PNG, "PNG", 0, "PNG", ""},
5907  {AV_CODEC_ID_QTRLE, "QTRLE", 0, "QT rle / QT Animation", ""},
5908  {AV_CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
5909  {AV_CODEC_ID_VP9, "WEBM", 0, "WEBM / VP9", ""},
5910  {0, NULL, 0, NULL, NULL},
5911  };
5912 
5913  /* Recommendations come from the FFmpeg wiki, https://trac.ffmpeg.org/wiki/Encode/VP9.
5914  * The label for BEST has been changed to "Slowest" so that it fits the "Encoding Speed"
5915  * property label in the UI. */
5916  static const EnumPropertyItem ffmpeg_preset_items[] = {
5917  {FFM_PRESET_BEST,
5918  "BEST",
5919  0,
5920  "Slowest",
5921  "Recommended if you have lots of time and want the best compression efficiency"},
5922  {FFM_PRESET_GOOD, "GOOD", 0, "Good", "The default and recommended for most applications"},
5923  {FFM_PRESET_REALTIME, "REALTIME", 0, "Realtime", "Recommended for fast encoding"},
5924  {0, NULL, 0, NULL, NULL},
5925  };
5926 
5927  static const EnumPropertyItem ffmpeg_crf_items[] = {
5928  {FFM_CRF_NONE,
5929  "NONE",
5930  0,
5931  "Constant Bitrate",
5932  "Configure constant bit rate, rather than constant output quality"},
5933  {FFM_CRF_LOSSLESS, "LOSSLESS", 0, "Lossless", ""},
5934  {FFM_CRF_PERC_LOSSLESS, "PERC_LOSSLESS", 0, "Perceptually Lossless", ""},
5935  {FFM_CRF_HIGH, "HIGH", 0, "High Quality", ""},
5936  {FFM_CRF_MEDIUM, "MEDIUM", 0, "Medium Quality", ""},
5937  {FFM_CRF_LOW, "LOW", 0, "Low Quality", ""},
5938  {FFM_CRF_VERYLOW, "VERYLOW", 0, "Very Low Quality", ""},
5939  {FFM_CRF_LOWEST, "LOWEST", 0, "Lowest Quality", ""},
5940  {0, NULL, 0, NULL, NULL},
5941  };
5942 
5943  static const EnumPropertyItem ffmpeg_audio_codec_items[] = {
5944  {AV_CODEC_ID_NONE, "NONE", 0, "No Audio", "Disables audio output, for video-only renders"},
5945  {AV_CODEC_ID_AAC, "AAC", 0, "AAC", ""},
5946  {AV_CODEC_ID_AC3, "AC3", 0, "AC3", ""},
5947  {AV_CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
5948  {AV_CODEC_ID_MP2, "MP2", 0, "MP2", ""},
5949  {AV_CODEC_ID_MP3, "MP3", 0, "MP3", ""},
5950  {AV_CODEC_ID_OPUS, "OPUS", 0, "Opus", ""},
5951  {AV_CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
5952  {AV_CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
5953  {0, NULL, 0, NULL, NULL},
5954  };
5955 # endif
5956 
5957  static const EnumPropertyItem audio_channel_items[] = {
5958  {FFM_CHANNELS_MONO, "MONO", 0, "Mono", "Set audio channels to mono"},
5959  {FFM_CHANNELS_STEREO, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
5960  {FFM_CHANNELS_SURROUND4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
5962  "SURROUND51",
5963  0,
5964  "5.1 Surround",
5965  "Set audio channels to 5.1 surround sound"},
5967  "SURROUND71",
5968  0,
5969  "7.1 Surround",
5970  "Set audio channels to 7.1 surround sound"},
5971  {0, NULL, 0, NULL, NULL},
5972  };
5973 
5974  srna = RNA_def_struct(brna, "FFmpegSettings", NULL);
5975  RNA_def_struct_sdna(srna, "FFMpegCodecData");
5976  RNA_def_struct_path_func(srna, "rna_FFmpegSettings_path");
5977  RNA_def_struct_ui_text(srna, "FFmpeg Settings", "FFmpeg related settings for the scene");
5978 
5979 # ifdef WITH_FFMPEG
5980  prop = RNA_def_property(srna, "format", PROP_ENUM, PROP_NONE);
5983  RNA_def_property_enum_items(prop, ffmpeg_format_items);
5984  RNA_def_property_enum_default(prop, FFMPEG_MKV);
5985  RNA_def_property_ui_text(prop, "Container", "Output file container");
5986 
5987  prop = RNA_def_property(srna, "codec", PROP_ENUM, PROP_NONE);
5988  RNA_def_property_enum_bitflag_sdna(prop, NULL, "codec");
5990  RNA_def_property_enum_items(prop, ffmpeg_codec_items);
5991  RNA_def_property_enum_default(prop, AV_CODEC_ID_H264);
5992  RNA_def_property_ui_text(prop, "Video Codec", "FFmpeg codec to use for video output");
5993  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_FFmpegSettings_codec_update");
5994 
5995  prop = RNA_def_property(srna, "video_bitrate", PROP_INT, PROP_NONE);
5996  RNA_def_property_int_sdna(prop, NULL, "video_bitrate");
5998  RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kbit/s)");
6000 
6001  prop = RNA_def_property(srna, "minrate", PROP_INT, PROP_NONE);
6002  RNA_def_property_int_sdna(prop, NULL, "rc_min_rate");
6004  RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kbit/s)");
6006 
6007  prop = RNA_def_property(srna, "maxrate", PROP_INT, PROP_NONE);
6008  RNA_def_property_int_sdna(prop, NULL, "rc_max_rate");
6010  RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kbit/s)");
6012 
6013  prop = RNA_def_property(srna, "muxrate", PROP_INT, PROP_NONE);
6014  RNA_def_property_int_sdna(prop, NULL, "mux_rate");
6016  RNA_def_property_range(prop, 0, 100000000);
6017  RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/second)");
6019 
6020  prop = RNA_def_property(srna, "gopsize", PROP_INT, PROP_NONE);
6021  RNA_def_property_int_sdna(prop, NULL, "gop_size");
6023  RNA_def_property_range(prop, 0, 500);
6024  RNA_def_property_int_default(prop, 25);
6026  "Keyframe Interval",
6027  "Distance between key frames, also known as GOP size; "
6028  "influences file size and seekability");
6030 
6031  prop = RNA_def_property(srna, "max_b_frames", PROP_INT, PROP_NONE);
6032  RNA_def_property_int_sdna(prop, NULL, "max_b_frames");
6034  RNA_def_property_range(prop, 0, 16);
6036  prop,
6037  "Max B-Frames",
6038  "Maximum number of B-frames between non-B-frames; influences file size and seekability");
6040 
6041  prop = RNA_def_property(srna, "use_max_b_frames", PROP_BOOLEAN, PROP_NONE);
6044  RNA_def_property_ui_text(prop, "Use Max B-Frames", "Set a maximum number of B-frames");
6046 
6047  prop = RNA_def_property(srna, "buffersize", PROP_INT, PROP_NONE);
6048  RNA_def_property_int_sdna(prop, NULL, "rc_buffer_size");
6050  RNA_def_property_range(prop, 0, 2000);
6051  RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
6053 
6054  prop = RNA_def_property(srna, "packetsize", PROP_INT, PROP_NONE);
6055  RNA_def_property_int_sdna(prop, NULL, "mux_packet_size");
6057  RNA_def_property_range(prop, 0, 16384);
6058  RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
6060 
6061  prop = RNA_def_property(srna, "constant_rate_factor", PROP_ENUM, PROP_NONE);
6062  RNA_def_property_enum_sdna(prop, NULL, "constant_rate_factor");
6064  RNA_def_property_enum_items(prop, ffmpeg_crf_items);
6067  prop,
6068  "Output Quality",
6069  "Constant Rate Factor (CRF); tradeoff between video quality and file size");
6071 
6072  prop = RNA_def_property(srna, "ffmpeg_preset", PROP_ENUM, PROP_NONE);
6073  RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffmpeg_preset");
6075  RNA_def_property_enum_items(prop, ffmpeg_preset_items);
6078  prop, "Encoding Speed", "Tradeoff between encoding speed and compression ratio");
6080 
6081  prop = RNA_def_property(srna, "use_autosplit", PROP_BOOLEAN, PROP_NONE);
6084  RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
6086 
6087  prop = RNA_def_property(srna, "use_lossless_output", PROP_BOOLEAN, PROP_NONE);
6090  RNA_def_property_boolean_funcs(prop, NULL, "rna_FFmpegSettings_lossless_output_set");
6091  RNA_def_property_ui_text(prop, "Lossless Output", "Use lossless output for video streams");
6093 
6094  /* FFMPEG Audio. */
6095  prop = RNA_def_property(srna, "audio_codec", PROP_ENUM, PROP_NONE);
6096  RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio_codec");
6098  RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
6099  RNA_def_property_ui_text(prop, "Audio Codec", "FFmpeg audio codec to use");
6101 
6102  prop = RNA_def_property(srna, "audio_bitrate", PROP_INT, PROP_NONE);
6103  RNA_def_property_int_sdna(prop, NULL, "audio_bitrate");
6105  RNA_def_property_range(prop, 32, 384);
6106  RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)");
6108 
6109  prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
6110  RNA_def_property_float_sdna(prop, NULL, "audio_volume");
6112  RNA_def_property_range(prop, 0.0f, 1.0f);
6113  RNA_def_property_ui_text(prop, "Volume", "Audio volume");
6116 # endif
6117 
6118  /* the following two "ffmpeg" settings are general audio settings */
6119  prop = RNA_def_property(srna, "audio_mixrate", PROP_INT, PROP_NONE);
6120  RNA_def_property_int_sdna(prop, NULL, "audio_mixrate");
6122  RNA_def_property_range(prop, 8000, 192000);
6123  RNA_def_property_ui_text(prop, "Samplerate", "Audio samplerate(samples/s)");
6125 
6126  prop = RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
6127  RNA_def_property_enum_sdna(prop, NULL, "audio_channels");
6129  RNA_def_property_enum_items(prop, audio_channel_items);
6130  RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
6131 }
6132 
6134 {
6135  StructRNA *srna;
6136  PropertyRNA *prop;
6137 
6138  /* Bake */
6139  static const EnumPropertyItem bake_mode_items[] = {
6140  //{RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
6141  {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"},
6142  {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"},
6143  {0, NULL, 0, NULL, NULL},
6144  };
6145 
6146  static const EnumPropertyItem bake_margin_type_items[] = {
6148  "ADJACENT_FACES",
6149  0,
6150  "Adjacent Faces",
6151  "Use pixels from adjacent faces across UV seams"},
6152  {R_BAKE_EXTEND, "EXTEND", 0, "Extend", "Extend border pixels outwards"},
6153  {0, NULL, 0, NULL, NULL},
6154  };
6155 
6156  static const EnumPropertyItem pixel_size_items[] = {
6157  {0, "AUTO", 0, "Automatic", "Automatic pixel size, depends on the user interface scale"},
6158  {1, "1", 0, "1x", "Render at full resolution"},
6159  {2, "2", 0, "2x", "Render at 50% resolution"},
6160  {4, "4", 0, "4x", "Render at 25% resolution"},
6161  {8, "8", 0, "8x", "Render at 12.5% resolution"},
6162  {0, NULL, 0, NULL, NULL},
6163  };
6164 
6165  static const EnumPropertyItem threads_mode_items[] = {
6166  {0,
6167  "AUTO",
6168  0,
6169  "Auto-Detect",
6170  "Automatically determine the number of threads, based on CPUs"},
6171  {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
6172  {0, NULL, 0, NULL, NULL},
6173  };
6174 
6175  static const EnumPropertyItem engine_items[] = {
6176  {0, "BLENDER_EEVEE", 0, "Eevee", ""},
6177  {0, NULL, 0, NULL, NULL},
6178  };
6179 
6180  static const EnumPropertyItem freestyle_thickness_items[] = {
6182  "ABSOLUTE",
6183  0,
6184  "Absolute",
6185  "Specify unit line thickness in pixels"},
6187  "RELATIVE",
6188  0,
6189  "Relative",
6190  "Unit line thickness is scaled by the proportion of the present vertical image "
6191  "resolution to 480 pixels"},
6192  {0, NULL, 0, NULL, NULL},
6193  };
6194 
6195  static const EnumPropertyItem views_format_items[] = {
6197  "STEREO_3D",
6198  0,
6199  "Stereo 3D",
6200  "Single stereo camera system, adjust the stereo settings in the camera panel"},
6202  "MULTIVIEW",
6203  0,
6204  "Multi-View",
6205  "Multi camera system, adjust the cameras individually"},
6206  {0, NULL, 0, NULL, NULL},
6207  };
6208 
6209  static const EnumPropertyItem hair_shape_type_items[] = {
6210  {SCE_HAIR_SHAPE_STRAND, "STRAND", 0, "Strand", ""},
6211  {SCE_HAIR_SHAPE_STRIP, "STRIP", 0, "Strip", ""},
6212  {0, NULL, 0, NULL, NULL},
6213  };
6214 
6215  static const EnumPropertyItem meta_input_items[] = {
6216  {0, "SCENE", 0, "Scene", "Use metadata from the current scene"},
6218  "STRIPS",
6219  0,
6220  "Sequencer Strips",
6221  "Use metadata from the strips in the sequencer"},
6222  {0, NULL, 0, NULL, NULL},
6223  };
6224 
6226 
6227  srna = RNA_def_struct(brna, "RenderSettings", NULL);
6228  RNA_def_struct_sdna(srna, "RenderData");
6229  RNA_def_struct_nested(brna, srna, "Scene");
6230  RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
6231  RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene data-block");
6232 
6233  /* Render Data */
6234  prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
6236  RNA_def_property_pointer_sdna(prop, NULL, "im_format");
6237  RNA_def_property_struct_type(prop, "ImageFormatSettings");
6238  RNA_def_property_ui_text(prop, "Image Format", "");
6239 
6240  prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL);
6241  RNA_def_property_int_sdna(prop, NULL, "xsch");
6244  RNA_def_property_range(prop, 4, 65536);
6246  prop, "Resolution X", "Number of horizontal pixels in the rendered image");
6247  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6248 
6249  prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL);
6250  RNA_def_property_int_sdna(prop, NULL, "ysch");
6253  RNA_def_property_range(prop, 4, 65536);
6255  prop, "Resolution Y", "Number of vertical pixels in the rendered image");
6256  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6257 
6258  prop = RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
6259  RNA_def_property_int_sdna(prop, NULL, "size");
6261  RNA_def_property_range(prop, 1, SHRT_MAX);
6262  RNA_def_property_ui_range(prop, 1, 100, 10, 1);
6263  RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
6264  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneSequencer_update");
6265 
6266  prop = RNA_def_property(srna, "preview_pixel_size", PROP_ENUM, PROP_NONE);
6267  RNA_def_property_enum_sdna(prop, NULL, "preview_pixel_size");
6268  RNA_def_property_enum_items(prop, pixel_size_items);
6269  RNA_def_property_ui_text(prop, "Pixel Size", "Pixel size for viewport rendering");
6271 
6272  prop = RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
6273  RNA_def_property_float_sdna(prop, NULL, "xasp");
6276  RNA_def_property_range(prop, 1.0f, 200.0f);
6278  "Pixel Aspect X",
6279  "Horizontal aspect ratio - for anamorphic or non-square pixel output");
6280  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6281 
6282  prop = RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
6283  RNA_def_property_float_sdna(prop, NULL, "yasp");
6286  RNA_def_property_range(prop, 1.0f, 200.0f);
6288  prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
6289  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6290 
6291  prop = RNA_def_property(srna, "ffmpeg", PROP_POINTER, PROP_NONE);
6292  RNA_def_property_struct_type(prop, "FFmpegSettings");
6293  RNA_def_property_pointer_sdna(prop, NULL, "ffcodecdata");
6295  RNA_def_property_ui_text(prop, "FFmpeg Settings", "FFmpeg related settings for the scene");
6296 
6297  prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
6298  RNA_def_property_int_sdna(prop, NULL, "frs_sec");
6300  RNA_def_property_range(prop, 1, SHRT_MAX);
6301  RNA_def_property_ui_range(prop, 1, 240, 1, -1);
6302  RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
6303  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
6304 
6305  prop = RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
6306  RNA_def_property_float_sdna(prop, NULL, "frs_sec_base");
6308  RNA_def_property_range(prop, 1e-5f, 1e6f);
6309  /* Important to show at least 3 decimal points because multiple presets set this to 1.001. */
6310  RNA_def_property_ui_range(prop, 0.1f, 120.0f, 2, 3);
6311  RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
6312  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
6313 
6314  /* frame mapping */
6315  prop = RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
6316  RNA_def_property_int_sdna(prop, NULL, "framapto");
6318  RNA_def_property_range(prop, 1, 900);
6319  RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames");
6320  RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
6321 
6322  prop = RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
6323  RNA_def_property_int_sdna(prop, NULL, "images");
6325  RNA_def_property_range(prop, 1, 900);
6326  RNA_def_property_ui_text(prop, "Frame Map New", "How many frames the Map Old will last");
6327  RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
6328 
6329  prop = RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
6330  RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
6331  RNA_def_property_range(prop, 0.0, FLT_MAX);
6332  RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 2);
6334  prop,
6335  "Dither Intensity",
6336  "Amount of dithering noise added to the rendered image to break up banding");
6338 
6339  prop = RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_PIXEL);
6340  RNA_def_property_float_sdna(prop, NULL, "gauss");
6341  RNA_def_property_range(prop, 0.0f, 500.0f);
6342  RNA_def_property_ui_range(prop, 0.01f, 10.0f, 1, 2);
6344  prop, "Filter Size", "Width over which the reconstruction filter combines samples");
6346 
6347  prop = RNA_def_property(srna, "film_transparent", PROP_BOOLEAN, PROP_NONE);
6348  RNA_def_property_boolean_sdna(prop, NULL, "alphamode", R_ALPHAPREMUL);
6350  prop,
6351  "Transparent",
6352  "World background is transparent, for compositing the render over another background");
6353  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
6354 
6355  prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
6358  RNA_def_property_ui_text(prop, "Edge", "Draw stylized strokes using Freestyle");
6359  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_freestyle_update");
6360 
6361  /* threads */
6362  prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
6363  RNA_def_property_int_sdna(prop, NULL, "threads");
6365  RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
6367  "Threads",
6368  "Maximum number of CPU cores to use simultaneously while rendering "
6369  "(for multi-core/CPU systems)");
6371 
6372  prop = RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
6374  RNA_def_property_enum_items(prop, threads_mode_items);
6375  RNA_def_property_enum_funcs(prop, "rna_RenderSettings_threads_mode_get", NULL, NULL);
6376  RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
6378 
6379  /* motion blur */
6380  prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
6381  RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR);
6382  RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
6384  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
6385 
6386  prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR);
6387  RNA_def_property_float_sdna(prop, NULL, "blurfac");
6388  RNA_def_property_range(prop, 0.0f, FLT_MAX);
6389  RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 2);
6390  RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
6391  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
6392 
6393  prop = RNA_def_property(srna, "motion_blur_shutter_curve", PROP_POINTER, PROP_NONE);
6394  RNA_def_property_pointer_sdna(prop, NULL, "mblur_shutter_curve");
6395  RNA_def_property_struct_type(prop, "CurveMapping");
6397  prop, "Shutter Curve", "Curve defining the shutter's openness over time");
6398 
6399  /* Hairs */
6400  prop = RNA_def_property(srna, "hair_type", PROP_ENUM, PROP_NONE);
6401  RNA_def_property_enum_items(prop, hair_shape_type_items);
6402  RNA_def_property_ui_text(prop, "Curves Shape Type", "Curves shape type");
6403  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
6404 
6405  prop = RNA_def_property(srna, "hair_subdiv", PROP_INT, PROP_NONE);
6406  RNA_def_property_range(prop, 0, 3);
6408  prop, "Additional Subdivision", "Additional subdivision along the curves");
6409  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
6410 
6411  /* Performance */
6412  prop = RNA_def_property(srna, "use_high_quality_normals", PROP_BOOLEAN, PROP_NONE);
6415  "High Quality Normals",
6416  "Use high quality tangent space at the cost of lower performance");
6417  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_mesh_quality_update");
6418 
6419  /* border */
6420  prop = RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
6424  prop, "Render Region", "Render a user-defined render region, within the frame size");
6426 
6427  prop = RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
6428  RNA_def_property_float_sdna(prop, NULL, "border.xmin");
6429  RNA_def_property_range(prop, 0.0f, 1.0f);
6431  RNA_def_property_ui_text(prop, "Region Minimum X", "Minimum X value for the render region");
6433 
6434  prop = RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
6435  RNA_def_property_float_sdna(prop, NULL, "border.ymin");
6436  RNA_def_property_range(prop, 0.0f, 1.0f);
6438  RNA_def_property_ui_text(prop, "Region Minimum Y", "Minimum Y value for the render region");
6440 
6441  prop = RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
6442  RNA_def_property_float_sdna(prop, NULL, "border.xmax");
6443  RNA_def_property_range(prop, 0.0f, 1.0f);
6445  RNA_def_property_ui_text(prop, "Region Maximum X", "Maximum X value for the render region");
6447 
6448  prop = RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
6449  RNA_def_property_float_sdna(prop, NULL, "border.ymax");
6450  RNA_def_property_range(prop, 0.0f, 1.0f);
6452  RNA_def_property_ui_text(prop, "Region Maximum Y", "Maximum Y value for the render region");
6454 
6455  prop = RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
6456  RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP);
6459  prop, "Crop to Render Region", "Crop the rendered frame to the defined render region size");
6461 
6462  prop = RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
6463  RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
6466  prop,
6467  "Placeholders",
6468  "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
6470 
6471  prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
6473  RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
6475 
6476  prop = RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
6477  RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
6480  "Compositing",
6481  "Process the render result through the compositing pipeline, "
6482  "if compositing nodes are enabled");
6484 
6485  prop = RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
6486  RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
6489  "Sequencer",
6490  "Process the render (and composited) result through the video sequence "
6491  "editor pipeline, if sequencer strips exist");
6493 
6494  prop = RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
6495  RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
6498  prop,
6499  "File Extensions",
6500  "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
6502 
6503 # if 0 /* moved */
6504  prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
6505  RNA_def_property_enum_sdna(prop, NULL, "imtype");
6507  RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_file_format_set", NULL);
6508  RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
6510 # endif
6511 
6512  prop = RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
6514  prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
6515  RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
6517 
6518  prop = RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
6519  RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_format_get", NULL);
6521  RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
6522 
6523  prop = RNA_def_property(srna, "use_lock_interface", PROP_BOOLEAN, PROP_NONE);
6524  RNA_def_property_boolean_sdna(prop, NULL, "use_lock_interface", 1);
6526  RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
6528  prop,
6529  "Lock Interface",
6530  "Lock interface during rendering in favor of giving more memory to the renderer");
6532 
6533  prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
6534  RNA_def_property_string_sdna(prop, NULL, "pic");
6536  "Output Path",
6537  "Directory/name to save animations, # characters defines the position "
6538  "and length of frame numbers");
6540 
6541  /* Render result EXR cache. */
6542  prop = RNA_def_property(srna, "use_render_cache", PROP_BOOLEAN, PROP_NONE);
6546  "Cache Result",
6547  "Save render cache to EXR files (useful for heavy compositing, "
6548  "Note: affects indirectly rendered scenes)");
6550 
6551  /* Bake */
6552 
6553  prop = RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
6554  RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode");
6555  RNA_def_property_enum_items(prop, bake_mode_items);
6556  RNA_def_property_ui_text(prop, "Bake Type", "Choose shading information to bake into the image");
6558 
6559  prop = RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
6562  "Selected to Active",
6563  "Bake shading on the surface of selected objects to the active object");
6565 
6566  prop = RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
6567  RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
6568  RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
6570 
6571  prop = RNA_def_property(srna, "bake_margin", PROP_INT, PROP_PIXEL);
6572  RNA_def_property_int_sdna(prop, NULL, "bake_margin");
6573  RNA_def_property_range(prop, 0, 64);
6574  RNA_def_property_ui_text(prop, "Margin", "Extends the baked result as a post process filter");
6576 
6577  prop = RNA_def_property(srna, "bake_margin_type", PROP_ENUM, PROP_NONE);
6578  RNA_def_property_enum_sdna(prop, NULL, "bake_margin_type");
6579  RNA_def_property_enum_items(prop, bake_margin_type_items);
6580  RNA_def_property_ui_text(prop, "Margin Type", "Algorithm to generate the margin");
6582 
6583  prop = RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
6584  RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
6585  RNA_def_property_range(prop, 0.0, 1000.0);
6587  prop, "Bias", "Bias towards faces further away from the object (in blender units)");
6589 
6590  prop = RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
6591  RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_MULTIRES);
6592  RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object");
6594 
6595  prop = RNA_def_property(srna, "use_bake_lores_mesh", PROP_BOOLEAN, PROP_NONE);
6598  prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh");
6600 
6601  prop = RNA_def_property(srna, "bake_samples", PROP_INT, PROP_NONE);
6602  RNA_def_property_int_sdna(prop, NULL, "bake_samples");
6603  RNA_def_property_range(prop, 64, 1024);
6605  prop, "Samples", "Number of samples used for ambient occlusion baking from multires");
6607 
6608  prop = RNA_def_property(srna, "use_bake_user_scale", PROP_BOOLEAN, PROP_NONE);
6610  RNA_def_property_ui_text(prop, "User Scale", "Use a user scale for the derivative map");
6611 
6612  prop = RNA_def_property(srna, "bake_user_scale", PROP_FLOAT, PROP_NONE);
6613  RNA_def_property_float_sdna(prop, NULL, "bake_user_scale");
6614  RNA_def_property_range(prop, 0.0, 1000.0);
6616  "Scale",
6617  "Instead of automatically normalizing to the range 0 to 1, "
6618  "apply a user scale to the derivative map");
6619 
6620  /* stamp */
6621 
6622  prop = RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
6625  prop, "Stamp Time", "Include the rendered frame timecode as HH:MM:SS.FF in image metadata");
6627 
6628  prop = RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
6630  RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image/video metadata");
6632 
6633  prop = RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
6635  RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
6637 
6638  prop = RNA_def_property(srna, "use_stamp_frame_range", PROP_BOOLEAN, PROP_NONE);
6641  prop, "Stamp Frame", "Include the rendered frame range in image/video metadata");
6643 
6644  prop = RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
6647  prop, "Stamp Camera", "Include the name of the active camera in image metadata");
6649 
6650  prop = RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
6653  prop, "Stamp Lens", "Include the active camera's lens in image metadata");
6655 
6656  prop = RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
6659  prop, "Stamp Scene", "Include the name of the active scene in image/video metadata");
6661 
6662  prop = RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
6664  RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image/video metadata");
6666 
6667  prop = RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
6670  prop, "Stamp Marker", "Include the name of the last marker in image metadata");
6672 
6673  prop = RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
6676  prop, "Stamp Filename", "Include the .blend filename in image/video metadata");
6678 
6679  prop = RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
6682  "Stamp Sequence Strip",
6683  "Include the name of the foreground sequence strip in image metadata");
6685 
6686  prop = RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
6688  RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in image metadata");
6690 
6691  prop = RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
6692  RNA_def_property_string_sdna(prop, NULL, "stamp_udata");
6693  RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
6695 
6696  prop = RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
6699  prop, "Stamp Output", "Render the stamp info text in the rendered image");
6701 
6702  prop = RNA_def_property(srna, "use_stamp_labels", PROP_BOOLEAN, PROP_NONE);
6705  prop, "Stamp Labels", "Display stamp labels (\"Camera\" in front of camera name, etc.)");
6707 
6708  prop = RNA_def_property(srna, "metadata_input", PROP_ENUM, PROP_NONE); /* as an enum */
6709  RNA_def_property_enum_bitflag_sdna(prop, NULL, "stamp");
6710  RNA_def_property_enum_items(prop, meta_input_items);
6711  RNA_def_property_ui_text(prop, "Metadata Input", "Where to take the metadata from");
6713 
6714  prop = RNA_def_property(srna, "use_stamp_memory", PROP_BOOLEAN, PROP_NONE);
6717  prop, "Stamp Peak Memory", "Include the peak memory usage in image metadata");
6719 
6720  prop = RNA_def_property(srna, "use_stamp_hostname", PROP_BOOLEAN, PROP_NONE);
6723  prop, "Stamp Hostname", "Include the hostname of the machine that rendered the frame");
6725 
6726  prop = RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_PIXEL);
6727  RNA_def_property_int_sdna(prop, NULL, "stamp_font_id");
6728  RNA_def_property_range(prop, 8, 64);
6729  RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
6731 
6732  prop = RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
6733  RNA_def_property_float_sdna(prop, NULL, "fg_stamp");
6734  RNA_def_property_array(prop, 4);
6735  RNA_def_property_range(prop, 0.0, 1.0);
6736  RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text");
6738 
6739  prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
6740  RNA_def_property_float_sdna(prop, NULL, "bg_stamp");
6741  RNA_def_property_array(prop, 4);
6742  RNA_def_property_range(prop, 0.0, 1.0);
6743  RNA_def_property_ui_text(prop, "Background", "Color to use behind stamp text");
6745 
6746  /* sequencer draw options */
6747 
6748  prop = RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
6749  RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
6752  prop, "Sequencer Preview Shading", "Display method used in the sequencer view");
6753  RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
6754 
6755  prop = RNA_def_property(srna, "use_sequencer_override_scene_strip", PROP_BOOLEAN, PROP_NONE);
6758  "Override Scene Settings",
6759  "Use workbench render settings from the sequencer scene, instead of "
6760  "each individual scene used in the strip");
6761  RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
6762 
6763  prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
6766  "Render Single Layer",
6767  "Only render the active layer. Only affects rendering from the "
6768  "interface, ignored for rendering from command line");
6771 
6772  /* views (stereoscopy et al) */
6773  prop = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE);
6774  RNA_def_property_struct_type(prop, "SceneRenderView");
6775  RNA_def_property_ui_text(prop, "Render Views", "");
6776  rna_def_render_views(brna, prop);
6777 
6778  prop = RNA_def_property(srna, "stereo_views", PROP_COLLECTION, PROP_NONE);
6779  RNA_def_property_collection_sdna(prop, NULL, "views", NULL);
6781  "rna_RenderSettings_stereoViews_begin",
6782  "rna_iterator_listbase_next",
6783  "rna_iterator_listbase_end",
6784  "rna_iterator_listbase_get",
6785  NULL,
6786  NULL,
6787  NULL,
6788  NULL);
6789  RNA_def_property_struct_type(prop, "SceneRenderView");
6790  RNA_def_property_ui_text(prop, "Render Views", "");
6791 
6792  prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
6793  RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_MULTIVIEW);
6794  RNA_def_property_ui_text(prop, "Multiple Views", "Use multiple views in the scene");
6796 
6797  prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
6798  RNA_def_property_enum_items(prop, views_format_items);
6800  RNA_def_property_ui_text(prop, "Setup Stereo Mode", "");
6801  RNA_def_property_enum_funcs(prop, NULL, "rna_RenderSettings_views_format_set", NULL);
6803 
6804  /* engine */
6805  prop = RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
6806  RNA_def_property_enum_items(prop, engine_items);
6808  "rna_RenderSettings_engine_get",
6809  "rna_RenderSettings_engine_set",
6810  "rna_RenderSettings_engine_itemf");
6812  RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
6813  RNA_def_property_update(prop, NC_WINDOW, "rna_RenderSettings_engine_update");
6814 
6815  prop = RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
6816  RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
6819  prop, "Multiple Engines", "More than one rendering engine is available");
6820 
6821  prop = RNA_def_property(srna, "use_spherical_stereo", PROP_BOOLEAN, PROP_NONE);
6822  RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_spherical_stereo_get", NULL);
6825  prop, "Use Spherical Stereo", "Active render engine supports spherical stereo rendering");
6826 
6827  /* simplify */
6828  prop = RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
6831  prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
6832  RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
6833 
6834  prop = RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
6835  RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf");
6836  RNA_def_property_ui_range(prop, 0, 6, 1, -1);
6837  RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
6838  RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
6839 
6840  prop = RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
6841  RNA_def_property_float_sdna(prop, NULL, "simplify_particles");
6842  RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
6843  RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
6844 
6845  prop = RNA_def_property(srna, "simplify_subdivision_render", PROP_INT, PROP_UNSIGNED);
6846  RNA_def_property_int_sdna(prop, NULL, "simplify_subsurf_render");
6847  RNA_def_property_ui_range(prop, 0, 6, 1, -1);
6849  prop, "Simplify Subdivision", "Global maximum subdivision level during rendering");
6850  RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
6851 
6852  prop = RNA_def_property(srna, "simplify_child_particles_render", PROP_FLOAT, PROP_FACTOR);
6853  RNA_def_property_float_sdna(prop, NULL, "simplify_particles_render");
6855  prop, "Simplify Child Particles", "Global child particles percentage during rendering");
6856  RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
6857 
6858  prop = RNA_def_property(srna, "simplify_volumes", PROP_FLOAT, PROP_FACTOR);
6859  RNA_def_property_range(prop, 0.0, 1.0f);
6861  prop, "Simplify Volumes", "Resolution percentage of volume objects in viewport");
6862  RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
6863 
6864  /* Grease Pencil - Simplify Options */
6865  prop = RNA_def_property(srna, "simplify_gpencil", PROP_BOOLEAN, PROP_NONE);
6866  RNA_def_property_boolean_sdna(prop, NULL, "simplify_gpencil", SIMPLIFY_GPENCIL_ENABLE);
6867  RNA_def_property_ui_text(prop, "Simplify", "Simplify Grease Pencil drawing");
6868  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
6869 
6870  prop = RNA_def_property(srna, "simplify_gpencil_onplay", PROP_BOOLEAN, PROP_NONE);
6871  RNA_def_property_boolean_sdna(prop, NULL, "simplify_gpencil", SIMPLIFY_GPENCIL_ON_PLAY);
6873  prop, "Playback Only", "Simplify Grease Pencil only during animation playback");
6874  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
6875 
6876  prop = RNA_def_property(srna, "simplify_gpencil_antialiasing", PROP_BOOLEAN, PROP_NONE);
6878  RNA_def_property_ui_text(prop, "Antialiasing", "Use Antialiasing to smooth stroke edges");
6879  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
6880 
6881  prop = RNA_def_property(srna, "simplify_gpencil_view_fill", PROP_BOOLEAN, PROP_NONE);
6883  RNA_def_property_ui_text(prop, "Fill", "Display fill strokes in the viewport");
6884  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
6885 
6886  prop = RNA_def_property(srna, "simplify_gpencil_modifier", PROP_BOOLEAN, PROP_NONE);
6888  prop, NULL, "simplify_gpencil", SIMPLIFY_GPENCIL_MODIFIER);
6889  RNA_def_property_ui_text(prop, "Modifiers", "Display modifiers");
6890  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
6891 
6892  prop = RNA_def_property(srna, "simplify_gpencil_shader_fx", PROP_BOOLEAN, PROP_NONE);
6894  RNA_def_property_ui_text(prop, "Shader Effects", "Display Shader Effects");
6895  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
6896 
6897  prop = RNA_def_property(srna, "simplify_gpencil_tint", PROP_BOOLEAN, PROP_NONE);
6899  RNA_def_property_ui_text(prop, "Layers Tinting", "Display layer tint");
6900  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
6901 
6902  /* persistent data */
6903  prop = RNA_def_property(srna, "use_persistent_data", PROP_BOOLEAN, PROP_NONE);
6906  "Persistent Data",
6907  "Keep render data around for faster re-renders and animation renders, "
6908  "at the cost of increased memory usage");
6909  RNA_def_property_update(prop, 0, "rna_Scene_use_persistent_data_update");
6910 
6911  /* Freestyle line thickness options */
6912  prop = RNA_def_property(srna, "line_thickness_mode", PROP_ENUM, PROP_NONE);
6913  RNA_def_property_enum_sdna(prop, NULL, "line_thickness_mode");
6914  RNA_def_property_enum_items(prop, freestyle_thickness_items);
6916  prop, "Line Thickness Mode", "Line thickness mode for Freestyle line drawing");
6917  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6918 
6919  prop = RNA_def_property(srna, "line_thickness", PROP_FLOAT, PROP_PIXEL);
6920  RNA_def_property_float_sdna(prop, NULL, "unit_line_thickness");
6921  RNA_def_property_range(prop, 0.0f, 10000.0f);
6922  RNA_def_property_ui_text(prop, "Line Thickness", "Line thickness in pixels");
6923  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6924 
6925  /* Bake Settings */
6926  prop = RNA_def_property(srna, "bake", PROP_POINTER, PROP_NONE);
6928  RNA_def_property_pointer_sdna(prop, NULL, "bake");
6929  RNA_def_property_struct_type(prop, "BakeSettings");
6930  RNA_def_property_ui_text(prop, "Bake Data", "");
6931 
6932  /* Nestled Data. */
6933  /* *** Non-Animated *** */
6934  RNA_define_animate_sdna(false);
6935  rna_def_bake_data(brna);
6937 
6938  /* *** Animated *** */
6939 
6940  /* Scene API */
6941  RNA_api_scene_render(srna);
6942 }
6943 
6944 /* scene.objects */
6946 {
6947  StructRNA *srna;
6948 
6949  RNA_def_property_srna(cprop, "SceneObjects");
6950  srna = RNA_def_struct(brna, "SceneObjects", NULL);
6951  RNA_def_struct_sdna(srna, "Scene");
6952  RNA_def_struct_ui_text(srna, "Scene Objects", "All of the scene objects");
6953 }
6954 
6955 /* scene.timeline_markers */
6957 {
6958  StructRNA *srna;
6959 
6960  FunctionRNA *func;
6961  PropertyRNA *parm;
6962 
6963  RNA_def_property_srna(cprop, "TimelineMarkers");
6964  srna = RNA_def_struct(brna, "TimelineMarkers", NULL);
6965  RNA_def_struct_sdna(srna, "Scene");
6966  RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
6967 
6968  func = RNA_def_function(srna, "new", "rna_TimeLine_add");
6969  RNA_def_function_ui_description(func, "Add a keyframe to the curve");
6970  parm = RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
6972  parm = RNA_def_int(func,
6973  "frame",
6974  1,
6975  -MAXFRAME,
6976  MAXFRAME,
6977  "",
6978  "The frame for the new marker",
6979  -MAXFRAME,
6980  MAXFRAME);
6981  parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
6982  RNA_def_function_return(func, parm);
6983 
6984  func = RNA_def_function(srna, "remove", "rna_TimeLine_remove");
6985  RNA_def_function_ui_description(func, "Remove a timeline marker");
6987  parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
6990 
6991  func = RNA_def_function(srna, "clear", "rna_TimeLine_clear");
6992  RNA_def_function_ui_description(func, "Remove all timeline markers");
6993 }
6994 
6995 /* scene.keying_sets */
6997 {
6998  StructRNA *srna;
6999  PropertyRNA *prop;
7000 
7001  FunctionRNA *func;
7002  PropertyRNA *parm;
7003 
7004  RNA_def_property_srna(cprop, "KeyingSets");
7005  srna = RNA_def_struct(brna, "KeyingSets", NULL);
7006  RNA_def_struct_sdna(srna, "Scene");
7007  RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
7008 
7009  /* Add Keying Set */
7010  func = RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
7011  RNA_def_function_ui_description(func, "Add a new Keying Set to Scene");
7013  /* name */
7014  RNA_def_string(func, "idname", "KeyingSet", 64, "IDName", "Internal identifier of Keying Set");
7015  RNA_def_string(func, "name", "KeyingSet", 64, "Name", "User visible name of Keying Set");
7016  /* returns the new KeyingSet */
7017  parm = RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set");
7018  RNA_def_function_return(func, parm);
7019 
7020  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
7021  RNA_def_property_struct_type(prop, "KeyingSet");
7024  prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
7026  prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
7028 
7029  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
7030  RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
7032  "rna_Scene_active_keying_set_index_get",
7033  "rna_Scene_active_keying_set_index_set",
7034  NULL);
7036  prop,
7037  "Active Keying Set Index",
7038  "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
7040 }
7041 
7043 {
7044  StructRNA *srna;
7045  PropertyRNA *prop;
7046 
7047  RNA_def_property_srna(cprop, "KeyingSetsAll");
7048  srna = RNA_def_struct(brna, "KeyingSetsAll", NULL);
7049  RNA_def_struct_sdna(srna, "Scene");
7050  RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
7051 
7052  /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
7053 
7054  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
7055  RNA_def_property_struct_type(prop, "KeyingSet");
7058  prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL);
7060  prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
7062 
7063  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
7064  RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
7066  "rna_Scene_active_keying_set_index_get",
7067  "rna_Scene_active_keying_set_index_set",
7068  NULL);
7070  prop,
7071  "Active Keying Set Index",
7072  "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
7074 }
7075 
7076 /* Runtime property, used to remember uv indices, used only in UV stitch for now.
7077  */
7079 {
7080  StructRNA *srna;
7081  PropertyRNA *prop;
7082 
7083  srna = RNA_def_struct(brna, "SelectedUvElement", "PropertyGroup");
7084  RNA_def_struct_ui_text(srna, "Selected UV Element", "");
7085 
7086  /* store the index to the UV element selected */
7087  prop = RNA_def_property(srna, "element_index", PROP_INT, PROP_UNSIGNED);
7089  RNA_def_property_ui_text(prop, "Element Index", "");
7090 
7091  prop = RNA_def_property(srna, "face_index", PROP_INT, PROP_UNSIGNED);
7093  RNA_def_property_ui_text(prop, "Face Index", "");
7094 }
7095 
7097 {
7098  StructRNA *srna;
7099  PropertyRNA *prop;
7100 
7101  srna = RNA_def_struct(brna, "DisplaySafeAreas", NULL);
7102  RNA_def_struct_ui_text(srna, "Safe Areas", "Safe areas used in 3D view and the sequencer");
7103  RNA_def_struct_sdna(srna, "DisplaySafeAreas");
7104 
7105  /* SAFE AREAS */
7106  prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_XYZ);
7107  RNA_def_property_float_sdna(prop, NULL, "title");
7108  RNA_def_property_array(prop, 2);
7109  RNA_def_property_range(prop, 0.0f, 1.0f);
7110  RNA_def_property_ui_text(prop, "Title Safe Margins", "Safe area for text and graphics");
7112 
7113  prop = RNA_def_property(srna, "action", PROP_FLOAT, PROP_XYZ);
7114  RNA_def_property_float_sdna(prop, NULL, "action");
7115  RNA_def_property_array(prop, 2);
7116  RNA_def_property_range(prop, 0.0f, 1.0f);
7117  RNA_def_property_ui_text(prop, "Action Safe Margins", "Safe area for general elements");
7119 
7120  prop = RNA_def_property(srna, "title_center", PROP_FLOAT, PROP_XYZ);
7121  RNA_def_property_float_sdna(prop, NULL, "title_center");
7122  RNA_def_property_array(prop, 2);
7123  RNA_def_property_range(prop, 0.0f, 1.0f);
7125  "Center Title Safe Margins",
7126  "Safe area for text and graphics in a different aspect ratio");
7128 
7129  prop = RNA_def_property(srna, "action_center", PROP_FLOAT, PROP_XYZ);
7130  RNA_def_property_float_sdna(prop, NULL, "action_center");
7131  RNA_def_property_array(prop, 2);
7132  RNA_def_property_range(prop, 0.0f, 1.0f);
7134  "Center Action Safe Margins",
7135  "Safe area for general elements in a different aspect ratio");
7137 }
7138 
7140 {
7141  StructRNA *srna;
7142  PropertyRNA *prop;
7143 
7144  srna = RNA_def_struct(brna, "SceneDisplay", NULL);
7145  RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
7146  RNA_def_struct_sdna(srna, "SceneDisplay");
7147 
7148  prop = RNA_def_property(srna, "light_direction", PROP_FLOAT, PROP_DIRECTION);
7149  RNA_def_property_float_sdna(prop, NULL, "light_direction");
7151  RNA_def_property_array(prop, 3);
7153  prop, "Light Direction", "Direction of the light for shadows and highlights");
7154  RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7155 
7156  prop = RNA_def_property(srna, "shadow_shift", PROP_FLOAT, PROP_ANGLE);
7157  RNA_def_property_ui_text(prop, "Shadow Shift", "Shadow termination angle");
7158  RNA_def_property_range(prop, 0.0f, 1.0f);
7159  RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 2);
7161  RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7162 
7163  prop = RNA_def_property(srna, "shadow_focus", PROP_FLOAT, PROP_FACTOR);
7164  RNA_def_property_float_default(prop, 0.0);
7165  RNA_def_property_ui_text(prop, "Shadow Focus", "Shadow factor hardness");
7166  RNA_def_property_range(prop, 0.0f, 1.0f);
7167  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
7169  RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7170 
7171  prop = RNA_def_property(srna, "matcap_ssao_distance", PROP_FLOAT, PROP_NONE);
7173  prop, "Distance", "Distance of object that contribute to the Cavity/Edge effect");
7174  RNA_def_property_range(prop, 0.0f, 100000.0f);
7175  RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
7176 
7177  prop = RNA_def_property(srna, "matcap_ssao_attenuation", PROP_FLOAT, PROP_NONE);
7178  RNA_def_property_ui_text(prop, "Attenuation", "Attenuation constant");
7179  RNA_def_property_range(prop, 1.0f, 100000.0f);
7180  RNA_def_property_ui_range(prop, 1.0f, 100.0f, 1, 3);
7181 
7182  prop = RNA_def_property(srna, "matcap_ssao_samples", PROP_INT, PROP_NONE);
7183  RNA_def_property_ui_text(prop, "Samples", "Number of samples");
7184  RNA_def_property_range(prop, 1, 500);
7185 
7186  prop = RNA_def_property(srna, "render_aa", PROP_ENUM, PROP_NONE);
7189  prop, "Render Anti-Aliasing", "Method of anti-aliasing when rendering final image");
7191 
7192  prop = RNA_def_property(srna, "viewport_aa", PROP_ENUM, PROP_NONE);
7195  prop, "Viewport Anti-Aliasing", "Method of anti-aliasing when rendering 3d viewport");
7197 
7198  /* OpenGL render engine settings. */
7199  prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
7200  RNA_def_property_ui_text(prop, "Shading Settings", "Shading settings for OpenGL render engine");
7201 }
7202 
7204 {
7205  StructRNA *srna;
7206  PropertyRNA *prop;
7207 
7208  static const EnumPropertyItem eevee_shadow_size_items[] = {
7209  {64, "64", 0, "64 px", ""},
7210  {128, "128", 0, "128 px", ""},
7211  {256, "256", 0, "256 px", ""},
7212  {512, "512", 0, "512 px", ""},
7213  {1024, "1024", 0, "1024 px", ""},
7214  {2048, "2048", 0, "2048 px", ""},
7215  {4096, "4096", 0, "4096 px", ""},
7216  {0, NULL, 0, NULL, NULL},
7217  };
7218 
7219  static const EnumPropertyItem eevee_gi_visibility_size_items[] = {
7220  {8, "8", 0, "8 px", ""},
7221  {16, "16", 0, "16 px", ""},
7222  {32, "32", 0, "32 px", ""},
7223  {64, "64", 0, "64 px", ""},
7224  {0, NULL, 0, NULL, NULL},
7225  };
7226 
7227  static const EnumPropertyItem eevee_volumetric_tile_size_items[] = {
7228  {2, "2", 0, "2 px", ""},
7229  {4, "4", 0, "4 px", ""},
7230  {8, "8", 0, "8 px", ""},
7231  {16, "16", 0, "16 px", ""},
7232  {0, NULL, 0, NULL, NULL},
7233  };
7234 
7235  static const EnumPropertyItem eevee_motion_blur_position_items[] = {
7236  {SCE_EEVEE_MB_START, "START", 0, "Start on Frame", "The shutter opens at the current frame"},
7238  "CENTER",
7239  0,
7240  "Center on Frame",
7241  "The shutter is open during the current frame"},
7242  {SCE_EEVEE_MB_END, "END", 0, "End on Frame", "The shutter closes at the current frame"},
7243  {0, NULL, 0, NULL, NULL},
7244  };
7245 
7246  srna = RNA_def_struct(brna, "SceneEEVEE", NULL);
7247  RNA_def_struct_path_func(srna, "rna_SceneEEVEE_path");
7248  RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
7249 
7250  /* Indirect Lighting */
7251  prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE);
7253  "Diffuse Bounces",
7254  "Number of time the light is reinjected inside light grids, "
7255  "0 disable indirect diffuse light");
7256  RNA_def_property_range(prop, 0, INT_MAX);
7258 
7259  prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
7260  RNA_def_property_enum_items(prop, eevee_shadow_size_items);
7261  RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
7263 
7264  prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE);
7265  RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items);
7267  "Irradiance Visibility Size",
7268  "Size of the shadow map applied to each irradiance sample");
7270 
7271  prop = RNA_def_property(srna, "gi_irradiance_smoothing", PROP_FLOAT, PROP_FACTOR);
7272  RNA_def_property_range(prop, 0.0f, FLT_MAX);
7273  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 5, 2);
7275  "Irradiance Smoothing",
7276  "Smoother irradiance interpolation but introduce light bleeding");
7279 
7280  prop = RNA_def_property(srna, "gi_glossy_clamp", PROP_FLOAT, PROP_NONE);
7282  "Clamp Glossy",
7283  "Clamp pixel intensity to reduce noise inside glossy reflections "
7284  "from reflection cubemaps (0 to disabled)");
7285  RNA_def_property_range(prop, 0.0f, FLT_MAX);
7287 
7288  prop = RNA_def_property(srna, "gi_filter_quality", PROP_FLOAT, PROP_NONE);
7290  prop, "Filter Quality", "Take more samples during cubemap filtering to remove artifacts");
7291  RNA_def_property_range(prop, 1.0f, 8.0f);
7293 
7294  prop = RNA_def_property(srna, "gi_show_irradiance", PROP_BOOLEAN, PROP_NONE);
7296  RNA_def_property_ui_icon(prop, ICON_HIDE_ON, 1);
7298  prop, "Show Irradiance Cache", "Display irradiance samples in the viewport");
7301 
7302  prop = RNA_def_property(srna, "gi_show_cubemaps", PROP_BOOLEAN, PROP_NONE);
7304  RNA_def_property_ui_icon(prop, ICON_HIDE_ON, 1);
7306  prop, "Show Cubemap Cache", "Display captured cubemaps in the viewport");
7309 
7310  prop = RNA_def_property(srna, "gi_irradiance_display_size", PROP_FLOAT, PROP_DISTANCE);
7311  RNA_def_property_float_sdna(prop, NULL, "gi_irradiance_draw_size");
7312  RNA_def_property_range(prop, 0.05f, 10.0f);
7314  "Irradiance Display Size",
7315  "Size of the irradiance sample spheres to debug captured light");
7317 
7318  prop = RNA_def_property(srna, "gi_cubemap_display_size", PROP_FLOAT, PROP_DISTANCE);
7319  RNA_def_property_float_sdna(prop, NULL, "gi_cubemap_draw_size");
7320  RNA_def_property_range(prop, 0.05f, 10.0f);
7322  prop, "Cubemap Display Size", "Size of the cubemap spheres to debug captured light");
7324 
7325  prop = RNA_def_property(srna, "gi_auto_bake", PROP_BOOLEAN, PROP_NONE);
7327  RNA_def_property_ui_text(prop, "Auto Bake", "Auto bake indirect lighting when editing probes");
7328 
7329  prop = RNA_def_property(srna, "gi_cache_info", PROP_STRING, PROP_NONE);
7330  RNA_def_property_string_sdna(prop, NULL, "light_cache_info");
7332  RNA_def_property_ui_text(prop, "Light Cache Info", "Info on current cache status");
7333 
7334  /* Temporal Anti-Aliasing (super sampling) */
7335  prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
7336  RNA_def_property_ui_text(prop, "Viewport Samples", "Number of samples, unlimited if 0");
7337  RNA_def_property_range(prop, 0, INT_MAX);
7340 
7341  prop = RNA_def_property(srna, "taa_render_samples", PROP_INT, PROP_NONE);
7342  RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixels for rendering");
7343  RNA_def_property_range(prop, 1, INT_MAX);
7346 
7347  prop = RNA_def_property(srna, "use_taa_reprojection", PROP_BOOLEAN, PROP_NONE);
7350  "Viewport Denoising",
7351  "Denoise image using temporal reprojection "
7352  "(can leave some ghosting)");
7355 
7356  /* Screen Space Subsurface Scattering */
7357  prop = RNA_def_property(srna, "sss_samples", PROP_INT, PROP_NONE);
7358  RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute the scattering effect");
7359  RNA_def_property_range(prop, 1, 32);
7362 
7363  prop = RNA_def_property(srna, "sss_jitter_threshold", PROP_FLOAT, PROP_FACTOR);
7365  prop, "Jitter Threshold", "Rotate samples that are below this threshold");
7366  RNA_def_property_range(prop, 0.0f, 1.0f);
7369 
7370  /* Screen Space Reflection */
7371  prop = RNA_def_property(srna, "use_ssr", PROP_BOOLEAN, PROP_NONE);
7373  RNA_def_property_ui_text(prop, "Screen Space Reflections", "Enable screen space reflection");
7376 
7377  prop = RNA_def_property(srna, "use_ssr_refraction", PROP_BOOLEAN, PROP_NONE);
7379  RNA_def_property_ui_text(prop, "Screen Space Refractions", "Enable screen space Refractions");
7382 
7383  prop = RNA_def_property(srna, "use_ssr_halfres", PROP_BOOLEAN, PROP_NONE);
7385  RNA_def_property_ui_text(prop, "Half Res Trace", "Raytrace at a lower resolution");
7388 
7389  prop = RNA_def_property(srna, "ssr_quality", PROP_FLOAT, PROP_FACTOR);
7390  RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the screen space ray-tracing");
7391  RNA_def_property_range(prop, 0.0f, 1.0f);
7394 
7395  prop = RNA_def_property(srna, "ssr_max_roughness", PROP_FLOAT, PROP_FACTOR);
7397  prop, "Max Roughness", "Do not raytrace reflections for roughness above this value");
7398  RNA_def_property_range(prop, 0.0f, 1.0f);
7401 
7402  prop = RNA_def_property(srna, "ssr_thickness", PROP_FLOAT, PROP_DISTANCE);
7403  RNA_def_property_ui_text(prop, "Thickness", "Pixel thickness used to detect intersection");
7404  RNA_def_property_range(prop, 1e-6f, FLT_MAX);
7405  RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3);
7408 
7409  prop = RNA_def_property(srna, "ssr_border_fade", PROP_FLOAT, PROP_FACTOR);
7410  RNA_def_property_ui_text(prop, "Edge Fading", "Screen percentage used to fade the SSR");
7411  RNA_def_property_range(prop, 0.0f, 0.5f);
7414 
7415  prop = RNA_def_property(srna, "ssr_firefly_fac", PROP_FLOAT, PROP_NONE);
7416  RNA_def_property_ui_text(prop, "Clamp", "Clamp pixel intensity to remove noise (0 to disabled)");
7417  RNA_def_property_range(prop, 0.0f, FLT_MAX);
7420 
7421  /* Volumetrics */
7422  prop = RNA_def_property(srna, "volumetric_start", PROP_FLOAT, PROP_DISTANCE);
7423  RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect");
7424  RNA_def_property_range(prop, 1e-6f, FLT_MAX);
7425  RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
7428 
7429  prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE);
7430  RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect");
7431  RNA_def_property_range(prop, 1e-6f, FLT_MAX);
7432  RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
7435 
7436  prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE);
7437  RNA_def_property_enum_items(prop, eevee_volumetric_tile_size_items);
7439  "Tile Size",
7440  "Control the quality of the volumetric effects "
7441  "(lower size increase vram usage and quality)");
7444 
7445  prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE);
7446  RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute volumetric effects");
7447  RNA_def_property_range(prop, 1, 256);
7450 
7451  prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR);
7453  prop, "Exponential Sampling", "Distribute more samples closer to the camera");
7456 
7457  prop = RNA_def_property(srna, "use_volumetric_lights", PROP_BOOLEAN, PROP_NONE);
7460  prop, "Volumetric Lighting", "Enable scene light interactions with volumetrics");
7463 
7464  prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE);
7465  RNA_def_property_range(prop, 0.0f, FLT_MAX);
7466  RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise");
7469 
7470  prop = RNA_def_property(srna, "use_volumetric_shadows", PROP_BOOLEAN, PROP_NONE);
7473  prop, "Volumetric Shadows", "Generate shadows from volumetric material (Very expensive)");
7476 
7477  prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE);
7478  RNA_def_property_range(prop, 1, 128);
7480  prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing");
7483 
7484  /* Ambient Occlusion */
7485  prop = RNA_def_property(srna, "use_gtao", PROP_BOOLEAN, PROP_NONE);
7488  "Ambient Occlusion",
7489  "Enable ambient occlusion to simulate medium scale indirect shadowing");
7492 
7493  prop = RNA_def_property(srna, "use_gtao_bent_normals", PROP_BOOLEAN, PROP_NONE);
7496  prop, "Bent Normals", "Compute main non occluded direction to sample the environment");
7499 
7500  prop = RNA_def_property(srna, "use_gtao_bounce", PROP_BOOLEAN, PROP_NONE);
7503  "Bounces Approximation",
7504  "An approximation to simulate light bounces "
7505  "giving less occlusion on brighter objects");
7508 
7509  prop = RNA_def_property(srna, "gtao_factor", PROP_FLOAT, PROP_FACTOR);
7510  RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending");
7511  RNA_def_property_range(prop, 0.0f, FLT_MAX);
7512  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 2);
7515 
7516  prop = RNA_def_property(srna, "gtao_quality", PROP_FLOAT, PROP_FACTOR);
7517  RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the horizon search");
7518  RNA_def_property_range(prop, 0.0f, 1.0f);
7521 
7522  prop = RNA_def_property(srna, "gtao_distance", PROP_FLOAT, PROP_DISTANCE);
7524  prop, "Distance", "Distance of object that contribute to the ambient occlusion effect");
7525  RNA_def_property_range(prop, 0.0f, 100000.0f);
7526  RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
7529 
7530  /* Depth of Field */
7531 
7532  prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_PIXEL);
7534  prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)");
7535  RNA_def_property_range(prop, 0.0f, 2000.0f);
7536  RNA_def_property_ui_range(prop, 0.0f, 200.0f, 100.0f, 1);
7538 
7539  prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR);
7541  prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field");
7542  RNA_def_property_range(prop, 0.0f, 100000.0f);
7543  RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 2);
7546 
7547  prop = RNA_def_property(srna, "bokeh_neighbor_max", PROP_FLOAT, PROP_FACTOR);
7549  "Neighbor Rejection",
7550  "Maximum brightness to consider when rejecting bokeh sprites "
7551  "based on neighborhood (lower is faster)");
7552  RNA_def_property_range(prop, 0.0f, 100000.0f);
7553  RNA_def_property_ui_range(prop, 0.0f, 40.0f, 10, 2);
7556 
7557  prop = RNA_def_property(srna, "bokeh_denoise_fac", PROP_FLOAT, PROP_FACTOR);
7559  prop, "Denoise Amount", "Amount of flicker removal applied to bokeh highlights");
7560  RNA_def_property_range(prop, 0.0f, 1.0f);
7561  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 10, 2);
7564 
7565  prop = RNA_def_property(srna, "use_bokeh_high_quality_slight_defocus", PROP_BOOLEAN, PROP_NONE);
7568  "High Quality Slight Defocus",
7569  "Sample all pixels in almost in-focus regions to eliminate noise");
7572 
7573  prop = RNA_def_property(srna, "use_bokeh_jittered", PROP_BOOLEAN, PROP_NONE);
7576  "Jitter Camera",
7577  "Jitter camera position to create accurate blurring "
7578  "using render samples");
7581 
7582  prop = RNA_def_property(srna, "bokeh_overblur", PROP_FLOAT, PROP_PERCENTAGE);
7584  "Over-blur",
7585  "Apply blur to each jittered sample to reduce "
7586  "under-sampling artifacts");
7587  RNA_def_property_range(prop, 0, 100);
7588  RNA_def_property_ui_range(prop, 0.0f, 20.0f, 1, 1);
7590 
7591  /* Bloom */
7592  prop = RNA_def_property(srna, "use_bloom", PROP_BOOLEAN, PROP_NONE);
7594  RNA_def_property_ui_text(prop, "Bloom", "High brightness pixels generate a glowing effect");
7597 
7598  prop = RNA_def_property(srna, "bloom_threshold", PROP_FLOAT, PROP_FACTOR);
7599  RNA_def_property_ui_text(prop, "Threshold", "Filters out pixels under this level of brightness");
7600  RNA_def_property_range(prop, 0.0f, 100000.0f);
7601  RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
7604 
7605  prop = RNA_def_property(srna, "bloom_color", PROP_FLOAT, PROP_COLOR);
7606  RNA_def_property_array(prop, 3);
7607  RNA_def_property_ui_text(prop, "Color", "Color applied to the bloom effect");
7610 
7611  prop = RNA_def_property(srna, "bloom_knee", PROP_FLOAT, PROP_FACTOR);
7612  RNA_def_property_ui_text(prop, "Knee", "Makes transition between under/over-threshold gradual");
7613  RNA_def_property_range(prop, 0.0f, 1.0f);
7616 
7617  prop = RNA_def_property(srna, "bloom_radius", PROP_FLOAT, PROP_FACTOR);
7618  RNA_def_property_ui_text(prop, "Radius", "Bloom spread distance");
7619  RNA_def_property_range(prop, 0.0f, 100.0f);
7620  RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
7623 
7624  prop = RNA_def_property(srna, "bloom_clamp", PROP_FLOAT, PROP_FACTOR);
7626  prop, "Clamp", "Maximum intensity a bloom pixel can have (0 to disabled)");
7627  RNA_def_property_range(prop, 0.0f, 100000.0f);
7628  RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 1, 3);
7631 
7632  prop = RNA_def_property(srna, "bloom_intensity", PROP_FLOAT, PROP_FACTOR);
7633  RNA_def_property_ui_text(prop, "Intensity", "Blend factor");
7634  RNA_def_property_range(prop, 0.0f, 10000.0f);
7635  RNA_def_property_ui_range(prop, 0.0f, 0.1f, 1, 3);
7638 
7639  /* Motion blur */
7640  prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
7642  RNA_def_property_ui_text(prop, "Motion Blur", "Enable motion blur effect (only in camera view)");
7645 
7646  prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR);
7647  RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
7648  RNA_def_property_range(prop, 0.0f, FLT_MAX);
7649  RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 2);
7652 
7653  prop = RNA_def_property(srna, "motion_blur_depth_scale", PROP_FLOAT, PROP_NONE);
7655  "Background Separation",
7656  "Lower values will reduce background"
7657  " bleeding onto foreground elements");
7658  RNA_def_property_range(prop, 0.0f, FLT_MAX);
7659  RNA_def_property_ui_range(prop, 0.01f, 1000.0f, 1, 2);
7662 
7663  prop = RNA_def_property(srna, "motion_blur_max", PROP_INT, PROP_PIXEL);
7664  RNA_def_property_ui_text(prop, "Max Blur", "Maximum blur distance a pixel can spread over");
7665  RNA_def_property_range(prop, 0, 2048);
7666  RNA_def_property_ui_range(prop, 0, 512, 1, -1);
7669 
7670  prop = RNA_def_property(srna, "motion_blur_steps", PROP_INT, PROP_NONE);
7672  "Motion steps",
7673  "Controls accuracy of motion blur, "
7674  "more steps means longer render time");
7675  RNA_def_property_range(prop, 1, INT_MAX);
7676  RNA_def_property_ui_range(prop, 1, 64, 1, -1);
7679 
7680  prop = RNA_def_property(srna, "motion_blur_position", PROP_ENUM, PROP_NONE);
7681  RNA_def_property_enum_items(prop, eevee_motion_blur_position_items);
7683  "Motion Blur Position",
7684  "Offset for the shutter's time interval, "
7685  "allows to change the motion blur trails");
7688 
7689  /* Shadows */
7690  prop = RNA_def_property(srna, "shadow_cube_size", PROP_ENUM, PROP_NONE);
7691  RNA_def_property_enum_items(prop, eevee_shadow_size_items);
7693  prop, "Cube Shadows Resolution", "Size of point and area light shadow maps");
7696 
7697  prop = RNA_def_property(srna, "shadow_cascade_size", PROP_ENUM, PROP_NONE);
7698  RNA_def_property_enum_items(prop, eevee_shadow_size_items);
7700  prop, "Directional Shadows Resolution", "Size of sun light shadow maps");
7703 
7704  prop = RNA_def_property(srna, "use_shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE);
7706  RNA_def_property_ui_text(prop, "High Bit Depth", "Use 32-bit shadows");
7709 
7710  prop = RNA_def_property(srna, "use_soft_shadows", PROP_BOOLEAN, PROP_NONE);
7713  prop, "Soft Shadows", "Randomize shadowmaps origin to create soft shadows");
7716 
7717  prop = RNA_def_property(srna, "light_threshold", PROP_FLOAT, PROP_UNSIGNED);
7719  "Light Threshold",
7720  "Minimum light intensity for a light to contribute to the lighting");
7721  RNA_def_property_range(prop, 0.0f, FLT_MAX);
7722  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
7725 
7726  /* Overscan */
7727  prop = RNA_def_property(srna, "use_overscan", PROP_BOOLEAN, PROP_NONE);
7730  "Overscan",
7731  "Internally render past the image border to avoid "
7732  "screen-space effects disappearing");
7734 
7735  prop = RNA_def_property(srna, "overscan_size", PROP_FLOAT, PROP_PERCENTAGE);
7736  RNA_def_property_float_sdna(prop, NULL, "overscan");
7738  "Overscan Size",
7739  "Percentage of render size to add as overscan to the "
7740  "internal render buffers");
7741  RNA_def_property_range(prop, 0.0f, 50.0f);
7742  RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 2);
7744 }
7745 
7747 {
7748  StructRNA *srna;
7749  PropertyRNA *prop;
7750 
7751  srna = RNA_def_struct(brna, "SceneGpencil", NULL);
7752  RNA_def_struct_path_func(srna, "rna_SceneGpencil_path");
7753  RNA_def_struct_ui_text(srna, "Grease Pencil Render", "Render settings");
7754 
7755  prop = RNA_def_property(srna, "antialias_threshold", PROP_FLOAT, PROP_NONE);
7756  RNA_def_property_float_sdna(prop, NULL, "smaa_threshold");
7757  RNA_def_property_float_default(prop, 1.0f);
7758  RNA_def_property_range(prop, 0.0f, FLT_MAX);
7759  RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
7761  "Anti-Aliasing Threshold",
7762  "Threshold for edge detection algorithm (higher values might over-blur "
7763  "some part of the image)");
7766 }
7767 
7769 {
7770  StructRNA *srna;
7771  PropertyRNA *prop;
7772 
7773  FunctionRNA *func;
7774  PropertyRNA *parm;
7775 
7776  static const EnumPropertyItem audio_distance_model_items[] = {
7777  {0, "NONE", 0, "None", "No distance attenuation"},
7778  {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
7779  {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
7780  {3, "LINEAR", 0, "Linear", "Linear distance model"},
7781  {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
7782  {5, "EXPONENT", 0, "Exponent", "Exponent distance model"},
7783  {6, "EXPONENT_CLAMPED", 0, "Exponent Clamped", "Exponent distance model with clamping"},
7784  {0, NULL, 0, NULL, NULL},
7785  };
7786 
7787  static const EnumPropertyItem sync_mode_items[] = {
7788  {0, "NONE", 0, "Play Every Frame", "Do not sync, play every frame"},
7789  {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
7790  {AUDIO_SYNC, "AUDIO_SYNC", 0, "Sync to Audio", "Sync to audio playback, dropping frames"},
7791  {0, NULL, 0, NULL, NULL},
7792  };
7793 
7794  /* Struct definition */
7795  srna = RNA_def_struct(brna, "Scene", "ID");
7797  "Scene",
7798  "Scene data-block, consisting in objects and "
7799  "defining time and render related settings");
7800  RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
7802 
7803  /* Global Settings */
7804  prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
7807  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
7808  RNA_def_property_ui_text(prop, "Camera", "Active camera, used for rendering the scene");
7809  RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_camera_update");
7810 
7811  prop = RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
7812  RNA_def_property_pointer_sdna(prop, NULL, "set");
7813  RNA_def_property_struct_type(prop, "Scene");
7816  RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL, NULL);
7817  RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
7818  RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7819 
7820  prop = RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
7823  RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
7824  RNA_def_property_update(prop, NC_SCENE | ND_WORLD, "rna_Scene_world_update");
7825 
7826  prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
7827  RNA_def_property_struct_type(prop, "Object");
7828  RNA_def_property_ui_text(prop, "Objects", "");
7830  "rna_Scene_objects_begin",
7831  "rna_Scene_objects_next",
7832  "rna_Scene_objects_end",
7833  "rna_Scene_objects_get",
7834  NULL,
7835  NULL,
7836  NULL,
7837  NULL);
7838  rna_def_scene_objects(brna, prop);
7839 
7840  /* Frame Range Stuff */
7841  prop = RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
7843  RNA_def_property_int_sdna(prop, NULL, "r.cfra");
7845  RNA_def_property_int_funcs(prop, NULL, "rna_Scene_frame_current_set", NULL);
7847  prop,
7848  "Current Frame",
7849  "Current frame, to update animation data from python frame_set() instead");
7850  RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
7851 
7852  prop = RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME);
7853  RNA_def_property_float_sdna(prop, NULL, "r.subframe");
7854  RNA_def_property_ui_text(prop, "Current Subframe", "");
7856  RNA_def_property_range(prop, 0.0f, 1.0f);
7857  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2);
7858  RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
7859 
7860  prop = RNA_def_property(srna, "frame_float", PROP_FLOAT, PROP_TIME);
7861  RNA_def_property_ui_text(prop, "Current Subframe", "");
7866  prop, "rna_Scene_frame_float_get", "rna_Scene_frame_float_set", NULL);
7867  RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
7868 
7869  prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
7871  RNA_def_property_int_sdna(prop, NULL, "r.sfra");
7872  RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL);
7874  RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
7876 
7877  prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
7879  RNA_def_property_int_sdna(prop, NULL, "r.efra");
7880  RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
7882  RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
7884 
7885  prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
7887  RNA_def_property_int_sdna(prop, NULL, "r.frame_step");
7888  RNA_def_property_range(prop, 0, MAXFRAME);
7889  RNA_def_property_ui_range(prop, 1, 100, 1, -1);
7891  prop,
7892  "Frame Step",
7893  "Number of frames to skip forward while rendering/playing back each frame");
7895 
7896  prop = RNA_def_property(srna, "frame_current_final", PROP_FLOAT, PROP_TIME);
7899  RNA_def_property_float_funcs(prop, "rna_Scene_frame_current_final_get", NULL, NULL);
7901  prop, "Current Frame Final", "Current frame with subframe and time remapping applied");
7902 
7903  prop = RNA_def_property(srna, "lock_frame_selection_to_range", PROP_BOOLEAN, PROP_NONE);
7907  "Lock Frame Selection",
7908  "Don't allow frame to be selected with mouse outside of frame range");
7910 
7911  /* Preview Range (frame-range for UI playback) */
7912  prop = RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
7915  RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_preview_range_set");
7917  prop,
7918  "Use Preview Range",
7919  "Use an alternative start/end frame range for animation playback and view renders");
7921  RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
7922 
7923  prop = RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
7925  RNA_def_property_int_sdna(prop, NULL, "r.psfra");
7926  RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL);
7928  prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
7930 
7931  prop = RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
7933  RNA_def_property_int_sdna(prop, NULL, "r.pefra");
7934  RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_end_frame_set", NULL);
7936  prop, "Preview Range End Frame", "Alternative end frame for UI playback");
7938 
7939  /* Sub-frame for motion-blur debug. */
7940  prop = RNA_def_property(srna, "show_subframe", PROP_BOOLEAN, PROP_NONE);
7944  prop, "Show Subframe", "Show current scene subframe and allow set it using interface tools");
7945  RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_show_subframe_update");
7946 
7947  /* Timeline / Time Navigation settings */
7948  prop = RNA_def_property(srna, "show_keys_from_selected_only", PROP_BOOLEAN, PROP_NONE);
7951  "Only Keyframes from Selected Channels",
7952  "Consider keyframes for active object and/or its selected bones only "
7953  "(in timeline and when jumping between keyframes)");
7955 
7956  /* Stamp */
7957  prop = RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
7958  RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
7959  RNA_def_property_ui_text(prop, "Stamp Note", "User defined note for the render stamping");
7961 
7962  /* Animation Data (for Scene) */
7964 
7965  /* Readonly Properties */
7966  prop = RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
7969  PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
7971  prop,
7972  "NLA Tweak Mode",
7973  "Whether there is any action referenced by NLA being edited (strictly read-only)");
7975 
7976  /* Frame dropping flag for playback and sync enum */
7977 # if 0 /* XXX: Is this actually needed? */
7978  prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
7981  prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
7983 # endif
7984 
7985  prop = RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
7986  RNA_def_property_enum_funcs(prop, "rna_Scene_sync_mode_get", "rna_Scene_sync_mode_set", NULL);
7987  RNA_def_property_enum_items(prop, sync_mode_items);
7989  RNA_def_property_ui_text(prop, "Sync Mode", "How to sync playback");
7991 
7992  /* Nodes (Compositing) */
7993  prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
7994  RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
7997  RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree");
7998 
7999  prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
8000  RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
8002  RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree");
8003  RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_nodes_update");
8004 
8005  /* Sequencer */
8006  prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
8007  RNA_def_property_pointer_sdna(prop, NULL, "ed");
8008  RNA_def_property_struct_type(prop, "SequenceEditor");
8009  RNA_def_property_ui_text(prop, "Sequence Editor", "");
8010 
8011  /* Keying Sets */
8012  prop = RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
8013  RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL);
8014  RNA_def_property_struct_type(prop, "KeyingSet");
8015  RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
8017  rna_def_scene_keying_sets(brna, prop);
8018 
8019  prop = RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
8021  "rna_Scene_all_keyingsets_begin",
8022  "rna_Scene_all_keyingsets_next",
8023  "rna_iterator_listbase_end",
8024  "rna_iterator_listbase_get",
8025  NULL,
8026  NULL,
8027  NULL,
8028  NULL);
8029  RNA_def_property_struct_type(prop, "KeyingSet");
8031  prop,
8032  "All Keying Sets",
8033  "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
8035  rna_def_scene_keying_sets_all(brna, prop);
8036 
8037  /* Rigid Body Simulation */
8038  prop = RNA_def_property(srna, "rigidbody_world", PROP_POINTER, PROP_NONE);
8039  RNA_def_property_pointer_sdna(prop, NULL, "rigidbody_world");
8040  RNA_def_property_struct_type(prop, "RigidBodyWorld");
8041  RNA_def_property_ui_text(prop, "Rigid Body World", "");
8042  RNA_def_property_update(prop, NC_SCENE, "rna_Physics_relations_update");
8043 
8044  /* Tool Settings */
8045  prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
8047  RNA_def_property_pointer_sdna(prop, NULL, "toolsettings");
8048  RNA_def_property_struct_type(prop, "ToolSettings");
8049  RNA_def_property_ui_text(prop, "Tool Settings", "");
8050 
8051  /* Unit Settings */
8052  prop = RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
8054  RNA_def_property_pointer_sdna(prop, NULL, "unit");
8055  RNA_def_property_struct_type(prop, "UnitSettings");
8056  RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
8057 
8058  /* Physics Settings */
8059  prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
8060  RNA_def_property_float_sdna(prop, NULL, "physics_settings.gravity");
8061  RNA_def_property_array(prop, 3);
8062  RNA_def_property_ui_range(prop, -200.0f, 200.0f, 1, 2);
8063  RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
8064  RNA_def_property_update(prop, 0, "rna_Physics_update");
8065 
8066  prop = RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
8067  RNA_def_property_boolean_sdna(prop, NULL, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
8068  RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics");
8069  RNA_def_property_update(prop, 0, "rna_Physics_update");
8070 
8071  /* Render Data */
8072  prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
8074  RNA_def_property_pointer_sdna(prop, NULL, "r");
8075  RNA_def_property_struct_type(prop, "RenderSettings");
8076  RNA_def_property_ui_text(prop, "Render Data", "");
8077 
8078  /* Safe Areas */
8079  prop = RNA_def_property(srna, "safe_areas", PROP_POINTER, PROP_NONE);
8080  RNA_def_property_pointer_sdna(prop, NULL, "safe_areas");
8082  RNA_def_property_struct_type(prop, "DisplaySafeAreas");
8083  RNA_def_property_ui_text(prop, "Safe Areas", "");
8084 
8085  /* Markers */
8086  prop = RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
8087  RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
8088  RNA_def_property_struct_type(prop, "TimelineMarker");
8090  prop, "Timeline Markers", "Markers used in all timelines for the current scene");
8091  rna_def_timeline_markers(brna, prop);
8092 
8093  /* Transform Orientations */
8094  prop = RNA_def_property(srna, "transform_orientation_slots", PROP_COLLECTION, PROP_NONE);
8096  "rna_Scene_transform_orientation_slots_begin",
8097  "rna_iterator_array_next",
8098  "rna_iterator_array_end",
8099  "rna_iterator_array_get",
8100  "rna_Scene_transform_orientation_slots_length",
8101  NULL,
8102  NULL,
8103  NULL);
8104  RNA_def_property_struct_type(prop, "TransformOrientationSlot");
8105  RNA_def_property_ui_text(prop, "Transform Orientation Slots", "");
8106 
8107  /* 3D View Cursor */
8108  prop = RNA_def_property(srna, "cursor", PROP_POINTER, PROP_NONE);
8110  RNA_def_property_pointer_sdna(prop, NULL, "cursor");
8111  RNA_def_property_struct_type(prop, "View3DCursor");
8112  RNA_def_property_ui_text(prop, "3D Cursor", "");
8113 
8114  /* Audio Settings */
8115  prop = RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE);
8116  RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set");
8118  prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted");
8119  RNA_def_property_update(prop, NC_SCENE, "rna_Scene_use_audio_update");
8120 
8121 # if 0 /* XXX: Is this actually needed? */
8122  prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
8123  RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
8125  prop,
8126  "Audio Sync",
8127  "Play back and sync with audio clock, dropping frames if frame display is too slow");
8129 # endif
8130 
8131  prop = RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
8132  RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SCRUB);
8134  prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing");
8136 
8137  prop = RNA_def_property(srna, "audio_doppler_speed", PROP_FLOAT, PROP_NONE);
8138  RNA_def_property_float_sdna(prop, NULL, "audio.speed_of_sound");
8140  RNA_def_property_range(prop, 0.01f, FLT_MAX);
8142  prop, "Speed of Sound", "Speed of sound for Doppler effect calculation");
8143  RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
8144 
8145  prop = RNA_def_property(srna, "audio_doppler_factor", PROP_FLOAT, PROP_NONE);
8146  RNA_def_property_float_sdna(prop, NULL, "audio.doppler_factor");
8148  RNA_def_property_range(prop, 0.0, FLT_MAX);
8149  RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for Doppler effect calculation");
8150  RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
8151 
8152  prop = RNA_def_property(srna, "audio_distance_model", PROP_ENUM, PROP_NONE);
8153  RNA_def_property_enum_bitflag_sdna(prop, NULL, "audio.distance_model");
8155  RNA_def_property_enum_items(prop, audio_distance_model_items);
8157  prop, "Distance Model", "Distance model for distance attenuation calculation");
8158  RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
8159 
8160  prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
8161  RNA_def_property_float_sdna(prop, NULL, "audio.volume");
8162  RNA_def_property_range(prop, 0.0f, 100.0f);
8163  RNA_def_property_ui_text(prop, "Volume", "Audio volume");
8166  RNA_def_property_update(prop, NC_SCENE, "rna_Scene_volume_update");
8167 
8168  func = RNA_def_function(srna, "update_render_engine", "rna_Scene_update_render_engine");
8170  RNA_def_function_ui_description(func, "Trigger a render engine update");
8171 
8172  /* Statistics */
8173  func = RNA_def_function(srna, "statistics", "rna_Scene_statistics_string_get");
8175  parm = RNA_def_pointer(func, "view_layer", "ViewLayer", "View Layer", "");
8177  parm = RNA_def_string(func, "statistics", NULL, 0, "Statistics", "");
8178  RNA_def_function_return(func, parm);
8179 
8180  /* Grease Pencil */
8181  prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
8182  RNA_def_property_pointer_sdna(prop, NULL, "gpd");
8183  RNA_def_property_struct_type(prop, "GreasePencil");
8185  prop, NULL, NULL, NULL, "rna_GPencil_datablocks_annotations_poll");
8189  prop, "Annotations", "Grease Pencil data-block used for annotations in the 3D view");
8191 
8192  /* active MovieClip */
8193  prop = RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE);
8194  RNA_def_property_pointer_sdna(prop, NULL, "clip");
8196  RNA_def_property_struct_type(prop, "MovieClip");
8198  "Active Movie Clip",
8199  "Active Movie Clip that can be used by motion tracking constraints "
8200  "or as a camera's background image");
8202 
8203  /* color management */
8204  prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
8205  RNA_def_property_pointer_sdna(prop, NULL, "view_settings");
8206  RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
8208  prop, "View Settings", "Color management settings applied on image before saving");
8209 
8210  prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
8211  RNA_def_property_pointer_sdna(prop, NULL, "display_settings");
8212  RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
8214  prop, "Display Settings", "Settings of device saved image would be displayed on");
8215 
8216  prop = RNA_def_property(srna, "sequencer_colorspace_settings", PROP_POINTER, PROP_NONE);
8217  RNA_def_property_pointer_sdna(prop, NULL, "sequencer_colorspace_settings");
8218  RNA_def_property_struct_type(prop, "ColorManagedSequencerColorspaceSettings");
8220  prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
8221 
8222  /* Layer and Collections */
8223  prop = RNA_def_property(srna, "view_layers", PROP_COLLECTION, PROP_NONE);
8224  RNA_def_property_collection_sdna(prop, NULL, "view_layers", NULL);
8225  RNA_def_property_struct_type(prop, "ViewLayer");
8226  RNA_def_property_ui_text(prop, "View Layers", "");
8227  rna_def_view_layers(brna, prop);
8228 
8229  prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
8231  RNA_def_property_pointer_sdna(prop, NULL, "master_collection");
8232  RNA_def_property_struct_type(prop, "Collection");
8236  "Collection",
8237  "Scene root collection that owns all the objects and other collections "
8238  "instantiated in the scene");
8239 
8240  /* Scene Display */
8241  prop = RNA_def_property(srna, "display", PROP_POINTER, PROP_NONE);
8242  RNA_def_property_pointer_sdna(prop, NULL, "display");
8243  RNA_def_property_struct_type(prop, "SceneDisplay");
8244  RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3D viewport");
8245 
8246  /* EEVEE */
8247  prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
8248  RNA_def_property_struct_type(prop, "SceneEEVEE");
8249  RNA_def_property_ui_text(prop, "Eevee", "Eevee settings for the scene");
8250 
8251  /* Grease Pencil */
8252  prop = RNA_def_property(srna, "grease_pencil_settings", PROP_POINTER, PROP_NONE);
8253  RNA_def_property_struct_type(prop, "SceneGpencil");
8254  RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil settings for the scene");
8255 
8256  /* Nestled Data. */
8257  /* *** Non-Animated *** */
8258  RNA_define_animate_sdna(false);
8259  rna_def_tool_settings(brna);
8264  rna_def_statvis(brna);
8265  rna_def_unit_settings(brna);
8269  rna_def_view3d_cursor(brna);
8272  rna_def_scene_display(brna);
8273  rna_def_scene_eevee(brna);
8274  rna_def_view_layer_aov(brna);
8277  rna_def_scene_gpencil(brna);
8279  /* *** Animated *** */
8282 
8283  /* Scene API */
8284  RNA_api_scene(srna);
8285 }
8286 
8287 #endif
typedef float(TangentPoint)[2]
struct KeyingSet * BKE_keyingset_add(struct ListBase *list, const char idname[], const char name[], short flag, short keyingflag)
Definition: anim_sys.c:126
void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode)
Definition: armature.c:1983
void BKE_brush_scale_size(int *r_brush_size, float new_unprojected_radius, float old_unprojected_radius)
Definition: brush.cc:2363
void BKE_brush_scale_unprojected_radius(float *unprojected_radius, int new_brush_size, int old_brush_size)
Definition: brush.cc:2351
void BKE_scene_objects_iterator_next(struct BLI_Iterator *iter)
Definition: collection.c:2042
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_SCENE_OBJECT_END
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
void BKE_scene_objects_iterator_end(struct BLI_Iterator *iter)
Definition: collection.c:2074
#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance)
void BKE_scene_objects_iterator_begin(struct BLI_Iterator *iter, void *data_in)
Definition: collection.c:1958
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
#define CTX_DATA_BEGIN(C, Type, instance, member)
Definition: BKE_context.h:269
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
#define CTX_DATA_END
Definition: BKE_context.h:278
struct FreestyleSettings FreestyleSettings
Definition: BKE_freestyle.h:21
short BKE_freestyle_lineset_get_active_index(struct FreestyleConfig *config)
Definition: freestyle.c:225
struct FreestyleModuleConfig * BKE_freestyle_module_add(struct FreestyleConfig *config)
Definition: freestyle.c:115
struct FreestyleLineSet * BKE_freestyle_lineset_add(struct Main *bmain, struct FreestyleConfig *config, const char *name)
Definition: freestyle.c:162
bool BKE_freestyle_lineset_delete(struct FreestyleConfig *config, struct FreestyleLineSet *lineset)
Definition: freestyle.c:196
void BKE_freestyle_lineset_set_active_index(struct FreestyleConfig *config, short index)
Definition: freestyle.c:239
struct FreestyleLineSet * BKE_freestyle_lineset_get_active(struct FreestyleConfig *config)
Definition: freestyle.c:213
bool BKE_freestyle_module_delete(struct FreestyleConfig *config, struct FreestyleModuleConfig *module_conf)
Definition: freestyle.c:130
#define G_MAIN
Definition: BKE_global.h:267
const struct IDTypeInfo * BKE_idtype_get_info_from_id(const struct ID *id)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
bool BKE_image_is_stereo(const struct Image *ima)
#define IMA_SIGNAL_FREE
Definition: BKE_image.h:130
void BKE_image_signal(struct Main *bmain, struct Image *ima, struct ImageUser *iuser, int signal)
char BKE_imtype_valid_channels(char imtype, bool write_file)
#define IMA_CHAN_FLAG_RGB
#define IMA_CHAN_FLAG_ALPHA
#define IMA_CHAN_FLAG_BW
int BKE_image_path_ensure_ext_from_imformat(char *string, const struct ImageFormatData *im_format)
char BKE_imtype_valid_depths(char imtype)
bool BKE_imtype_is_movie(char imtype)
void BKE_image_format_color_management_copy_from_scene(struct ImageFormatData *imf, const struct Scene *scene)
bool BKE_imtype_requires_linear_float(char imtype)
void BKE_view_layer_rename(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, const char *name)
Definition: layer.c:534
struct ViewLayer * BKE_view_layer_find_with_lightgroup(struct Scene *scene, struct ViewLayerLightgroup *view_layer_lightgroup)
Definition: layer.c:2581
@ VIEWLAYER_ADD_NEW
Definition: BKE_layer.h:37
void BKE_view_layer_verify_aov(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition: layer.c:2476
struct ViewLayer * BKE_view_layer_find_with_aov(struct Scene *scene, struct ViewLayerAOV *view_layer_aov)
Definition: layer.c:2503
struct ViewLayer * BKE_view_layer_add(struct Scene *scene, const char *name, struct ViewLayer *view_layer_source, int type)
Definition: layer.c:185
void BKE_view_layer_rename_lightgroup(struct Scene *scene, ViewLayer *view_layer, ViewLayerLightgroup *lightgroup, const char *name)
Definition: layer.c:2592
void id_us_min(struct ID *id)
Definition: lib_id.c:313
void id_lib_extern(struct ID *id)
Definition: lib_id.c:237
void id_us_plus(struct ID *id)
Definition: lib_id.c:305
bool BKE_id_is_in_global_main(struct ID *id)
Definition: lib_id.c:1902
void BKE_main_id_tag_listbase(struct ListBase *lb, int tag, bool value)
Definition: lib_id.c:904
struct Mesh * BKE_mesh_from_object(struct Object *ob)
Definition: mesh.cc:1365
#define CMP_NODE_OUTPUT_FILE
Definition: BKE_node.h:1218
struct Paint * BKE_paint_get_active(struct Scene *sce, struct ViewLayer *view_layer)
Definition: paint.c:444
struct Brush * BKE_paint_brush(struct Paint *paint)
Definition: paint.c:607
void BKE_paint_invalidate_overlay_all(void)
Definition: paint.c:260
int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode)
Definition: pointcache.c:2930
#define PTCACHE_RESET_DEPSGRAPH
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
int BKE_scene_orientation_slot_get_index(const struct TransformOrientationSlot *orient_slot)
void BKE_scene_cursor_to_mat4(const struct View3DCursor *cursor, float mat[4][4])
void BKE_scene_cursor_from_mat4(struct View3DCursor *cursor, const float mat[4][4], bool use_compat)
Definition: scene.cc:3688
#define SETLOOPER_SET_ONLY(_sce_basis, _sce_iter, _base)
Definition: BKE_scene.h:48
struct SceneRenderView * BKE_scene_add_render_view(struct Scene *sce, const char *name)
Definition: scene.cc:2740
bool BKE_scene_has_view_layer(const struct Scene *scene, const struct ViewLayer *layer)
int BKE_render_num_threads(const struct RenderData *r)
void BKE_scene_orientation_slot_set_index(struct TransformOrientationSlot *orient_slot, int orientation)
Definition: scene.cc:2456
float BKE_scene_frame_to_ctime(const struct Scene *scene, int frame)
struct TransformOrientation * BKE_scene_transform_orientation_find(const struct Scene *scene, int index)
bool BKE_scene_remove_render_view(struct Scene *scene, struct SceneRenderView *srv)
Definition: scene.cc:2759
bool BKE_scene_use_spherical_stereo(struct Scene *scene)
Definition: scene.cc:2844
int BKE_unit_base_of_type_get(int system, int type)
Definition: unit.c:1269
const char * BKE_unit_display_name_get(const void *usys_pt, int index)
Definition: unit.c:1278
bool BKE_unit_is_suppressed(const void *usys_pt, int index)
Definition: unit.c:1296
void BKE_unit_system_get(int system, int type, const void **r_usys_pt, int *r_len)
Definition: unit.c:1251
@ B_UNIT_LENGTH
Definition: BKE_unit.h:101
@ B_UNIT_TEMPERATURE
Definition: BKE_unit.h:112
@ B_UNIT_MASS
Definition: BKE_unit.h:104
@ B_UNIT_TIME
Definition: BKE_unit.h:106
const char * BKE_unit_identifier_get(const void *usys_pt, int index)
Definition: unit.c:1282
Volume data-block.
#define BLI_assert_unreachable()
Definition: BLI_assert.h:93
#define BLI_assert(a)
Definition: BLI_assert.h:46
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
bool BLI_remlink_safe(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:123
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
#define M_PI
Definition: BLI_math_base.h:20
void normalize_m4_m4(float R[4][4], const float M[4][4]) ATTR_NONNULL()
Definition: math_matrix.c:1965
#define DEG2RAD(_deg)
#define DEG2RADF(_deg)
MINLINE void copy_v3_v3(float r[3], const float a[3])
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
#define STR_ELEM(...)
Definition: BLI_string.h:539
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:250
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL(1
bool BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_len)
Definition: string_utils.c:309
int BLI_system_num_threads_override_get(void)
Definition: threads.cc:322
#define BLENDER_MAX_THREADS
Definition: BLI_threads.h:19
#define ARRAY_SIZE(arr)
#define UNUSED(x)
#define MAX2(a, b)
#define ELEM(...)
#define MIN2(a, b)
#define STREQ(a, b)
#define BLT_I18NCONTEXT_EDITOR_VIEW3D
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_ID_SOUND
#define DATA_(msgid)
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_AUDIO_FPS
Definition: DNA_ID.h:843
@ ID_RECALC_AUDIO_LISTENER
Definition: DNA_ID.h:846
@ ID_RECALC_TRANSFORM
Definition: DNA_ID.h:771
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:834
@ ID_RECALC_FRAME_CHANGE
Definition: DNA_ID.h:841
@ ID_RECALC_SELECT
Definition: DNA_ID.h:818
@ ID_RECALC_PSYS_CHILD
Definition: DNA_ID.h:802
@ ID_RECALC_AUDIO_MUTE
Definition: DNA_ID.h:845
@ ID_RECALC_SEQUENCER_STRIPS
Definition: DNA_ID.h:838
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
@ ID_RECALC_AUDIO_VOLUME
Definition: DNA_ID.h:844
@ LIB_TAG_DOIT
Definition: DNA_ID.h:707
@ ID_IM
Definition: DNA_ID_enums.h:53
@ ID_NT
Definition: DNA_ID_enums.h:68
@ ID_SCE
Definition: DNA_ID_enums.h:45
@ KEYINGSET_ABSOLUTE
#define MAX_BRUSH_PIXEL_RADIUS
Object groups, one object can be in many groups at once.
@ CU_BEZIER
@ CU_POLY
@ FREESTYLE_CULLING
@ FREESTYLE_FACE_SMOOTHNESS_FLAG
@ FREESTYLE_MATERIAL_BOUNDARIES_FLAG
@ FREESTYLE_RIDGES_AND_VALLEYS_FLAG
@ FREESTYLE_VIEW_MAP_CACHE
@ FREESTYLE_SUGGESTIVE_CONTOURS_FLAG
@ FREESTYLE_AS_RENDER_PASS
@ FREESTYLE_FE_EDGE_MARK
@ FREESTYLE_FE_BORDER
@ FREESTYLE_FE_SILHOUETTE
@ FREESTYLE_FE_RIDGE_VALLEY
@ FREESTYLE_FE_CREASE
@ FREESTYLE_FE_EXTERNAL_CONTOUR
@ FREESTYLE_FE_CONTOUR
@ FREESTYLE_FE_SUGGESTIVE_CONTOUR
@ FREESTYLE_FE_MATERIAL_BOUNDARY
@ FREESTYLE_QI_VISIBLE
@ FREESTYLE_QI_RANGE
@ FREESTYLE_QI_HIDDEN
@ FREESTYLE_SEL_VISIBILITY
@ FREESTYLE_SEL_EDGE_TYPES
@ FREESTYLE_SEL_IMAGE_BORDER
@ FREESTYLE_SEL_FACE_MARK
@ FREESTYLE_SEL_GROUP
@ FREESTYLE_LINESET_FE_AND
@ FREESTYLE_LINESET_ENABLED
@ FREESTYLE_LINESET_FM_NOT
@ FREESTYLE_LINESET_FE_NOT
@ FREESTYLE_LINESET_FM_BOTH
@ FREESTYLE_LINESET_GR_NOT
@ FREESTYLE_CONTROL_EDITOR_MODE
@ FREESTYLE_CONTROL_SCRIPT_MODE
@ GP_STROKE_SELECT
@ GP_DATA_CACHE_IS_DIRTY
@ GP_SPOINT_SELECT
@ VIEW_LAYER_CRYPTOMATTE_MATERIAL
@ VIEW_LAYER_CRYPTOMATTE_ASSET
@ VIEW_LAYER_CRYPTOMATTE_ACCURATE
@ VIEW_LAYER_CRYPTOMATTE_OBJECT
@ EEVEE_RENDER_PASS_VOLUME_LIGHT
@ EEVEE_RENDER_PASS_BLOOM
@ AOV_TYPE_COLOR
@ AOV_TYPE_VALUE
@ AOV_CONFLICT
@ eModifierType_ParticleSystem
@ eModifierType_Subsurf
@ eModifierType_Multires
Object is a sort of wrapper for general info.
@ OB_MBALL
@ OB_CAMERA
@ OB_MESH
@ OB_VOLUME
@ OB_CURVES_LEGACY
@ OB_GPENCIL
Types and defines for representing Rigid Body entities.
#define SCER_LOCK_FRAME_SELECTION
#define SEQ_SNAP_CURRENT_FRAME_TO_STRIPS
#define PROP_RANDOM
#define R_IMF_IMTYPE_FFMPEG
#define USER_UNIT_METRIC
#define STEREO_LEFT_NAME
#define R_EXTENSION
#define MINFRAME
#define R_SINGLE_LAYER
#define SCE_NLA_EDIT_ON
@ SCE_XFORM_SKIP_CHILDREN
@ SCE_XFORM_AXIS_ALIGN
@ SCE_XFORM_DATA_ORIGIN
#define R_STAMP_RENDERTIME
#define R_BAKE_CLEAR
#define R_BORDER
#define R_STAMP_HOSTNAME
@ R_IMF_TIFF_CODEC_PACKBITS
@ R_IMF_TIFF_CODEC_DEFLATE
@ R_IMF_TIFF_CODEC_NONE
@ R_IMF_TIFF_CODEC_LZW
#define UV_SCULPT_TOOL_RELAX_HC
#define R_MULTIVIEW
#define UV_SELECT_EDGE
#define USER_UNIT_OPT_SPLIT
#define R_BAKE_SPACE_OBJECT
#define R_IMF_EXR_CODEC_MAX
#define R_LINE_THICKNESS_ABSOLUTE
#define R_IMF_PLANES_BW
@ UNIFIED_PAINT_WEIGHT
@ UNIFIED_PAINT_SIZE
@ UNIFIED_PAINT_BRUSH_LOCK_SIZE
@ UNIFIED_PAINT_ALPHA
@ UNIFIED_PAINT_COLOR
#define SEQ_SNAP_TO_STRIP_HOLD
#define UV_SHOW_SAME_IMAGE
#define AUDIO_SCRUB
#define R_IMF_EXR_CODEC_PXR24
#define R_PERSISTENT_DATA
#define PROP_LIN
#define R_CROP
@ SCE_PERF_HQ_NORMALS
#define MINAFRAME
#define SCE_STATVIS_INTERSECT
#define UV_SELECT_FACE
#define R_IMF_IMTYPE_AVIJPEG
#define R_STAMP_MARKER
#define USER_UNIT_NONE
#define R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE
#define R_BAKE_USERSCALE
@ FFM_PRESET_GOOD
@ FFM_PRESET_REALTIME
@ FFM_PRESET_BEST
#define SCE_STATVIS_THICKNESS
#define SCE_LAY_MOTION_BLUR
@ SCE_WORKSPACE_TOOL_DEFAULT
@ SCE_WORKSPACE_TOOL_FALLBACK
@ GP_SELECTMODE_POINT
@ GP_SELECTMODE_SEGMENT
@ GP_SELECTMODE_STROKE
#define SCE_STATVIS_SHARP
#define R_STAMP_MEMORY
#define R_NO_OVERWRITE
@ AUTO_MERGE
@ AUTO_MERGE_AND_SPLIT
#define R_IMF_EXR_CODEC_NONE
#define R_IMF_EXR_CODEC_RLE
#define PHYS_GLOBAL_GRAVITY
#define SCE_STATVIS_DISTORT
#define R_DOCOMP
@ SCE_HAIR_SHAPE_STRAND
@ SCE_HAIR_SHAPE_STRIP
#define SCER_PRV_RANGE
#define R_IMF_JP2_CODEC_J2K
#define SCE_KEYS_NO_SELONLY
@ R_BAKE_TARGET_VERTEX_COLORS
@ R_BAKE_TARGET_IMAGE_TEXTURES
@ S3D_ANAGLYPH_REDCYAN
@ S3D_ANAGLYPH_YELLOWBLUE
@ S3D_ANAGLYPH_GREENMAGENTA
#define PROP_SPHERE
@ R_BAKE_POSY
@ R_BAKE_NEGX
@ R_BAKE_POSZ
@ R_BAKE_NEGY
@ R_BAKE_POSX
@ R_BAKE_NEGZ
#define R_IMF_EXR_CODEC_ZIP
#define R_STAMP_FRAME_RANGE
#define SCE_SELECT_FACE
#define R_DOSEQ
@ SCE_OBJECT_MODE_LOCK
@ FFMPEG_LOSSLESS_OUTPUT
@ FFMPEG_AUTOSPLIT_OUTPUT
@ FFMPEG_USE_MAX_B_FRAMES
@ R_BAKE_ADJACENT_FACES
@ R_BAKE_EXTEND
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE
@ CURVE_PAINT_SURFACE_PLANE_VIEW
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW
@ SEQ_OVERLAP_EXPAND
@ SEQ_OVERLAP_SHUFFLE
@ SEQ_OVERLAP_OVERWRITE
@ R_SEQ_OVERRIDE_SCENE_SETTINGS
#define R_EXR_CACHE_FILE
#define R_IMF_COLOR_MANAGEMENT_OVERRIDE
#define OBACT(_view_layer)
@ S3D_SQUEEZED_FRAME
@ S3D_INTERLACE_SWAP
@ S3D_SIDEBYSIDE_CROSSEYED
#define R_IMF_IMTYPE_MULTILAYER
#define R_IMF_EXR_CODEC_DWAA
@ SCE_ORIENT_DEFAULT
#define UV_SCULPT_TOOL_RELAX_LAPLACIAN
#define PROP_SMOOTH
@ S3D_DISPLAY_ANAGLYPH
@ S3D_DISPLAY_INTERLACE
@ S3D_DISPLAY_TOPBOTTOM
@ S3D_DISPLAY_SIDEBYSIDE
@ S3D_DISPLAY_PAGEFLIP
@ FFM_CRF_LOW
@ FFM_CRF_MEDIUM
@ FFM_CRF_VERYLOW
@ FFM_CRF_LOSSLESS
@ FFM_CRF_PERC_LOSSLESS
@ FFM_CRF_NONE
@ FFM_CRF_LOWEST
@ FFM_CRF_HIGH
#define R_IMF_JP2_FLAG_CINE_PRESET
#define R_STAMP_DRAW
#define R_FIXED_THREADS
@ R_IMF_CHAN_DEPTH_24
@ R_IMF_CHAN_DEPTH_8
@ R_IMF_CHAN_DEPTH_16
@ R_IMF_CHAN_DEPTH_12
@ R_IMF_CHAN_DEPTH_1
@ R_IMF_CHAN_DEPTH_10
@ R_IMF_CHAN_DEPTH_32
#define R_BAKE_SPACE_TANGENT
#define UV_SCULPT_LOCK_BORDERS
#define SCE_STATVIS_OVERHANG
@ SI_STICKY_VERTEX
@ SI_STICKY_LOC
@ SI_STICKY_DISABLE
@ R_ALPHAPREMUL
#define UV_SCULPT_ALL_ISLANDS
@ CURVE_PAINT_PROJECT_CURSOR
@ CURVE_PAINT_PROJECT_SURFACE
#define R_STAMP_HIDE_LABELS
#define SCE_LAY_SOLID
#define R_STAMP_NOTE
#define AUDIO_SYNC
@ GP_SCULPT_MASK_SELECTMODE_POINT
@ GP_SCULPT_MASK_SELECTMODE_STROKE
@ GP_SCULPT_MASK_SELECTMODE_SEGMENT
@ PROP_EDIT_PROJECTED
@ PROP_EDIT_USE
@ PROP_EDIT_CONNECTED
#define UV_SYNC_SELECTION
#define SCE_SELECT_VERTEX
#define UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED
@ SCE_EEVEE_MB_END
@ SCE_EEVEE_MB_START
@ SCE_EEVEE_MB_CENTER
#define SCER_SHOW_SUBFRAME
#define UV_SELECT_ISLAND
#define R_BAKE_AUTO_NAME
#define PROP_ROOT
@ GP_VERTEX_MASK_SELECTMODE_SEGMENT
@ GP_VERTEX_MASK_SELECTMODE_STROKE
@ GP_VERTEX_MASK_SELECTMODE_POINT
#define SCE_LAY_AO
#define USER_UNIT_IMPERIAL
#define SEQ_SNAP_TO_CURRENT_FRAME
#define USER_UNIT_ROT_RADIANS
#define R_STAMP_FRAME
@ S3D_INTERLACE_ROW
@ S3D_INTERLACE_COLUMN
@ S3D_INTERLACE_CHECKERBOARD
#define UV_SELECT_VERTEX
#define R_IMF_PLANES_RGBA
#define R_IMF_CINEON_FLAG_LOG
@ SCE_EEVEE_SHADOW_HIGH_BITDEPTH
@ SCE_EEVEE_VOLUMETRIC_SHADOWS
@ SCE_EEVEE_DOF_HQ_SLIGHT_FOCUS
@ SCE_EEVEE_SSR_ENABLED
@ SCE_EEVEE_MOTION_BLUR_ENABLED
@ SCE_EEVEE_SHOW_IRRADIANCE
@ SCE_EEVEE_SSR_REFRACTION
@ SCE_EEVEE_BLOOM_ENABLED
@ SCE_EEVEE_GTAO_BOUNCE
@ SCE_EEVEE_SSR_HALF_RESOLUTION
@ SCE_EEVEE_TAA_REPROJECTION
@ SCE_EEVEE_OVERSCAN
@ SCE_EEVEE_SHADOW_SOFT
@ SCE_EEVEE_GTAO_BENT_NORMALS
@ SCE_EEVEE_GTAO_ENABLED
@ SCE_EEVEE_SHOW_CUBEMAPS
@ SCE_EEVEE_DOF_JITTER
@ SCE_EEVEE_VOLUMETRIC_LIGHTS
@ SCE_EEVEE_GI_AUTOBAKE
#define R_BAKE_MULTIRES
#define R_STAMP_CAMERA
#define R_STAMP_STRIPMETA
#define R_TOUCH
@ CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS
@ CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS
@ CURVE_PAINT_FLAG_CORNERS_DETECT
@ CURVE_PAINT_FLAG_PRESSURE_RADIUS
#define R_BAKE_CAGE
@ GP_PROJECT_VIEWSPACE
@ GP_PROJECT_DEPTH_VIEW
@ GP_PROJECT_CURSOR
@ GP_PROJECT_DEPTH_STROKE_ENDPOINTS
@ GP_PROJECT_DEPTH_STROKE
@ GP_PROJECT_DEPTH_STROKE_FIRST
@ SCE_SNAP_PEEL_OBJECT
@ SCE_SNAP_TO_INCLUDE_EDITED
@ SCE_SNAP_NOT_TO_ACTIVE
@ SCE_SNAP
@ SCE_SNAP_TO_INCLUDE_NONEDITED
@ SCE_SNAP_PROJECT
@ SCE_SNAP_ROTATE
@ SCE_SNAP_ABS_GRID
@ SCE_SNAP_BACKFACE_CULLING
@ SCE_SNAP_KEEP_ON_SAME_OBJECT
@ SCE_SNAP_TO_ONLY_SELECTABLE
#define R_STAMP_DATE
#define R_BAKE_SPLIT_MAT
@ SIMPLIFY_GPENCIL_FILL
@ SIMPLIFY_GPENCIL_ON_PLAY
@ SIMPLIFY_GPENCIL_AA
@ SIMPLIFY_GPENCIL_MODIFIER
@ SIMPLIFY_GPENCIL_TINT
@ SIMPLIFY_GPENCIL_ENABLE
@ SIMPLIFY_GPENCIL_FX
#define UVCALC_TRANSFORM_CORRECT
#define R_STAMP_FILENAME
#define SCE_LAY_STRAND
#define R_IMF_IMTYPE_AVIRAW
@ SCE_DISPLAY_AA_OFF
@ SCE_DISPLAY_AA_SAMPLES_32
@ SCE_DISPLAY_AA_SAMPLES_8
@ SCE_DISPLAY_AA_SAMPLES_11
@ SCE_DISPLAY_AA_SAMPLES_5
@ SCE_DISPLAY_AA_SAMPLES_16
@ SCE_DISPLAY_AA_FXAA
@ SCE_SNAP_SOURCE_MEDIAN
@ SCE_SNAP_SOURCE_CLOSEST
@ SCE_SNAP_SOURCE_ACTIVE
@ SCE_SNAP_SOURCE_CENTER
@ OB_DRAW_GROUPUSER_ACTIVE
@ OB_DRAW_GROUPUSER_NONE
@ OB_DRAW_GROUPUSER_ALL
#define R_MBLUR
#define R_IMF_EXR_CODEC_ZIPS
#define R_EDGE_FRS
#define STEREO_RIGHT_NAME
#define R_IMF_FLAG_PREVIEW_JPG
@ GP_TOOL_FLAG_RETAIN_LAST
@ GP_TOOL_FLAG_THUMBNAIL_LIST
@ GP_TOOL_FLAG_PAINT_ONBACK
@ GP_TOOL_FLAG_AUTOMERGE_STROKE
@ GP_TOOL_FLAG_CREATE_WEIGHTS
@ SCE_SNAP_TRANSFORM_MODE_SCALE
@ SCE_SNAP_TRANSFORM_MODE_ROTATE
@ SCE_SNAP_TRANSFORM_MODE_TRANSLATE
#define R_LINE_THICKNESS_RELATIVE
#define R_IMF_EXR_CODEC_DWAB
@ FFM_CHANNELS_SURROUND4
@ FFM_CHANNELS_STEREO
@ FFM_CHANNELS_SURROUND51
@ FFM_CHANNELS_SURROUND71
@ FFM_CHANNELS_MONO
#define R_IMF_IMTYPE_RADHDR
#define AUDIO_MUTE
#define SCE_LAY_SKY
#define R_STAMP_SCENE
#define USER_UNIT_ADAPTIVE
@ SEQ_SCALE_TO_FILL
@ SEQ_STRETCH_TO_FILL
@ SEQ_USE_ORIGINAL_SIZE
@ SEQ_SCALE_TO_FIT
#define R_IMF_JP2_FLAG_YCC
#define R_STAMP_SEQSTRIP
#define R_IMF_EXR_CODEC_B44A
#define R_IMF_JP2_CODEC_JP2
#define R_IMF_JP2_FLAG_CINE_48
#define PROP_INVSQUARE
#define SEQ_SNAP_IGNORE_MUTED
#define R_SIMPLIFY
#define SCE_SELECT_EDGE
#define R_STAMP_CAMERALENS
#define SCE_FRAME_DROP
#define SCE_VIEW_DISABLE
#define R_IMF_FLAG_ZBUF
#define R_IMF_IMTYPE_OPENEXR
#define SEQ_SNAP_IGNORE_SOUND
#define R_BAKE_TO_ACTIVE
#define PROP_CONST
@ R_BAKE_SAVE_EXTERNAL
@ R_BAKE_SAVE_INTERNAL
#define R_STAMP_TIME
#define R_IMF_PLANES_RGB
#define PROP_SHARP
#define R_IMF_EXR_CODEC_B44
@ R_BAKE_PASS_FILTER_DIFFUSE
@ R_BAKE_PASS_FILTER_NONE
@ R_BAKE_PASS_FILTER_COLOR
@ R_BAKE_PASS_FILTER_INDIRECT
@ R_BAKE_PASS_FILTER_DIRECT
@ R_BAKE_PASS_FILTER_GLOSSY
@ R_BAKE_PASS_FILTER_EMIT
@ R_BAKE_PASS_FILTER_TRANSM
#define SCE_LAY_VOLUMES
@ SCE_PASS_NORMAL
@ SCE_PASS_GLOSSY_DIRECT
@ SCE_PASS_AO
@ SCE_PASS_DIFFUSE_COLOR
@ SCE_PASS_POSITION
@ 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_DIFFUSE_INDIRECT
@ SCE_PASS_SUBSURFACE_DIRECT
@ SCE_PASS_SHADOW
@ SCE_PASS_TRANSM_COLOR
@ SCE_PASS_MIST
@ SCE_PASS_EMIT
@ SCE_PASS_ENVIRONMENT
#define R_BAKE_LORES_MESH
@ CURVE_PAINT_FIT_METHOD_REFIT
@ CURVE_PAINT_FIT_METHOD_SPLIT
#define R_IMF_EXR_CODEC_PIZ
@ SCE_VIEWS_FORMAT_STEREO_3D
@ SCE_VIEWS_FORMAT_MULTIVIEW
@ WT_VGROUP_ALL
@ WT_VGROUP_BONE_DEFORM_OFF
@ WT_VGROUP_BONE_DEFORM
@ SCE_SNAP_MODE_FACE_NEAREST
@ SCE_SNAP_MODE_EDGE_MIDPOINT
@ SCE_SNAP_MODE_VERTEX
@ SCE_SNAP_MODE_EDGE
@ SCE_SNAP_MODE_INCREMENT
@ SCE_SNAP_MODE_NODE_Y
@ SCE_SNAP_MODE_FACE_RAYCAST
@ SCE_SNAP_MODE_VOLUME
@ SCE_SNAP_MODE_GRID
@ SCE_SNAP_MODE_EDGE_PERPENDICULAR
@ SCE_SNAP_MODE_NODE_X
#define MAXFRAME
#define FRAMENUMBER_MIN_CLAMP(cfra)
@ ANIMRECORD_FLAG_WITHNLA
@ AUTOKEY_FLAG_CYCLEAWARE
@ AUTOKEY_FLAG_ONLYKEYINGSET
@ AUTOKEY_MODE_NORMAL
@ AUTOKEY_MODE_EDITKEYS
@ AUTOKEY_ON
@ V3D_AROUND_ACTIVE
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CURSOR
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_ORIENT_NORMAL
@ V3D_ORIENT_CUSTOM
@ V3D_ORIENT_GLOBAL
@ V3D_ORIENT_LOCAL
@ V3D_ORIENT_VIEW
@ V3D_ORIENT_CURSOR
@ V3D_ORIENT_GIMBAL
const char * ED_info_statistics_string(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
Definition: info_stats.cc:697
void EDBM_selectmode_set(struct BMEditMesh *em)
void ED_node_composit_default(const struct bContext *C, struct Scene *scene)
void ED_render_engine_changed(struct Main *bmain, bool update_scene_data)
bool ED_scene_view_layer_delete(struct Main *bmain, struct Scene *scene, struct ViewLayer *layer, struct ReportList *reports) ATTR_NONNULL(1
void ED_uvedit_selectmode_clean_multi(struct bContext *C)
void FRS_free_view_map_cache(void)
_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
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
#define RE_BAKE_NORMALS
Definition: RE_pipeline.h:439
#define RE_BAKE_DISPLACEMENT
Definition: RE_pipeline.h:440
#define RNA_POINTER_INVALIDATE(ptr)
Definition: RNA_access.h:744
const EnumPropertyItem * rna_TransformOrientation_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
@ PARM_RNAPTR
Definition: RNA_types.h:354
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ FUNC_NO_SELF
Definition: RNA_types.h:656
@ FUNC_USE_MAIN
Definition: RNA_types.h:661
@ FUNC_USE_SELF_ID
Definition: RNA_types.h:650
@ STRUCT_ID_REFCOUNT
Definition: RNA_types.h:706
@ STRUCT_UNDO
Definition: RNA_types.h:708
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROP_THICK_WRAP
Definition: RNA_types.h:285
@ PROP_CONTEXT_UPDATE
Definition: RNA_types.h:269
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_PROPORTIONAL
Definition: RNA_types.h:223
@ PROP_NEVER_UNLINK
Definition: RNA_types.h:246
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_ENUM_FLAG
Definition: RNA_types.h:266
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_PTR_NO_OWNERSHIP
Definition: RNA_types.h:257
@ PROP_ID_SELF_CHECK
Definition: RNA_types.h:232
@ PROP_ID_REFCOUNT
Definition: RNA_types.h:226
@ PROP_IDPROPERTY
Definition: RNA_types.h:288
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition: RNA_types.h:477
@ PROP_TIME
Definition: RNA_types.h:146
@ PROP_MATRIX
Definition: RNA_types.h:158
@ PROP_DIRECTION
Definition: RNA_types.h:155
@ PROP_XYZ
Definition: RNA_types.h:162
@ PROP_DISTANCE
Definition: RNA_types.h:149
@ PROP_ACCELERATION
Definition: RNA_types.h:157
@ PROP_COLOR
Definition: RNA_types.h:153
@ PROP_PIXEL
Definition: RNA_types.h:141
@ PROP_ANGLE
Definition: RNA_types.h:145
@ PROP_AXISANGLE
Definition: RNA_types.h:161
@ PROP_EULER
Definition: RNA_types.h:159
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_PERCENTAGE
Definition: RNA_types.h:143
@ PROP_FACTOR
Definition: RNA_types.h:144
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:165
@ PROP_XYZ_LENGTH
Definition: RNA_types.h:163
@ PROP_UNSIGNED
Definition: RNA_types.h:142
@ PROP_QUATERNION
Definition: RNA_types.h:160
@ PROP_FILEPATH
Definition: RNA_types.h:129
#define C
Definition: RandGen.cpp:25
#define ND_SEQUENCER
Definition: WM_types.h:385
#define NC_WORLD
Definition: WM_types.h:337
#define ND_WORLD
Definition: WM_types.h:401
#define NC_WINDOW
Definition: WM_types.h:325
#define NC_GEOM
Definition: WM_types.h:343
#define ND_DRAW
Definition: WM_types.h:410
#define NC_BRUSH
Definition: WM_types.h:335
#define ND_DATA
Definition: WM_types.h:456
#define ND_RENDER_OPTIONS
Definition: WM_types.h:383
#define NC_ANIMATION
Definition: WM_types.h:338
#define ND_DISPLAY
Definition: WM_types.h:439
#define ND_KEYINGSET
Definition: WM_types.h:396
#define NC_SCENE
Definition: WM_types.h:328
#define ND_TOOLSETTINGS
Definition: WM_types.h:397
#define ND_SPACE_IMAGE
Definition: WM_types.h:465
#define NA_EDITED
Definition: WM_types.h:523
#define ND_SPACE_GRAPH
Definition: WM_types.h:475
#define ND_FRAME_RANGE
Definition: WM_types.h:399
#define NC_IMAGE
Definition: WM_types.h:334
#define ND_MARKERS
Definition: WM_types.h:381
#define ND_FRAME
Definition: WM_types.h:382
#define NC_GPENCIL
Definition: WM_types.h:349
#define ND_TRANSFORM
Definition: WM_types.h:405
#define ND_LAYER
Definition: WM_types.h:398
#define ND_SPACE_VIEW3D
Definition: WM_types.h:471
#define NC_OBJECT
Definition: WM_types.h:329
#define NC_SPACE
Definition: WM_types.h:342
#define ND_DRAW_RENDER_VIEWPORT
Definition: WM_types.h:418
ListBase builtin_keyingsets
Definition: keyingsets.c:516
volatile int lock
return(oflags[bm->toolflag_index].f &oflag) !=0
#define SELECT
OperationNode * node
Scene scene
SyclQueue void void size_t num_bytes void
int len
Definition: draw_manager.c:108
bNodeTree * ntree
RenderEngine * RE_engine_create(RenderEngineType *type)
Definition: engine.c:136
RenderEngineType * RE_engines_find(const char *idname)
Definition: engine.c:98
void RE_engine_free(RenderEngine *engine)
Definition: engine.c:164
ListBase R_engines
Definition: engine.c:57
#define str(s)
void ED_gpencil_tag_scene_gpencil(Scene *scene)
void SEQ_cache_cleanup(Scene *scene)
Definition: image_cache.c:602
#define GS(x)
Definition: iris.c:225
KeyingSet * ANIM_scene_get_active_keyingset(const Scene *scene)
Definition: keyingsets.c:647
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *ks)
Definition: keyingsets.c:665
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
static unsigned a[3]
Definition: RandGen.cpp:78
void ntreeCompositUpdateRLayers(bNodeTree *ntree)
void RE_FreePersistentData(const Scene *scene)
Definition: pipeline.c:660
static struct PyModuleDef module
Definition: python.cpp:972
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
Definition: rna_access.c:4729
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
Definition: rna_access.c:4781
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:186
void rna_def_animdata_common(StructRNA *srna)
static const EnumPropertyItem curve_type_items[]
Definition: rna_curve.c:126
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4465
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2740
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
void RNA_define_animate_sdna(bool animate)
Definition: rna_define.c:748
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1526
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3285
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2022
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
Definition: rna_define.c:2106
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3126
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1653
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
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:3420
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
Definition: rna_define.c:1937
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
Definition: rna_define.c:1598
void RNA_def_property_int_default(PropertyRNA *prop, int value)
Definition: rna_define.c:1978
const float rna_default_axis_angle[4]
Definition: rna_define.c:1591
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
Definition: rna_define.c:1138
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2769
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
const int rna_matrix_dimsize_4x4[]
Definition: rna_define.c:1595
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2669
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
Definition: rna_define.c:4487
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1103
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
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:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4436
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3028
const int rna_matrix_dimsize_3x3[]
Definition: rna_define.c:1594
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
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:3687
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
Definition: rna_define.c:2848
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
Definition: rna_define.c:4459
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:3597
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2493
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1664
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
Definition: rna_define.c:2043
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2327
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
Definition: rna_define.c:1119
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1503
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
const EnumPropertyItem rna_enum_beztriple_keyframe_type_items[]
Definition: rna_fcurve.c:81
void rna_Scene_glsl_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr)
void rna_FreestyleSettings_active_lineset_index_set(struct PointerRNA *ptr, int value)
void rna_FreestyleSettings_active_lineset_index_range(struct PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
int rna_FreestyleSettings_active_lineset_index_get(struct PointerRNA *ptr)
void rna_ViewLayer_material_override_update(struct Main *bmain, struct Scene *activescene, struct PointerRNA *ptr)
void rna_Scene_use_view_map_cache_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr)
int rna_ViewLayer_active_aov_index_get(PointerRNA *ptr)
size_t rna_ViewLayer_path_buffer_get(const struct ViewLayer *view_layer, char *r_rna_path, const size_t rna_path_buffer_size)
struct FreestyleLineSet * rna_FreestyleSettings_lineset_add(struct ID *id, struct FreestyleSettings *config, struct Main *bmain, const char *name)
void rna_FreestyleSettings_lineset_remove(struct ID *id, struct FreestyleSettings *config, struct ReportList *reports, struct PointerRNA *lineset_ptr)
void RNA_api_scene(struct StructRNA *srna)
struct FreestyleModuleConfig * rna_FreestyleSettings_module_add(struct ID *id, struct FreestyleSettings *config)
struct PointerRNA rna_FreestyleSettings_active_lineset_get(struct PointerRNA *ptr)
void rna_ViewLayer_active_aov_index_set(PointerRNA *ptr, int value)
void rna_ViewLayer_active_aov_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
void rna_ViewLayer_name_set(struct PointerRNA *ptr, const char *value)
struct PointerRNA rna_FreestyleLineSet_linestyle_get(struct PointerRNA *ptr)
void rna_FreestyleSettings_module_remove(struct ID *id, struct FreestyleSettings *config, struct ReportList *reports, struct PointerRNA *module_ptr)
int rna_ViewLayer_active_lightgroup_index_get(PointerRNA *ptr)
void rna_Scene_freestyle_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr)
void rna_ViewLayer_active_lightgroup_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
void rna_ViewLayer_pass_update(struct Main *bmain, struct Scene *activescene, struct PointerRNA *ptr)
void rna_ViewLayer_active_lightgroup_index_set(PointerRNA *ptr, int value)
void RNA_api_scene_render(struct StructRNA *srna)
void rna_FreestyleLineSet_linestyle_set(struct PointerRNA *ptr, struct PointerRNA value, struct ReportList *reports)
const EnumPropertyItem rna_enum_object_rotation_mode_items[]
Definition: rna_object.c:281
const EnumPropertyItem rna_enum_object_axis_items[]
Definition: rna_object.c:297
const EnumPropertyItem DummyRNA_DEFAULT_items[]
Definition: rna_rna.c:31
const EnumPropertyItem rna_enum_mesh_select_mode_uv_items[]
Definition: rna_scene.c:138
static void rna_def_view3d_cursor(BlenderRNA *brna)
Definition: rna_scene.c:2819
static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
Definition: rna_scene.c:5874
void rna_def_freestyle_settings(BlenderRNA *brna)
Definition: rna_scene.c:4839
const EnumPropertyItem rna_enum_image_color_depth_items[]
Definition: rna_scene.c:413
const EnumPropertyItem rna_enum_image_type_items[]
Definition: rna_scene.c:370
static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:7042
static void rna_def_display_safe_areas(BlenderRNA *brna)
Definition: rna_scene.c:7096
const EnumPropertyItem rna_enum_proportional_falloff_curve_only_items[]
Definition: rna_scene.c:120
static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:6956
static void rna_def_scene_gpencil(BlenderRNA *brna)
Definition: rna_scene.c:7746
const EnumPropertyItem rna_enum_views_format_multilayer_items[]
Definition: rna_scene.c:489
const EnumPropertyItem rna_enum_mesh_select_mode_items[]
Definition: rna_scene.c:131
static void rna_def_curve_paint_settings(BlenderRNA *brna)
Definition: rna_scene.c:3920
static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:6996
static void rna_def_scene_display(BlenderRNA *brna)
Definition: rna_scene.c:7139
static void rna_def_tool_settings(BlenderRNA *brna)
Definition: rna_scene.c:2882
void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool scene)
Definition: rna_scene.c:4323
static void rna_def_freestyle_linesets(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:4794
const EnumPropertyItem rna_enum_stereo3d_display_items[]
Definition: rna_scene.c:501
const EnumPropertyItem rna_enum_normal_swizzle_items[]
Definition: rna_scene.c:430
static const EnumPropertyItem rna_enum_scene_display_aa_methods[]
Definition: rna_scene.c:201
static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:6945
static void rna_def_scene_eevee(BlenderRNA *brna)
Definition: rna_scene.c:7203
static void rna_def_view_layer_lightgroups(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:4285
static const EnumPropertyItem snap_uv_element_items[]
Definition: rna_scene.c:191
#define R_IMF_VIEWS_ENUM_MV
Definition: rna_scene.c:482
static void rna_def_selected_uv_element(BlenderRNA *brna)
Definition: rna_scene.c:7078
static const EnumPropertyItem uv_sculpt_relaxation_items[]
Definition: rna_scene.c:84
static void rna_def_transform_orientation_slot(BlenderRNA *brna)
Definition: rna_scene.c:2787
const EnumPropertyItem rna_enum_proportional_falloff_items[]
Definition: rna_scene.c:103
void RNA_def_scene(BlenderRNA *brna)
Definition: rna_scene.c:7768
const EnumPropertyItem rna_enum_snap_node_element_items[]
Definition: rna_scene.c:178
static void rna_def_gpencil_interpolate(BlenderRNA *brna)
Definition: rna_scene.c:2748
static void rna_def_bake_data(BlenderRNA *brna)
Definition: rna_scene.c:5292
static void rna_def_sequencer_tool_settings(BlenderRNA *brna)
Definition: rna_scene.c:3726
#define R_IMF_VIEWS_ENUM_IND
Definition: rna_scene.c:474
static void rna_def_view_layer_lightgroup(BlenderRNA *brna)
Definition: rna_scene.c:4304
static void rna_def_transform_orientation(BlenderRNA *brna)
Definition: rna_scene.c:2769
static void rna_def_scene_image_format_data(BlenderRNA *brna)
Definition: rna_scene.c:5661
const EnumPropertyItem rna_enum_bake_pass_filter_type_items[]
Definition: rna_scene.c:547
static void rna_def_statvis(BlenderRNA *brna)
Definition: rna_scene.c:4036
const EnumPropertyItem rna_enum_snap_source_items[]
Definition: rna_scene.c:95
const EnumPropertyItem rna_enum_snap_element_items[]
Definition: rna_scene.c:146
const EnumPropertyItem rna_enum_bake_save_mode_items[]
Definition: rna_scene.c:464
static void rna_def_scene_render_view(BlenderRNA *brna)
Definition: rna_scene.c:5501
static void rna_def_view_layer_aovs(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:4240
static const EnumPropertyItem rna_enum_view_layer_aov_type_items[]
Definition: rna_scene.c:559
const EnumPropertyItem rna_enum_transform_pivot_items_full[]
Definition: rna_scene.c:565
const EnumPropertyItem rna_enum_bake_margin_type_items[]
Definition: rna_scene.c:440
static void rna_def_view_layer_eevee(BlenderRNA *brna)
Definition: rna_scene.c:4221
const EnumPropertyItem rna_enum_bake_target_items[]
Definition: rna_scene.c:450
static void rna_def_freestyle_modules(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:4765
const EnumPropertyItem rna_enum_curve_fit_method_items[]
Definition: rna_scene.c:241
const EnumPropertyItem rna_enum_views_format_items[]
Definition: rna_scene.c:485
static void rna_def_render_views(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:5538
const EnumPropertyItem rna_enum_normal_space_items[]
Definition: rna_scene.c:424
static void rna_def_unified_paint_settings(BlenderRNA *brna)
Definition: rna_scene.c:3819
const EnumPropertyItem rna_enum_views_format_multiview_items[]
Definition: rna_scene.c:493
#define IMAGE_TYPE_ITEMS_IMAGE_ONLY
Definition: rna_scene.c:349
const EnumPropertyItem rna_enum_transform_orientation_items[]
Definition: rna_scene.c:591
const EnumPropertyItem rna_enum_stereo3d_anaglyph_type_items[]
Definition: rna_scene.c:533
const EnumPropertyItem rna_enum_stereo3d_interlace_type_items[]
Definition: rna_scene.c:540
#define R_IMF_VIEWS_ENUM_S3D
Definition: rna_scene.c:480
static void rna_def_view_layer_aov(BlenderRNA *brna)
Definition: rna_scene.c:4258
static void rna_def_unit_settings(BlenderRNA *brna)
Definition: rna_scene.c:4143
static void rna_def_image_format_stereo3d_format(BlenderRNA *brna)
Definition: rna_scene.c:5587
const EnumPropertyItem rna_enum_image_color_mode_items[]
Definition: rna_scene.c:392
static void rna_def_scene_render_data(BlenderRNA *brna)
Definition: rna_scene.c:6133
static void rna_def_view_layers(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_scene.c:5472
const EnumPropertyItem rna_enum_shading_type_items[]
Definition: rna_space.c:403
void SEQ_sound_update_length(Main *bmain, Scene *scene)
static const EnumPropertyItem scale_fit_methods[]
Definition: sequencer_add.c:90
#define min(a, b)
Definition: sort.c:35
unsigned char uint8_t
Definition: stdint.h:78
short selectmode
Definition: BKE_editmesh.h:52
struct ImageFormatData im_format
struct Object * object
ListBaseIterator listbase
Definition: RNA_types.h:409
union CollectionPropertyIterator::@1147 internal
const char * identifier
Definition: RNA_types.h:461
const char * name
Definition: RNA_types.h:465
const char * description
Definition: RNA_types.h:467
struct FreestyleLineStyle * linestyle
IDTypeEmbeddedOwnerGetFunction owner_get
Definition: BKE_idtype.h:189
Definition: DNA_ID.h:368
int tag
Definition: DNA_ID.h:387
char name[66]
Definition: DNA_ID.h:378
struct KeyingSet * next
void * last
Definition: DNA_listBase.h:31
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
ListBase wm
Definition: BKE_main.h:197
ListBase objects
Definition: BKE_main.h:170
struct BMEditMesh * edit_mesh
struct ModifierData * next
ListBase particlesystem
struct Collection * instance_collection
ListBase modifiers
void * data
struct ParticleSystem * next
struct StructRNA * type
Definition: RNA_types.h:37
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
struct BakeData bake
char engine[32]
struct ImageFormatData im_format
ListBase views
struct FFMpegCodecData ffcodecdata
short views_format
void(* update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition: RE_engine.h:109
struct bNodeTree * nodetree
int active_keyingset
short flag
ListBase keyingsets
struct RenderData r
TransformOrientationSlot orientation_slots[4]
struct UnitSettings unit
struct Object * camera
char use_nodes
ListBase markers
ListBase transform_spaces
struct Scene * set
struct AudioData audio
char name[64]
unsigned int flag
char gpencil_selectmode_vertex
char gpencil_selectmode_edit
char gpencil_selectmode_sculpt
float rotation_axis[3]
float rotation_quaternion[4]
float rotation_euler[3]
ListBase lightgroups
ViewLayerLightgroup * active_lightgroup
ViewLayerAOV * active_aov
struct Base * basact
ListBase aovs
char name[64]
struct bNodeSocket * next
ListBase nodes
float max
#define N_(msgid)
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Definition: wm_window.c:2217
void WM_windows_scene_data_sync(const ListBase *win_lb, Scene *scene)
Definition: wm_window.c:2142