Blender V5.3
rna_scene.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdlib>
10
11#include "DNA_curve_types.h"
12#include "DNA_layer_types.h"
13#include "DNA_scene_types.h"
14#include "DNA_userdef_types.h"
15#include "DNA_view3d_types.h"
16
18
19#include "MOV_enums.hh"
20
23
24#include "BLT_translation.hh"
25
26#include "BKE_paint.hh"
27
28#include "ED_object.hh"
29#include "ED_sequencer.hh"
30
31#include "RNA_define.hh"
32#include "RNA_enum_types.hh"
33
34#include "rna_internal.hh"
35
36/* Include for Bake Options */
37#include "RE_pipeline.h"
38
39#include "WM_api.hh"
40#include "WM_types.hh"
41
42#include "BLI_threads.hh"
43
44namespace blender {
45
47 {R_IMF_EXR_CODEC_NONE, "NONE", 0, "None", "No compression"},
48 {R_IMF_EXR_CODEC_ZIP, "ZIP", 0, "ZIP", "Lossless zip compression of 16 row image blocks"},
50 "PIZ",
51 0,
52 "PIZ",
53 "Lossless wavelet compression, effective for noisy/grainy images"},
55 "DWAA",
56 0,
57 "DWAA (lossy)",
58 "JPEG-like lossy compression on 32 row image blocks"},
60 "DWAB",
61 0,
62 "DWAB (lossy)",
63 "JPEG-like lossy compression on 256 row image blocks"},
65 "HTJ2K",
66 0,
67 "HTJ2K",
68 "Lossless compression based on high throughput JPEG 2000 encoding. It produces smaller "
69 "files, but it is new and not widely supported by other software yet."},
71 "ZIPS",
72 0,
73 "ZIPS",
74 "Lossless zip compression, each image row compressed separately"},
75 {R_IMF_EXR_CODEC_RLE, "RLE", 0, "RLE", "Lossless run length encoding compression"},
77 "PXR24",
78 0,
79 "Pxr24 (lossy)",
80 "Lossy compression for 32 bit float images (stores 24 bits of each float)"},
82 "B44",
83 0,
84 "B44 (lossy)",
85 "Lossy compression for 16 bit float images, at fixed 2.3:1 ratio"},
87 "B44A",
88 0,
89 "B44A (lossy)",
90 "Lossy compression for 16 bit float images, at fixed 2.3:1 ratio"},
91 {0, nullptr, 0, nullptr, nullptr},
92};
93
95 {SCE_SNAP_SOURCE_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
96 {SCE_SNAP_SOURCE_CENTER, "CENTER", 0, "Center", "Snap transformation center onto target"},
97 {SCE_SNAP_SOURCE_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
98 {SCE_SNAP_SOURCE_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
99 {0, nullptr, 0, nullptr, nullptr},
100};
101
103 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
104 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
105 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
107 "INVERSE_SQUARE",
108 ICON_INVERSESQUARECURVE,
109 "Inverse Square",
110 "Inverse Square falloff"},
111 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
112 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
113 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Constant falloff"},
114 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", "Random falloff"},
115 {0, nullptr, 0, nullptr, nullptr},
116};
117
118/* subset of the enum - only curves, missing random and const */
120 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
121 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
122 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
124 "INVERSE_SQUARE",
125 ICON_INVERSESQUARECURVE,
126 "Inverse Square",
127 "Inverse Square falloff"},
128 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
129 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
130 {0, nullptr, 0, nullptr, nullptr},
131};
132
133/* Keep for operators, not used here. */
134
136 {SCE_SELECT_VERTEX, "VERT", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
137 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
138 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
139 {0, nullptr, 0, nullptr, nullptr},
140};
141
143 {UV_SELECT_VERT, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
144 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
145 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
146 {0, nullptr, 0, nullptr, nullptr},
147};
148
149/* clang-format off */
150#define RNA_SNAP_ELEMENTS_BASE \
151 {SCE_SNAP_TO_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments"}, \
152 {SCE_SNAP_TO_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"}, \
153 {SCE_SNAP_TO_ORIGIN, "ORIGIN", ICON_OBJECT_ORIGIN, "Origin", "Snap to origins"}, \
154 {SCE_SNAP_TO_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"}, \
155 {SCE_SNAP_TO_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"}, \
156 {SCE_SNAP_TO_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap by projecting onto faces"}, \
157 {SCE_SNAP_TO_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"}, \
158 {SCE_SNAP_TO_EDGE_MIDPOINT, "EDGE_MIDPOINT", ICON_SNAP_MIDPOINT, "Edge Center", "Snap to the middle of edges"}, \
159 {SCE_SNAP_TO_EDGE_PERPENDICULAR, "EDGE_PERPENDICULAR", ICON_SNAP_PERPENDICULAR, "Edge Perpendicular", "Snap to the nearest point on an edge"}, \
160 {SCE_SNAP_TO_FACE_MIDPOINT, "FACE_MIDPOINT", ICON_SNAP_FACE_CENTER,"Face Center","Snap to the middle of faces"}
161/* clang-format on */
162
166 "FACE_PROJECT",
167 ICON_SNAP_FACE,
168 "Face Project",
169 "Snap by projecting onto faces"},
171 "FACE_NEAREST",
172 ICON_SNAP_FACE_NEAREST,
173 "Face Nearest",
174 "Snap to nearest point on faces"},
175 {0, nullptr, 0, nullptr, nullptr},
176};
177
180 {0, nullptr, 0, nullptr, nullptr},
181};
182
183#ifndef RNA_RUNTIME
184/* Last two snap elements from #rna_enum_snap_element_items. */
187#endif
188
190 {SCE_SNAP_TO_FRAME, "FRAME", 0, "Frame", "Snap to frame"},
191 {SCE_SNAP_TO_SECOND, "SECOND", 0, "Second", "Snap to seconds"},
192 {SCE_SNAP_TO_MARKERS, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
193 {0, nullptr, 0, nullptr, nullptr},
194};
195
196#ifndef RNA_RUNTIME
199 "INCREMENT",
200 ICON_SNAP_INCREMENT,
201 "Increment",
202 "Snap to increments of grid"},
203 {SCE_SNAP_TO_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"},
204 {SCE_SNAP_TO_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
205 {0, nullptr, 0, nullptr, nullptr},
206};
207
209 {SCE_SNAP_TO_FRAME, "FRAME", 0, "Frames", "Snap to frame increments"},
210 {SCE_SNAP_TO_SECOND, "SECOND", 0, "Seconds", "Snap to second increments"},
211 {SCE_SNAP_TO_MARKERS, "MARKER", 0, "Markers", "Snap to markers"},
212 {SCE_SNAP_TO_KEYS, "KEY", 0, "Keyframes", "Snap to keyframes"},
213 {SCE_SNAP_TO_STRIPS, "Strip", 0, "Strips", "Snap to Strips"},
214 {0, nullptr, 0, nullptr, nullptr},
215};
216
219 "OFF",
220 0,
221 "No Anti-Aliasing",
222 "Scene will be rendering without any anti-aliasing"},
224 "FXAA",
225 0,
226 "Single Pass Anti-Aliasing",
227 "Scene will be rendered using a single pass anti-aliasing method (FXAA)"},
229 "5",
230 0,
231 "5 Samples",
232 "Scene will be rendered using 5 anti-aliasing samples"},
234 "8",
235 0,
236 "8 Samples",
237 "Scene will be rendered using 8 anti-aliasing samples"},
239 "11",
240 0,
241 "11 Samples",
242 "Scene will be rendered using 11 anti-aliasing samples"},
244 "16",
245 0,
246 "16 Samples",
247 "Scene will be rendered using 16 anti-aliasing samples"},
249 "32",
250 0,
251 "32 Samples",
252 "Scene will be rendered using 32 anti-aliasing samples"},
253 {0, nullptr, 0, nullptr, nullptr},
254};
255#endif
256
259 "REFIT",
260 0,
261 "Refit",
262 "Incrementally refit the curve (high quality)"},
264 "SPLIT",
265 0,
266 "Split",
267 "Split the curve until the tolerance is met (fast)"},
268 {0, nullptr, 0, nullptr, nullptr},
269};
270
271#define MEDIA_TYPE_ENUM_IMAGE {MEDIA_TYPE_IMAGE, "IMAGE", ICON_NONE, "Image", ""}
272#define MEDIA_TYPE_ENUM_MULTI_LAYER_IMAGE \
273 {MEDIA_TYPE_MULTI_LAYER_IMAGE, "MULTI_LAYER_IMAGE", ICON_NONE, "Multi-Layer EXR", ""}
274#define MEDIA_TYPE_ENUM_VIDEO {MEDIA_TYPE_VIDEO, "VIDEO", ICON_NONE, "Video", ""}
275
280 {0, nullptr, 0, nullptr, nullptr},
281};
282
283#ifdef RNA_RUNTIME
284static const EnumPropertyItem rna_enum_media_type_image_items[] = {
287 {0, nullptr, 0, nullptr, nullptr},
288};
289#endif
290
291/* workaround for duplicate enums,
292 * have each enum line as a define then conditionally set it or not
293 */
294
295#define R_IMF_ENUM_BMP \
296 {R_IMF_IMTYPE_BMP, "BMP", 0, "Bitmap (.bmp)", "Output image in bitmap format"},
297#define R_IMF_ENUM_IRIS \
298 {R_IMF_IMTYPE_IRIS, "IRIS", 0, "Iris (.rgb)", "Output image in SGI IRIS format"},
299#define R_IMF_ENUM_PNG {R_IMF_IMTYPE_PNG, "PNG", 0, "PNG (.png)", "Output image in PNG format"},
300#define R_IMF_ENUM_JPEG \
301 {R_IMF_IMTYPE_JPEG90, "JPEG", 0, "JPEG (.jpg)", "Output image in JPEG format"},
302#define R_IMF_ENUM_TAGA \
303 {R_IMF_IMTYPE_TARGA, "TARGA", 0, "Targa (.tga)", "Output image in Targa format"},
304#define R_IMF_ENUM_TAGA_RAW \
305 {R_IMF_IMTYPE_RAWTGA, \
306 "TARGA_RAW", \
307 0, \
308 "Targa Raw (.tga)", \
309 "Output image in uncompressed Targa format"},
310
311#if 0 /* UNUSED (so far) */
312# define R_IMF_ENUM_DDS \
313 {R_IMF_IMTYPE_DDS, "DDS", 0, "DirectDraw Surface (.dds)", "Output image in DDS format"},
314#endif
315
316#ifdef WITH_IMAGE_OPENJPEG
317# define R_IMF_ENUM_JPEG2K \
318 {R_IMF_IMTYPE_JP2, "JPEG2000", 0, "JPEG 2000 (.jp2)", "Output image in JPEG 2000 format"},
319#else
320# define R_IMF_ENUM_JPEG2K
321#endif
322
323#ifdef WITH_IMAGE_CINEON
324# define R_IMF_ENUM_CINEON \
325 {R_IMF_IMTYPE_CINEON, "CINEON", 0, "Cineon (.cin)", "Output image in Cineon format"},
326# define R_IMF_ENUM_DPX {R_IMF_IMTYPE_DPX, "DPX", 0, "DPX (.dpx)", "Output image in DPX format"},
327#else
328# define R_IMF_ENUM_CINEON
329# define R_IMF_ENUM_DPX
330#endif
331
332#define R_IMF_ENUM_EXR_MULTILAYER \
333 {R_IMF_IMTYPE_MULTILAYER, \
334 "OPEN_EXR_MULTILAYER", \
335 0, \
336 "OpenEXR MultiLayer (.exr)", \
337 "Output image in multilayer OpenEXR format"},
338#define R_IMF_ENUM_EXR \
339 {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", 0, "OpenEXR (.exr)", "Output image in OpenEXR format"},
340
341#define R_IMF_ENUM_HDR \
342 {R_IMF_IMTYPE_RADHDR, "HDR", 0, "Radiance HDR (.hdr)", "Output image in Radiance HDR format"},
343
344#define R_IMF_ENUM_TIFF \
345 {R_IMF_IMTYPE_TIFF, "TIFF", 0, "TIFF (.tif)", "Output image in TIFF format"},
346
347#ifdef WITH_IMAGE_WEBP
348# define R_IMF_ENUM_WEBP \
349 {R_IMF_IMTYPE_WEBP, "WEBP", 0, "WebP (.webp)", "Output image in WebP format"},
350#else
351# define R_IMF_ENUM_WEBP
352#endif
353
354#define R_IMF_ENUM_AVIF \
355 {R_IMF_IMTYPE_AVIF, "AVIF", 0, "AVIF (.avif)", "Output image in AVIF format"},
356
357#ifdef WITH_FFMPEG
358# define R_IMF_ENUM_FFMPEG {R_IMF_IMTYPE_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFmpeg Video", ""},
359#else
360# define R_IMF_ENUM_FFMPEG
361#endif
362
363#define IMAGE_TYPE_ITEMS_IMAGE \
364 /* DDS save not supported yet R_IMF_ENUM_DDS */ \
365 R_IMF_ENUM_AVIF \
366 R_IMF_ENUM_JPEG \
367 R_IMF_ENUM_EXR \
368 R_IMF_ENUM_PNG \
369 R_IMF_ENUM_WEBP \
370 RNA_ENUM_ITEM_SEPR, \
371 R_IMF_ENUM_BMP R_IMF_ENUM_CINEON R_IMF_ENUM_DPX R_IMF_ENUM_IRIS R_IMF_ENUM_JPEG2K \
372 R_IMF_ENUM_HDR R_IMF_ENUM_TAGA R_IMF_ENUM_TAGA_RAW R_IMF_ENUM_TIFF
373
374#define IMAGE_TYPE_ITEMS_MULTI_LAYER_IMAGE R_IMF_ENUM_EXR_MULTILAYER
375
376#define IMAGE_TYPE_ITEMS_VIDEO R_IMF_ENUM_FFMPEG
377
378#ifdef RNA_RUNTIME
379static const EnumPropertyItem image_type_items[] = {
381
382 {0, nullptr, 0, nullptr, nullptr},
383};
384
385static const EnumPropertyItem multi_layer_image_type_items[] = {
387
388 {0, nullptr, 0, nullptr, nullptr},
389};
390
391static const EnumPropertyItem video_image_type_items[] = {
393
394 {0, nullptr, 0, nullptr, nullptr},
395};
396#endif
397
403
405 {int(ImColorMode::BW),
406 "BW",
407 0,
408 "BW",
409 "Images get saved in 8-bit grayscale (only PNG, JPEG, TGA, TIF)"},
410 {int(ImColorMode::RGB), "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
411 {int(ImColorMode::RGBA),
412 "RGBA",
413 0,
414 "RGBA",
415 "Images are saved with RGB and Alpha data (if supported)"},
416 {0, nullptr, 0, nullptr, nullptr},
417};
418
419#ifdef RNA_RUNTIME
420# define IMAGE_COLOR_MODE_BW rna_enum_image_color_mode_items[0]
421# define IMAGE_COLOR_MODE_RGB rna_enum_image_color_mode_items[1]
422# define IMAGE_COLOR_MODE_RGBA rna_enum_image_color_mode_items[2]
423#endif
424
426 /* 1 (monochrome) not used */
427 {R_IMF_CHAN_DEPTH_8, "8", 0, "8", "8-bit color channels"},
428 {R_IMF_CHAN_DEPTH_10, "10", 0, "10", "10-bit color channels"},
429 {R_IMF_CHAN_DEPTH_12, "12", 0, "12", "12-bit color channels"},
430 {R_IMF_CHAN_DEPTH_16, "16", 0, "16", "16-bit color channels"},
431 /* 24 not used */
432 {R_IMF_CHAN_DEPTH_32, "32", 0, "32", "32-bit color channels"},
433 {0, nullptr, 0, nullptr, nullptr},
434};
435
437 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
438 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
439 {0, nullptr, 0, nullptr, nullptr},
440};
441
443 {R_BAKE_POSX, "POS_X", 0, "+X", ""},
444 {R_BAKE_POSY, "POS_Y", 0, "+Y", ""},
445 {R_BAKE_POSZ, "POS_Z", 0, "+Z", ""},
446 {R_BAKE_NEGX, "NEG_X", 0, "-X", ""},
447 {R_BAKE_NEGY, "NEG_Y", 0, "-Y", ""},
448 {R_BAKE_NEGZ, "NEG_Z", 0, "-Z", ""},
449 {0, nullptr, 0, nullptr, nullptr},
450};
451
454 "ADJACENT_FACES",
455 0,
456 "Adjacent Faces",
457 "Use pixels from adjacent faces across UV seams"},
458 {R_BAKE_EXTEND, "EXTEND", 0, "Extend", "Extend border pixels outwards"},
459 {0, nullptr, 0, nullptr, nullptr},
460};
461
464 "IMAGE_TEXTURES",
465 0,
466 "Image Textures",
467 "Bake to image data-blocks associated with active image texture nodes in materials"},
469 "VERTEX_COLORS",
470 0,
471 "Active Color Attribute",
472 "Bake to the active color attribute on meshes"},
473 {0, nullptr, 0, nullptr, nullptr},
474};
475
478 "INTERNAL",
479 0,
480 "Internal",
481 "Save the baking map in an internal image data-block"},
482 {R_BAKE_SAVE_EXTERNAL, "EXTERNAL", 0, "External", "Save the baking map in an external file"},
483 {0, nullptr, 0, nullptr, nullptr},
484};
485
488 "ABOVE_SURFACE",
489 0,
490 "Above Surface",
491 "Cast rays from above the surface"},
493 "ACTIVE_CAMERA",
494 0,
495 "Active Camera",
496 "Use the active camera's position to cast rays"},
497 {0, nullptr, 0, nullptr, nullptr},
498};
499
500#define R_IMF_VIEWS_ENUM_IND \
501 {R_IMF_VIEWS_INDIVIDUAL, \
502 "INDIVIDUAL", \
503 0, \
504 "Individual", \
505 "Individual files for each view with the prefix as defined by the scene views"},
506#define R_IMF_VIEWS_ENUM_S3D \
507 {R_IMF_VIEWS_STEREO_3D, "STEREO_3D", 0, "Stereo 3D", "Single file with an encoded stereo pair"},
508#define R_IMF_VIEWS_ENUM_MV \
509 {R_IMF_VIEWS_MULTIVIEW, "MULTIVIEW", 0, "Multi-View", "Single file with all the views"},
510
512 R_IMF_VIEWS_ENUM_IND R_IMF_VIEWS_ENUM_S3D{0, nullptr, 0, nullptr, nullptr},
513};
514
518
522
523#undef R_IMF_VIEWS_ENUM_IND
524#undef R_IMF_VIEWS_ENUM_S3D
525#undef R_IMF_VIEWS_ENUM_MV
526
529 "ANAGLYPH",
530 0,
531 "Anaglyph",
532 "Render views for left and right eyes as two differently filtered colors in a single image "
533 "(anaglyph glasses are required)"},
535 "INTERLACE",
536 0,
537 "Interlace",
538 "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
539 "required)"},
541 "TIMESEQUENTIAL",
542 0,
543 "Time Sequential",
544 "Render alternate eyes (also known as page flip, quad buffer support in the graphic card is "
545 "required)"},
547 "SIDEBYSIDE",
548 0,
549 "Side-by-Side",
550 "Render views for left and right eyes side-by-side"},
552 "TOPBOTTOM",
553 0,
554 "Top-Bottom",
555 "Render views for left and right eyes one above another"},
556 {0, nullptr, 0, nullptr, nullptr},
557};
558
560 {S3D_ANAGLYPH_REDCYAN, "RED_CYAN", 0, "Red-Cyan", ""},
561 {S3D_ANAGLYPH_GREENMAGENTA, "GREEN_MAGENTA", 0, "Green-Magenta", ""},
562 {S3D_ANAGLYPH_YELLOWBLUE, "YELLOW_BLUE", 0, "Yellow-Blue", ""},
563 {0, nullptr, 0, nullptr, nullptr},
564};
565
567 {S3D_INTERLACE_ROW, "ROW_INTERLEAVED", 0, "Row Interleaved", ""},
568 {S3D_INTERLACE_COLUMN, "COLUMN_INTERLEAVED", 0, "Column Interleaved", ""},
569 {S3D_INTERLACE_CHECKERBOARD, "CHECKERBOARD_INTERLEAVED", 0, "Checkerboard Interleaved", ""},
570 {0, nullptr, 0, nullptr, nullptr},
571};
572
574 {R_BAKE_PASS_FILTER_NONE, "NONE", 0, "None", ""},
575 {R_BAKE_PASS_FILTER_EMIT, "EMIT", 0, "Emit", ""},
576 {R_BAKE_PASS_FILTER_DIRECT, "DIRECT", 0, "Direct", ""},
577 {R_BAKE_PASS_FILTER_INDIRECT, "INDIRECT", 0, "Indirect", ""},
578 {R_BAKE_PASS_FILTER_COLOR, "COLOR", 0, "Color", ""},
579 {R_BAKE_PASS_FILTER_DIFFUSE, "DIFFUSE", 0, "Diffuse", ""},
580 {R_BAKE_PASS_FILTER_GLOSSY, "GLOSSY", 0, "Glossy", ""},
581 {R_BAKE_PASS_FILTER_TRANSM, "TRANSMISSION", 0, "Transmission", ""},
582 {0, nullptr, 0, nullptr, nullptr},
583};
584
586 {AOV_TYPE_COLOR, "COLOR", 0, "Color", ""},
587 {AOV_TYPE_VALUE, "VALUE", 0, "Value", ""},
588 {0, nullptr, 0, nullptr, nullptr},
589};
590
593 "BOUNDING_BOX_CENTER",
594 ICON_PIVOT_BOUNDBOX,
595 "Bounding Box Center",
596 "Pivot around bounding box center of selected object(s)"},
597 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
599 "INDIVIDUAL_ORIGINS",
600 ICON_PIVOT_INDIVIDUAL,
601 "Individual Origins",
602 "Pivot around each object's own origin"},
604 "MEDIAN_POINT",
605 ICON_PIVOT_MEDIAN,
606 "Median Point",
607 "Pivot around the median point of selected objects"},
609 "ACTIVE_ELEMENT",
610 ICON_PIVOT_ACTIVE,
611 "Active Element",
612 "Pivot around active object"},
613 {0, nullptr, 0, nullptr, nullptr},
614};
615
616/* Icons could be made a consistent set of images. */
619 "GLOBAL",
620 ICON_ORIENTATION_GLOBAL,
621 "Global",
622 "Align the transformation axes to world space"},
624 "LOCAL",
625 ICON_ORIENTATION_LOCAL,
626 "Local",
627 "Align the transformation axes to the selected objects' local space"},
629 "NORMAL",
630 ICON_ORIENTATION_NORMAL,
631 "Normal",
632 "Align the transformation axes to average normal of selected elements "
633 "(bone Y axis for pose mode)"},
635 "GIMBAL",
636 ICON_ORIENTATION_GIMBAL,
637 "Gimbal",
638 "Align each axis to the Euler rotation axis as used for input"},
640 "VIEW",
641 ICON_ORIENTATION_VIEW,
642 "View",
643 "Align the transformation axes to the window"},
645 "CURSOR",
646 ICON_ORIENTATION_CURSOR,
647 "Cursor",
648 "Align the transformation axes to the 3D cursor"},
650 "PARENT",
651 ICON_ORIENTATION_PARENT,
652 "Parent",
653 "Align the transformation axes to the object's parent space"},
654 // {V3D_ORIENT_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
655 {0, nullptr, 0, nullptr, nullptr},
656};
657
660 "SURFACE",
661 0,
662 "Surface",
663 "Start placing on the surface, using the 3D cursor position as a fallback"},
665 "CURSOR_PLANE",
666 0,
667 "Cursor Plane",
668 "Start placement using a point projected onto the orientation axis "
669 "at the 3D cursor position"},
671 "CURSOR_VIEW",
672 0,
673 "Cursor View",
674 "Start placement using a point projected onto the view plane at the 3D cursor position"},
675 {0, nullptr, 0, nullptr, nullptr},
676};
677
680 "SURFACE",
681 ICON_SNAP_NORMAL,
682 "Surface",
683 "Use the surface normal (using the transform orientation as a fallback)"},
685 "DEFAULT",
686 ICON_ORIENTATION_GLOBAL,
687 "Default",
688 "Use the current transform orientation"},
689 {0, nullptr, 0, nullptr, nullptr},
690};
691
693 {SCE_SNAP_TO_GEOM, "GEOMETRY", 0, "Geometry", "Snap to all geometry"},
694 {SCE_SNAP_TO_NONE, "DEFAULT", 0, "Default", "Use the current snap settings"},
695 {0, nullptr, 0, nullptr, nullptr},
696};
697
699 {GP_SELECTMODE_POINT, "POINT", ICON_GP_SELECT_POINTS, "Point", "Select only points"},
700 {GP_SELECTMODE_STROKE, "STROKE", ICON_GP_SELECT_STROKES, "Stroke", "Select all stroke points"},
702 "SEGMENT",
703 ICON_GP_SELECT_BETWEEN_STROKES,
704 "Segment",
705 "Select all stroke points between other strokes"},
706 {0, nullptr, 0, nullptr, nullptr},
707};
708
710 {1, "1", 0, "1:1", "Full resolution"},
711 {2, "2", 0, "1:2", "Render this effect at 50% render resolution"},
712 {4, "4", 0, "1:4", "Render this effect at 25% render resolution"},
713 {8, "8", 0, "1:8", "Render this effect at 12.5% render resolution"},
714 {16, "16", 0, "1:16", "Render this effect at 6.25% render resolution"},
715 {0, nullptr, 0, nullptr, nullptr},
716};
717
718} // namespace blender
719
720#ifdef RNA_RUNTIME
721
722# include <algorithm>
723
724# include <fmt/format.h>
725
726# include "BLI_index_range.hh"
727# include "BLI_string_utf8.hh"
728# include "BLI_string_utils.hh"
729
730# include "DNA_anim_types.h"
731# include "DNA_cachefile_types.h"
732# include "DNA_color_types.h"
734# include "DNA_linestyle_types.h"
735# include "DNA_mesh_types.h"
736# include "DNA_node_types.h"
737# include "DNA_object_types.h"
738# include "DNA_particle_types.h"
739# include "DNA_text_types.h"
740# include "DNA_workspace_types.h"
741# include "DNA_world_types.h"
742
743# include "RNA_access.hh"
744
745# include "MEM_guardedalloc.h"
746
747# include "MOV_util.hh"
748
749# include "BKE_animsys.hh"
750# include "BKE_armature.hh"
752# include "BKE_brush.hh"
753# include "BKE_collection.hh"
754# include "BKE_compositor.hh"
755# include "BKE_context.hh"
756# include "BKE_editmesh.hh"
757# include "BKE_freestyle.h"
758# include "BKE_global.hh"
759# include "BKE_idprop.hh"
760# include "BKE_image.hh"
761# include "BKE_image_format.hh"
762# include "BKE_layer.hh"
763# include "BKE_lib_id.hh"
764# include "BKE_main.hh"
765# include "BKE_main_invariants.hh"
766# include "BKE_mesh.hh"
767# include "BKE_node.hh"
768# include "BKE_node_legacy_types.hh"
769# include "BKE_node_runtime.hh"
770# include "BKE_pointcache.h"
771# include "BKE_scene.hh"
772# include "BKE_screen.hh"
773# include "BKE_unit.hh"
774
775# include "NOD_composite.hh"
777# include "NOD_nodes_srna.hh"
778
779# include "ED_grease_pencil.hh"
780# include "ED_image.hh"
781# include "ED_info.hh"
782# include "ED_keyframing.hh"
783# include "ED_mesh.hh"
784# include "ED_node.hh"
785# include "ED_render.hh"
786# include "ED_scene.hh"
787# include "ED_sequencer.hh"
788# include "ED_uvedit.hh"
789# include "ED_view3d.hh"
790
791# include "DEG_depsgraph.hh"
792# include "DEG_depsgraph_build.hh"
793# include "DEG_depsgraph_query.hh"
794
795# include "SEQ_iterator.hh"
796# include "SEQ_relations.hh"
797# include "SEQ_sequencer.hh"
798# include "SEQ_sound.hh"
799
800# ifdef WITH_FREESTYLE
801# include "FRS_freestyle.h"
802# endif
803
804# ifdef WITH_ALEMBIC
805# include "ABC_alembic.h"
806# endif
807
808# include "RE_engine.h"
809
810# include "ANIM_keyingsets.hh"
811
812namespace blender {
813
815
816static int rna_ToolSettings_snap_mode_get(PointerRNA *ptr)
817{
818 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
819 return ts->snap_mode;
820}
821
822static void rna_ToolSettings_snap_mode_set(PointerRNA *ptr, int value)
823{
824 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
825 if (value != 0) {
826 ts->snap_mode = eSnapMode(value);
827 }
828}
829
830static void rna_ToolSettings_snap_uv_mode_set(PointerRNA *ptr, int value)
831{
832 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
833 if (value != 0) {
834 ts->snap_uv_mode = eSnapMode(value);
835 }
836}
837
838static void rna_Gpencil_mask_point_update(bContext *C, PointerRNA *ptr)
839{
840 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
841
843 ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_SEGMENT;
844
846 if (ob && ob->type == OB_GREASE_PENCIL) {
848 }
849}
850
851static void rna_Gpencil_mask_stroke_update(bContext *C, PointerRNA *ptr)
852{
853 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
854
856 ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_SEGMENT;
857
859 if (ob && ob->type == OB_GREASE_PENCIL) {
861 }
862}
863
864static void rna_Gpencil_mask_segment_update(bContext *C, PointerRNA *ptr)
865{
866 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
867
869 ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_STROKE;
870
872 if (ob && ob->type == OB_GREASE_PENCIL) {
874 }
875}
876
877static void rna_Gpencil_vertex_mask_point_update(bContext *C, PointerRNA *ptr)
878{
879 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
880
882 ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_SEGMENT;
883
885 if (ob && ob->type == OB_GREASE_PENCIL) {
887 }
888}
889
890static void rna_Gpencil_vertex_mask_stroke_update(bContext *C, PointerRNA *ptr)
891{
892 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
893
895 ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_SEGMENT;
896
898 if (ob && ob->type == OB_GREASE_PENCIL) {
900 }
901}
902
903static void rna_Gpencil_vertex_mask_segment_update(bContext *C, PointerRNA *ptr)
904{
905 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
906
908 ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_STROKE;
909
911 if (ob && ob->type == OB_GREASE_PENCIL) {
913 }
914}
915
916static void rna_all_grease_pencil_update(bContext *C, PointerRNA * /*ptr*/)
917{
918 /* FIXME: We shouldn't have to tag all the Grease Pencil IDs for an update! */
919 Main *bmain = CTX_data_main(C);
920 for (GreasePencil &grease_pencil : bmain->grease_pencils) {
921 DEG_id_tag_update(&grease_pencil.id, ID_RECALC_GEOMETRY);
922 }
924}
925
926/* Read-only Iterator of all the scene objects. */
927
928static void rna_Scene_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
929{
930 Scene *scene = static_cast<Scene *>(ptr->data);
931 iter->internal.custom = MEM_new_zeroed<BLI_Iterator>(__func__);
932
933 BKE_scene_objects_iterator_begin(static_cast<BLI_Iterator *>(iter->internal.custom),
934 static_cast<void *>(scene));
935 iter->valid = (static_cast<BLI_Iterator *>(iter->internal.custom))->valid;
936}
937
938static void rna_Scene_objects_next(CollectionPropertyIterator *iter)
939{
940 BKE_scene_objects_iterator_next(static_cast<BLI_Iterator *>(iter->internal.custom));
941 iter->valid = (static_cast<BLI_Iterator *>(iter->internal.custom))->valid;
942}
943
944static void rna_Scene_objects_end(CollectionPropertyIterator *iter)
945{
946 BKE_scene_objects_iterator_end(static_cast<BLI_Iterator *>(iter->internal.custom));
947 MEM_delete_void(iter->internal.custom);
948}
949
950static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
951{
952 Object *ob = static_cast<Object *>(
953 (static_cast<BLI_Iterator *>(iter->internal.custom))->current);
954 return RNA_id_pointer_create(reinterpret_cast<ID *>(ob));
955}
956
957/* End of read-only Iterator of all the scene objects. */
958
959static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
960{
961 Scene *scene = static_cast<Scene *>(ptr->data);
962 Scene *set = static_cast<Scene *>(value.data);
963 Scene *nested_set;
964
965 for (nested_set = set; nested_set; nested_set = nested_set->set) {
966 if (nested_set == scene) {
967 return;
968 }
969 /* prevent eternal loops, set can point to next, and next to set, without problems usually */
970 if (nested_set->set == set) {
971 return;
972 }
973 }
974
975 id_lib_extern(id_cast<ID *>(set));
976 scene->set = set;
977}
978
979void rna_Scene_set_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
980{
981 Scene *scene = id_cast<Scene *>(ptr->owner_id);
982
984 DEG_id_tag_update_ex(bmain, &scene->id, ID_RECALC_BASE_FLAGS);
985 if (scene->set != nullptr) {
986 /* Objects which are pulled into main scene's depsgraph needs to have
987 * their base flags updated.
988 */
989 DEG_id_tag_update_ex(bmain, &scene->set->id, ID_RECALC_BASE_FLAGS);
990 }
991}
992
993static void rna_Scene_camera_update(Main *bmain, Scene * /*scene_unused*/, PointerRNA *ptr)
994{
995 wmWindowManager *wm = bmain->wm.first();
996 Scene *scene = static_cast<Scene *>(ptr->data);
997
998 WM_windows_scene_data_sync(&wm->windows, scene);
1001}
1002
1003static void rna_Scene_fps_update(Main *bmain, Scene * /*active_scene*/, PointerRNA *ptr)
1004{
1005 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1007 /* NOTE: Tag via dependency graph will take care of all the updates ion the evaluated domain,
1008 * however, changes in FPS actually modifies an original skip length,
1009 * so this we take care about here. */
1010 seq::sound_update_length(bmain, scene);
1011 /* Reset simulation states because new frame interval doesn't apply anymore. */
1013}
1014
1015static void rna_Scene_listener_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1016{
1018}
1019
1020static void rna_Scene_volume_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1021{
1022 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1024}
1025
1026static const char *rna_Scene_statistics_string_get(Scene *scene,
1027 Main *bmain,
1028 ReportList *reports,
1029 ViewLayer *view_layer)
1030{
1031 if (!BKE_scene_has_view_layer(scene, view_layer)) {
1032 BKE_reportf(reports,
1033 RPT_ERROR,
1034 "View Layer '%s' not found in scene '%s'",
1035 view_layer->name,
1036 scene->id.name + 2);
1037 return "";
1038 }
1039
1040 return ED_info_statistics_string(bmain, scene, view_layer);
1041}
1042
1043static void rna_Scene_framelen_update(Main * /*bmain*/, Scene * /*active_scene*/, PointerRNA *ptr)
1044{
1045 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1046 scene->r.framelen = float(scene->r.framapto) / float(scene->r.images);
1047}
1048
1049static void rna_Scene_frame_current_set(PointerRNA *ptr, int value)
1050{
1051 Scene *data = static_cast<Scene *>(ptr->data);
1052
1053 /* if negative frames aren't allowed, then we can't use them */
1054 FRAMENUMBER_MIN_CLAMP(value);
1055 data->r.cfra = value;
1056}
1057
1058static float rna_Scene_frame_float_get(PointerRNA *ptr)
1059{
1060 Scene *data = static_cast<Scene *>(ptr->data);
1061 return float(data->r.cfra) + data->r.subframe;
1062}
1063
1064static void rna_Scene_frame_float_set(PointerRNA *ptr, float value)
1065{
1066 Scene *data = static_cast<Scene *>(ptr->data);
1067 /* if negative frames aren't allowed, then we can't use them */
1068 FRAMENUMBER_MIN_CLAMP(value);
1069 data->r.cfra = int(value);
1070 data->r.subframe = value - data->r.cfra;
1071}
1072
1073static float rna_Scene_frame_current_final_get(PointerRNA *ptr)
1074{
1075 Scene *scene = static_cast<Scene *>(ptr->data);
1076
1077 return BKE_scene_frame_to_ctime(scene, float(scene->r.cfra));
1078}
1079
1080static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
1081{
1082 Scene *data = static_cast<Scene *>(ptr->data);
1083 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
1084 CLAMP(value, MINFRAME, MAXFRAME);
1085 data->r.sfra = value;
1086
1087 if (value > data->r.efra) {
1088 data->r.efra = std::min(value, MAXFRAME);
1089 }
1090}
1091
1092static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
1093{
1094 Scene *data = static_cast<Scene *>(ptr->data);
1095 CLAMP(value, MINFRAME, MAXFRAME);
1096 data->r.efra = value;
1097
1098 if (data->r.sfra > value) {
1099 data->r.sfra = std::max(value, MINFRAME);
1100 }
1101}
1102
1103static void rna_Scene_use_preview_range_set(PointerRNA *ptr, bool value)
1104{
1105 Scene *data = static_cast<Scene *>(ptr->data);
1106
1107 if (value) {
1108 /* copy range from scene if not set before */
1109 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
1110 data->r.psfra = data->r.sfra;
1111 data->r.pefra = data->r.efra;
1112 }
1113
1114 data->r.flag |= SCER_PRV_RANGE;
1115 }
1116 else {
1117 data->r.flag &= ~SCER_PRV_RANGE;
1118 }
1119}
1120
1121static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
1122{
1123 Scene *data = static_cast<Scene *>(ptr->data);
1124
1125 /* check if enabled already */
1126 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
1127 /* set end of preview range to end frame, then clamp as per normal */
1128 /* TODO: or just refuse to set instead? */
1129 data->r.pefra = data->r.efra;
1130 }
1131 CLAMP(value, MINAFRAME, MAXFRAME);
1132 data->r.psfra = value;
1133
1134 if (value > data->r.pefra) {
1135 data->r.pefra = std::min(value, MAXFRAME);
1136 }
1137}
1138
1139static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
1140{
1141 Scene *data = static_cast<Scene *>(ptr->data);
1142
1143 /* check if enabled already */
1144 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
1145 /* set start of preview range to start frame, then clamp as per normal */
1146 /* TODO: or just refuse to set instead? */
1147 data->r.psfra = data->r.sfra;
1148 }
1149 CLAMP(value, MINAFRAME, MAXFRAME);
1150 data->r.pefra = value;
1151
1152 if (data->r.psfra > value) {
1153 data->r.psfra = std::max(value, MINAFRAME);
1154 }
1155}
1156
1157static void rna_Scene_show_subframe_update(Main * /*bmain*/,
1158 Scene * /*current_scene*/,
1159 PointerRNA *ptr)
1160{
1161 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1162 scene->r.subframe = 0.0f;
1163}
1164
1165static void rna_Scene_frame_update_context(bContext *C, PointerRNA *ptr)
1166{
1167 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1171}
1172
1173static void rna_Scene_frame_update(Main * /*bmain*/, Scene * /*current_scene*/, PointerRNA *ptr)
1174{
1175 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1178}
1179
1180static void rna_Scene_frame_range_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1181{
1182 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1185}
1186
1187static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
1188{
1189 Scene *scene = static_cast<Scene *>(ptr->data);
1191 *ptr, RNA_KeyingSet, animrig::scene_get_active_keyingset(scene));
1192}
1193
1194static void rna_Scene_active_keying_set_set(PointerRNA *ptr,
1195 PointerRNA value,
1196 ReportList * /*reports*/)
1197{
1198 Scene *scene = static_cast<Scene *>(ptr->data);
1199 KeyingSet *ks = static_cast<KeyingSet *>(value.data);
1200
1201 scene->active_keyingset = ANIM_scene_get_keyingset_index(scene, ks);
1202}
1203
1204/* get KeyingSet index stuff for list of Keying Sets editing UI
1205 * - active_keyingset-1 since 0 is reserved for 'none'
1206 * - don't clamp, otherwise can never set builtin's types as active...
1207 */
1208static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
1209{
1210 Scene *scene = static_cast<Scene *>(ptr->data);
1211 return scene->active_keyingset - 1;
1212}
1213
1214/* get KeyingSet index stuff for list of Keying Sets editing UI
1215 * - value+1 since 0 is reserved for 'none'
1216 */
1217static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
1218{
1219 Scene *scene = static_cast<Scene *>(ptr->data);
1220 scene->active_keyingset = value + 1;
1221}
1222
1223/* XXX: evil... builtin_keyingsets is defined in `animrig::keyingsets.cc`! */
1224/* TODO: make API function to retrieve this... */
1225extern ListBaseT<KeyingSet> builtin_keyingsets;
1226
1227static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1228{
1229 Scene *scene = static_cast<Scene *>(ptr->data);
1230
1231 /* start going over the scene KeyingSets first, while we still have pointer to it
1232 * but only if we have any Keying Sets to use...
1233 */
1234 if (scene->keyingsets.first()) {
1235 rna_iterator_listbase_begin(iter, ptr, &scene->keyingsets, nullptr);
1236 }
1237 else {
1238 rna_iterator_listbase_begin(iter, ptr, &builtin_keyingsets, nullptr);
1239 }
1240}
1241
1242static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
1243{
1244 ListBaseIterator *internal = &iter->internal.listbase;
1245 KeyingSet *ks = reinterpret_cast<KeyingSet *>(internal->link);
1246
1247 /* If we've run out of links in Scene list,
1248 * jump over to the builtins list unless we're there already. */
1249 if ((ks->next == nullptr) && (ks != builtin_keyingsets.last())) {
1250 internal->link = builtin_keyingsets.first_as<Link>();
1251 }
1252 else {
1253 internal->link = reinterpret_cast<Link *>(ks->next);
1254 }
1255
1256 iter->valid = (internal->link != nullptr);
1257}
1258
1259static bool rna_Scene_compositing_node_group_poll(PointerRNA * /*ptr*/, PointerRNA value)
1260{
1261 bNodeTree *ntree = static_cast<bNodeTree *>(value.data);
1262 return ntree->type == NTREE_COMPOSIT;
1263}
1264
1265static PointerRNA rna_Scene_compositing_node_group_get(PointerRNA *scene_ptr)
1266{
1267 Scene *scene = scene_ptr->data_as<Scene>();
1269 if (!effect) {
1270 return RNA_pointer_create_with_parent(*scene_ptr, RNA_NodeTree, nullptr);
1271 }
1272 return RNA_pointer_create_with_parent(*scene_ptr, RNA_NodeTree, effect->node_group);
1273}
1274
1275static void rna_Scene_compositing_node_group_set(PointerRNA *scene_ptr,
1276 const PointerRNA value,
1277 ReportList *reports)
1278{
1279 Scene *scene = scene_ptr->data_as<Scene>();
1280 bNodeTree *node_tree = value.data_as<bNodeTree>();
1281 if (node_tree && node_tree->type != NTREE_COMPOSIT) {
1282 BKE_reportf(reports,
1283 RPT_ERROR,
1284 "Node tree '%s' is not a compositing node group.",
1285 node_tree->id.name + 2);
1286 return;
1287 }
1288
1290 if (!effect) {
1291 effect = &bke::compositor::new_effect(*scene, "Scene Effect");
1292 }
1293
1294 if (effect->node_group) {
1295 id_us_min(&effect->node_group->id);
1296 }
1297 effect->node_group = node_tree;
1298 if (effect->node_group) {
1299 id_us_plus(&effect->node_group->id);
1300 }
1301}
1302
1303void rna_Scene_compositing_node_group_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1304{
1305 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1306
1310
1312 if (effect) {
1314 }
1315}
1316
1317static std::optional<std::string> rna_SceneEEVEE_path(const PointerRNA * /*ptr*/)
1318{
1319 return "eevee";
1320}
1321
1322static std::optional<std::string> rna_RaytraceEEVEE_path(const PointerRNA * /*ptr*/)
1323{
1324 return "eevee.ray_tracing_options";
1325}
1326
1327static std::optional<std::string> rna_SceneGpencil_path(const PointerRNA * /*ptr*/)
1328{
1329 return "grease_pencil_settings";
1330}
1331
1332static std::optional<std::string> rna_SceneHydra_path(const PointerRNA * /*ptr*/)
1333{
1334 return "hydra";
1335}
1336
1337static bool rna_RenderSettings_stereoViews_skip(CollectionPropertyIterator *iter, void * /*data*/)
1338{
1339 ListBaseIterator *internal = &iter->internal.listbase;
1340 SceneRenderView *srv = reinterpret_cast<SceneRenderView *>(internal->link);
1341
1342 if (STR_ELEM(srv->name, STEREO_LEFT_NAME, STEREO_RIGHT_NAME)) {
1343 return false;
1344 }
1345
1346 return true;
1347};
1348
1349static void rna_RenderSettings_stereoViews_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1350{
1351 RenderData *rd = static_cast<RenderData *>(ptr->data);
1352 rna_iterator_listbase_begin(iter, ptr, &rd->views, rna_RenderSettings_stereoViews_skip);
1353}
1354
1355static std::optional<std::string> rna_RenderSettings_path(const PointerRNA * /*ptr*/)
1356{
1357 return "render";
1358}
1359
1360static std::optional<std::string> rna_BakeSettings_path(const PointerRNA * /*ptr*/)
1361{
1362 return "render.bake";
1363}
1364
1366 Editing *ed, const ColorManagedColorspaceSettings *colorspace_settings)
1367{
1368 Strip *found_strip = nullptr;
1369
1370 seq::foreach_strip(&ed->seqbase, [&](Strip *strip) -> bool {
1371 if (strip->data && &strip->data->colorspace_settings == colorspace_settings) {
1372 found_strip = strip;
1373 return false;
1374 }
1375 return true;
1376 });
1377
1378 return found_strip;
1379}
1380
1381static std::optional<std::string> rna_ImageFormatSettings_path(
1382 const PointerRNA *ptr, FunctionRef<bool(ImageFormatData *)> match)
1383{
1384 ID *id = ptr->owner_id;
1385
1386 switch (GS(id->name)) {
1387 case ID_SCE: {
1388 Scene *scene = id_cast<Scene *>(id);
1389
1390 if (match(&scene->r.im_format)) {
1391 return "render.image_settings";
1392 }
1393 else if (match(&scene->r.bake.im_format)) {
1394 return "render.bake.image_settings";
1395 }
1396 return std::nullopt;
1397 }
1398 case ID_NT: {
1399 bNodeTree *ntree = id_cast<bNodeTree *>(id);
1400
1401 for (bNode *node : ntree->all_nodes()) {
1402 if (node->type_legacy == CMP_NODE_OUTPUT_FILE) {
1403 NodeCompositorFileOutput &storage = *static_cast<NodeCompositorFileOutput *>(
1404 node->storage);
1405 if (match(&storage.format)) {
1406 char node_name_esc[sizeof(node->name) * 2];
1407 BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
1408 return fmt::format("nodes[\"{}\"].format", node_name_esc);
1409 }
1410 else {
1411 for (const int i : IndexRange(storage.items_count)) {
1412 NodeCompositorFileOutputItem &item = storage.items[i];
1413 if (match(&item.format)) {
1414 char node_name_esc[sizeof(node->name) * 2];
1415 BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
1416
1417 const std::string identifier = FileOutputItemsAccessor::socket_identifier_for_item(
1418 item);
1419 const std::string escaped_identifier = BLI_str_escape(identifier);
1420 return fmt::format("nodes[\"{}\"].file_output_items[\"{}\"].format",
1421 node_name_esc,
1422 escaped_identifier.c_str());
1423 }
1424 }
1425 }
1426 }
1427 }
1428 return std::nullopt;
1429 }
1430 default:
1431 return std::nullopt;
1432 }
1433}
1434
1435static std::optional<std::string> rna_ImageFormatSettings_path(const PointerRNA *ptr)
1436{
1437 ImageFormatData *data = static_cast<ImageFormatData *>(ptr->data);
1438 return rna_ImageFormatSettings_path(ptr, [&](ImageFormatData *imf) { return imf == data; });
1439}
1440
1441std::optional<std::string> rna_ColorManagedDisplaySettings_path(const PointerRNA *ptr)
1442{
1443 ColorManagedDisplaySettings *data = static_cast<ColorManagedDisplaySettings *>(ptr->data);
1444 std::optional<std::string> path = rna_ImageFormatSettings_path(
1445 ptr, [&](ImageFormatData *imf) { return &imf->display_settings == data; });
1446 if (path) {
1447 return *path + ".display_settings";
1448 }
1449 if (GS(ptr->owner_id->name) == ID_SCE) {
1450 return "display_settings";
1451 }
1452
1453 return std::nullopt;
1454}
1455
1456std::optional<std::string> rna_ColorManagedViewSettings_path(const PointerRNA *ptr)
1457{
1458 ColorManagedViewSettings *data = static_cast<ColorManagedViewSettings *>(ptr->data);
1459 std::optional<std::string> path = rna_ImageFormatSettings_path(
1460 ptr, [&](ImageFormatData *imf) { return &imf->view_settings == data; });
1461 if (path) {
1462 return *path + ".view_settings";
1463 }
1464 if (GS(ptr->owner_id->name) == ID_SCE) {
1465 return "view_settings";
1466 }
1467 return std::nullopt;
1468}
1469
1470std::optional<std::string> rna_ColorManagedInputColorspaceSettings_path(const PointerRNA *ptr)
1471{
1472 ColorManagedColorspaceSettings *data = static_cast<ColorManagedColorspaceSettings *>(ptr->data);
1473 std::optional<std::string> path = rna_ImageFormatSettings_path(
1474 ptr, [&](ImageFormatData *imf) { return &imf->linear_colorspace_settings == data; });
1475 if (path) {
1476 return *path + ".linear_colorspace_settings";
1477 }
1478
1479 /* Images and Movieclips have this directly. */
1480 if (ELEM(GS(ptr->owner_id->name), ID_IM, ID_MC)) {
1481 return "colorspace_settings";
1482 }
1483
1484 /* Search VSE for ImageStrips/MovieStrips. */
1485 if (GS(ptr->owner_id->name) == ID_SCE) {
1486 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1487 if (scene->ed) {
1488 Strip *strip = rna_strip_find_by_colorspace_settings(scene->ed, data);
1489
1490 if (strip) {
1491 char name_esc[(sizeof(strip->name) - 2) * 2];
1492 BLI_str_escape(name_esc, strip->name + 2, sizeof(name_esc));
1493 return fmt::format("sequence_editor.strips_all[\"{}\"].colorspace_settings", name_esc);
1494 }
1495 }
1496 }
1497
1498 return std::nullopt;
1499}
1500
1501static int rna_RenderSettings_threads_get(PointerRNA *ptr)
1502{
1503 RenderData *rd = static_cast<RenderData *>(ptr->data);
1504 return BKE_render_num_threads(rd);
1505}
1506
1507static int rna_RenderSettings_threads_mode_get(PointerRNA *ptr)
1508{
1509 RenderData *rd = static_cast<RenderData *>(ptr->data);
1510 int override = BLI_system_num_threads_override_get();
1511
1512 if (override > 0) {
1513 return R_FIXED_THREADS;
1514 }
1515 else {
1516 return (rd->mode & R_FIXED_THREADS);
1517 }
1518}
1519
1520static bool rna_RenderSettings_is_movie_format_get(PointerRNA *ptr)
1521{
1522 RenderData *rd = static_cast<RenderData *>(ptr->data);
1523 return BKE_imtype_is_movie(rd->im_format.imtype);
1524}
1525
1526static const EnumPropertyItem *rna_ImageFormatSettings_media_type_itemf(bContext * /*C*/,
1527 PointerRNA *ptr,
1528 PropertyRNA * /*prop*/,
1529 bool * /*r_free*/)
1530{
1531 ID *id = ptr->owner_id;
1532 /* Scene format setting include video, so we return all items. Otherwise, only image types are
1533 * returned. */
1534 if (id && GS(id->name) == ID_SCE) {
1536 }
1537 else {
1538 return rna_enum_media_type_image_items;
1539 }
1540}
1541
1542/* If the existing imtype does not match the new media type, assign an appropriate default media
1543 * type. */
1544static void rna_ImageFormatSettings_media_type_set(PointerRNA *ptr, int value)
1545{
1546 ImageFormatData *format = ptr->data_as<ImageFormatData>();
1547 BKE_image_format_media_type_set(format, ptr->owner_id, static_cast<MediaType>(value));
1548}
1549
1550static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
1551{
1552 BKE_image_format_set(static_cast<ImageFormatData *>(ptr->data), ptr->owner_id, value);
1553}
1554
1555static const EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf(bContext * /*C*/,
1556 PointerRNA *ptr,
1557 PropertyRNA * /*prop*/,
1558 bool * /*r_free*/)
1559{
1560 const ImageFormatData *format = ptr->data_as<ImageFormatData>();
1561 switch (static_cast<MediaType>(format->media_type)) {
1562 case MEDIA_TYPE_IMAGE:
1563 return image_type_items;
1565 return multi_layer_image_type_items;
1566 case MEDIA_TYPE_VIDEO:
1567 return video_image_type_items;
1568 }
1569
1571}
1572
1573static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext * /*C*/,
1574 PointerRNA *ptr,
1575 PropertyRNA * /*prop*/,
1576 bool *r_free)
1577{
1578 ImageFormatData *imf = static_cast<ImageFormatData *>(ptr->data);
1579 ID *id = ptr->owner_id;
1580 const bool is_render = (id && GS(id->name) == ID_SCE);
1581
1582 /* NOTE(@ideasman42): we need to act differently for render
1583 * where 'BW' will force grayscale even if the output format writes
1584 * as RGBA, this is age old blender convention and not sure how useful
1585 * it really is but keep it for now. */
1586 char chan_flag = BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
1587
1588 /* a WAY more crappy case than B&W flag: depending on codec, file format MIGHT support
1589 * alpha channel. for example MPEG format with h264 codec can't do alpha channel, but
1590 * the same MPEG format with QTRLE codec can easily handle alpha channel.
1591 * not sure how to deal with such cases in a nicer way (sergey) */
1592 if (is_render) {
1593 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1594 RenderData *rd = &scene->r;
1595
1596 if (MOV_codec_supports_alpha(rd->ffcodecdata.codec_id_get(),
1597 rd->ffcodecdata.ffmpeg_prores_profile))
1598 {
1599 chan_flag |= IMA_CHAN_FLAG_RGBA;
1600 }
1601 }
1602
1603 if (chan_flag == (IMA_CHAN_FLAG_BW | IMA_CHAN_FLAG_RGB | IMA_CHAN_FLAG_RGBA)) {
1605 }
1606 else {
1607 int totitem = 0;
1608 EnumPropertyItem *item = nullptr;
1609
1610 if (chan_flag & IMA_CHAN_FLAG_BW) {
1611 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_BW);
1612 }
1613 if (chan_flag & IMA_CHAN_FLAG_RGB) {
1614 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB);
1615 }
1616 if (chan_flag & IMA_CHAN_FLAG_RGBA) {
1617 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA);
1618 }
1619
1620 RNA_enum_item_end(&item, &totitem);
1621 *r_free = true;
1622
1623 return item;
1624 }
1625}
1626
1627static const EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext * /*C*/,
1628 PointerRNA *ptr,
1629 PropertyRNA * /*prop*/,
1630 bool *r_free)
1631{
1632 ImageFormatData *imf = static_cast<ImageFormatData *>(ptr->data);
1633
1634 if (imf == nullptr) {
1636 }
1637 else {
1638 const eImageFormatDepth depth_ok = BKE_imtype_valid_depths_with_video(imf->imtype,
1639 ptr->owner_id);
1640 const int is_float = ELEM(
1641 imf->imtype, R_IMF_IMTYPE_RADHDR, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER);
1642
1643 const EnumPropertyItem *item_8bit = &rna_enum_image_color_depth_items[0];
1644 const EnumPropertyItem *item_10bit = &rna_enum_image_color_depth_items[1];
1645 const EnumPropertyItem *item_12bit = &rna_enum_image_color_depth_items[2];
1646 const EnumPropertyItem *item_16bit = &rna_enum_image_color_depth_items[3];
1647 const EnumPropertyItem *item_32bit = &rna_enum_image_color_depth_items[4];
1648
1649 int totitem = 0;
1650 EnumPropertyItem *item = nullptr;
1651 EnumPropertyItem tmp = {0, "", 0, "", ""};
1652
1653 if (depth_ok & R_IMF_CHAN_DEPTH_8) {
1654 RNA_enum_item_add(&item, &totitem, item_8bit);
1655 }
1656
1657 if (depth_ok & R_IMF_CHAN_DEPTH_10) {
1658 RNA_enum_item_add(&item, &totitem, item_10bit);
1659 }
1660
1661 if (depth_ok & R_IMF_CHAN_DEPTH_12) {
1662 RNA_enum_item_add(&item, &totitem, item_12bit);
1663 }
1664
1665 if (depth_ok & R_IMF_CHAN_DEPTH_16) {
1666 if (is_float) {
1667 tmp = *item_16bit;
1668 tmp.name = N_("Float (Half)");
1669 if (ELEM(imf->imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER)) {
1670 tmp.description = N_(
1671 "16-bit color channels. Data passes like Depth will still be saved using full "
1672 "32-bit precision.");
1673 }
1674 RNA_enum_item_add(&item, &totitem, &tmp);
1675 }
1676 else {
1677 RNA_enum_item_add(&item, &totitem, item_16bit);
1678 }
1679 }
1680
1681 if (depth_ok & R_IMF_CHAN_DEPTH_32) {
1682 if (is_float) {
1683 tmp = *item_32bit;
1684 tmp.name = N_("Float (Full)");
1685 RNA_enum_item_add(&item, &totitem, &tmp);
1686 }
1687 else {
1688 RNA_enum_item_add(&item, &totitem, item_32bit);
1689 }
1690 }
1691
1692 RNA_enum_item_end(&item, &totitem);
1693 *r_free = true;
1694
1695 return item;
1696 }
1697}
1698
1699static const EnumPropertyItem *rna_ImageFormatSettings_views_format_itemf(bContext * /*C*/,
1700 PointerRNA *ptr,
1701 PropertyRNA * /*prop*/,
1702 bool * /*r_free*/)
1703{
1704 ImageFormatData *imf = static_cast<ImageFormatData *>(ptr->data);
1705
1706 if (imf == nullptr) {
1708 }
1709 else if (imf->imtype == R_IMF_IMTYPE_OPENEXR) {
1711 }
1712 else if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) {
1714 }
1715 else {
1717 }
1718}
1719
1720/* OpenEXR */
1721
1722static const EnumPropertyItem *rna_ImageFormatSettings_exr_codec_itemf(bContext * /*C*/,
1723 PointerRNA *ptr,
1724 PropertyRNA * /*prop*/,
1725 bool *r_free)
1726{
1727 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1728
1729 EnumPropertyItem *item = nullptr;
1730 int i = 1, totitem = 0;
1731
1732 if (imf->depth == 16) {
1733 return rna_enum_exr_codec_items; /* All compression types are defined for half-float. */
1734 }
1735
1736 for (i = 0; i < R_IMF_EXR_CODEC_MAX; i++) {
1737 if (ELEM(rna_enum_exr_codec_items[i].value, R_IMF_EXR_CODEC_B44, R_IMF_EXR_CODEC_B44A)) {
1738 continue; /* B44 and B44A are not defined for 32 bit floats */
1739 }
1740
1741 RNA_enum_item_add(&item, &totitem, &rna_enum_exr_codec_items[i]);
1742 }
1743
1744 RNA_enum_item_end(&item, &totitem);
1745 *r_free = true;
1746
1747 return item;
1748}
1749
1750static bool rna_ImageFormatSettings_has_linear_colorspace_get(PointerRNA *ptr)
1751{
1752 ImageFormatData *imf = static_cast<ImageFormatData *>(ptr->data);
1753 return BKE_imtype_requires_linear_float(imf->imtype);
1754}
1755
1756static void rna_ImageFormatSettings_color_management_set(PointerRNA *ptr, int value)
1757{
1758 ImageFormatData *imf = static_cast<ImageFormatData *>(ptr->data);
1759
1760 if (imf->color_management != value) {
1761 imf->color_management = value;
1762
1763 /* Copy from scene when enabling override. */
1764 if (imf->color_management == R_IMF_COLOR_MANAGEMENT_OVERRIDE) {
1765 ID *owner_id = ptr->owner_id;
1766 if (owner_id && GS(owner_id->name) == ID_NT) {
1767 /* For compositing nodes, find the corresponding scene. */
1768 owner_id = BKE_id_owner_get(owner_id);
1769 }
1770 if (owner_id && GS(owner_id->name) == ID_SCE) {
1771 BKE_image_format_color_management_copy_from_scene(imf, id_cast<Scene *>(owner_id));
1772 }
1773 }
1774 }
1775}
1776
1777static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
1778{
1779 const RenderData *rd = static_cast<RenderData *>(ptr->data);
1780 const char *ext_array[BKE_IMAGE_PATH_EXT_MAX];
1781 int ext_num = BKE_image_path_ext_from_imformat(&rd->im_format, ext_array);
1782 return ext_num ? strlen(ext_array[0]) : 0;
1783}
1784
1785static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *value)
1786{
1787 const RenderData *rd = static_cast<RenderData *>(ptr->data);
1788 const char *ext_array[BKE_IMAGE_PATH_EXT_MAX];
1789 int ext_num = BKE_image_path_ext_from_imformat(&rd->im_format, ext_array);
1790 strcpy(value, ext_num ? ext_array[0] : "");
1791}
1792
1793# ifdef WITH_FFMPEG
1794static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, bool value)
1795{
1796 Scene *scene = (Scene *)ptr->owner_id;
1797 RenderData *rd = &scene->r;
1798
1799 if (value) {
1800 rd->ffcodecdata.flags |= FFMPEG_LOSSLESS_OUTPUT;
1801 }
1802 else {
1803 rd->ffcodecdata.flags &= ~FFMPEG_LOSSLESS_OUTPUT;
1804 }
1805}
1806# endif
1807
1808static int rna_RenderSettings_active_view_index_get(PointerRNA *ptr)
1809{
1810 RenderData *rd = static_cast<RenderData *>(ptr->data);
1811 return rd->actview;
1812}
1813
1814static void rna_RenderSettings_active_view_index_set(PointerRNA *ptr, int value)
1815{
1816 RenderData *rd = static_cast<RenderData *>(ptr->data);
1817 rd->actview = value;
1818}
1819
1820static void rna_RenderSettings_active_view_index_range(
1821 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
1822{
1823 RenderData *rd = static_cast<RenderData *>(ptr->data);
1824
1825 *min = 0;
1826 *max = max_ii(0, rd->views.count() - 1);
1827}
1828
1829static PointerRNA rna_RenderSettings_active_view_get(PointerRNA *ptr)
1830{
1831 RenderData *rd = static_cast<RenderData *>(ptr->data);
1832 SceneRenderView *srv = static_cast<SceneRenderView *>(BLI_findlink(&rd->views, rd->actview));
1833
1834 return RNA_pointer_create_with_parent(*ptr, RNA_SceneRenderView, srv);
1835}
1836
1837static void rna_RenderSettings_active_view_set(PointerRNA *ptr,
1838 PointerRNA value,
1839 ReportList * /*reports*/)
1840{
1841 RenderData *rd = static_cast<RenderData *>(ptr->data);
1842 SceneRenderView *srv = static_cast<SceneRenderView *>(value.data);
1843 const int index = BLI_findindex(&rd->views, srv);
1844 if (index != -1) {
1845 rd->actview = index;
1846 }
1847}
1848
1849static SceneRenderView *rna_RenderView_new(ID *id, RenderData * /*rd*/, const char *name)
1850{
1851 Scene *scene = id_cast<Scene *>(id);
1852 SceneRenderView *srv = BKE_scene_add_render_view(scene, name);
1853
1855
1856 return srv;
1857}
1858
1859static void rna_RenderView_remove(
1860 ID *id, RenderData * /*rd*/, Main * /*bmain*/, ReportList *reports, PointerRNA *srv_ptr)
1861{
1862 SceneRenderView *srv = static_cast<SceneRenderView *>(srv_ptr->data);
1863 Scene *scene = id_cast<Scene *>(id);
1864
1865 if (!BKE_scene_remove_render_view(scene, srv)) {
1866 BKE_reportf(reports,
1867 RPT_ERROR,
1868 "Render view '%s' could not be removed from scene '%s'",
1869 srv->name,
1870 scene->id.name + 2);
1871 return;
1872 }
1873
1874 srv_ptr->invalidate();
1875
1877}
1878
1879static void rna_RenderSettings_views_format_set(PointerRNA *ptr, int value)
1880{
1881 RenderData *rd = static_cast<RenderData *>(ptr->data);
1882
1883 if (rd->views_format == SCE_VIEWS_FORMAT_MULTIVIEW && value == SCE_VIEWS_FORMAT_STEREO_3D) {
1884 /* make sure the actview is visible */
1885 if (rd->actview > 1) {
1886 rd->actview = 1;
1887 }
1888 }
1889
1890 rd->views_format = eSceneViews_Format(value);
1891}
1892
1893static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
1894{
1895 RenderData *rd = static_cast<RenderData *>(ptr->data);
1896 RenderEngineType *type = static_cast<RenderEngineType *>(BLI_findlink(&R_engines, value));
1897
1898 if (type) {
1899 STRNCPY_UTF8(rd->engine, type->idname);
1900 DEG_id_tag_update(ptr->owner_id, ID_RECALC_SYNC_TO_EVAL);
1901 }
1902}
1903
1904static const EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext * /*C*/,
1905 PointerRNA * /*ptr*/,
1906 PropertyRNA * /*prop*/,
1907 bool *r_free)
1908{
1909 RenderEngineType *type;
1910 EnumPropertyItem *item = nullptr;
1911 EnumPropertyItem tmp = {0, "", 0, "", ""};
1912 int a = 0, totitem = 0;
1913
1914 for (type = R_engines.first(); type; type = type->next, a++) {
1915 tmp.value = a;
1916 tmp.identifier = type->idname;
1917 tmp.name = type->name;
1918 RNA_enum_item_add(&item, &totitem, &tmp);
1919 }
1920
1921 RNA_enum_item_end(&item, &totitem);
1922 *r_free = true;
1923
1924 return item;
1925}
1926
1927static int rna_RenderSettings_engine_get(PointerRNA *ptr)
1928{
1929 RenderData *rd = static_cast<RenderData *>(ptr->data);
1930 RenderEngineType *type;
1931 int a = 0;
1932
1933 for (type = R_engines.first(); type; type = type->next, a++) {
1934 if (STREQ(type->idname, rd->engine)) {
1935 return a;
1936 }
1937 }
1938
1939 return 0;
1940}
1941
1942static void rna_RenderSettings_engine_update(Main *bmain, Scene * /*unused*/, PointerRNA * /*ptr*/)
1943{
1944 ED_render_engine_changed(bmain, true);
1945}
1946
1947static void rna_Scene_update_render_engine(Main *bmain)
1948{
1949 ED_render_engine_changed(bmain, true);
1950}
1951
1952static bool rna_RenderSettings_multiple_engines_get(PointerRNA * /*ptr*/)
1953{
1954 return (R_engines.count() > 1);
1955}
1956
1957static bool rna_RenderSettings_use_spherical_stereo_get(PointerRNA *ptr)
1958{
1959 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1960 return BKE_scene_use_spherical_stereo(scene);
1961}
1962
1963void rna_Scene_render_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1964{
1965 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1966
1967 DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
1968}
1969
1970static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1971{
1972 Scene *screen = id_cast<Scene *>(ptr->owner_id);
1973
1974 rna_Scene_render_update(bmain, scene, ptr);
1975 WM_main_add_notifier(NC_WORLD | ND_WORLD, &screen->id);
1977}
1978
1979static void rna_Scene_mesh_quality_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1980{
1981 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1982
1983 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1984 if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_VOLUME, OB_MBALL)) {
1985 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
1986 }
1987 }
1989
1990 rna_Scene_render_update(bmain, scene, ptr);
1991}
1992
1993void rna_Scene_freestyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1994{
1995 Scene *scene = id_cast<Scene *>(ptr->owner_id);
1996
1997 DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
1998}
1999
2000void rna_Scene_use_freestyle_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
2001{
2002 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2003
2004 DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
2005
2006 BKE_ntree_update_tag_id_changed(bmain, &scene->id);
2007 BKE_ntree_update(*bmain);
2008}
2009
2010void rna_Scene_compositor_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2011{
2012 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2013 DEG_id_tag_update(&scene->id, ID_RECALC_COMPOSITOR);
2015}
2016
2017void rna_Scene_use_view_map_cache_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
2018{
2019# ifdef WITH_FREESTYLE
2021# endif
2022}
2023
2024void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value)
2025{
2026 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2027 ViewLayer *view_layer = static_cast<ViewLayer *>(ptr->data);
2029 BKE_view_layer_rename(G_MAIN, scene, view_layer, value);
2030}
2031
2032static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value)
2033{
2034 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2035 SceneRenderView *rv = static_cast<SceneRenderView *>(ptr->data);
2036 STRNCPY_UTF8(rv->name, value);
2037 BLI_uniquename(&scene->r.views,
2038 rv,
2039 DATA_("RenderView"),
2040 '.',
2041 offsetof(SceneRenderView, name),
2042 sizeof(rv->name));
2043}
2044
2045void rna_ViewLayer_override_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
2046{
2047 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2048 rna_Scene_render_update(bmain, scene, ptr);
2050}
2051
2052void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
2053{
2054 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2055
2056 ViewLayer *view_layer = nullptr;
2057 if (ptr->type == RNA_ViewLayer) {
2058 view_layer = static_cast<ViewLayer *>(ptr->data);
2059 }
2060 else if (ptr->type == RNA_AOV) {
2061 ViewLayerAOV *aov = static_cast<ViewLayerAOV *>(ptr->data);
2062 view_layer = BKE_view_layer_find_with_aov(scene, aov);
2063 }
2064 else if (ptr->type == RNA_Lightgroup) {
2065 ViewLayerLightgroup *lightgroup = static_cast<ViewLayerLightgroup *>(ptr->data);
2066 view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
2067 }
2068
2069 if (view_layer) {
2070 RenderEngineType *engine_type = RE_engines_find(scene->r.engine);
2071 if (engine_type->update_render_passes) {
2072 RenderEngine *engine = RE_engine_create(engine_type);
2073 if (engine) {
2074 BKE_view_layer_verify_aov(engine, scene, view_layer);
2075 }
2076 RE_engine_free(engine);
2077 engine = nullptr;
2078 }
2079 }
2080
2081 BKE_ntree_update_tag_id_changed(bmain, &scene->id);
2082 BKE_ntree_update(*bmain);
2083
2084 rna_Scene_render_update(bmain, activescene, ptr);
2085}
2086
2087static std::optional<std::string> rna_ViewLayerEEVEE_path(const PointerRNA *ptr)
2088{
2089 const ViewLayerEEVEE *view_layer_eevee = static_cast<ViewLayerEEVEE *>(ptr->data);
2090 const ViewLayer *view_layer = reinterpret_cast<ViewLayer *>(
2091 reinterpret_cast<uint8_t *>(const_cast<ViewLayerEEVEE *>(view_layer_eevee)) -
2092 offsetof(ViewLayer, eevee));
2093 char rna_path[sizeof(view_layer->name) * 3];
2094
2095 const size_t view_layer_path_len = rna_ViewLayer_path_buffer_get(
2096 view_layer, rna_path, sizeof(rna_path));
2097
2098 BLI_strncpy(rna_path + view_layer_path_len, ".eevee", sizeof(rna_path) - view_layer_path_len);
2099
2100 return rna_path;
2101}
2102
2103static void rna_SceneEEVEE_gi_cubemap_resolution_update(Main * /*main*/,
2104 Scene *scene,
2105 PointerRNA * /*ptr*/)
2106{
2107 /* Tag all light probes to recalc transform. This signals EEVEE to update the light probes. */
2108 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
2109 if (ob->type == OB_LIGHTPROBE) {
2110 DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);
2111 }
2112 }
2114}
2115
2116static void rna_SceneEEVEE_clamp_surface_indirect_update(Main * /*main*/,
2117 Scene *scene,
2118 PointerRNA * /*ptr*/)
2119{
2120 /* Tag all light probes to recalc transform. This signals EEVEE to update the light probes. */
2121 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
2122 if (ob->type == OB_LIGHTPROBE) {
2123 DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);
2124 }
2125 }
2127
2128 /* Also tag the world. */
2129 DEG_id_tag_update(&scene->world->id, ID_RECALC_SHADING);
2130}
2131
2132static void rna_SceneEEVEE_shadow_resolution_update(Main * /*bmain*/,
2133 Scene *scene,
2134 PointerRNA * /*ptr*/)
2135{
2136 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
2137 if (ob->type == OB_LAMP) {
2138 DEG_id_tag_update(&ob->id, ID_RECALC_SHADING);
2139 }
2140 }
2142
2145 DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
2146}
2147
2148static std::optional<std::string> rna_SceneRenderView_path(const PointerRNA *ptr)
2149{
2150 const SceneRenderView *srv = static_cast<SceneRenderView *>(ptr->data);
2151 char srv_name_esc[sizeof(srv->name) * 2];
2152 BLI_str_escape(srv_name_esc, srv->name, sizeof(srv_name_esc));
2153 return fmt::format("render.views[\"{}\"]", srv_name_esc);
2154}
2155
2156static bool rna_Scene_use_nodes_get(PointerRNA * /*ptr*/)
2157{
2158 /* #use_nodes is deprecated. Always return true for consistency with Materials and World. */
2159 return true;
2160}
2161
2162static void rna_Scene_use_nodes_set(PointerRNA * /*ptr*/, const bool /*use_nodes*/)
2163{
2164 /* #use_nodes is deprecated. Setting the property has no effect.
2165 * Note: Users will get a warning through the RNA deprecation warning, so no need to log a
2166 * warning here. */
2167 return;
2168}
2169
2170static void rna_Physics_relations_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
2171{
2173}
2174
2175static void rna_Physics_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2176{
2177 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2178 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
2180 }
2182
2183 DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
2184}
2185
2186static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const bool *value)
2187{
2188 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
2189 const int selectmode = (value[0] ? SCE_SELECT_VERTEX : 0) | (value[1] ? SCE_SELECT_EDGE : 0) |
2190 (value[2] ? SCE_SELECT_FACE : 0);
2191
2192 if (selectmode) {
2193 ts->selectmode = selectmode;
2194
2195 /* Update select mode in all the workspaces in mesh edit mode. */
2196 wmWindowManager *wm = G_MAIN->wm.first();
2197 for (wmWindow &win : wm->windows) {
2198 const Scene *scene = WM_window_get_active_scene(&win);
2199 ViewLayer *view_layer = WM_window_get_active_view_layer(&win);
2200 if (view_layer) {
2201 /* FIXME Using G_MAIN is weak, but should work in practice given current context (code
2202 * already relies on 'G_MAIN data'). */
2203 BKE_view_layer_synced_ensure(*G_MAIN, scene, view_layer);
2204 Object *object = BKE_view_layer_active_object_get(view_layer);
2205 if (object && object->type == OB_MESH) {
2206 if (BMEditMesh *em = BKE_editmesh_from_object(object)) {
2208 if (em->selectmode != selectmode) {
2209 EDBM_selectmode_set(em, bm, selectmode);
2210 }
2211 }
2212 }
2213 }
2214 }
2215 }
2216}
2217
2218static void rna_Scene_editmesh_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2219{
2220 const Main *bmain = CTX_data_main(C);
2221 const Scene *scene = CTX_data_scene(C);
2222 ViewLayer *view_layer = CTX_data_view_layer(C);
2223 Mesh *mesh = nullptr;
2224
2225 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
2226 Object *object = BKE_view_layer_active_object_get(view_layer);
2227 if (object) {
2228 mesh = BKE_mesh_from_object(object);
2229 if (mesh && mesh->runtime->edit_mesh == nullptr) {
2230 mesh = nullptr;
2231 }
2232 }
2233
2234 if (mesh) {
2235 DEG_id_tag_update(&mesh->id, ID_RECALC_SELECT);
2237 }
2238}
2239
2240static void rna_Scene_uv_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2241{
2242 /* Makes sure that the UV selection states are consistent with the current UV select mode and
2243 * sticky mode. */
2245}
2246
2247static void rna_Scene_uv_select_sync_update(bContext *C, PointerRNA * /*ptr*/)
2248{
2250}
2251
2252static void rna_Scene_uv_sticky_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2253{
2254 /* Some changes to sticky select mode require rebuilding. */
2256}
2257
2258static void object_simplify_update(Scene *scene,
2259 Object *ob,
2260 bool update_normals,
2261 Depsgraph *depsgraph)
2262{
2263 ModifierData *md;
2264 ParticleSystem *psys;
2265
2266 if ((ob->id.tag & ID_TAG_DOIT) == 0) {
2267 return;
2268 }
2269
2270 ob->id.tag &= ~ID_TAG_DOIT;
2271
2272 for (md = ob->modifiers.first(); md; md = md->next) {
2273 if (md->type == eModifierType_Nodes && depsgraph != nullptr) {
2274 Object *ob_eval = DEG_get_evaluated(depsgraph, ob);
2275 const bke::GeometrySet *geometry_set = ob_eval->runtime->geometry_set_eval;
2276 if (geometry_set != nullptr && geometry_set->has_volume()) {
2277 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
2278 }
2279 continue;
2280 }
2281 if (ELEM(
2282 md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem))
2283 {
2284 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
2285 }
2286 }
2287
2288 for (psys = ob->particlesystem.first(); psys; psys = psys->next) {
2289 psys->recalc |= ID_RECALC_PSYS_CHILD;
2290 }
2291
2292 if (ob->instance_collection) {
2293 FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (ob->instance_collection, ob_collection) {
2294 object_simplify_update(scene, ob_collection, update_normals, depsgraph);
2295 }
2297 }
2298
2299 if (ob->type == OB_VOLUME) {
2300 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
2301 }
2302
2303 if (scene->r.mode & R_SIMPLIFY_NORMALS || update_normals) {
2304 if (OB_TYPE_IS_GEOMETRY(ob->type)) {
2305 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
2306 }
2307 }
2308
2309 if (ob->type == OB_LAMP) {
2310 DEG_id_tag_update(&ob->id, ID_RECALC_SHADING);
2311 }
2312}
2313
2314static void rna_Scene_simplify_update_impl(Main *bmain,
2315 Scene *sce,
2316 bool update_normals,
2317 Depsgraph *depsgraph)
2318{
2319 Scene *sce_iter;
2320 Base *base;
2321
2322 BKE_main_id_tag_listbase(&bmain->objects.cast<ID>(), ID_TAG_DOIT, true);
2323 FOREACH_SCENE_OBJECT_BEGIN (sce, ob) {
2324 object_simplify_update(sce, ob, update_normals, depsgraph);
2325 }
2327
2328 for (SETLOOPER_SET_ONLY(*bmain, sce, sce_iter, base)) {
2329 object_simplify_update(sce, base->object, update_normals, depsgraph);
2330 }
2331
2334 DEG_id_tag_update(&sce->id, ID_RECALC_SYNC_TO_EVAL);
2335}
2336
2337static void rna_Scene_use_simplify_update(bContext *C, PointerRNA *ptr)
2338{
2339 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2340 Main *bmain = CTX_data_main(C);
2341 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
2342 rna_Scene_simplify_update_impl(bmain, scene, false, depsgraph);
2343}
2344
2345static void rna_Scene_simplify_volume_update(bContext *C, PointerRNA *ptr)
2346{
2347 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2348 Main *bmain = CTX_data_main(C);
2349 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
2350 if (scene->r.mode & R_SIMPLIFY) {
2351 rna_Scene_simplify_update_impl(bmain, scene, false, depsgraph);
2352 }
2353}
2354
2355static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
2356{
2357 if (scene->r.mode & R_SIMPLIFY) {
2358 rna_Scene_simplify_update_impl(bmain, scene, false, nullptr);
2359 }
2360}
2361
2362static void rna_Scene_use_simplify_normals_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
2363{
2364 /* NOTE: Ideally this would just force recalculation of the draw batch cache normals.
2365 * That's complicated enough to not be worth it here. */
2366 if (scene->r.mode & R_SIMPLIFY) {
2367 rna_Scene_simplify_update_impl(bmain, scene, true, nullptr);
2368 }
2369}
2370
2371static void rna_Scene_use_persistent_data_update(Main * /*bmain*/,
2372 Scene * /*scene*/,
2373 PointerRNA *ptr)
2374{
2375 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2376
2377 if (!(scene->r.mode & R_PERSISTENT_DATA)) {
2378 RE_FreePersistentData(scene);
2379 }
2380}
2381
2382/* Scene.transform_orientation_slots */
2383static void rna_Scene_transform_orientation_slots_begin(CollectionPropertyIterator *iter,
2384 PointerRNA *ptr)
2385{
2386 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2387 TransformOrientationSlot *orient_slot = &scene->orientation_slots[0];
2389 ptr,
2390 orient_slot,
2391 sizeof(*orient_slot),
2392 ARRAY_SIZE(scene->orientation_slots),
2393 0,
2394 nullptr);
2395}
2396
2397static int rna_Scene_transform_orientation_slots_length(PointerRNA * /*ptr*/)
2398{
2399 return ARRAY_SIZE((static_cast<Scene *>(nullptr))->orientation_slots);
2400}
2401
2402static bool rna_Scene_use_audio_get(PointerRNA *ptr)
2403{
2404 Scene *scene = static_cast<Scene *>(ptr->data);
2405 return (scene->audio.flag & AUDIO_MUTE) == 0;
2406}
2407
2408static void rna_Scene_use_audio_set(PointerRNA *ptr, bool value)
2409{
2410 Scene *scene = static_cast<Scene *>(ptr->data);
2411
2412 if (!value) {
2413 scene->audio.flag |= AUDIO_MUTE;
2414 }
2415 else {
2416 scene->audio.flag &= ~AUDIO_MUTE;
2417 }
2418}
2419
2420static void rna_Scene_use_audio_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2421{
2422 DEG_id_tag_update(ptr->owner_id, ID_RECALC_AUDIO_MUTE);
2423}
2424
2425static int rna_Scene_sync_mode_get(PointerRNA *ptr)
2426{
2427 Scene *scene = static_cast<Scene *>(ptr->data);
2428 if (scene->audio.flag & AUDIO_SYNC) {
2429 return AUDIO_SYNC;
2430 }
2431 return scene->flag & SCE_FRAME_DROP;
2432}
2433
2434static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
2435{
2436 Scene *scene = static_cast<Scene *>(ptr->data);
2437
2438 if (value == AUDIO_SYNC) {
2439 scene->audio.flag |= AUDIO_SYNC;
2440 }
2441 else if (value == SCE_FRAME_DROP) {
2442 scene->audio.flag &= ~AUDIO_SYNC;
2443 scene->flag |= SCE_FRAME_DROP;
2444 }
2445 else {
2446 scene->audio.flag &= ~AUDIO_SYNC;
2447 scene->flag &= ~SCE_FRAME_DROP;
2448 }
2449}
2450
2451static void rna_View3DCursor_rotation_mode_set(PointerRNA *ptr, int value)
2452{
2453 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2454
2455 /* use API Method for conversions... */
2456 BKE_rotMode_change_values(cursor->rotation_quaternion,
2457 cursor->rotation_euler,
2458 cursor->rotation_axis,
2459 &cursor->rotation_angle,
2460 eRotationModes(cursor->rotation_mode),
2461 eRotationModes(value));
2462
2463 /* finally, set the new rotation type */
2464 cursor->rotation_mode = value;
2465}
2466
2467static void rna_View3DCursor_rotation_axis_angle_get(PointerRNA *ptr, float *value)
2468{
2469 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2470 value[0] = cursor->rotation_angle;
2471 copy_v3_v3(&value[1], cursor->rotation_axis);
2472}
2473
2474static void rna_View3DCursor_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
2475{
2476 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2477 cursor->rotation_angle = value[0];
2478 copy_v3_v3(cursor->rotation_axis, &value[1]);
2479}
2480
2481static void rna_View3DCursor_matrix_get(PointerRNA *ptr, float *values)
2482{
2483 const View3DCursor *cursor = static_cast<const View3DCursor *>(ptr->data);
2484 copy_m4_m4(reinterpret_cast<float (*)[4]>(values), cursor->matrix<float4x4>().ptr());
2485}
2486
2487static void rna_View3DCursor_matrix_set(PointerRNA *ptr, const float *values)
2488{
2489 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2490 float unit_mat[4][4];
2491 normalize_m4_m4(unit_mat, reinterpret_cast<const float (*)[4]>(values));
2492 cursor->set_matrix(float4x4(unit_mat), false);
2493}
2494
2495static std::optional<std::string> rna_TransformOrientationSlot_path(const PointerRNA *ptr)
2496{
2497 const Scene *scene = id_cast<Scene *>(ptr->owner_id);
2498 const TransformOrientationSlot *orientation_slot = static_cast<const TransformOrientationSlot *>(
2499 ptr->data);
2500
2501 if (!ELEM(nullptr, scene, orientation_slot)) {
2502 for (int i = 0; i < ARRAY_SIZE(scene->orientation_slots); i++) {
2503 if (&scene->orientation_slots[i] == orientation_slot) {
2504 return fmt::format("transform_orientation_slots[{}]", i);
2505 }
2506 }
2507 }
2508
2509 /* Should not happen, but in case, just return default path. */
2511 return "transform_orientation_slots[0]";
2512}
2513
2514static std::optional<std::string> rna_View3DCursor_path(const PointerRNA * /*ptr*/)
2515{
2516 return "cursor";
2517}
2518
2519static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[], int frame)
2520{
2521 TimeMarker *marker = MEM_new<TimeMarker>("TimeMarker");
2522 marker->flag = SELECT;
2523 marker->frame = frame;
2524 STRNCPY_UTF8(marker->name, name);
2525 BLI_addtail(&scene->markers, marker);
2526
2529
2530 return marker;
2531}
2532
2533static void rna_TimeLine_remove(Scene *scene, ReportList *reports, PointerRNA *marker_ptr)
2534{
2535 TimeMarker *marker = static_cast<TimeMarker *>(marker_ptr->data);
2536 if (BLI_remlink_safe(&scene->markers, marker) == false) {
2537 BKE_reportf(reports,
2538 RPT_ERROR,
2539 "Timeline marker '%s' not found in scene '%s'",
2540 marker->name,
2541 scene->id.name + 2);
2542 return;
2543 }
2544
2545 BKE_free_time_marker(*marker, true);
2546 marker_ptr->invalidate();
2547
2550}
2551
2552static void rna_TimeLine_clear(Scene *scene)
2553{
2554 BKE_free_time_markers(scene->markers, true);
2555
2558}
2559
2560static std::optional<std::string> rna_Scene_KeyingsSetsAll_path(const PointerRNA * /*ptr*/)
2561{
2562 return "keying_sets_all";
2563}
2564
2565static KeyingSet *rna_Scene_keying_set_new(Scene *sce,
2566 ReportList *reports,
2567 const char idname[],
2568 const char name[])
2569{
2570 KeyingSet *ks = nullptr;
2571
2572 /* call the API func, and set the active keyingset index */
2573 ks = BKE_keyingset_add(&sce->keyingsets, idname, name, KEYINGSET_ABSOLUTE, INSERTKEY_NOFLAGS);
2574
2575 if (ks) {
2576 sce->active_keyingset = sce->keyingsets.count();
2577 return ks;
2578 }
2579 else {
2580 BKE_report(reports, RPT_ERROR, "Keying set could not be added");
2581 return nullptr;
2582 }
2583}
2584
2585static std::optional<std::string> rna_CurvePaintSettings_path(const PointerRNA * /*ptr*/)
2586{
2587 return "tool_settings.curve_paint_settings";
2588}
2589
2590static std::optional<std::string> rna_SequencerToolSettings_path(const PointerRNA * /*ptr*/)
2591{
2592 return "tool_settings.sequencer_tool_settings";
2593}
2594
2595/* generic function to recalc geometry */
2596static void rna_EditMesh_update(bContext *C, PointerRNA * /*ptr*/)
2597{
2598 const Main *bmain = CTX_data_main(C);
2599 const Scene *scene = CTX_data_scene(C);
2600 ViewLayer *view_layer = CTX_data_view_layer(C);
2601 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
2602
2604 *bmain, scene, view_layer, CTX_wm_view3d(C));
2605 for (Object *obedit : objects) {
2606 Mesh *mesh = BKE_mesh_from_object(obedit);
2607
2608 DEG_id_tag_update(&mesh->id, ID_RECALC_GEOMETRY);
2610 }
2611}
2612
2613static std::optional<std::string> rna_MeshStatVis_path(const PointerRNA * /*ptr*/)
2614{
2615 return "tool_settings.statvis";
2616}
2617
2618/* NOTE: without this, when Multi-Paint is activated/deactivated, the colors
2619 * will not change right away when multiple bones are selected, this function
2620 * is not for general use and only for the few cases where changing scene
2621 * settings and NOT for general purpose updates, possibly this should be
2622 * given its own notifier. */
2623static void rna_Scene_update_active_object_data(bContext *C, PointerRNA * /*ptr*/)
2624{
2625 const Main *bmain = CTX_data_main(C);
2626 const Scene *scene = CTX_data_scene(C);
2627 ViewLayer *view_layer = CTX_data_view_layer(C);
2628 BKE_view_layer_synced_ensure(*bmain, scene, view_layer);
2629 Object *ob = BKE_view_layer_active_object_get(view_layer);
2630
2631 if (ob) {
2632 DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
2634 }
2635}
2636
2637static void rna_SceneCamera_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2638{
2639 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2640 Object *camera = scene->camera;
2641
2642 seq::cache_cleanup(scene, seq::CacheCleanup::SourceImage | seq::CacheCleanup::FinalAndIntra);
2643
2644 if (camera && (camera->type == OB_CAMERA)) {
2645 DEG_id_tag_update(&camera->id, ID_RECALC_GEOMETRY);
2646 }
2647}
2648
2649static void rna_SceneSequencer_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2650{
2651 seq::cache_cleanup(id_cast<Scene *>(ptr->owner_id), seq::CacheCleanup::FinalAndIntra);
2652}
2653
2654static std::optional<std::string> rna_ToolSettings_path(const PointerRNA * /*ptr*/)
2655{
2656 return "tool_settings";
2657}
2658
2659PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr)
2660{
2661 FreestyleLineSet *lineset = static_cast<FreestyleLineSet *>(ptr->data);
2662
2663 return RNA_id_pointer_create(reinterpret_cast<ID *>(lineset->linestyle));
2664}
2665
2666void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr,
2667 PointerRNA value,
2668 ReportList * /*reports*/)
2669{
2670 FreestyleLineSet *lineset = static_cast<FreestyleLineSet *>(ptr->data);
2671
2672 if (lineset->linestyle) {
2673 id_us_min(&lineset->linestyle->id);
2674 }
2675 lineset->linestyle = static_cast<FreestyleLineStyle *>(value.data);
2676 id_us_plus(&lineset->linestyle->id);
2677}
2678
2679FreestyleLineSet *rna_FreestyleSettings_lineset_add(ID *id,
2680 FreestyleSettings *config,
2681 Main *bmain,
2682 const char *name)
2683{
2684 Scene *scene = id_cast<Scene *>(id);
2685 FreestyleLineSet *lineset = BKE_freestyle_lineset_add(
2686 bmain, reinterpret_cast<FreestyleConfig *>(config), name);
2687
2688 DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
2690
2691 return lineset;
2692}
2693
2695 FreestyleSettings *config,
2696 ReportList *reports,
2697 PointerRNA *lineset_ptr)
2698{
2699 FreestyleLineSet *lineset = static_cast<FreestyleLineSet *>(lineset_ptr->data);
2700 Scene *scene = id_cast<Scene *>(id);
2701
2702 if (!BKE_freestyle_lineset_delete(reinterpret_cast<FreestyleConfig *>(config), lineset)) {
2703 BKE_reportf(reports, RPT_ERROR, "Line set '%s' could not be removed", lineset->name);
2704 return;
2705 }
2706
2707 lineset_ptr->invalidate();
2708
2709 DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
2711}
2712
2713PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr)
2714{
2715 FreestyleConfig *config = static_cast<FreestyleConfig *>(ptr->data);
2716 FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
2717 return RNA_pointer_create_with_parent(*ptr, RNA_FreestyleLineSet, lineset);
2718}
2719
2721 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2722{
2723 FreestyleConfig *config = static_cast<FreestyleConfig *>(ptr->data);
2724
2725 *min = 0;
2726 *max = max_ii(0, config->linesets.count() - 1);
2727}
2728
2730{
2731 FreestyleConfig *config = static_cast<FreestyleConfig *>(ptr->data);
2733}
2734
2735void rna_FreestyleSettings_active_lineset_index_set(PointerRNA *ptr, int value)
2736{
2737 FreestyleConfig *config = static_cast<FreestyleConfig *>(ptr->data);
2739}
2740
2741FreestyleModuleConfig *rna_FreestyleSettings_module_add(ID *id, FreestyleSettings *config)
2742{
2743 Scene *scene = id_cast<Scene *>(id);
2744 FreestyleModuleConfig *module = BKE_freestyle_module_add(
2745 reinterpret_cast<FreestyleConfig *>(config));
2746
2747 DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
2749
2750 return module;
2751}
2752
2754 FreestyleSettings *config,
2755 ReportList *reports,
2756 PointerRNA *module_ptr)
2757{
2758 Scene *scene = id_cast<Scene *>(id);
2759 FreestyleModuleConfig *module = static_cast<FreestyleModuleConfig *>(module_ptr->data);
2760
2761 if (!BKE_freestyle_module_delete(reinterpret_cast<FreestyleConfig *>(config), module)) {
2762 if (module->script) {
2763 BKE_reportf(reports,
2764 RPT_ERROR,
2765 "Style module '%s' could not be removed",
2766 module->script->id.name + 2);
2767 }
2768 else {
2769 BKE_report(reports, RPT_ERROR, "Style module could not be removed");
2770 }
2771 return;
2772 }
2773
2774 module_ptr->invalidate();
2775
2776 DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL);
2778}
2779
2780static void rna_Stereo3dFormat_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
2781{
2782 ID *id = ptr->owner_id;
2783
2784 if (id && GS(id->name) == ID_IM) {
2785 Image *ima = id_cast<Image *>(id);
2786 ImBuf *ibuf;
2787 void *lock;
2788
2789 if (!BKE_image_is_stereo(ima)) {
2790 return;
2791 }
2792
2793 ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
2794
2795 if (ibuf) {
2796 BKE_image_signal(bmain, ima, nullptr, IMA_SIGNAL_FREE);
2797 }
2798 BKE_image_release_ibuf(ima, ibuf, lock);
2799 }
2800 else if (id && GS(id->name) == ID_SCE) {
2801 Scene *scene = id_cast<Scene *>(id);
2802 Editing *ed = seq::editing_get(scene);
2803
2804 if (ed == nullptr) {
2805 return;
2806 }
2807
2808 seq::foreach_strip(&ed->seqbase, [&](Strip *strip) {
2809 /* Compare pointers until we find the strip that just changed. */
2810 if (strip->stereo3d_format != ptr->data) {
2811 return true;
2812 }
2813 seq::relations_invalidate_cache_raw(scene, strip);
2814 return false;
2815 });
2816 }
2817}
2818
2819static ViewLayer *rna_ViewLayer_new(ID *id, Scene * /*sce*/, Main *bmain, const char *name)
2820{
2821 Scene *scene = id_cast<Scene *>(id);
2822 ViewLayer *view_layer = BKE_view_layer_add(bmain, scene, name, nullptr, VIEWLAYER_ADD_NEW);
2823
2824 DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
2827
2828 return view_layer;
2829}
2830
2831static void rna_ViewLayer_remove(
2832 ID *id, Scene * /*sce*/, Main *bmain, ReportList *reports, PointerRNA *sl_ptr)
2833{
2834 Scene *scene = id_cast<Scene *>(id);
2835 ViewLayer *view_layer = static_cast<ViewLayer *>(sl_ptr->data);
2836
2837 if (ED_scene_view_layer_delete(bmain, scene, view_layer, reports)) {
2838 sl_ptr->invalidate();
2839 }
2840}
2841
2842static void rna_ViewLayer_move(
2843 ID *id, Scene * /*sce*/, Main *bmain, ReportList *reports, int from, int to)
2844{
2845 if (from == to) {
2846 return;
2847 }
2848
2849 Scene *scene = id_cast<Scene *>(id);
2850
2851 if (!BLI_listbase_move_index(&scene->view_layers, from, to)) {
2852 BKE_reportf(reports, RPT_ERROR, "Could not move layer from index '%d' to '%d'", from, to);
2853 return;
2854 }
2855
2856 DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
2859}
2860
2862 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2863{
2864 ViewLayer *view_layer = static_cast<ViewLayer *>(ptr->data);
2865
2866 *min = 0;
2867 *max = max_ii(0, view_layer->aovs.count() - 1);
2868}
2869
2870int rna_ViewLayer_active_aov_index_get(PointerRNA *ptr)
2871{
2872 ViewLayer *view_layer = static_cast<ViewLayer *>(ptr->data);
2873 return BLI_findindex(&view_layer->aovs, view_layer->active_aov);
2874}
2875
2876void rna_ViewLayer_active_aov_index_set(PointerRNA *ptr, int value)
2877{
2878 ViewLayer *view_layer = static_cast<ViewLayer *>(ptr->data);
2879 ViewLayerAOV *aov = static_cast<ViewLayerAOV *>(BLI_findlink(&view_layer->aovs, value));
2880 view_layer->active_aov = aov;
2881}
2882
2884 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2885{
2886 ViewLayer *view_layer = static_cast<ViewLayer *>(ptr->data);
2887
2888 *min = 0;
2889 *max = max_ii(0, view_layer->lightgroups.count() - 1);
2890}
2891
2893{
2894 ViewLayer *view_layer = static_cast<ViewLayer *>(ptr->data);
2895 return BLI_findindex(&view_layer->lightgroups, view_layer->active_lightgroup);
2896}
2897
2898void rna_ViewLayer_active_lightgroup_index_set(PointerRNA *ptr, int value)
2899{
2900 ViewLayer *view_layer = static_cast<ViewLayer *>(ptr->data);
2901 ViewLayerLightgroup *lightgroup = static_cast<ViewLayerLightgroup *>(
2902 BLI_findlink(&view_layer->lightgroups, value));
2903 view_layer->active_lightgroup = lightgroup;
2904}
2905
2906static void rna_ViewLayerLightgroup_name_get(PointerRNA *ptr, char *value)
2907{
2908 ViewLayerLightgroup *lightgroup = static_cast<ViewLayerLightgroup *>(ptr->data);
2909 strcpy(value, lightgroup->name);
2910}
2911
2912static int rna_ViewLayerLightgroup_name_length(PointerRNA *ptr)
2913{
2914 ViewLayerLightgroup *lightgroup = static_cast<ViewLayerLightgroup *>(ptr->data);
2915 return strlen(lightgroup->name);
2916}
2917
2918static void rna_ViewLayerLightgroup_name_set(PointerRNA *ptr, const char *value)
2919{
2920 ViewLayerLightgroup *lightgroup = static_cast<ViewLayerLightgroup *>(ptr->data);
2921 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2922 ViewLayer *view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
2923
2924 BKE_view_layer_rename_lightgroup(scene, view_layer, lightgroup, value);
2925}
2926
2927/* Fake value, used internally (not saved to DNA). */
2928# define V3D_ORIENT_DEFAULT -1
2929
2930static int rna_TransformOrientationSlot_type_get(PointerRNA *ptr)
2931{
2932 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2933 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2934 if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2935 if ((orient_slot->flag & SELECT) == 0) {
2936 return V3D_ORIENT_DEFAULT;
2937 }
2938 }
2939 return BKE_scene_orientation_slot_get_index(orient_slot);
2940}
2941
2942void rna_TransformOrientationSlot_type_set(PointerRNA *ptr, int value)
2943{
2944 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2945 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2946
2947 if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2948 if (value == V3D_ORIENT_DEFAULT) {
2949 orient_slot->flag &= ~SELECT;
2950 return;
2951 }
2952 else {
2953 orient_slot->flag |= SELECT;
2954 }
2955 }
2956
2957 BKE_scene_orientation_slot_set_index(orient_slot, value);
2958}
2959
2960static PointerRNA rna_TransformOrientationSlot_get(PointerRNA *ptr)
2961{
2962 Scene *scene = id_cast<Scene *>(ptr->owner_id);
2963 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2964 TransformOrientation *orientation;
2965 if (orient_slot->type < V3D_ORIENT_CUSTOM) {
2966 orientation = nullptr;
2967 }
2968 else {
2969 orientation = BKE_scene_transform_orientation_find(scene, orient_slot->index_custom);
2970 }
2971 return RNA_pointer_create_with_parent(*ptr, RNA_TransformOrientation, orientation);
2972}
2973
2974static const EnumPropertyItem *rna_TransformOrientation_impl_itemf(Scene *scene,
2975 const bool include_default,
2976 bool *r_free)
2977{
2978 EnumPropertyItem tmp = {0, "", 0, "", ""};
2979 EnumPropertyItem *item = nullptr;
2980 int i = V3D_ORIENT_CUSTOM, totitem = 0;
2981
2982 if (include_default) {
2983 tmp.identifier = "DEFAULT";
2984 tmp.name = N_("Default");
2985 tmp.description = N_("Use the scene orientation");
2986 tmp.value = V3D_ORIENT_DEFAULT;
2987 tmp.icon = ICON_OBJECT_ORIGIN;
2988 RNA_enum_item_add(&item, &totitem, &tmp);
2989 tmp.icon = 0;
2990
2991 RNA_enum_item_add_separator(&item, &totitem);
2992 }
2993
2994 RNA_enum_items_add(&item, &totitem, rna_enum_transform_orientation_items);
2995
2996 const ListBaseT<TransformOrientation> *transform_orientations = scene ?
2997 &scene->transform_spaces :
2998 nullptr;
2999
3000 if (transform_orientations && (transform_orientations->is_empty() == false)) {
3001 RNA_enum_item_add_separator(&item, &totitem);
3002
3003 for (TransformOrientation &ts : *transform_orientations) {
3004 tmp.identifier = ts.name;
3005 tmp.name = ts.name;
3006 tmp.value = i++;
3007 RNA_enum_item_add(&item, &totitem, &tmp);
3008 }
3009 }
3010
3011 RNA_enum_item_end(&item, &totitem);
3012 *r_free = true;
3013
3014 return item;
3015}
3016const EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C,
3017 PointerRNA *ptr,
3018 PropertyRNA * /*prop*/,
3019 bool *r_free)
3020{
3021 if (C == nullptr) {
3023 }
3024
3025 Scene *scene;
3026 if (ptr->owner_id && (GS(ptr->owner_id->name) == ID_SCE)) {
3027 scene = id_cast<Scene *>(ptr->owner_id);
3028 }
3029 else {
3030 scene = CTX_data_scene(C);
3031 }
3032 return rna_TransformOrientation_impl_itemf(scene, false, r_free);
3033}
3034
3035const EnumPropertyItem *rna_TransformOrientation_with_scene_itemf(bContext *C,
3036 PointerRNA *ptr,
3037 PropertyRNA * /*prop*/,
3038 bool *r_free)
3039{
3040 if (C == nullptr) {
3042 }
3043
3044 Scene *scene = id_cast<Scene *>(ptr->owner_id);
3045 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
3046 bool include_default = (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]);
3047 return rna_TransformOrientation_impl_itemf(scene, include_default, r_free);
3048}
3049
3050# undef V3D_ORIENT_DEFAULT
3051
3052static const EnumPropertyItem *rna_UnitSettings_itemf_wrapper(const int system,
3053 const int type,
3054 bool *r_free)
3055{
3056 const void *usys;
3057 int len;
3058 BKE_unit_system_get(system, type, &usys, &len);
3059
3060 EnumPropertyItem *items = nullptr;
3061 int totitem = 0;
3062
3063 EnumPropertyItem adaptive = {0};
3064 adaptive.identifier = "ADAPTIVE";
3065 adaptive.name = N_("Adaptive");
3066 adaptive.value = USER_UNIT_ADAPTIVE;
3067 RNA_enum_item_add(&items, &totitem, &adaptive);
3068
3069 for (int i = 0; i < len; i++) {
3070 if (!BKE_unit_is_suppressed(usys, i)) {
3071 EnumPropertyItem tmp = {0};
3072 tmp.identifier = BKE_unit_identifier_get(usys, i);
3073 tmp.name = BKE_unit_display_name_get(usys, i);
3074 tmp.value = i;
3075 RNA_enum_item_add(&items, &totitem, &tmp);
3076 }
3077 }
3078
3079 RNA_enum_item_end(&items, &totitem);
3080 *r_free = true;
3081
3082 return items;
3083}
3084
3085const EnumPropertyItem *rna_UnitSettings_length_unit_itemf(bContext * /*C*/,
3086 PointerRNA *ptr,
3087 PropertyRNA * /*prop*/,
3088 bool *r_free)
3089{
3090 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
3091 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_LENGTH, r_free);
3092}
3093
3094const EnumPropertyItem *rna_UnitSettings_mass_unit_itemf(bContext * /*C*/,
3095 PointerRNA *ptr,
3096 PropertyRNA * /*prop*/,
3097 bool *r_free)
3098{
3099 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
3100 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_MASS, r_free);
3101}
3102
3103const EnumPropertyItem *rna_UnitSettings_time_unit_itemf(bContext * /*C*/,
3104 PointerRNA *ptr,
3105 PropertyRNA * /*prop*/,
3106 bool *r_free)
3107{
3108 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
3109 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TIME, r_free);
3110}
3111
3112const EnumPropertyItem *rna_UnitSettings_temperature_unit_itemf(bContext * /*C*/,
3113 PointerRNA *ptr,
3114 PropertyRNA * /*prop*/,
3115 bool *r_free)
3116{
3117 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
3118 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TEMPERATURE, r_free);
3119}
3120
3121static void rna_UnitSettings_system_update(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
3122{
3123 UnitSettings *unit = &scene->unit;
3124 if (unit->system == USER_UNIT_NONE) {
3125 unit->length_unit = USER_UNIT_ADAPTIVE;
3126 unit->mass_unit = USER_UNIT_ADAPTIVE;
3127 }
3128 else {
3129 unit->length_unit = BKE_unit_base_of_type_get(unit->system, B_UNIT_LENGTH);
3130 unit->mass_unit = BKE_unit_base_of_type_get(unit->system, B_UNIT_MASS);
3131 }
3132}
3133
3134static std::optional<std::string> rna_UnitSettings_path(const PointerRNA * /*ptr*/)
3135{
3136 return "unit_settings";
3137}
3138
3139static std::optional<std::string> rna_FFmpegSettings_path(const PointerRNA * /*ptr*/)
3140{
3141 return "render.ffmpeg";
3142}
3143
3144# ifdef WITH_FFMPEG
3145/* FFMpeg Codec setting update hook. */
3146static void rna_FFmpegSettings_codec_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
3147{
3148 FFMpegCodecData *codec_data = (FFMpegCodecData *)ptr->data;
3149 if (!MOV_codec_supports_crf(codec_data->codec_id_get())) {
3150 /* Constant Rate Factor (CRF) setting is only available for some codecs. Change encoder quality
3151 * mode to CBR for others. */
3152 codec_data->constant_rate_factor = FFM_CRF_NONE;
3153 }
3154
3155 /* Ensure valid color depth when changing the codec. */
3156 const ID *id = ptr->owner_id;
3157 const bool is_render = (id && GS(id->name) == ID_SCE);
3158 if (is_render) {
3159 Scene *scene = (Scene *)ptr->owner_id;
3161 scene->r.im_format.imtype, id);
3162 if ((scene->r.im_format.depth & valid_depths) == 0) {
3163 scene->r.im_format.depth = BKE_imtype_first_valid_depth(valid_depths);
3164 }
3165 }
3166}
3167# endif
3168
3169static std::optional<std::string> rna_SceneCompositorEffect_path(const PointerRNA *ptr)
3170{
3171 SceneCompositorEffect *effect = ptr->data_as<SceneCompositorEffect>();
3172 const std::string escaped_effect_name = BLI_str_escape(effect->name);
3173 return fmt::format("compositor_effects[\"{}\"]", escaped_effect_name);
3174}
3175
3176static void rna_SceneCompositorEffect_name_set(PointerRNA *ptr, const char *value)
3177{
3178 Scene *scene = id_cast<Scene *>(ptr->owner_id);
3179 SceneCompositorEffect *effect = ptr->data_as<SceneCompositorEffect>();
3180 bke::compositor::rename_effect(*scene, *effect, value);
3182}
3183
3184static void rna_SceneCompositorEffect_is_active_set(PointerRNA *ptr, bool is_active)
3185{
3186 /* We only support setting an effect as active, since we always need an active effect. */
3187 if (!is_active) {
3188 return;
3189 }
3190
3191 Scene *scene = id_cast<Scene *>(ptr->owner_id);
3192 SceneCompositorEffect *effect = ptr->data_as<SceneCompositorEffect>();
3193 bke::compositor::set_active_effect(*scene, *effect);
3194 DEG_id_tag_update(&scene->id, ID_RECALC_COMPOSITOR);
3196}
3197
3198static bool rna_SceneCompositorEffect_node_group_poll(PointerRNA * /*ptr*/, PointerRNA value)
3199{
3200 const bNodeTree *node_tree = value.data_as<bNodeTree>();
3201 if (node_tree->type != NTREE_COMPOSIT) {
3202 return false;
3203 }
3204 if (node_tree->compositor_node_asset_traits) {
3205 if ((node_tree->compositor_node_asset_traits->flag & COMPOSIT_NODE_ASSET_SCENE_EFFECT) == 0) {
3206 return false;
3207 }
3208 }
3209 return true;
3210}
3211
3212static void rna_SceneCompositorEffect_node_group_update(Main *bmain,
3213 Scene * /*scene*/,
3214 PointerRNA *effect_ptr)
3215{
3216 Scene *scene = id_cast<Scene *>(effect_ptr->owner_id);
3217
3219 DEG_id_tag_update(&scene->id, ID_RECALC_COMPOSITOR);
3221
3222 SceneCompositorEffect *effect = effect_ptr->data_as<SceneCompositorEffect>();
3223 bke::compositor::update_effect_node_group_interface(*bmain, *scene, *effect);
3224}
3225
3226static SceneCompositorEffect *rna_SceneCompositorEffects_new(ID *scene_id, const char *name)
3227{
3228 Scene *scene = id_cast<Scene *>(scene_id);
3229 SceneCompositorEffect &effect = bke::compositor::new_effect(*scene, name);
3231 return &effect;
3232}
3233
3234static void rna_SceneCompositorEffects_remove(ID *scene_id,
3235 Main *bmain,
3236 ReportList *reports,
3237 PointerRNA *effect_ptr)
3238{
3239 Scene *scene = id_cast<Scene *>(scene_id);
3240 SceneCompositorEffect *effect = effect_ptr->data_as<SceneCompositorEffect>();
3241 if (BLI_findindex(&scene->compositor_effects, effect) == -1) {
3242 BKE_report(reports, RPT_ERROR, "Effect was not found in the stack");
3243 return;
3244 }
3245 bke::compositor::remove_effect(*scene, *effect);
3246 effect_ptr->invalidate();
3247
3249 DEG_id_tag_update(&scene->id, ID_RECALC_COMPOSITOR);
3251}
3252
3253static void rna_SceneCompositorEffects_clear(ID *scene_id, Main *bmain)
3254{
3255 Scene *scene = id_cast<Scene *>(scene_id);
3256 bke::compositor::clear_effects(*scene);
3257
3259 DEG_id_tag_update(&scene->id, ID_RECALC_COMPOSITOR);
3261}
3262
3263static PointerRNA rna_SceneCompositorEffects_active_get(PointerRNA *ptr)
3264{
3265 const Scene *scene = ptr->data_as<Scene>();
3266 SceneCompositorEffect *effect = bke::compositor::get_active_effect(*scene);
3267 return RNA_pointer_create_with_parent(*ptr, RNA_SceneCompositorEffect, effect);
3268}
3269
3270static void rna_SceneCompositorEffects_active_set(PointerRNA *ptr,
3271 PointerRNA value,
3272 ReportList * /*reports*/)
3273{
3274 Scene *scene = ptr->data_as<Scene>();
3275 SceneCompositorEffect *effect = value.data_as<SceneCompositorEffect>();
3276 bke::compositor::set_active_effect(*scene, *effect);
3277
3278 if (bke::compositor::is_effect_enabled(*effect, bke::compositor::ExecutionMode::Preview)) {
3279 DEG_id_tag_update(&scene->id, ID_RECALC_COMPOSITOR);
3281 }
3282}
3283
3284static StructRNA *rna_SceneCompositorEffectProperties_refine(PointerRNA *effect_ptr)
3285{
3286 SceneCompositorEffect *effect = effect_ptr->data_as<SceneCompositorEffect>();
3287 if (!effect->node_group || ID_MISSING(effect->node_group)) {
3288 return RNA_SceneCompositorEffectPropertiesEmpty;
3289 }
3290 if (!effect->node_group->runtime->scene_compositor_effect_srna_data) {
3291 return RNA_SceneCompositorEffectPropertiesEmpty;
3292 }
3293 return effect->node_group->runtime->scene_compositor_effect_srna_data->properties_struct;
3294}
3295
3296static std::optional<std::string> rna_SceneCompositorEffectProperties_path(
3297 const PointerRNA *effect_ptr)
3298{
3299 const SceneCompositorEffect *effect = effect_ptr->data_as<SceneCompositorEffect>();
3300 return fmt::format("compositor_effects[\"{}\"].properties", BLI_str_escape(effect->name));
3301}
3302
3303static IDProperty **rna_SceneCompositorEffect_idprops(PointerRNA *effect_ptr)
3304{
3305 SceneCompositorEffect *effect = effect_ptr->data_as<SceneCompositorEffect>();
3306 return &effect->system_properties;
3307}
3308
3309static PointerRNA rna_SceneCompositorEffectProperties_get(PointerRNA *effect_ptr)
3310{
3311 SceneCompositorEffect *effect = effect_ptr->data_as<SceneCompositorEffect>();
3312 if (!effect->node_group) {
3313 return {};
3314 }
3315 return RNA_pointer_create_with_parent(*effect_ptr, RNA_SceneCompositorEffectProperties, effect);
3316}
3317
3318} // namespace blender
3319
3320#else
3321
3322namespace blender {
3323
3324/* Grease Pencil Interpolation tool settings */
3326{
3327 StructRNA *srna;
3328 PropertyRNA *prop;
3329
3330 srna = RNA_def_struct(brna, "GPencilInterpolateSettings", nullptr);
3331 RNA_def_struct_sdna(srna, "GP_Interpolate_Settings");
3333 "Grease Pencil Interpolate Settings",
3334 "Settings for Grease Pencil interpolation tools");
3336
3337 /* Custom curve-map. */
3338 prop = RNA_def_property(srna, "interpolation_curve", PROP_POINTER, PROP_NONE);
3339 RNA_def_property_pointer_sdna(prop, nullptr, "custom_ipo");
3340 RNA_def_property_struct_type(prop, "CurveMapping");
3342 prop,
3343 "Interpolation Curve",
3344 "Custom curve to control 'sequence' interpolation between Grease Pencil frames");
3345}
3346
3348{
3349 StructRNA *srna;
3350 PropertyRNA *prop;
3351
3352 srna = RNA_def_struct(brna, "TransformOrientation", nullptr);
3353
3354 prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
3355 RNA_def_property_float_sdna(prop, nullptr, "mat");
3358
3359 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
3360 RNA_def_struct_name_property(srna, prop);
3361 RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation");
3363}
3364
3366{
3367 StructRNA *srna;
3368 PropertyRNA *prop;
3369
3370 srna = RNA_def_struct(brna, "TransformOrientationSlot", nullptr);
3371 RNA_def_struct_sdna(srna, "TransformOrientationSlot");
3372 RNA_def_struct_path_func(srna, "rna_TransformOrientationSlot_path");
3373 RNA_def_struct_ui_text(srna, "Orientation Slot", "");
3374
3375 /* Orientations */
3376 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3379 "rna_TransformOrientationSlot_type_get",
3380 "rna_TransformOrientationSlot_type_set",
3381 "rna_TransformOrientation_with_scene_itemf");
3382 RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
3384
3385 prop = RNA_def_property(srna, "custom_orientation", PROP_POINTER, PROP_NONE);
3386 RNA_def_property_struct_type(prop, "TransformOrientation");
3388 prop, "rna_TransformOrientationSlot_get", nullptr, nullptr, nullptr);
3389 RNA_def_property_ui_text(prop, "Current Transform Orientation", "");
3390
3391 /* flag */
3392 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
3393 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SELECT);
3394 RNA_def_property_ui_text(prop, "Use", "Use scene orientation instead of a custom setting");
3396}
3397
3399{
3400 StructRNA *srna;
3401 PropertyRNA *prop;
3402
3403 srna = RNA_def_struct(brna, "View3DCursor", nullptr);
3404 RNA_def_struct_sdna(srna, "View3DCursor");
3405 RNA_def_struct_path_func(srna, "rna_View3DCursor_path");
3406 RNA_def_struct_ui_text(srna, "3D Cursor", "");
3407 RNA_def_struct_ui_icon(srna, ICON_CURSOR);
3409
3410 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ_LENGTH);
3412 RNA_def_property_float_sdna(prop, nullptr, "location");
3413 RNA_def_property_ui_text(prop, "Location", "");
3414 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
3415 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3416
3417 prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
3419 RNA_def_property_float_sdna(prop, nullptr, "rotation_quaternion");
3421 prop, "Quaternion Rotation", "Rotation in quaternions (keep normalized)");
3422 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3423
3424 prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
3426 RNA_def_property_array(prop, 4);
3428 "rna_View3DCursor_rotation_axis_angle_get",
3429 "rna_View3DCursor_rotation_axis_angle_set",
3430 nullptr);
3433 prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
3434 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3435
3436 prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
3438 RNA_def_property_float_sdna(prop, nullptr, "rotation_euler");
3439 RNA_def_property_ui_text(prop, "Euler Rotation", "3D rotation");
3441 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3442
3443 prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
3445 RNA_def_property_enum_sdna(prop, nullptr, "rotation_mode");
3447 RNA_def_property_enum_funcs(prop, nullptr, "rna_View3DCursor_rotation_mode_set", nullptr);
3449 prop,
3450 "Rotation Mode",
3451 /* This description is shared by other "rotation_mode" properties. */
3452 "The kind of rotation to apply, values from other rotation modes are not used");
3453 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3454
3455 /* Matrix access to avoid having to check current rotation mode. */
3456 prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
3458 RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */
3460 prop, "Transform Matrix", "Matrix combining location and rotation of the cursor");
3462 prop, "rna_View3DCursor_matrix_get", "rna_View3DCursor_matrix_set", nullptr);
3463 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3464}
3465
3467{
3468 StructRNA *srna;
3469 PropertyRNA *prop;
3470
3471 /* the construction of this enum is quite special - everything is stored as bitflags,
3472 * with 1st position only for on/off (and exposed as boolean), while others are mutually
3473 * exclusive options but which will only have any effect when autokey is enabled
3474 */
3475 static const EnumPropertyItem auto_key_items[] = {
3476 {AUTOKEY_MODE_NORMAL & ~AUTOKEY_ON, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
3477 {AUTOKEY_MODE_EDITKEYS & ~AUTOKEY_ON, "REPLACE_KEYS", 0, "Replace", ""},
3478 {0, nullptr, 0, nullptr, nullptr},
3479 };
3480
3481 static const EnumPropertyItem draw_groupuser_items[] = {
3482 {OB_DRAW_GROUPUSER_NONE, "NONE", 0, "None", ""},
3484 "ACTIVE",
3485 0,
3486 "Active",
3487 "Show vertices with no weights in the active group"},
3488 {OB_DRAW_GROUPUSER_ALL, "ALL", 0, "All", "Show vertices with no weights in any group"},
3489 {0, nullptr, 0, nullptr, nullptr},
3490 };
3491
3492 static const EnumPropertyItem vertex_group_select_items[] = {
3493 {WT_VGROUP_ALL, "ALL", 0, "All", "All Vertex Groups"},
3495 "BONE_DEFORM",
3496 0,
3497 "Deform",
3498 "Vertex Groups assigned to Deform Bones"},
3500 "OTHER_DEFORM",
3501 0,
3502 "Other",
3503 "Vertex Groups assigned to non Deform Bones"},
3504 {0, nullptr, 0, nullptr, nullptr},
3505 };
3506
3507 static const EnumPropertyItem gpencil_stroke_placement_items[] = {
3509 "ORIGIN",
3510 ICON_OBJECT_ORIGIN,
3511 "Origin",
3512 "Draw stroke at Object origin"},
3514 "CURSOR",
3515 ICON_PIVOT_CURSOR,
3516 "3D Cursor",
3517 "Draw stroke at 3D cursor location"},
3519 "SURFACE",
3520 ICON_SNAP_FACE,
3521 "Surface",
3522 "Stick stroke to surfaces"},
3524 "STROKE",
3525 ICON_STROKE,
3526 "Stroke",
3527 "Stick stroke to other strokes"},
3528 {0, nullptr, 0, nullptr, nullptr},
3529 };
3530
3531 static const EnumPropertyItem gpencil_stroke_snap_items[] = {
3532 {0, "NONE", 0, "All Points", "Snap to all points"},
3534 "ENDS",
3535 0,
3536 "End Points",
3537 "Snap to first and last points and interpolate"},
3538 {GP_PROJECT_DEPTH_STROKE_FIRST, "FIRST", 0, "First Point", "Snap to first point"},
3539 {0, nullptr, 0, nullptr, nullptr},
3540 };
3541
3542 static const EnumPropertyItem annotation_stroke_placement_view2d_items[] = {
3544 "IMAGE",
3545 ICON_IMAGE_DATA,
3546 "Image",
3547 "Stick stroke to the image"},
3548 /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
3549 {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
3550 {0, nullptr, 0, nullptr, nullptr},
3551 };
3552
3553 static const EnumPropertyItem annotation_stroke_placement_view3d_items[] = {
3555 "CURSOR",
3556 ICON_PIVOT_CURSOR,
3557 "3D Cursor",
3558 "Draw stroke at 3D cursor location"},
3559 /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
3560 {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
3562 "SURFACE",
3563 ICON_FACESEL,
3564 "Surface",
3565 "Stick stroke to surfaces"},
3566 {0, nullptr, 0, nullptr, nullptr},
3567 };
3568
3569 static const EnumPropertyItem uv_sticky_mode_items[] = {
3571 "DISABLED",
3572 ICON_STICKY_UVS_DISABLE,
3573 "Disabled",
3574 "Sticky vertex selection disabled"},
3576 "SHARED_LOCATION",
3577 ICON_STICKY_UVS_LOC,
3578 "Shared Location",
3579 "Select UVs that are at the same location and share a mesh vertex"},
3581 "SHARED_VERTEX",
3582 ICON_STICKY_UVS_VERT,
3583 "Shared Vertex",
3584 "Select UVs that share a mesh vertex, whether or not they are at the same location"},
3585 {0, nullptr, 0, nullptr, nullptr},
3586 };
3587
3588 srna = RNA_def_struct(brna, "ToolSettings", nullptr);
3589 RNA_def_struct_path_func(srna, "rna_ToolSettings_path");
3590 RNA_def_struct_ui_text(srna, "Tool Settings", "");
3591 /*
3592 * `STRUCT_UNDO` only applies to the top level attributes and not nested structs, any struct
3593 * contained within the `ToolSettings` struct should also clear this flag to avoid pushing empty
3594 * undo steps.
3595 */
3597
3598 prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
3599 RNA_def_property_struct_type(prop, "Sculpt");
3600 RNA_def_property_ui_text(prop, "Sculpt", "");
3601
3602 prop = RNA_def_property(srna, "curves_sculpt", PROP_POINTER, PROP_NONE);
3603 RNA_def_property_struct_type(prop, "CurvesSculpt");
3604 RNA_def_property_ui_text(prop, "Curves Sculpt", "");
3605
3606 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
3608 RNA_def_property_boolean_sdna(prop, nullptr, "auto_normalize", 1);
3610 "Weight Paint Auto-Normalize",
3611 "Ensure all bone-deforming vertex groups add up "
3612 "to 1.0 while weight painting or assigning to vertices");
3613 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3614
3615 prop = RNA_def_property(srna, "use_lock_relative", PROP_BOOLEAN, PROP_NONE);
3617 RNA_def_property_boolean_sdna(prop, nullptr, "wpaint_lock_relative", 1);
3619 "Weight Paint Lock-Relative",
3620 "Display bone-deforming groups as if all locked deform groups "
3621 "were deleted, and the remaining ones were re-normalized");
3622 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3623
3624 prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
3626 RNA_def_property_boolean_sdna(prop, nullptr, "multipaint", 1);
3628 "Weight Paint Multi-Paint",
3629 "Paint across the weights of all selected bones, "
3630 "maintaining their relative influence");
3631 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3632
3633 prop = RNA_def_property(srna, "vertex_group_user", PROP_ENUM, PROP_NONE);
3635 RNA_def_property_enum_sdna(prop, nullptr, "weightuser");
3636 RNA_def_property_enum_items(prop, draw_groupuser_items);
3638 RNA_def_property_ui_text(prop, "Mask Non-Group Vertices", "Display unweighted vertices");
3639 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3640
3641 prop = RNA_def_property(srna, "vertex_group_subset", PROP_ENUM, PROP_NONE);
3643 RNA_def_property_enum_sdna(prop, nullptr, "vgroupsubset");
3644 RNA_def_property_enum_items(prop, vertex_group_select_items);
3645 RNA_def_property_ui_text(prop, "Subset", "Filter Vertex groups for Display");
3646 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3647
3648 prop = RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
3649 RNA_def_property_pointer_sdna(prop, nullptr, "vpaint");
3650 RNA_def_property_ui_text(prop, "Vertex Paint", "");
3651
3652 prop = RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
3653 RNA_def_property_pointer_sdna(prop, nullptr, "wpaint");
3654 RNA_def_property_ui_text(prop, "Weight Paint", "");
3655
3656 prop = RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
3657 RNA_def_property_pointer_sdna(prop, nullptr, "imapaint");
3658 RNA_def_property_ui_text(prop, "Image Paint", "");
3659
3660 prop = RNA_def_property(srna, "paint_mode", PROP_POINTER, PROP_NONE);
3661 RNA_def_property_pointer_sdna(prop, nullptr, "paint_mode");
3662 RNA_def_property_ui_text(prop, "Paint Mode", "");
3663
3664 prop = RNA_def_property(srna, "uv_sculpt", PROP_POINTER, PROP_NONE);
3665 RNA_def_property_pointer_sdna(prop, nullptr, "uvsculpt");
3666 RNA_def_property_ui_text(prop, "UV Sculpt", "");
3667
3668 prop = RNA_def_property(srna, "gpencil_paint", PROP_POINTER, PROP_NONE);
3669 RNA_def_property_pointer_sdna(prop, nullptr, "gp_paint");
3670 RNA_def_property_ui_text(prop, "Grease Pencil Paint", "");
3671
3672 prop = RNA_def_property(srna, "gpencil_vertex_paint", PROP_POINTER, PROP_NONE);
3673 RNA_def_property_pointer_sdna(prop, nullptr, "gp_vertexpaint");
3674 RNA_def_property_ui_text(prop, "Grease Pencil Vertex Paint", "");
3675
3676 prop = RNA_def_property(srna, "gpencil_sculpt_paint", PROP_POINTER, PROP_NONE);
3677 RNA_def_property_pointer_sdna(prop, nullptr, "gp_sculptpaint");
3678 RNA_def_property_ui_text(prop, "Grease Pencil Sculpt Paint", "");
3679
3680 prop = RNA_def_property(srna, "gpencil_weight_paint", PROP_POINTER, PROP_NONE);
3681 RNA_def_property_pointer_sdna(prop, nullptr, "gp_weightpaint");
3682 RNA_def_property_ui_text(prop, "Grease Pencil Weight Paint", "");
3683
3684 prop = RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
3685 RNA_def_property_pointer_sdna(prop, nullptr, "particle");
3686 RNA_def_property_ui_text(prop, "Particle Edit", "");
3687
3688 prop = RNA_def_property(srna, "uv_sculpt_lock_borders", PROP_BOOLEAN, PROP_NONE);
3689 RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_LOCK_BORDERS);
3691 RNA_def_property_ui_text(prop, "Lock Borders", "Disable editing of boundary edges");
3692
3693 prop = RNA_def_property(srna, "uv_sculpt_all_islands", PROP_BOOLEAN, PROP_NONE);
3694 RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_ALL_ISLANDS);
3696 RNA_def_property_ui_text(prop, "Sculpt All Islands", "Brush operates on all islands");
3697
3698 prop = RNA_def_property(srna, "lock_object_mode", PROP_BOOLEAN, PROP_NONE);
3699 RNA_def_property_boolean_sdna(prop, nullptr, "object_flag", SCE_OBJECT_MODE_LOCK);
3702 "Lock Object Modes",
3703 "Restrict selection to objects using the same mode as the active "
3704 "object, to prevent accidental mode switch when selecting");
3706
3707 static const EnumPropertyItem workspace_tool_items[] = {
3708 {SCE_WORKSPACE_TOOL_DEFAULT, "DEFAULT", 0, "Active Tool", ""},
3709 {SCE_WORKSPACE_TOOL_FALLBACK, "FALLBACK", 0, "Select", ""},
3710 {0, nullptr, 0, nullptr, nullptr},
3711 };
3712
3713 prop = RNA_def_property(srna, "workspace_tool_type", PROP_ENUM, PROP_NONE);
3714 RNA_def_property_enum_sdna(prop, nullptr, "workspace_tool_type");
3716 RNA_def_property_enum_items(prop, workspace_tool_items);
3718 RNA_def_property_ui_text(prop, "Drag", "Action when dragging in the viewport");
3719
3720 /* Transform */
3721 prop = RNA_def_property(srna, "use_proportional_edit", PROP_BOOLEAN, PROP_NONE);
3722 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_USE);
3724 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional edit mode");
3725 RNA_def_property_ui_icon(prop, ICON_PROP_ON, 0);
3726 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3727
3728 prop = RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
3729 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_objects", 0);
3732 prop, "Proportional Editing Objects", "Proportional editing object mode");
3733 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3734 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3735
3736 prop = RNA_def_property(srna, "use_proportional_projected", PROP_BOOLEAN, PROP_NONE);
3737 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_PROJECTED);
3740 prop, "Projected from View", "Proportional Editing using screen space locations");
3741 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3742
3743 prop = RNA_def_property(srna, "use_proportional_connected", PROP_BOOLEAN, PROP_NONE);
3744 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_CONNECTED);
3747 prop, "Connected Only", "Proportional Editing using connected geometry only");
3748 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3749
3750 prop = RNA_def_property(srna, "use_proportional_edit_mask", PROP_BOOLEAN, PROP_NONE);
3751 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_mask", 0);
3753 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing mask mode");
3754 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3755 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3756
3757 prop = RNA_def_property(srna, "use_proportional_action", PROP_BOOLEAN, PROP_NONE);
3758 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_action", 0);
3761 prop, "Proportional Editing Actions", "Proportional editing in action editor");
3762 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3763 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3764
3765 prop = RNA_def_property(srna, "use_proportional_fcurve", PROP_BOOLEAN, PROP_NONE);
3766 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_fcurve", 0);
3769 prop, "Proportional Editing F-Curves", "Proportional editing in F-Curve editor");
3770 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3771 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3772
3773 prop = RNA_def_property(srna, "lock_markers", PROP_BOOLEAN, PROP_NONE);
3774 RNA_def_property_boolean_sdna(prop, nullptr, "lock_markers", 0);
3776 RNA_def_property_ui_text(prop, "Lock Markers", "Prevent marker editing");
3777
3778 prop = RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
3779 RNA_def_property_enum_sdna(prop, nullptr, "prop_mode");
3783 prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
3784 /* Abusing id_curve :/ */
3786 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3787
3788 prop = RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_NONE);
3789 RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
3792 prop, "Proportional Size", "Display size for proportional editing circle");
3793 RNA_def_property_range(prop, 0.00001, 5000.0);
3794
3795 prop = RNA_def_property(srna, "proportional_distance", PROP_FLOAT, PROP_DISTANCE);
3796 RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
3799 prop, "Proportional Size", "Display size for proportional editing circle");
3800 RNA_def_property_range(prop, 0.00001, 5000.0);
3801
3802 prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE);
3803 RNA_def_property_float_sdna(prop, nullptr, "doublimit");
3805 RNA_def_property_ui_text(prop, "Merge Threshold", "Threshold distance for Auto Merge");
3806 RNA_def_property_range(prop, 0.0, 1.0);
3807 RNA_def_property_ui_range(prop, 0.0, 0.1, 0.01, 6);
3808
3809 /* Pivot Point */
3810 prop = RNA_def_property(srna, "transform_pivot_point", PROP_ENUM, PROP_NONE);
3811 RNA_def_property_enum_sdna(prop, nullptr, "transform_pivot_point");
3814 RNA_def_property_ui_text(prop, "Transform Pivot Point", "Pivot center for rotation/scaling");
3816
3817 prop = RNA_def_property(srna, "use_transform_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
3818 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_AXIS_ALIGN);
3821 prop,
3822 "Only Locations",
3823 "Only transform object locations, without affecting rotation or scaling");
3825
3826 prop = RNA_def_property(srna, "use_transform_data_origin", PROP_BOOLEAN, PROP_NONE);
3827 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_DATA_ORIGIN);
3830 prop, "Transform Origins", "Transform object origins, while leaving the shape in place");
3832
3833 prop = RNA_def_property(srna, "use_transform_skip_children", PROP_BOOLEAN, PROP_NONE);
3834 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_SKIP_CHILDREN);
3837 prop, "Transform Parents", "Transform the parents, leaving the children in place");
3839
3840 prop = RNA_def_property(srna, "use_transform_data_pivot", PROP_BOOLEAN, PROP_NONE);
3841 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_SCULPT_PIVOT);
3844 prop, "Transform Pivot", "Transform sculpt pivot, while leaving the shape in place");
3846
3847 prop = RNA_def_property(srna, "use_transform_correct_face_attributes", PROP_BOOLEAN, PROP_NONE);
3848 RNA_def_property_boolean_sdna(prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT);
3851 "Correct Face Attributes",
3852 "Correct data such as UVs and color attributes when transforming");
3854
3855 prop = RNA_def_property(srna, "use_transform_correct_keep_connected", PROP_BOOLEAN, PROP_NONE);
3857 prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED);
3860 prop,
3861 "Keep Connected",
3862 "During the Face Attributes correction, merge attributes connected to the same vertex");
3864
3865 prop = RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
3866 RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE);
3869 prop, "Auto Merge Vertices", "Automatically merge vertices moved to the same location");
3870 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3871 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3872
3873 prop = RNA_def_property(srna, "use_mesh_automerge_and_split", PROP_BOOLEAN, PROP_NONE);
3874 RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE_AND_SPLIT);
3876 RNA_def_property_ui_text(prop, "Split Edges & Faces", "Automatically split edges and faces");
3877 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3878 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3879
3880 prop = RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
3881 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP);
3883 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
3884 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3885 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3886
3887 prop = RNA_def_property(srna, "use_snap_node", PROP_BOOLEAN, PROP_NONE);
3888 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_node", SCE_SNAP);
3890 RNA_def_property_ui_text(prop, "Snap", "Snap Node during transform");
3891 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3892 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3893
3894 prop = RNA_def_property(srna, "use_snap_sequencer", PROP_BOOLEAN, PROP_NONE);
3895 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_seq", SCE_SNAP);
3897 RNA_def_property_ui_text(prop, "Use Snapping", "Snap strips during transform");
3898 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3899 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* Publish message-bus. */
3900
3901 prop = RNA_def_property(srna, "use_snap_uv", PROP_BOOLEAN, PROP_NONE);
3902 RNA_def_property_boolean_sdna(prop, nullptr, "snap_uv_flag", SCE_SNAP);
3904 RNA_def_property_ui_text(prop, "Snap", "Snap UV during transform");
3905 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3906 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3907
3908 prop = RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
3909 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ROTATE);
3912 prop, "Align Rotation to Target", "Align rotation with the snapping target");
3913 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3914
3915 prop = RNA_def_property(srna, "use_snap_grid_absolute", PROP_BOOLEAN, PROP_NONE);
3916 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ABS_GRID);
3919 prop,
3920 "Absolute Increment Snap",
3921 "Absolute grid alignment while translating (based on the pivot center)");
3922 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3923
3924 prop = RNA_def_property(srna, "snap_angle_increment_2d", PROP_FLOAT, PROP_ANGLE);
3925 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_2d");
3927 prop, "Rotation Increment", "Angle used for rotation increments in 2D editors");
3928 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3929 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 100.0f, 2);
3930 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3931
3932 prop = RNA_def_property(srna, "snap_angle_increment_2d_precision", PROP_FLOAT, PROP_ANGLE);
3933 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_2d_precision");
3935 "Rotation Precision Increment",
3936 "Precision angle used for rotation increments in 2D editors");
3937 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3938 RNA_def_property_ui_range(prop, DEG2RADF(0.1f), DEG2RADF(180.0f), 10.0f, 3);
3939 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3940
3941 prop = RNA_def_property(srna, "snap_angle_increment_3d", PROP_FLOAT, PROP_ANGLE);
3942 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_3d");
3944 prop, "Rotation Increment", "Angle used for rotation increments in 3D editors");
3945 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3946 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 100.0f, 2);
3947 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3948
3949 prop = RNA_def_property(srna, "snap_angle_increment_3d_precision", PROP_FLOAT, PROP_ANGLE);
3950 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_3d_precision");
3952 "Rotation Precision Increment",
3953 "Precision angle used for rotation increments in 3D editors");
3954 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3955 RNA_def_property_ui_range(prop, DEG2RADF(0.1f), DEG2RADF(180.0f), 10.0f, 3);
3956 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3957
3958 prop = RNA_def_property(srna, "snap_elements", PROP_ENUM, PROP_NONE);
3959 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3963 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3964 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
3965 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3966
3967 prop = RNA_def_property(srna, "snap_elements_base", PROP_ENUM, PROP_NONE);
3968 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3972 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3974 prop, "Snap Element", "Type of element for the \"Snap Base\" to snap to");
3975 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3976
3977 prop = RNA_def_property(srna, "snap_elements_individual", PROP_ENUM, PROP_NONE);
3978 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3982 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3984 prop, "Project Mode", "Type of element for individual transformed elements to snap to");
3985 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3986
3987 prop = RNA_def_property(srna, "snap_face_nearest_steps", PROP_INT, PROP_FACTOR);
3988 RNA_def_property_int_sdna(prop, nullptr, "snap_face_nearest_steps");
3990 RNA_def_property_range(prop, 1, 100);
3992 prop,
3993 "Face Nearest Steps",
3994 "Number of steps to break transformation into for face nearest snapping");
3995
3996 prop = RNA_def_property(srna, "use_snap_to_same_target", PROP_BOOLEAN, PROP_NONE);
4000 prop,
4001 "Snap to Same Target",
4002 "Snap only to target that source was initially near (\"Face Nearest\" only)");
4003
4004 prop = RNA_def_property(srna, "use_snap_anim", PROP_BOOLEAN, PROP_NONE);
4005 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP);
4007 RNA_def_property_ui_text(prop, "Snap", "Enable snapping when transforming keyframes");
4008 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
4009 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4010
4011 prop = RNA_def_property(srna, "use_snap_driver", PROP_BOOLEAN, PROP_NONE);
4012 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_driver", SCE_SNAP);
4015 prop, "Snap", "Enable snapping when transforming keys in the Driver Editor");
4016 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
4017 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4018
4019 prop = RNA_def_property(srna, "use_snap_time_absolute", PROP_BOOLEAN, PROP_NONE);
4020 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP_ABS_TIME_STEP);
4023 prop, "Absolute Time Snap", "Absolute time alignment when transforming keyframes");
4024 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4025
4026 prop = RNA_def_property(srna, "use_snap_driver_absolute", PROP_BOOLEAN, PROP_NONE);
4027 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_driver", SCE_SNAP_ABS_TIME_STEP);
4029 RNA_def_property_ui_text(prop, "Absolute Snap", "Snap to full values");
4030 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4031
4032 prop = RNA_def_property(srna, "snap_anim_element", PROP_ENUM, PROP_NONE);
4033 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_anim_mode");
4036 RNA_def_property_ui_text(prop, "Snap Animation Element", "Type of element to snap to");
4038 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4039
4040 prop = RNA_def_property(srna, "use_snap_playhead", PROP_BOOLEAN, PROP_NONE);
4041 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_playhead", SCE_SNAP);
4042 RNA_def_property_ui_icon(prop, ICON_PLAYHEAD_SNAP_OFF, 1);
4044 RNA_def_property_ui_text(prop, "Use Snapping", "Snap playhead when scrubbing");
4047
4048 prop = RNA_def_property(srna, "snap_playhead_element", PROP_ENUM, PROP_NONE);
4049 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_playhead_mode");
4053 RNA_def_property_ui_text(prop, "Snap Playhead Element", "Type of element to snap to");
4056
4057 prop = RNA_def_property(srna, "snap_playhead_frame_step", PROP_INT, PROP_NONE);
4058 RNA_def_property_int_sdna(prop, nullptr, "snap_step_frames");
4059 RNA_def_property_range(prop, 1, 32768);
4060 RNA_def_property_ui_text(prop, "Frame Step", "At which interval to snap to frames");
4062
4063 prop = RNA_def_property(srna, "snap_playhead_second_step", PROP_INT, PROP_NONE);
4064 RNA_def_property_int_sdna(prop, nullptr, "snap_step_seconds");
4065 RNA_def_property_ui_text(prop, "Second Step", "At which interval to snap to seconds");
4066 RNA_def_property_range(prop, 1, 32768);
4068
4069 prop = RNA_def_property(srna, "playhead_snap_distance", PROP_INT, PROP_PIXEL);
4070 RNA_def_property_int_sdna(prop, nullptr, "playhead_snap_distance");
4071 RNA_def_property_ui_range(prop, 1, 100, 1, 1);
4072 RNA_def_property_ui_text(prop, "Snap Distance", "Maximum distance for snapping in pixels");
4073
4074 /* image editor uses its own set of snap modes */
4075 prop = RNA_def_property(srna, "snap_uv_element", PROP_ENUM, PROP_NONE);
4076 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_uv_mode");
4078 RNA_def_property_enum_funcs(prop, nullptr, "rna_ToolSettings_snap_uv_mode_set", nullptr);
4080 RNA_def_property_ui_text(prop, "Snap UV Element", "Type of element to snap to");
4081 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4082
4083 /* TODO(@gfxcoder): Rename `snap_target` to `snap_source` to avoid previous ambiguity of "target"
4084 * (now, "source" is geometry to be moved and "target" is geometry to which moved geometry is
4085 * snapped). */
4086 prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
4087 RNA_def_property_enum_sdna(prop, nullptr, "snap_target");
4090 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
4091 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4092
4093 prop = RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
4094 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_PEEL_OBJECT);
4097 prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
4098 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4099
4100 prop = RNA_def_property(srna, "use_snap_backface_culling", PROP_BOOLEAN, PROP_NONE);
4101 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_BACKFACE_CULLING);
4103 RNA_def_property_ui_text(prop, "Backface Culling", "Exclude back facing geometry from snapping");
4104 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4105
4106 /* TODO(@gfxcoder): Rename `use_snap_self` to `use_snap_active`, because active is correct but
4107 * self is not (breaks API). This only makes a difference when more than one mesh is edited. */
4108 prop = RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
4112 prop, "Snap onto Active", "Snap onto itself only if enabled (edit mode only)");
4113 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4114
4115 prop = RNA_def_property(srna, "use_snap_edit", PROP_BOOLEAN, PROP_NONE);
4116 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_TO_INCLUDE_EDITED);
4119 prop, "Snap onto Edited", "Snap onto non-active objects in edit mode (edit mode only)");
4120 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4121
4122 prop = RNA_def_property(srna, "use_snap_nonedit", PROP_BOOLEAN, PROP_NONE);
4126 prop, "Snap onto Non-edited", "Snap onto objects not in edit mode (edit mode only)");
4127 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4128
4129 prop = RNA_def_property(srna, "use_snap_selectable", PROP_BOOLEAN, PROP_NONE);
4133 prop, "Snap onto Selectable Only", "Snap only onto objects that are selectable");
4134 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4135
4136 prop = RNA_def_property(srna, "use_snap_translate", PROP_BOOLEAN, PROP_NONE);
4138 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_TRANSLATE);
4141 prop, "Use Snap for Translation", "Move is affected by snapping settings");
4142 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4143
4144 prop = RNA_def_property(srna, "use_snap_rotate", PROP_BOOLEAN, PROP_NONE);
4146 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_ROTATE);
4150 prop, "Use Snap for Rotation", "Rotate is affected by the snapping settings");
4151 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4152
4153 prop = RNA_def_property(srna, "use_snap_scale", PROP_BOOLEAN, PROP_NONE);
4155 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_SCALE);
4158 RNA_def_property_ui_text(prop, "Use Snap for Scale", "Scale is affected by snapping settings");
4159 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4160
4161 prop = RNA_def_property(srna, "plane_axis", PROP_ENUM, PROP_NONE);
4162 RNA_def_property_enum_sdna(prop, nullptr, "plane_axis");
4166 RNA_def_property_ui_text(prop, "Plane Axis", "The axis used for placing the base region");
4167
4168 prop = RNA_def_property(srna, "plane_axis_auto", PROP_BOOLEAN, PROP_NONE);
4169 RNA_def_property_boolean_sdna(prop, nullptr, "use_plane_axis_auto", 1);
4173 "Auto Axis",
4174 "Select the closest axis when placing objects "
4175 "(surface overrides)");
4176
4177 prop = RNA_def_property(srna, "plane_depth", PROP_ENUM, PROP_NONE);
4178 RNA_def_property_enum_sdna(prop, nullptr, "plane_depth");
4182 RNA_def_property_ui_text(prop, "Position", "The initial depth used when placing the cursor");
4183
4184 prop = RNA_def_property(srna, "plane_orientation", PROP_ENUM, PROP_NONE);
4185 RNA_def_property_enum_sdna(prop, nullptr, "plane_orient");
4189 RNA_def_property_ui_text(prop, "Orientation", "The initial depth used when placing the cursor");
4190
4191 prop = RNA_def_property(srna, "snap_elements_tool", PROP_ENUM, PROP_NONE);
4192 RNA_def_property_enum_sdna(prop, nullptr, "snap_mode_tools");
4196 RNA_def_property_ui_text(prop, "Snap to", "The target to use while snapping");
4197
4198 /* Grease Pencil */
4199 prop = RNA_def_property(srna, "use_gpencil_draw_additive", PROP_BOOLEAN, PROP_NONE);
4200 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_RETAIN_LAST);
4203 "Use Additive Drawing",
4204 "When creating new frames, the strokes from the previous/active frame "
4205 "are included as the basis for the new one");
4207
4208 prop = RNA_def_property(srna, "use_gpencil_draw_onback", PROP_BOOLEAN, PROP_NONE);
4209 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_PAINT_ONBACK);
4212 prop, "Draw Strokes on Back", "New strokes are drawn below of all strokes in the layer");
4214
4215 prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE);
4217 prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_THUMBNAIL_LIST);
4220 prop, "Compact List", "Show compact list of colors instead of thumbnails");
4222
4223 prop = RNA_def_property(srna, "use_gpencil_weight_data_add", PROP_BOOLEAN, PROP_NONE);
4224 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_CREATE_WEIGHTS);
4227 "Add weight data for new strokes",
4228 "Weight data for new strokes is added according to the current vertex "
4229 "group and weight. If no vertex group selected, weight is not added.");
4231
4232 prop = RNA_def_property(srna, "use_gpencil_automerge_strokes", PROP_BOOLEAN, PROP_NONE);
4233 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_AUTOMERGE_STROKE);
4236 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
4238 prop,
4239 "Automerge",
4240 "Join the last drawn stroke with previous strokes in the active layer by distance");
4243
4244 prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE);
4245 RNA_def_property_pointer_sdna(prop, nullptr, "gp_sculpt");
4247 RNA_def_property_struct_type(prop, "GPencilSculptSettings");
4249 prop, "Grease Pencil Sculpt", "Settings for stroke sculpting tools and brushes");
4250
4251 prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE);
4252 RNA_def_property_pointer_sdna(prop, nullptr, "gp_interpolate");
4254 RNA_def_property_struct_type(prop, "GPencilInterpolateSettings");
4256 prop, "Grease Pencil Interpolate", "Settings for Grease Pencil interpolation tools");
4257
4258 /* Grease Pencil - 3D View Stroke Placement */
4259 prop = RNA_def_property(srna, "gpencil_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
4260 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
4262 RNA_def_property_enum_items(prop, gpencil_stroke_placement_items);
4263 RNA_def_property_ui_text(prop, "Stroke Placement (3D View)", "");
4264 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4265
4266 prop = RNA_def_property(srna, "gpencil_stroke_snap_mode", PROP_ENUM, PROP_NONE);
4267 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
4269 RNA_def_property_enum_items(prop, gpencil_stroke_snap_items);
4270 RNA_def_property_ui_text(prop, "Stroke Snap", "");
4271 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4272
4273 prop = RNA_def_property(srna, "gpencil_surface_offset", PROP_FLOAT, PROP_DISTANCE);
4274 RNA_def_property_float_sdna(prop, nullptr, "gpencil_surface_offset");
4277 prop, "Surface Offset", "Offset along the normal when drawing on surfaces");
4279 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 3);
4280 RNA_def_property_float_default(prop, 0.150f);
4281
4282 prop = RNA_def_property(srna, "use_gpencil_project_only_selected", PROP_BOOLEAN, PROP_NONE);
4284 prop, nullptr, "gpencil_v3d_align", GP_PROJECT_DEPTH_ONLY_SELECTED);
4287 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
4288 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4289
4290 /* Grease Pencil - Select mode Edit */
4291 prop = RNA_def_property(srna, "gpencil_selectmode_edit", PROP_ENUM, PROP_NONE);
4292 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_selectmode_edit");
4295 RNA_def_property_ui_text(prop, "Select Mode", "");
4299
4300 /* Grease Pencil - Select mode Sculpt */
4301 prop = RNA_def_property(srna, "use_gpencil_select_mask_point", PROP_BOOLEAN, PROP_NONE);
4303 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_POINT);
4305 RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points");
4306 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
4309 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_point_update");
4310
4311 prop = RNA_def_property(srna, "use_gpencil_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
4313 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_STROKE);
4315 RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected strokes");
4316 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
4319 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_stroke_update");
4320
4321 prop = RNA_def_property(srna, "use_gpencil_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
4323 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_SEGMENT);
4326 prop, "Selection Mask", "Only sculpt selected stroke points between other strokes");
4327 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
4330 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_segment_update");
4331
4332 /* Grease Pencil - Select mode Vertex Paint */
4333 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_point", PROP_BOOLEAN, PROP_NONE);
4335 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_POINT);
4337 RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected stroke points");
4338 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
4342 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_point_update");
4343
4344 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
4346 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_STROKE);
4348 RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected strokes");
4349 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
4353 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_stroke_update");
4354
4355 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
4357 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_SEGMENT);
4360 prop, "Selection Mask", "Only paint selected stroke points between other strokes");
4361 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
4365 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_segment_update");
4366
4367 prop = RNA_def_property(srna, "use_grease_pencil_multi_frame_editing", PROP_BOOLEAN, PROP_NONE);
4368 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_USE_MULTI_FRAME_EDITING);
4370 RNA_def_property_ui_text(prop, "Multi-frame Editing", "Enable multi-frame editing");
4371 RNA_def_property_ui_icon(prop, ICON_GP_MULTIFRAME_EDITING, 0);
4373 /* FIXME: We shouldn't have to tag all the Grease Pencil IDs for an update! */
4375 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_all_grease_pencil_update");
4376
4377 /* Annotations - 2D Views Stroke Placement */
4378 prop = RNA_def_property(srna, "annotation_stroke_placement_view2d", PROP_ENUM, PROP_NONE);
4379 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v2d_align");
4381 RNA_def_property_enum_items(prop, annotation_stroke_placement_view2d_items);
4382 RNA_def_property_ui_text(prop, "Stroke Placement (2D View)", "");
4383 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4384
4385 /* Annotations - 3D View Stroke Placement */
4386 /* XXX: Do we need to decouple the stroke_endpoints setting too? */
4387 prop = RNA_def_property(srna, "annotation_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
4388 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "annotate_v3d_align");
4390 RNA_def_property_enum_items(prop, annotation_stroke_placement_view3d_items);
4393 "Annotation Stroke Placement (3D View)",
4394 "How annotation strokes are orientated in 3D space");
4395 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4396
4397 prop = RNA_def_property(srna, "use_annotation_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
4399 prop, nullptr, "annotate_v3d_align", GP_PROJECT_DEPTH_STROKE_ENDPOINTS);
4402 prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");
4403 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4404
4405 prop = RNA_def_property(srna, "use_annotation_project_only_selected", PROP_BOOLEAN, PROP_NONE);
4407 prop, nullptr, "annotate_v3d_align", GP_PROJECT_DEPTH_ONLY_SELECTED);
4410 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
4411 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4412
4413 /* Annotations - Stroke Thickness */
4414 prop = RNA_def_property(srna, "annotation_thickness", PROP_INT, PROP_PIXEL);
4415 RNA_def_property_int_sdna(prop, nullptr, "annotate_thickness");
4417 RNA_def_property_range(prop, 1, 10);
4418 RNA_def_property_ui_text(prop, "Annotation Stroke Thickness", "Thickness of annotation strokes");
4419 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4420
4421 /* Auto Keying */
4422 prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
4423 RNA_def_property_boolean_sdna(prop, nullptr, "autokey_mode", AUTOKEY_ON);
4426 prop, "Auto Keying", "Automatically insert keyframes on modified properties");
4427 RNA_def_property_ui_icon(prop, ICON_RECORD_OFF, 1);
4429
4430 prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
4431 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "autokey_mode");
4433 RNA_def_property_enum_items(prop, auto_key_items);
4435 prop,
4436 "Auto-Keying Mode",
4437 "Can add additional constraints on when auto keying can insert keyframes");
4438
4439 prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
4440 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_LAYERED_RECORD);
4443 prop,
4444 "Layered",
4445 "Add a new NLA Track + Strip for every loop/pass made over the animation "
4446 "to allow non-destructive tweaking");
4447
4448 prop = RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
4449 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
4452 "Auto Keyframe Insert Keying Set",
4453 "Automatic keyframe insertion using active Keying Set only");
4454 RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0);
4455
4456 prop = RNA_def_property(srna, "use_keyframe_cycle_aware", PROP_BOOLEAN, PROP_NONE);
4457 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", KEYING_FLAG_CYCLEAWARE);
4460 prop,
4461 "Cycle-Aware Keying",
4462 "For channels with cyclic extrapolation, keyframe insertion is automatically "
4463 "remapped inside the cycle time range, and keeps ends in sync. Curves newly added to "
4464 "actions with a Manual Frame Range and Cyclic Animation are automatically made cyclic.");
4465
4466 /* Keyframing */
4467 prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE);
4468 RNA_def_property_enum_sdna(prop, nullptr, "keyframe_type");
4472 prop, "New Keyframe Type", "Type of keyframes to create when inserting keyframes");
4475
4476 /* Animation */
4477 prop = RNA_def_property(srna, "anim_mirror_object", PROP_POINTER, PROP_NONE);
4479 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
4481 "Mirror Object",
4482 "Object to mirror over. Leave empty and name a bone to always mirror "
4483 "over that bone of the active armature");
4484
4485 prop = RNA_def_property(srna, "anim_mirror_bone", PROP_STRING, PROP_NONE);
4486 RNA_def_struct_name_property(srna, prop);
4487 RNA_def_property_ui_text(prop, "Mirror Bone", "Bone to use for the mirroring");
4488
4489 prop = RNA_def_property(srna, "anim_relative_object", PROP_POINTER, PROP_NONE);
4491 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
4492 RNA_def_property_ui_text(prop, "Relative Object", "Object to which matrices are made relative");
4493
4494 prop = RNA_def_property(srna, "anim_fix_to_cam_use_loc", PROP_BOOLEAN, PROP_NONE);
4495 RNA_def_property_boolean_sdna(prop, nullptr, "fix_to_cam_flag", FIX_TO_CAM_FLAG_USE_LOC);
4497 prop, "Use Location for Camera Fix", "Create location keys when fixing to the scene camera");
4498
4499 prop = RNA_def_property(srna, "anim_fix_to_cam_use_rot", PROP_BOOLEAN, PROP_NONE);
4500 RNA_def_property_boolean_sdna(prop, nullptr, "fix_to_cam_flag", FIX_TO_CAM_FLAG_USE_ROT);
4502 prop, "Use Rotation for Camera Fix", "Create rotation keys when fixing to the scene camera");
4503
4504 prop = RNA_def_property(srna, "anim_fix_to_cam_use_scale", PROP_BOOLEAN, PROP_NONE);
4505 RNA_def_property_boolean_sdna(prop, nullptr, "fix_to_cam_flag", FIX_TO_CAM_FLAG_USE_SCALE);
4507 prop, "Use Scale for Camera Fix", "Create scale keys when fixing to the scene camera");
4508
4509 /* UV */
4510 prop = RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
4511 RNA_def_property_enum_sdna(prop, nullptr, "uv_selectmode");
4514 /* Tracked by edit-mode undo. */
4517 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
4519 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_select_mode_update");
4520
4521 prop = RNA_def_property(srna, "uv_sticky_select_mode", PROP_ENUM, PROP_NONE);
4522 RNA_def_property_enum_sdna(prop, nullptr, "uv_sticky");
4525 /* Tracked by edit-mode undo. */
4527 RNA_def_property_enum_items(prop, uv_sticky_mode_items);
4529 prop, "Sticky Selection Mode", "Method for extending UV vertex selection");
4532 prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_sticky_select_mode_update");
4533
4534 prop = RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
4535 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_FLAG_SELECT_SYNC);
4538 /* Tracked by edit-mode undo. */
4541 prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
4542 RNA_def_property_ui_icon(prop, ICON_UV_SYNC_SELECT, 0);
4544 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_select_sync_update");
4545
4546 prop = RNA_def_property(srna, "use_uv_select_island", PROP_BOOLEAN, PROP_NONE);
4547 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_FLAG_SELECT_ISLAND);
4550 /* Tracked by edit-mode undo. */
4552 RNA_def_property_ui_text(prop, "UV Island Selection", "Island selection");
4553 RNA_def_property_ui_icon(prop, ICON_UV_ISLANDSEL, 0);
4555
4556 prop = RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
4557 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_FLAG_SHOW_SAME_IMAGE);
4560 prop, "UV Local View", "Display only faces with the currently displayed image assigned");
4562
4563 prop = RNA_def_property(srna, "use_uv_custom_region", PROP_BOOLEAN, PROP_NONE);
4564 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_FLAG_CUSTOM_REGION);
4566 RNA_def_property_ui_text(prop, "UV Custom Region", "Custom defined region");
4568
4569 /* Mesh */
4570 prop = RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
4571 RNA_def_property_boolean_bitset_array_sdna(prop, nullptr, "selectmode", 1 << 0, 3);
4574 /* Tracked by edit-mode undo. */
4576 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Scene_editmesh_select_mode_set");
4577 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
4579 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
4580
4581 prop = RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
4582 RNA_def_property_float_sdna(prop, nullptr, "vgroup_weight");
4584 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
4585
4586 prop = RNA_def_property(srna, "use_edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
4587 RNA_def_property_boolean_sdna(prop, nullptr, "edge_mode_live_unwrap", 1);
4589 RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edge seams recalculates UV unwrap");
4590
4591 prop = RNA_def_property(srna, "normal_vector", PROP_FLOAT, PROP_XYZ);
4592 RNA_def_property_ui_text(prop, "Normal Vector", "Normal vector used to copy, add or multiply");
4593 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, 3);
4594
4595 /* Curve Paint Settings */
4596 prop = RNA_def_property(srna, "curve_paint_settings", PROP_POINTER, PROP_NONE);
4598 RNA_def_property_struct_type(prop, "CurvePaintSettings");
4599 RNA_def_property_ui_text(prop, "Curve Paint Settings", nullptr);
4600
4601 /* Mesh Statistics */
4602 prop = RNA_def_property(srna, "statvis", PROP_POINTER, PROP_NONE);
4604 RNA_def_property_struct_type(prop, "MeshStatVis");
4605 RNA_def_property_ui_text(prop, "Mesh Statistics Visualization", nullptr);
4606
4607 /* CurveProfile */
4608 prop = RNA_def_property(srna, "custom_bevel_profile_preset", PROP_POINTER, PROP_NONE);
4609 RNA_def_property_pointer_sdna(prop, nullptr, "custom_bevel_profile_preset");
4610 RNA_def_property_struct_type(prop, "CurveProfile");
4611 RNA_def_property_ui_text(prop, "Curve Profile Widget", "Used for defining a profile's path");
4612
4613 /* Sequencer tool settings */
4614 prop = RNA_def_property(srna, "sequencer_tool_settings", PROP_POINTER, PROP_NONE);
4616 RNA_def_property_struct_type(prop, "SequencerToolSettings");
4617 RNA_def_property_ui_text(prop, "Sequencer Tool Settings", nullptr);
4618}
4619
4621{
4622 StructRNA *srna;
4623 PropertyRNA *prop;
4624
4625 static const EnumPropertyItem pivot_points[] = {
4626 {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
4627 {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
4628 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
4630 "INDIVIDUAL_ORIGINS",
4631 ICON_PIVOT_INDIVIDUAL,
4632 "Individual Origins",
4633 "Pivot around each selected island's own median point"},
4634 {0, nullptr, 0, nullptr, nullptr},
4635
4636 };
4637 srna = RNA_def_struct(brna, "SequencerToolSettings", nullptr);
4638 RNA_def_struct_path_func(srna, "rna_SequencerToolSettings_path");
4639 RNA_def_struct_ui_text(srna, "Sequencer Tool Settings", "");
4641
4642 /* Add strip settings. */
4643 prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_NONE);
4645 RNA_def_property_ui_text(prop, "Fit Method", "Scale fit method");
4646
4647 /* Transform snapping. */
4648 prop = RNA_def_property(srna, "snap_to_current_frame", PROP_BOOLEAN, PROP_NONE);
4649 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_CURRENT_FRAME);
4650 RNA_def_property_ui_text(prop, "Current Frame", "Snap to current frame");
4651 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4652
4653 prop = RNA_def_property(srna, "snap_to_hold_offset", PROP_BOOLEAN, PROP_NONE);
4654 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_STRIP_HOLD);
4656 "Holds",
4657 "Snap to underlying strip content start and end in cases where the "
4658 "strip length extends beyond this range, producing holds");
4659 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4660
4661 prop = RNA_def_property(srna, "snap_to_markers", PROP_BOOLEAN, PROP_NONE);
4662 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_MARKERS);
4663 RNA_def_property_ui_text(prop, "Markers", "Snap to markers");
4664 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4665
4666 prop = RNA_def_property(srna, "snap_to_retiming_keys", PROP_BOOLEAN, PROP_NONE);
4667 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_RETIMING);
4668 RNA_def_property_ui_text(prop, "Retiming Keys", "Snap to retiming keys");
4669 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4670
4671 prop = RNA_def_property(srna, "snap_to_frame_range", PROP_BOOLEAN, PROP_NONE);
4672 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_FRAME_RANGE);
4673 RNA_def_property_ui_text(prop, "Frame Range", "Snap to preview or scene start and end frame");
4674 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4675
4676 prop = RNA_def_property(srna, "snap_to_borders", PROP_BOOLEAN, PROP_NONE);
4678 RNA_def_property_ui_text(prop, "Borders", "Snap to preview borders");
4679 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4680
4681 prop = RNA_def_property(srna, "snap_to_center", PROP_BOOLEAN, PROP_NONE);
4682 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_PREVIEW_CENTER);
4683 RNA_def_property_ui_text(prop, "Center", "Snap to preview center");
4684 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4685
4686 prop = RNA_def_property(srna, "snap_to_strips_preview", PROP_BOOLEAN, PROP_NONE);
4687 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_STRIPS_PREVIEW);
4689 prop, "Other Strips", "Snap to borders and origins of deselected, visible strips");
4690 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4691
4692 prop = RNA_def_property(srna, "snap_ignore_muted", PROP_BOOLEAN, PROP_NONE);
4693 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SEQ_SNAP_IGNORE_MUTED);
4694 RNA_def_property_ui_text(prop, "Ignore Muted Strips", "Don't snap to hidden strips");
4695
4696 prop = RNA_def_property(srna, "snap_ignore_sound", PROP_BOOLEAN, PROP_NONE);
4697 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SEQ_SNAP_IGNORE_SOUND);
4698 RNA_def_property_ui_text(prop, "Ignore Sound Strips", "Don't snap to sound strips");
4699
4700 prop = RNA_def_property(srna, "use_snap_current_frame_to_strips", PROP_BOOLEAN, PROP_NONE);
4703 prop, "Snap Current Frame to Strips", "Snap current frame to strip start or end");
4704
4705 prop = RNA_def_property(srna, "snap_to_all_channels", PROP_BOOLEAN, PROP_NONE);
4708 "All Channels",
4709 "Allow snapping to any channel. If disabled, only snap to strips "
4710 "currently on the same channel as transformed strips");
4711
4712 prop = RNA_def_property(srna, "snap_distance", PROP_INT, PROP_PIXEL);
4713 RNA_def_property_int_sdna(prop, nullptr, "snap_distance");
4715 RNA_def_property_ui_range(prop, 0, 50, 1, 1);
4716 RNA_def_property_ui_text(prop, "Snapping Distance", "Maximum distance for snapping in pixels");
4717
4718 /* Transform overlap handling. */
4719 prop = RNA_def_property(srna, "overlap_mode", PROP_ENUM, PROP_NONE);
4721 RNA_def_property_ui_text(prop, "Overlap Mode", "How to resolve overlap after transformation");
4722
4723 /* Ripple handling. */
4724 prop = RNA_def_property(srna, "ripple_all_channels", PROP_BOOLEAN, PROP_NONE);
4725 RNA_def_property_boolean_sdna(prop, nullptr, "ripple_flag", SEQ_RIPPLE_ALL_CHANNELS);
4727 "All Channels",
4728 "Ripple strips on other channels too, else only strips on the same "
4729 "channels as the edited strips");
4730
4731 prop = RNA_def_property(srna, "ripple_markers", PROP_BOOLEAN, PROP_NONE);
4732 RNA_def_property_boolean_sdna(prop, nullptr, "ripple_flag", SEQ_RIPPLE_MARKERS);
4733 RNA_def_property_ui_text(prop, "Markers", "Ripple markers along with strips");
4734
4735 prop = RNA_def_property(srna, "ripple_clear_ranges", PROP_BOOLEAN, PROP_NONE);
4736 RNA_def_property_boolean_sdna(prop, nullptr, "ripple_flag", SEQ_RIPPLE_CLEAR_RANGES);
4738 prop,
4739 "Clear Ranges",
4740 "Delete strip contents inside the removed ranges on rippled channels so later strips "
4741 "close the full gap, else ripple later strips only as far as they can");
4742
4743 prop = RNA_def_property(srna, "ripple_insert", PROP_BOOLEAN, PROP_NONE);
4744 RNA_def_property_boolean_sdna(prop, nullptr, "ripple_flag", SEQ_RIPPLE_INSERT);
4746 "Insert",
4747 "Split strips at the leftmost edited handle and push the remainder "
4748 "aside, else ripple only as far as needed to resolve the overlap");
4750
4751 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
4752 RNA_def_property_enum_items(prop, pivot_points);
4753 RNA_def_property_ui_text(prop, "Pivot Point", "Rotation or scaling pivot point");
4755}
4756
4758{
4759 StructRNA *srna;
4760 PropertyRNA *prop;
4761
4762 srna = RNA_def_struct(brna, "CurvePaintSettings", nullptr);
4763 RNA_def_struct_path_func(srna, "rna_CurvePaintSettings_path");
4764 RNA_def_struct_ui_text(srna, "Curve Paint Settings", "");
4766
4767 static const EnumPropertyItem curve_type_items[] = {
4768 {CU_POLY, "POLY", 0, "Poly", ""},
4769 {CU_BEZIER, "BEZIER", 0, "Bézier", ""},
4770 {0, nullptr, 0, nullptr, nullptr},
4771 };
4772
4773 prop = RNA_def_property(srna, "curve_type", PROP_ENUM, PROP_NONE);
4775 RNA_def_property_enum_sdna(prop, nullptr, "curve_type");
4777 RNA_def_property_ui_text(prop, "Type", "Type of curve to use for new strokes");
4778
4779 prop = RNA_def_property(srna, "use_corners_detect", PROP_BOOLEAN, PROP_NONE);
4782 RNA_def_property_ui_text(prop, "Detect Corners", "Detect corners and use non-aligned handles");
4783
4784 prop = RNA_def_property(srna, "use_pressure_radius", PROP_BOOLEAN, PROP_NONE);
4787 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
4788 RNA_def_property_ui_text(prop, "Use Pressure", "Map tablet pressure to curve radius");
4789
4790 prop = RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
4793 RNA_def_property_ui_text(prop, "Only First", "Use the start of the stroke for the depth");
4794
4795 prop = RNA_def_property(srna, "use_offset_absolute", PROP_BOOLEAN, PROP_NONE);
4799 prop, "Absolute Offset", "Apply a fixed offset (don't scale by the radius)");
4800
4801 prop = RNA_def_property(srna, "use_project_only_selected", PROP_BOOLEAN, PROP_NONE);
4805 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
4806
4807 prop = RNA_def_property(srna, "error_threshold", PROP_INT, PROP_PIXEL);
4809 RNA_def_property_range(prop, 1, 100);
4810 RNA_def_property_ui_text(prop, "Tolerance", "Allow deviation for a smoother, less precise line");
4811
4812 prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_PIXEL);
4814 RNA_def_property_enum_sdna(prop, nullptr, "fit_method");
4816 RNA_def_property_ui_text(prop, "Method", "Curve fitting method");
4817
4818 prop = RNA_def_property(srna, "corner_angle", PROP_FLOAT, PROP_ANGLE);
4820 RNA_def_property_range(prop, 0, M_PI);
4821 RNA_def_property_ui_text(prop, "Corner Angle", "Angles above this are considered corners");
4822
4823 prop = RNA_def_property(srna, "radius_min", PROP_FLOAT, PROP_NONE);
4825 RNA_def_property_range(prop, 0.0, 100.0);
4826 RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
4828 prop,
4829 "Radius Min",
4830 "Minimum radius when the minimum pressure is applied (also the minimum when tapering)");
4831
4832 prop = RNA_def_property(srna, "radius_max", PROP_FLOAT, PROP_NONE);
4834 RNA_def_property_range(prop, 0.0, 100.0);
4835 RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
4837 prop,
4838 "Radius Max",
4839 "Radius to use when the maximum pressure is applied (or when a tablet isn't used)");
4840
4841 prop = RNA_def_property(srna, "radius_taper_start", PROP_FLOAT, PROP_NONE);
4843 RNA_def_property_range(prop, 0.0, 1.0);
4844 RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
4846 prop, "Radius Min", "Taper factor for the radius of each point along the curve");
4847
4848 prop = RNA_def_property(srna, "radius_taper_end", PROP_FLOAT, PROP_NONE);
4850 RNA_def_property_range(prop, 0.0, 10.0);
4851 RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
4853 prop, "Radius Max", "Taper factor for the radius of each point along the curve");
4854
4855 prop = RNA_def_property(srna, "surface_offset", PROP_FLOAT, PROP_NONE);
4857 RNA_def_property_range(prop, -10.0, 10.0);
4858 RNA_def_property_ui_range(prop, -1.0f, 1.0, 1, 2);
4859 RNA_def_property_ui_text(prop, "Offset", "Offset the stroke from the surface");
4860
4861 static const EnumPropertyItem depth_mode_items[] = {
4862 {CURVE_PAINT_PROJECT_CURSOR, "CURSOR", 0, "Cursor", ""},
4863 {CURVE_PAINT_PROJECT_SURFACE, "SURFACE", 0, "Surface", ""},
4864 {0, nullptr, 0, nullptr, nullptr},
4865 };
4866
4867 prop = RNA_def_property(srna, "depth_mode", PROP_ENUM, PROP_NONE);
4869 RNA_def_property_enum_sdna(prop, nullptr, "depth_mode");
4870 RNA_def_property_enum_items(prop, depth_mode_items);
4871 RNA_def_property_ui_text(prop, "Depth", "Method of projecting depth");
4872
4873 static const EnumPropertyItem surface_plane_items[] = {
4875 "NORMAL_VIEW",
4876 0,
4877 "Normal to Surface",
4878 "Draw in a plane perpendicular to the surface"},
4880 "NORMAL_SURFACE",
4881 0,
4882 "Tangent to Surface",
4883 "Draw in the surface plane"},
4885 "VIEW",
4886 0,
4887 "View",
4888 "Draw in a plane aligned to the viewport"},
4889 {0, nullptr, 0, nullptr, nullptr},
4890 };
4891
4892 prop = RNA_def_property(srna, "surface_plane", PROP_ENUM, PROP_NONE);
4894 RNA_def_property_enum_sdna(prop, nullptr, "surface_plane");
4895 RNA_def_property_enum_items(prop, surface_plane_items);
4896 RNA_def_property_ui_text(prop, "Plane", "Plane for projected stroke");
4897}
4898
4899static void rna_def_statvis(BlenderRNA *brna)
4900{
4901 StructRNA *srna;
4902 PropertyRNA *prop;
4903
4904 static const EnumPropertyItem stat_type[] = {
4905 {SCE_STATVIS_OVERHANG, "OVERHANG", 0, "Overhang", ""},
4906 {SCE_STATVIS_THICKNESS, "THICKNESS", 0, "Thickness", ""},
4907 {SCE_STATVIS_INTERSECT, "INTERSECT", 0, "Intersect", ""},
4908 {SCE_STATVIS_DISTORT, "DISTORT", 0, "Distortion", ""},
4909 {SCE_STATVIS_SHARP, "SHARP", 0, "Sharp", ""},
4910 {0, nullptr, 0, nullptr, nullptr},
4911 };
4912
4913 srna = RNA_def_struct(brna, "MeshStatVis", nullptr);
4914 RNA_def_struct_path_func(srna, "rna_MeshStatVis_path");
4915 RNA_def_struct_ui_text(srna, "Mesh Visualize Statistics", "");
4917
4918 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4919 RNA_def_property_enum_items(prop, stat_type);
4920 RNA_def_property_ui_text(prop, "Type", "Type of data to visualize/check");
4922 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4923
4924 /* overhang */
4925 prop = RNA_def_property(srna, "overhang_min", PROP_FLOAT, PROP_ANGLE);
4926 RNA_def_property_float_sdna(prop, nullptr, "overhang_min");
4927 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4928 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4929 RNA_def_property_ui_text(prop, "Overhang Min", "Minimum angle to display");
4931 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4932
4933 prop = RNA_def_property(srna, "overhang_max", PROP_FLOAT, PROP_ANGLE);
4934 RNA_def_property_float_sdna(prop, nullptr, "overhang_max");
4935 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4936 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4937 RNA_def_property_ui_text(prop, "Overhang Max", "Maximum angle to display");
4939 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4940
4941 prop = RNA_def_property(srna, "overhang_axis", PROP_ENUM, PROP_NONE);
4942 RNA_def_property_enum_sdna(prop, nullptr, "overhang_axis");
4944 RNA_def_property_ui_text(prop, "Axis", "");
4946 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4947
4948 /* thickness */
4949 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_DISTANCE);
4950 RNA_def_property_float_sdna(prop, nullptr, "thickness_min");
4951 RNA_def_property_range(prop, 0.0f, 1000.0);
4952 RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4953 RNA_def_property_ui_text(prop, "Thickness Min", "Minimum for measuring thickness");
4955 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4956
4957 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_DISTANCE);
4958 RNA_def_property_float_sdna(prop, nullptr, "thickness_max");
4959 RNA_def_property_range(prop, 0.0f, 1000.0);
4960 RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4961 RNA_def_property_ui_text(prop, "Thickness Max", "Maximum for measuring thickness");
4963 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4964
4965 prop = RNA_def_property(srna, "thickness_samples", PROP_INT, PROP_UNSIGNED);
4966 RNA_def_property_int_sdna(prop, nullptr, "thickness_samples");
4967 RNA_def_property_range(prop, 1, 32);
4968 RNA_def_property_ui_text(prop, "Samples", "Number of samples to test per face");
4970 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4971
4972 /* distort */
4973 prop = RNA_def_property(srna, "distort_min", PROP_FLOAT, PROP_ANGLE);
4974 RNA_def_property_float_sdna(prop, nullptr, "distort_min");
4975 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4976 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4977 RNA_def_property_ui_text(prop, "Distort Min", "Minimum angle to display");
4979 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4980
4981 prop = RNA_def_property(srna, "distort_max", PROP_FLOAT, PROP_ANGLE);
4982 RNA_def_property_float_sdna(prop, nullptr, "distort_max");
4983 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4984 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4985 RNA_def_property_ui_text(prop, "Distort Max", "Maximum angle to display");
4987 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4988
4989 /* sharp */
4990 prop = RNA_def_property(srna, "sharp_min", PROP_FLOAT, PROP_ANGLE);
4991 RNA_def_property_float_sdna(prop, nullptr, "sharp_min");
4992 RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
4993 RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
4994 RNA_def_property_ui_text(prop, "Sharpness Min", "Minimum angle to display");
4996 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4997
4998 prop = RNA_def_property(srna, "sharp_max", PROP_FLOAT, PROP_ANGLE);
4999 RNA_def_property_float_sdna(prop, nullptr, "sharp_max");
5000 RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
5001 RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
5002 RNA_def_property_ui_text(prop, "Sharpness Max", "Maximum angle to display");
5004 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
5005}
5006
5008{
5009 StructRNA *srna;
5010 PropertyRNA *prop;
5011
5012 static const EnumPropertyItem unit_systems[] = {
5013 {USER_UNIT_NONE, "NONE", 0, "None", ""},
5014 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
5015 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
5016 {0, nullptr, 0, nullptr, nullptr},
5017 };
5018
5019 static const EnumPropertyItem rotation_units[] = {
5020 {0, "DEGREES", 0, "Degrees", "Use degrees for measuring angles and rotations"},
5021 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
5022 {0, nullptr, 0, nullptr, nullptr},
5023 };
5024
5025 srna = RNA_def_struct(brna, "UnitSettings", nullptr);
5026 RNA_def_struct_ui_text(srna, "Unit Settings", "");
5027 RNA_def_struct_nested(brna, srna, "Scene");
5028 RNA_def_struct_path_func(srna, "rna_UnitSettings_path");
5029
5030 /* Units */
5031 prop = RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
5032 RNA_def_property_enum_items(prop, unit_systems);
5034 prop, "Unit System", "The unit system to use for user interface controls");
5035 RNA_def_property_update(prop, NC_WINDOW, "rna_UnitSettings_system_update");
5036
5037 prop = RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
5038 RNA_def_property_enum_items(prop, rotation_units);
5040 prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
5041 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5042
5043 prop = RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
5045 prop,
5046 "Unit Scale",
5047 "Scale to use when converting between Blender units and dimensions."
5048 " When working at microscopic or astronomical scale, a small or large unit scale"
5049 " respectively can be used to avoid numerical precision problems");
5050 RNA_def_property_range(prop, 1e-9f, 1e+9f);
5051 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 6);
5052 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5053
5054 prop = RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
5055 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_UNIT_OPT_SPLIT);
5056 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs (e.g. 1m 0cm)");
5057 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5058
5059 prop = RNA_def_property(srna, "length_unit", PROP_ENUM, PROP_NONE);
5061 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_length_unit_itemf");
5062 RNA_def_property_ui_text(prop, "Length Unit", "Unit that will be used to display length values");
5063 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5064
5065 prop = RNA_def_property(srna, "mass_unit", PROP_ENUM, PROP_NONE);
5067 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_mass_unit_itemf");
5068 RNA_def_property_ui_text(prop, "Mass Unit", "Unit that will be used to display mass values");
5069 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5070
5071 prop = RNA_def_property(srna, "time_unit", PROP_ENUM, PROP_NONE);
5073 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_time_unit_itemf");
5074 RNA_def_property_ui_text(prop, "Time Unit", "Unit that will be used to display time values");
5075 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5076
5077 prop = RNA_def_property(srna, "temperature_unit", PROP_ENUM, PROP_NONE);
5079 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_temperature_unit_itemf");
5081 prop, "Temperature Unit", "Unit that will be used to display temperature values");
5082 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5083}
5084
5086{
5087 StructRNA *srna;
5088 PropertyRNA *prop;
5089 srna = RNA_def_struct(brna, "ViewLayerEEVEE", nullptr);
5090 RNA_def_struct_path_func(srna, "rna_ViewLayerEEVEE_path");
5091 RNA_def_struct_ui_text(srna, "EEVEE Settings", "View Layer settings for EEVEE");
5092
5093 prop = RNA_def_property(srna, "use_pass_volume_direct", PROP_BOOLEAN, PROP_NONE);
5094 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", EEVEE_RENDER_PASS_VOLUME_LIGHT);
5095 RNA_def_property_ui_text(prop, "Volume Light", "Deliver volume direct light pass");
5096 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5097
5098# if 1
5099 /* Bloom is deprecated since Blender 4.2, is kept for add-on compatibility reasons and needs to
5100 * be removed in a future release. */
5101 prop = RNA_def_property(srna, "use_pass_bloom", PROP_BOOLEAN, PROP_NONE);
5102 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", 0 /*EEVEE_RENDER_PASS_BLOOM*/);
5103 RNA_def_property_ui_text(prop, "Bloom", "Deliver bloom pass (deprecated)");
5104 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5105# endif
5106
5107 prop = RNA_def_property(srna, "use_pass_transparent", PROP_BOOLEAN, PROP_NONE);
5108 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", EEVEE_RENDER_PASS_TRANSPARENT);
5110 prop, "Transparent", "Deliver alpha blended surfaces in a separate pass");
5111 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5112
5113 prop = RNA_def_property(srna, "ambient_occlusion_distance", PROP_FLOAT, PROP_DISTANCE);
5114 RNA_def_property_range(prop, 0.0f, 100000.0f);
5115 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
5117 prop, "Distance", "Distance of object that contribute to the ambient occlusion effect");
5119
5120 prop = RNA_def_property(srna, "denoising_store_passes", PROP_BOOLEAN, PROP_NONE);
5121 RNA_def_property_boolean_sdna(prop, nullptr, "denoising_pass_flags", EEVEE_DENOISING_PASS_STORE);
5122 RNA_def_property_ui_text(prop, "Denoising Data", "Deliver denoising passes");
5123 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5124
5125 prop = RNA_def_property(
5126 srna, "denoising_pass_use_albedo_roughness_weighting", PROP_BOOLEAN, PROP_NONE);
5128 prop, nullptr, "denoising_pass_flags", EEVEE_DENOISING_PASS_USE_ALBEDO_ROUGHNESS_WEIGHTING);
5130 prop,
5131 "Denoising Pass Albedo Roughness Weighting",
5132 "Use roughness-based weighting of the albedo for the denoising feature passes");
5134}
5135
5137{
5138 StructRNA *srna;
5139 // PropertyRNA *prop;
5140
5141 FunctionRNA *func;
5142 PropertyRNA *parm;
5143
5144 RNA_def_property_srna(cprop, "AOVs");
5145 srna = RNA_def_struct(brna, "AOVs", nullptr);
5146 RNA_def_struct_sdna(srna, "ViewLayer");
5147 RNA_def_struct_ui_text(srna, "List of AOVs", "Collection of AOVs");
5148
5149 func = RNA_def_function(srna, "add", "BKE_view_layer_add_aov");
5150 parm = RNA_def_pointer(func, "aov", "AOV", "", "Newly created AOV");
5152 RNA_def_function_return(func, parm);
5153
5154 /* Defined in `rna_layer.cc`. */
5155 func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove_aov");
5156 parm = RNA_def_pointer(func, "aov", "AOV", "", "AOV to remove");
5157 RNA_def_function_ui_description(func, "Remove an AOV");
5161}
5162
5164{
5165 StructRNA *srna;
5166 PropertyRNA *prop;
5167 srna = RNA_def_struct(brna, "AOV", nullptr);
5168 RNA_def_struct_sdna(srna, "ViewLayerAOV");
5169 RNA_def_struct_ui_text(srna, "Shader AOV", "");
5170
5171 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5172 RNA_def_property_string_sdna(prop, nullptr, "name");
5174 RNA_def_property_ui_text(prop, "Name", "Name of the AOV");
5175 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5176 RNA_def_struct_name_property(srna, prop);
5177
5178 prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
5180 RNA_def_property_ui_text(prop, "Valid", "Is the name of the AOV conflicting");
5181
5182 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
5183 RNA_def_property_enum_sdna(prop, nullptr, "type");
5186 RNA_def_property_ui_text(prop, "Type", "Data type of the AOV");
5187 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5188}
5189
5191{
5192 StructRNA *srna;
5193 // PropertyRNA *prop;
5194
5195 FunctionRNA *func;
5196 PropertyRNA *parm;
5197
5198 RNA_def_property_srna(cprop, "Lightgroups");
5199 srna = RNA_def_struct(brna, "Lightgroups", nullptr);
5200 RNA_def_struct_sdna(srna, "ViewLayer");
5201 RNA_def_struct_ui_text(srna, "List of Lightgroups", "Collection of Lightgroups");
5202
5203 func = RNA_def_function(srna, "add", "BKE_view_layer_add_lightgroup");
5204 parm = RNA_def_pointer(func, "lightgroup", "Lightgroup", "", "Newly created Lightgroup");
5206 RNA_def_function_return(func, parm);
5207 parm = RNA_def_string(func, "name", nullptr, 0, "Name", "Name of newly created lightgroup");
5208
5209 func = RNA_def_function(srna, "remove", "BKE_view_layer_remove_lightgroup");
5210 parm = RNA_def_pointer(func, "lightgroup", "Lightgroup", "", "Lightgroup to remove");
5211 RNA_def_function_ui_description(func, "Remove given light group");
5214}
5215
5217{
5218 StructRNA *srna;
5219 PropertyRNA *prop;
5220 srna = RNA_def_struct(brna, "Lightgroup", nullptr);
5221 RNA_def_struct_sdna(srna, "ViewLayerLightgroup");
5222 RNA_def_struct_ui_text(srna, "Light Group", "");
5223
5224 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5227 "rna_ViewLayerLightgroup_name_get",
5228 "rna_ViewLayerLightgroup_name_length",
5229 "rna_ViewLayerLightgroup_name_set");
5230 RNA_def_property_ui_text(prop, "Name", "Name of the Lightgroup");
5231 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5232 RNA_def_struct_name_property(srna, prop);
5233}
5234
5235void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool scene)
5236{
5237 PropertyRNA *prop;
5238
5239 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5240 if (scene) {
5241 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_ViewLayer_name_set");
5242 }
5243 else {
5244 RNA_def_property_string_sdna(prop, nullptr, "name");
5245 }
5246 RNA_def_property_ui_text(prop, "Name", "View layer name");
5247 RNA_def_struct_name_property(srna, prop);
5248 if (scene) {
5250 }
5251 else {
5253 }
5254
5255 if (scene) {
5256 prop = RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
5257 RNA_def_property_pointer_sdna(prop, nullptr, "mat_override");
5258 RNA_def_property_struct_type(prop, "Material");
5262 prop, "Material Override", "Material to override all other materials in this view layer");
5263 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_override_update");
5264
5265 prop = RNA_def_property(srna, "world_override", PROP_POINTER, PROP_NONE);
5266 RNA_def_property_pointer_sdna(prop, nullptr, "world_override");
5267 RNA_def_property_struct_type(prop, "World");
5270 RNA_def_property_ui_text(prop, "World Override", "Override world in this view layer");
5271 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_override_update");
5272
5273 prop = RNA_def_property(srna, "samples", PROP_INT, PROP_UNSIGNED);
5275 "Samples",
5276 "Override number of render samples for this view layer, "
5277 "0 will use the scene setting");
5279
5280 prop = RNA_def_property(srna, "pass_alpha_threshold", PROP_FLOAT, PROP_FACTOR);
5282 prop,
5283 "Alpha Threshold",
5284 "Z, Index, normal, UV and vector passes are only affected by surfaces with "
5285 "alpha transparency equal to or higher than this threshold");
5287
5288 prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
5290 RNA_def_property_struct_type(prop, "ViewLayerEEVEE");
5291 RNA_def_property_ui_text(prop, "EEVEE Settings", "View layer settings for EEVEE");
5292
5293 prop = RNA_def_property(srna, "aovs", PROP_COLLECTION, PROP_NONE);
5294 RNA_def_property_collection_sdna(prop, nullptr, "aovs", nullptr);
5295 RNA_def_property_struct_type(prop, "AOV");
5296 RNA_def_property_ui_text(prop, "Shader AOV", "");
5297 rna_def_view_layer_aovs(brna, prop);
5298
5299 prop = RNA_def_property(srna, "active_aov", PROP_POINTER, PROP_NONE);
5300 RNA_def_property_struct_type(prop, "AOV");
5302 RNA_def_property_ui_text(prop, "Shader AOV", "Active AOV");
5303
5304 prop = RNA_def_property(srna, "active_aov_index", PROP_INT, PROP_UNSIGNED);
5306 "rna_ViewLayer_active_aov_index_get",
5307 "rna_ViewLayer_active_aov_index_set",
5308 "rna_ViewLayer_active_aov_index_range");
5309 RNA_def_property_ui_text(prop, "Active AOV Index", "Index of active AOV");
5311
5312 prop = RNA_def_property(srna, "lightgroups", PROP_COLLECTION, PROP_NONE);
5313 RNA_def_property_collection_sdna(prop, nullptr, "lightgroups", nullptr);
5314 RNA_def_property_struct_type(prop, "Lightgroup");
5315 RNA_def_property_ui_text(prop, "Light Groups", "");
5317
5318 prop = RNA_def_property(srna, "active_lightgroup", PROP_POINTER, PROP_NONE);
5319 RNA_def_property_struct_type(prop, "Lightgroup");
5321 RNA_def_property_ui_text(prop, "Light Groups", "Active Lightgroup");
5322
5323 prop = RNA_def_property(srna, "active_lightgroup_index", PROP_INT, PROP_UNSIGNED);
5325 "rna_ViewLayer_active_lightgroup_index_get",
5326 "rna_ViewLayer_active_lightgroup_index_set",
5327 "rna_ViewLayer_active_lightgroup_index_range");
5328 RNA_def_property_ui_text(prop, "Active Lightgroup Index", "Index of active lightgroup");
5330
5331 prop = RNA_def_property(srna, "use_pass_cryptomatte_object", PROP_BOOLEAN, PROP_NONE);
5333 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_OBJECT);
5335 prop,
5336 "Cryptomatte Object",
5337 "Render cryptomatte object pass, for isolating objects in compositing");
5338 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5339
5340 prop = RNA_def_property(srna, "use_pass_cryptomatte_material", PROP_BOOLEAN, PROP_NONE);
5342 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_MATERIAL);
5344 prop,
5345 "Cryptomatte Material",
5346 "Render cryptomatte material pass, for isolating materials in compositing");
5347 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5348
5349 prop = RNA_def_property(srna, "use_pass_cryptomatte_asset", PROP_BOOLEAN, PROP_NONE);
5350 RNA_def_property_boolean_sdna(prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_ASSET);
5352 prop,
5353 "Cryptomatte Asset",
5354 "Render cryptomatte asset pass, for isolating groups of objects with the same parent");
5355 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5356
5357 prop = RNA_def_property(srna, "pass_cryptomatte_depth", PROP_INT, PROP_NONE);
5358 RNA_def_property_int_sdna(prop, nullptr, "cryptomatte_levels");
5359 RNA_def_property_range(prop, 2.0, 16.0);
5361 prop, "Cryptomatte Levels", "Sets how many unique objects can be distinguished per pixel");
5362 RNA_def_property_ui_range(prop, 2.0, 16.0, 2.0, 0.0);
5363 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5364
5365 prop = RNA_def_property(srna, "use_pass_cryptomatte_accurate", PROP_BOOLEAN, PROP_NONE);
5367 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_ACCURATE);
5369 prop, "Cryptomatte Accurate", "Generate a more accurate cryptomatte pass");
5370 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5371 }
5372
5373 prop = RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
5374 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_SOLID);
5375 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
5376 if (scene) {
5378 }
5379 else {
5381 }
5382 prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
5383 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_SKY);
5384 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
5385 if (scene) {
5386 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
5387 }
5388 else {
5390 }
5391
5392 prop = RNA_def_property(srna, "use_ao", PROP_BOOLEAN, PROP_NONE);
5393 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_AO);
5394 RNA_def_property_ui_text(prop, "Ambient Occlusion", "Render Ambient Occlusion in this Layer");
5395 if (scene) {
5396 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
5397 }
5398 else {
5400 }
5401
5402 prop = RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
5403 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_STRAND);
5404 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
5405 if (scene) {
5407 }
5408 else {
5410 }
5411
5412 prop = RNA_def_property(srna, "use_volumes", PROP_BOOLEAN, PROP_NONE);
5413 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_VOLUMES);
5414 RNA_def_property_ui_text(prop, "Volumes", "Render volumes in this Layer");
5415 if (scene) {
5417 }
5418 else {
5420 }
5421
5422 prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
5423 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_MOTION_BLUR);
5425 prop, "Motion Blur", "Render motion blur in this Layer, if enabled in the scene");
5426 if (scene) {
5428 }
5429 else {
5431 }
5432
5433 prop = RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
5434 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_GREASE_PENCIL);
5435 RNA_def_property_ui_text(prop, "Grease Pencil", "Render Grease Pencil on this layer");
5436 if (scene) {
5438 }
5439 else {
5441 }
5442
5443 /* passes */
5444 prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
5445 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_COMBINED);
5446 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
5447 if (scene) {
5448 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5449 }
5450 else {
5452 }
5453
5454 prop = RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
5455 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DEPTH);
5456 RNA_def_property_ui_text(prop, "Depth", "Deliver depth values pass");
5457 if (scene) {
5458 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5459 }
5460 else {
5462 }
5463
5464 prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
5465 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_VECTOR);
5466 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
5467 if (scene) {
5468 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5469 }
5470 else {
5472 }
5473
5474 prop = RNA_def_property(srna, "use_pass_position", PROP_BOOLEAN, PROP_NONE);
5475 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_POSITION);
5476 RNA_def_property_ui_text(prop, "Position", "Deliver position pass");
5477 if (scene) {
5478 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5479 }
5480 else {
5482 }
5483
5484 prop = RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
5485 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_NORMAL);
5486 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
5487 if (scene) {
5488 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5489 }
5490 else {
5492 }
5493
5494 prop = RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
5495 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_UV);
5496 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
5497 if (scene) {
5498 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5499 }
5500 else {
5502 }
5503
5504 prop = RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
5505 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_MIST);
5506 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0 to 1.0)");
5507 if (scene) {
5508 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5509 }
5510 else {
5512 }
5513
5514 prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
5515 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_INDEXOB);
5516 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
5518 if (scene) {
5519 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5520 }
5521 else {
5523 }
5524
5525 prop = RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
5526 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_INDEXMA);
5527 RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
5528 if (scene) {
5529 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5530 }
5531 else {
5533 }
5534
5535 prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
5536 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_SHADOW);
5537 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
5538 if (scene) {
5539 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5540 }
5541 else {
5543 }
5544
5545 prop = RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
5546 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_AO);
5547 RNA_def_property_ui_text(prop, "Ambient Occlusion", "Deliver Ambient Occlusion pass");
5548 if (scene) {
5549 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5550 }
5551 else {
5553 }
5554
5555 prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
5556 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_EMIT);
5557 RNA_def_property_ui_text(prop, "Emission", "Deliver emission pass");
5558 if (scene) {
5559 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5560 }
5561 else {
5563 }
5564
5565 prop = RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
5566 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_ENVIRONMENT);
5567 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
5568 if (scene) {
5569 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5570 }
5571 else {
5573 }
5574
5575 prop = RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
5576 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_DIRECT);
5577 RNA_def_property_ui_text(prop, "Diffuse Direct", "Deliver diffuse direct pass");
5578 if (scene) {
5579 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5580 }
5581 else {
5583 }
5584
5585 prop = RNA_def_property(srna, "use_pass_diffuse_indirect", PROP_BOOLEAN, PROP_NONE);
5586 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_INDIRECT);
5587 RNA_def_property_ui_text(prop, "Diffuse Indirect", "Deliver diffuse indirect pass");
5588 if (scene) {
5589 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5590 }
5591 else {
5593 }
5594
5595 prop = RNA_def_property(srna, "use_pass_diffuse_color", PROP_BOOLEAN, PROP_NONE);
5596 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_COLOR);
5597 RNA_def_property_ui_text(prop, "Diffuse Color", "Deliver diffuse color pass");
5598 if (scene) {
5599 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5600 }
5601 else {
5603 }
5604
5605 prop = RNA_def_property(srna, "use_pass_glossy_direct", PROP_BOOLEAN, PROP_NONE);
5606 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_DIRECT);
5607 RNA_def_property_ui_text(prop, "Glossy Direct", "Deliver glossy direct pass");
5608 if (scene) {
5609 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5610 }
5611 else {
5613 }
5614
5615 prop = RNA_def_property(srna, "use_pass_glossy_indirect", PROP_BOOLEAN, PROP_NONE);
5616 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_INDIRECT);
5617 RNA_def_property_ui_text(prop, "Glossy Indirect", "Deliver glossy indirect pass");
5618 if (scene) {
5619 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5620 }
5621 else {
5623 }
5624
5625 prop = RNA_def_property(srna, "use_pass_glossy_color", PROP_BOOLEAN, PROP_NONE);
5626 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_COLOR);
5627 RNA_def_property_ui_text(prop, "Glossy Color", "Deliver glossy color pass");
5628 if (scene) {
5629 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5630 }
5631 else {
5633 }
5634
5635 prop = RNA_def_property(srna, "use_pass_transmission_direct", PROP_BOOLEAN, PROP_NONE);
5636 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_DIRECT);
5637 RNA_def_property_ui_text(prop, "Transmission Direct", "Deliver transmission direct pass");
5638 if (scene) {
5639 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5640 }
5641 else {
5643 }
5644
5645 prop = RNA_def_property(srna, "use_pass_transmission_indirect", PROP_BOOLEAN, PROP_NONE);
5646 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_INDIRECT);
5647 RNA_def_property_ui_text(prop, "Transmission Indirect", "Deliver transmission indirect pass");
5648 if (scene) {
5649 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5650 }
5651 else {
5653 }
5654
5655 prop = RNA_def_property(srna, "use_pass_transmission_color", PROP_BOOLEAN, PROP_NONE);
5656 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_COLOR);
5657 RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass");
5658 if (scene) {
5659 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5660 }
5661 else {
5663 }
5664
5665 prop = RNA_def_property(srna, "use_pass_subsurface_direct", PROP_BOOLEAN, PROP_NONE);
5667 RNA_def_property_ui_text(prop, "Subsurface Direct", "Deliver subsurface direct pass");
5668 if (scene) {
5669 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5670 }
5671 else {
5673 }
5674
5675 prop = RNA_def_property(srna, "use_pass_subsurface_indirect", PROP_BOOLEAN, PROP_NONE);
5677 RNA_def_property_ui_text(prop, "Subsurface Indirect", "Deliver subsurface indirect pass");
5678 if (scene) {
5679 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5680 }
5681 else {
5683 }
5684
5685 prop = RNA_def_property(srna, "use_pass_subsurface_color", PROP_BOOLEAN, PROP_NONE);
5686 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_SUBSURFACE_COLOR);
5687 RNA_def_property_ui_text(prop, "Subsurface Color", "Deliver subsurface color pass");
5688 if (scene) {
5689 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5690 }
5691 else {
5693 }
5694}
5695
5697{
5698 StructRNA *srna;
5699 FunctionRNA *func;
5700 PropertyRNA *parm;
5701
5702 RNA_def_property_srna(cprop, "FreestyleModules");
5703 srna = RNA_def_struct(brna, "FreestyleModules", nullptr);
5704 RNA_def_struct_sdna(srna, "FreestyleSettings");
5706 srna, "Style Modules", "A list of style modules (to be applied from top to bottom)");
5707
5708 func = RNA_def_function(srna, "new", "rna_FreestyleSettings_module_add");
5710 "Add a style module to scene render layer Freestyle settings");
5712 parm = RNA_def_pointer(
5713 func, "module", "FreestyleModuleSettings", "", "Newly created style module");
5715 RNA_def_function_return(func, parm);
5716
5717 func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_module_remove");
5719 func, "Remove a style module from scene render layer Freestyle settings");
5721 parm = RNA_def_pointer(func, "module", "FreestyleModuleSettings", "", "Style module to remove");
5724}
5725
5727{
5728 StructRNA *srna;
5729 PropertyRNA *prop;
5730 FunctionRNA *func;
5731 PropertyRNA *parm;
5732
5733 RNA_def_property_srna(cprop, "Linesets");
5734 srna = RNA_def_struct(brna, "Linesets", nullptr);
5735 RNA_def_struct_sdna(srna, "FreestyleSettings");
5737 srna, "Line Sets", "Line sets for associating lines and style parameters");
5738
5739 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
5740 RNA_def_property_struct_type(prop, "FreestyleLineSet");
5742 prop, "rna_FreestyleSettings_active_lineset_get", nullptr, nullptr, nullptr);
5743 RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed");
5745
5746 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
5748 "rna_FreestyleSettings_active_lineset_index_get",
5749 "rna_FreestyleSettings_active_lineset_index_set",
5750 "rna_FreestyleSettings_active_lineset_index_range");
5751 RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
5753
5754 func = RNA_def_function(srna, "new", "rna_FreestyleSettings_lineset_add");
5755 RNA_def_function_ui_description(func, "Add a line set to scene render layer Freestyle settings");
5757 parm = RNA_def_string(func, "name", "LineSet", 0, "", "New name for the line set (not unique)");
5759 parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Newly created line set");
5761 RNA_def_function_return(func, parm);
5762
5763 func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_lineset_remove");
5765 "Remove a line set from scene render layer Freestyle settings");
5767 parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Line set to remove");
5770}
5771
5773{
5774 StructRNA *srna;
5775 PropertyRNA *prop;
5776
5777 static const EnumPropertyItem edge_type_negation_items[] = {
5778 {0,
5779 "INCLUSIVE",
5780 0,
5781 "Inclusive",
5782 "Select feature edges satisfying the given edge type conditions"},
5784 "EXCLUSIVE",
5785 0,
5786 "Exclusive",
5787 "Select feature edges not satisfying the given edge type conditions"},
5788 {0, nullptr, 0, nullptr, nullptr},
5789 };
5790
5791 static const EnumPropertyItem edge_type_combination_items[] = {
5792 {0,
5793 "OR",
5794 0,
5795 "Logical OR",
5796 "Select feature edges satisfying at least one of edge type conditions"},
5798 "AND",
5799 0,
5800 "Logical AND",
5801 "Select feature edges satisfying all edge type conditions"},
5802 {0, nullptr, 0, nullptr, nullptr},
5803 };
5804
5805 static const EnumPropertyItem collection_negation_items[] = {
5806 {0,
5807 "INCLUSIVE",
5808 0,
5809 "Inclusive",
5810 "Select feature edges belonging to some object in the group"},
5812 "EXCLUSIVE",
5813 0,
5814 "Exclusive",
5815 "Select feature edges not belonging to any object in the group"},
5816 {0, nullptr, 0, nullptr, nullptr},
5817 };
5818
5819 static const EnumPropertyItem face_mark_negation_items[] = {
5820 {0,
5821 "INCLUSIVE",
5822 0,
5823 "Inclusive",
5824 "Select feature edges satisfying the given face mark conditions"},
5826 "EXCLUSIVE",
5827 0,
5828 "Exclusive",
5829 "Select feature edges not satisfying the given face mark conditions"},
5830 {0, nullptr, 0, nullptr, nullptr},
5831 };
5832
5833 static const EnumPropertyItem face_mark_condition_items[] = {
5834 {0, "ONE", 0, "One Face", "Select a feature edge if either of its adjacent faces is marked"},
5836 "BOTH",
5837 0,
5838 "Both Faces",
5839 "Select a feature edge if both of its adjacent faces are marked"},
5840 {0, nullptr, 0, nullptr, nullptr},
5841 };
5842
5843 static const EnumPropertyItem freestyle_ui_mode_items[] = {
5845 "SCRIPT",
5846 0,
5847 "Python Scripting",
5848 "Advanced mode for using style modules written in Python"},
5850 "EDITOR",
5851 0,
5852 "Parameter Editor",
5853 "Basic mode for interactive style parameter editing"},
5854 {0, nullptr, 0, nullptr, nullptr},
5855 };
5856
5857 static const EnumPropertyItem visibility_items[] = {
5858 {FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible feature edges"},
5859 {FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden feature edges"},
5861 "RANGE",
5862 0,
5863 "Quantitative Invisibility",
5864 "Select feature edges within a range of quantitative invisibility (QI) values"},
5865 {0, nullptr, 0, nullptr, nullptr},
5866 };
5867
5868 /* FreestyleLineSet */
5869
5870 srna = RNA_def_struct(brna, "FreestyleLineSet", nullptr);
5872 srna, "Freestyle Line Set", "Line set for associating lines and style parameters");
5873
5874 /* access to line style settings is redirected through functions
5875 * to allow proper id-buttons functionality
5876 */
5877 prop = RNA_def_property(srna, "linestyle", PROP_POINTER, PROP_NONE);
5878 RNA_def_property_struct_type(prop, "FreestyleLineStyle");
5881 "rna_FreestyleLineSet_linestyle_get",
5882 "rna_FreestyleLineSet_linestyle_set",
5883 nullptr,
5884 nullptr);
5885 RNA_def_property_ui_text(prop, "Line Style", "Line style settings");
5886 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5887
5888 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5889 RNA_def_property_string_sdna(prop, nullptr, "name");
5890 RNA_def_property_ui_text(prop, "Line Set Name", "Line set name");
5892 RNA_def_struct_name_property(srna, prop);
5893
5894 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
5897 prop, "Render", "Enable or disable this line set during stroke rendering");
5898 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5899
5900 prop = RNA_def_property(srna, "select_by_visibility", PROP_BOOLEAN, PROP_NONE);
5901 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_VISIBILITY);
5903 prop, "Selection by Visibility", "Select feature edges based on visibility");
5904 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5905
5906 prop = RNA_def_property(srna, "select_by_edge_types", PROP_BOOLEAN, PROP_NONE);
5907 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_EDGE_TYPES);
5909 prop, "Selection by Edge Types", "Select feature edges based on edge types");
5910 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5911
5912 prop = RNA_def_property(srna, "select_by_collection", PROP_BOOLEAN, PROP_NONE);
5913 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_GROUP);
5915 prop, "Selection by Collection", "Select feature edges based on a collection of objects");
5916 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5917
5918 prop = RNA_def_property(srna, "select_by_image_border", PROP_BOOLEAN, PROP_NONE);
5919 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_IMAGE_BORDER);
5921 "Selection by Image Border",
5922 "Select feature edges by image border (less memory consumption)");
5923 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5924
5925 prop = RNA_def_property(srna, "select_by_face_marks", PROP_BOOLEAN, PROP_NONE);
5926 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_FACE_MARK);
5927 RNA_def_property_ui_text(prop, "Selection by Face Marks", "Select feature edges by face marks");
5928 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5929
5930 prop = RNA_def_property(srna, "edge_type_negation", PROP_ENUM, PROP_NONE);
5931 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5932 RNA_def_property_enum_items(prop, edge_type_negation_items);
5934 prop,
5935 "Edge Type Negation",
5936 "Specify either inclusion or exclusion of feature edges selected by edge types");
5937 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5938
5939 prop = RNA_def_property(srna, "edge_type_combination", PROP_ENUM, PROP_NONE);
5940 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5941 RNA_def_property_enum_items(prop, edge_type_combination_items);
5943 prop,
5944 "Edge Type Combination",
5945 "Specify a logical combination of selection conditions on feature edge types");
5946 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5947
5948 prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
5949 RNA_def_property_pointer_sdna(prop, nullptr, "group");
5950 RNA_def_property_struct_type(prop, "Collection");
5953 prop, "Collection", "A collection of objects based on which feature edges are selected");
5954 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5955
5956 prop = RNA_def_property(srna, "collection_negation", PROP_ENUM, PROP_NONE);
5957 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5958 RNA_def_property_enum_items(prop, collection_negation_items);
5960 "Collection Negation",
5961 "Specify either inclusion or exclusion of feature edges belonging to a "
5962 "collection of objects");
5963 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5964
5965 prop = RNA_def_property(srna, "face_mark_negation", PROP_ENUM, PROP_NONE);
5966 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5967 RNA_def_property_enum_items(prop, face_mark_negation_items);
5969 prop,
5970 "Face Mark Negation",
5971 "Specify either inclusion or exclusion of feature edges selected by face marks");
5972 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5973
5974 prop = RNA_def_property(srna, "face_mark_condition", PROP_ENUM, PROP_NONE);
5975 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5976 RNA_def_property_enum_items(prop, face_mark_condition_items);
5978 "Face Mark Condition",
5979 "Specify a feature edge selection condition based on face marks");
5980 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5981
5982 prop = RNA_def_property(srna, "select_silhouette", PROP_BOOLEAN, PROP_NONE);
5983 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_SILHOUETTE);
5985 prop,
5986 "Silhouette",
5987 "Select silhouettes (edges at the boundary of visible and hidden faces)");
5988 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5989
5990 prop = RNA_def_property(srna, "select_border", PROP_BOOLEAN, PROP_NONE);
5991 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_BORDER);
5992 RNA_def_property_ui_text(prop, "Border", "Select border edges (open mesh edges)");
5993 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5994
5995 prop = RNA_def_property(srna, "select_crease", PROP_BOOLEAN, PROP_NONE);
5996 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_CREASE);
5998 "Crease",
5999 "Select crease edges (those between two faces making an angle smaller "
6000 "than the Crease Angle)");
6001 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6002
6003 prop = RNA_def_property(srna, "select_ridge_valley", PROP_BOOLEAN, PROP_NONE);
6004 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_RIDGE_VALLEY);
6006 prop,
6007 "Ridge & Valley",
6008 "Select ridges and valleys (boundary lines between convex and concave areas of surface)");
6009 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6010
6011 prop = RNA_def_property(srna, "select_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
6014 prop, "Suggestive Contour", "Select suggestive contours (almost silhouette/contour edges)");
6015 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6016
6017 prop = RNA_def_property(srna, "select_material_boundary", PROP_BOOLEAN, PROP_NONE);
6019 RNA_def_property_ui_text(prop, "Material Boundary", "Select edges at material boundaries");
6020 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6021
6022 prop = RNA_def_property(srna, "select_contour", PROP_BOOLEAN, PROP_NONE);
6023 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_CONTOUR);
6024 RNA_def_property_ui_text(prop, "Contour", "Select contours (outer silhouettes of each object)");
6025 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6026
6027 prop = RNA_def_property(srna, "select_external_contour", PROP_BOOLEAN, PROP_NONE);
6030 prop,
6031 "External Contour",
6032 "Select external contours (outer silhouettes of occluding and occluded objects)");
6033 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6034
6035 prop = RNA_def_property(srna, "select_edge_mark", PROP_BOOLEAN, PROP_NONE);
6036 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_EDGE_MARK);
6038 prop, "Edge Mark", "Select edge marks (edges annotated by Freestyle edge marks)");
6039 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6040
6041 prop = RNA_def_property(srna, "exclude_silhouette", PROP_BOOLEAN, PROP_NONE);
6042 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_SILHOUETTE);
6043 RNA_def_property_ui_text(prop, "Silhouette", "Exclude silhouette edges");
6044 RNA_def_property_ui_icon(prop, ICON_X, 0);
6045 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6046
6047 prop = RNA_def_property(srna, "exclude_border", PROP_BOOLEAN, PROP_NONE);
6048 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_BORDER);
6049 RNA_def_property_ui_text(prop, "Border", "Exclude border edges");
6050 RNA_def_property_ui_icon(prop, ICON_X, 0);
6051 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6052
6053 prop = RNA_def_property(srna, "exclude_crease", PROP_BOOLEAN, PROP_NONE);
6054 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_CREASE);
6055 RNA_def_property_ui_text(prop, "Crease", "Exclude crease edges");
6056 RNA_def_property_ui_icon(prop, ICON_X, 0);
6057 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6058
6059 prop = RNA_def_property(srna, "exclude_ridge_valley", PROP_BOOLEAN, PROP_NONE);
6060 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_RIDGE_VALLEY);
6061 RNA_def_property_ui_text(prop, "Ridge & Valley", "Exclude ridges and valleys");
6062 RNA_def_property_ui_icon(prop, ICON_X, 0);
6063 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6064
6065 prop = RNA_def_property(srna, "exclude_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
6067 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_SUGGESTIVE_CONTOUR);
6068 RNA_def_property_ui_text(prop, "Suggestive Contour", "Exclude suggestive contours");
6069 RNA_def_property_ui_icon(prop, ICON_X, 0);
6070 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6071
6072 prop = RNA_def_property(srna, "exclude_material_boundary", PROP_BOOLEAN, PROP_NONE);
6074 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_MATERIAL_BOUNDARY);
6075 RNA_def_property_ui_text(prop, "Material Boundary", "Exclude edges at material boundaries");
6076 RNA_def_property_ui_icon(prop, ICON_X, 0);
6077 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6078
6079 prop = RNA_def_property(srna, "exclude_contour", PROP_BOOLEAN, PROP_NONE);
6080 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_CONTOUR);
6081 RNA_def_property_ui_text(prop, "Contour", "Exclude contours");
6082 RNA_def_property_ui_icon(prop, ICON_X, 0);
6083 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6084
6085 prop = RNA_def_property(srna, "exclude_external_contour", PROP_BOOLEAN, PROP_NONE);
6087 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_EXTERNAL_CONTOUR);
6088 RNA_def_property_ui_text(prop, "External Contour", "Exclude external contours");
6089 RNA_def_property_ui_icon(prop, ICON_X, 0);
6090 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6091
6092 prop = RNA_def_property(srna, "exclude_edge_mark", PROP_BOOLEAN, PROP_NONE);
6093 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_EDGE_MARK);
6094 RNA_def_property_ui_text(prop, "Edge Mark", "Exclude edge marks");
6095 RNA_def_property_ui_icon(prop, ICON_X, 0);
6096 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6097
6098 prop = RNA_def_property(srna, "visibility", PROP_ENUM, PROP_NONE);
6099 RNA_def_property_enum_sdna(prop, nullptr, "qi");
6100 RNA_def_property_enum_items(prop, visibility_items);
6102 prop, "Visibility", "Determine how to use visibility for feature edge selection");
6103 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6104
6105 prop = RNA_def_property(srna, "qi_start", PROP_INT, PROP_UNSIGNED);
6106 RNA_def_property_int_sdna(prop, nullptr, "qi_start");
6108 RNA_def_property_ui_text(prop, "Start", "First QI value of the QI range");
6109 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6110
6111 prop = RNA_def_property(srna, "qi_end", PROP_INT, PROP_UNSIGNED);
6112 RNA_def_property_int_sdna(prop, nullptr, "qi_end");
6114 RNA_def_property_ui_text(prop, "End", "Last QI value of the QI range");
6115 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6116
6117 /* FreestyleModuleSettings */
6118
6119 srna = RNA_def_struct(brna, "FreestyleModuleSettings", nullptr);
6120 RNA_def_struct_sdna(srna, "FreestyleModuleConfig");
6122 srna, "Freestyle Module", "Style module configuration for specifying a style module");
6123
6124 prop = RNA_def_property(srna, "script", PROP_POINTER, PROP_NONE);
6125 RNA_def_property_struct_type(prop, "Text");
6127 RNA_def_property_ui_text(prop, "Style Module", "Python script to define a style module");
6128 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6129
6130 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
6131 RNA_def_property_boolean_sdna(prop, nullptr, "is_displayed", 1);
6133 prop, "Use", "Enable or disable this style module during stroke rendering");
6134 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6135
6136 /* FreestyleSettings */
6137
6138 srna = RNA_def_struct(brna, "FreestyleSettings", nullptr);
6139 RNA_def_struct_sdna(srna, "FreestyleConfig");
6140 RNA_def_struct_nested(brna, srna, "ViewLayer");
6142 srna, "Freestyle Settings", "Freestyle settings for a ViewLayer data-block");
6143
6144 prop = RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
6145 RNA_def_property_collection_sdna(prop, nullptr, "modules", nullptr);
6146 RNA_def_property_struct_type(prop, "FreestyleModuleSettings");
6148 prop, "Style Modules", "A list of style modules (to be applied from top to bottom)");
6149 rna_def_freestyle_modules(brna, prop);
6150
6151 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6152 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6153 RNA_def_property_enum_items(prop, freestyle_ui_mode_items);
6154 RNA_def_property_ui_text(prop, "Control Mode", "Select the Freestyle control mode");
6155 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6156
6157 prop = RNA_def_property(srna, "use_culling", PROP_BOOLEAN, PROP_NONE);
6158 RNA_def_property_boolean_sdna(prop, nullptr, "flags", FREESTYLE_CULLING);
6159 RNA_def_property_ui_text(prop, "Culling", "If enabled, out-of-view edges are ignored");
6160 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6161
6162 prop = RNA_def_property(srna, "use_suggestive_contours", PROP_BOOLEAN, PROP_NONE);
6164 RNA_def_property_ui_text(prop, "Suggestive Contours", "Enable suggestive contours");
6165 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6166
6167 prop = RNA_def_property(srna, "use_ridges_and_valleys", PROP_BOOLEAN, PROP_NONE);
6169 RNA_def_property_ui_text(prop, "Ridges and Valleys", "Enable ridges and valleys");
6170 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6171
6172 prop = RNA_def_property(srna, "use_material_boundaries", PROP_BOOLEAN, PROP_NONE);
6174 RNA_def_property_ui_text(prop, "Material Boundaries", "Enable material boundaries");
6175 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6176
6177 prop = RNA_def_property(srna, "use_smoothness", PROP_BOOLEAN, PROP_NONE);
6180 prop, "Face Smoothness", "Take face smoothness into account in view map calculation");
6181 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6182
6183 prop = RNA_def_property(srna, "use_view_map_cache", PROP_BOOLEAN, PROP_NONE);
6186 prop,
6187 "View Map Cache",
6188 "Keep the computed view map and avoid recalculating it if mesh geometry is unchanged");
6190 prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_view_map_cache_update");
6191
6192 prop = RNA_def_property(srna, "as_render_pass", PROP_BOOLEAN, PROP_NONE);
6195 prop,
6196 "As Render Pass",
6197 "Renders Freestyle output to a separate pass instead of overlaying it on the Combined pass");
6198 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
6199
6200 prop = RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
6201 RNA_def_property_float_sdna(prop, nullptr, "sphere_radius");
6203 RNA_def_property_range(prop, 0.0, 1000.0);
6204 RNA_def_property_ui_text(prop, "Sphere Radius", "Sphere radius for computing curvatures");
6205 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6206
6207 prop = RNA_def_property(srna, "kr_derivative_epsilon", PROP_FLOAT, PROP_NONE);
6209 RNA_def_property_float_sdna(prop, nullptr, "dkr_epsilon");
6210 RNA_def_property_range(prop, -1000.0, 1000.0);
6212 prop, "Kr Derivative Epsilon", "Kr derivative epsilon for computing suggestive contours");
6213 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6214
6215 prop = RNA_def_property(srna, "crease_angle", PROP_FLOAT, PROP_ANGLE);
6216 RNA_def_property_float_sdna(prop, nullptr, "crease_angle");
6217 RNA_def_property_range(prop, 0.0, DEG2RAD(180.0));
6218 RNA_def_property_ui_text(prop, "Crease Angle", "Angular threshold for detecting crease edges");
6219 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6220
6221 prop = RNA_def_property(srna, "linesets", PROP_COLLECTION, PROP_NONE);
6222 RNA_def_property_collection_sdna(prop, nullptr, "linesets", nullptr);
6223 RNA_def_property_struct_type(prop, "FreestyleLineSet");
6224 RNA_def_property_ui_text(prop, "Line Sets", "");
6225 rna_def_freestyle_linesets(brna, prop);
6226}
6227
6229{
6230 static const EnumPropertyItem bake_type_items[] = {
6231 //{R_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
6232 {R_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"},
6233 {R_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"},
6235 "VECTOR_DISPLACEMENT",
6236 0,
6237 "Vector Displacement",
6238 "Bake vector displacement"},
6239 {0, nullptr, 0, nullptr, nullptr},
6240 };
6241
6242 static const EnumPropertyItem displacement_space_items[] = {
6243 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the displacement in object space"},
6244 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the displacement in tangent space"},
6245 {0, nullptr, 0, nullptr, nullptr},
6246 };
6247
6248 StructRNA *srna;
6249 PropertyRNA *prop;
6250
6251 srna = RNA_def_struct(brna, "BakeSettings", nullptr);
6252 RNA_def_struct_sdna(srna, "BakeData");
6253 RNA_def_struct_nested(brna, srna, "RenderSettings");
6254 RNA_def_struct_ui_text(srna, "Bake Data", "Bake data for a Scene data-block");
6255 RNA_def_struct_path_func(srna, "rna_BakeSettings_path");
6256
6257 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
6258 RNA_def_property_enum_items(prop, bake_type_items);
6259 RNA_def_property_ui_text(prop, "Bake Type", "Choose shading information to bake into the image");
6261
6262 prop = RNA_def_property(srna, "cage_object", PROP_POINTER, PROP_NONE);
6264 prop,
6265 "Cage Object",
6266 "Object to use as cage "
6267 "instead of calculating the cage from the active object with cage extrusion");
6270
6271 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
6272 RNA_def_property_ui_text(prop, "File Path", "Image filepath to use when saving externally");
6275
6276 prop = RNA_def_property(srna, "width", PROP_INT, PROP_PIXEL);
6277 RNA_def_property_range(prop, 4, 10000);
6278 RNA_def_property_ui_text(prop, "Width", "Horizontal dimension of the baking map");
6280
6281 prop = RNA_def_property(srna, "height", PROP_INT, PROP_PIXEL);
6282 RNA_def_property_range(prop, 4, 10000);
6283 RNA_def_property_ui_text(prop, "Height", "Vertical dimension of the baking map");
6285
6286 prop = RNA_def_property(srna, "margin", PROP_INT, PROP_PIXEL);
6288 RNA_def_property_ui_range(prop, 0, 64, 1, 1);
6289 RNA_def_property_ui_text(prop, "Margin", "Extends the baked result as a post process filter");
6291
6292 prop = RNA_def_property(srna, "margin_type", PROP_ENUM, PROP_NONE);
6294 RNA_def_property_ui_text(prop, "Margin Type", "Algorithm to extend the baked result");
6296
6297 prop = RNA_def_property(srna, "max_ray_distance", PROP_FLOAT, PROP_DISTANCE);
6298 RNA_def_property_range(prop, 0.0, FLT_MAX);
6299 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
6301 "Max Ray Distance",
6302 "The maximum ray distance for matching points between the active and "
6303 "selected objects. If zero, there is no limit.");
6305
6306 prop = RNA_def_property(srna, "cage_extrusion", PROP_FLOAT, PROP_DISTANCE);
6307 RNA_def_property_range(prop, 0.0, FLT_MAX);
6308 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
6310 prop,
6311 "Cage Extrusion",
6312 "Inflate the active object by the specified distance for baking. This helps matching to "
6313 "points nearer to the outside of the selected object meshes.");
6315
6316 prop = RNA_def_property(srna, "normal_space", PROP_ENUM, PROP_NONE);
6317 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_space");
6319 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
6321
6322 prop = RNA_def_property(srna, "normal_r", PROP_ENUM, PROP_NONE);
6323 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[0]");
6325 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in red channel");
6327
6328 prop = RNA_def_property(srna, "normal_g", PROP_ENUM, PROP_NONE);
6329 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[1]");
6331 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in green channel");
6333
6334 prop = RNA_def_property(srna, "normal_b", PROP_ENUM, PROP_NONE);
6335 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[2]");
6337 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in blue channel");
6339
6340 prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
6342 RNA_def_property_pointer_sdna(prop, nullptr, "im_format");
6343 RNA_def_property_struct_type(prop, "ImageFormatSettings");
6344 RNA_def_property_ui_text(prop, "Image Format", "");
6345
6346 prop = RNA_def_property(srna, "target", PROP_ENUM, PROP_NONE);
6348 RNA_def_property_ui_text(prop, "Target", "Where to output the baked map");
6350
6351 prop = RNA_def_property(srna, "save_mode", PROP_ENUM, PROP_NONE);
6352 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "save_mode");
6354 RNA_def_property_ui_text(prop, "Save Mode", "Where to save baked image textures");
6356
6357 prop = RNA_def_property(srna, "view_from", PROP_ENUM, PROP_NONE);
6359 RNA_def_property_ui_text(prop, "View From", "Source of reflection ray directions");
6361
6362 /* flags */
6363 prop = RNA_def_property(srna, "use_selected_to_active", PROP_BOOLEAN, PROP_NONE);
6364 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_TO_ACTIVE);
6366 "Selected to Active",
6367 "Bake shading on the surface of selected objects to the active object");
6369
6370 prop = RNA_def_property(srna, "use_clear", PROP_BOOLEAN, PROP_NONE);
6371 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_CLEAR);
6372 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking (internal only)");
6374
6375 prop = RNA_def_property(srna, "use_split_materials", PROP_BOOLEAN, PROP_NONE);
6376 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_SPLIT_MAT);
6378 prop, "Split Materials", "Split external images per material (external only)");
6380
6381 prop = RNA_def_property(srna, "use_automatic_name", PROP_BOOLEAN, PROP_NONE);
6382 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_AUTO_NAME);
6384 prop,
6385 "Automatic Name",
6386 "Automatically name the output file with the pass type (external only)");
6388
6389 prop = RNA_def_property(srna, "use_cage", PROP_BOOLEAN, PROP_NONE);
6390 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_CAGE);
6391 RNA_def_property_ui_text(prop, "Cage", "Cast rays to active object from a cage");
6393
6394 /* custom passes flags */
6395 prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
6396 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_EMIT);
6397 RNA_def_property_ui_text(prop, "Emission", "Add emission contribution");
6398
6399 prop = RNA_def_property(srna, "use_pass_direct", PROP_BOOLEAN, PROP_NONE);
6400 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_DIRECT);
6401 RNA_def_property_ui_text(prop, "Direct", "Add direct lighting contribution");
6403
6404 prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
6405 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_INDIRECT);
6406 RNA_def_property_ui_text(prop, "Indirect", "Add indirect lighting contribution");
6408
6409 prop = RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
6410 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_COLOR);
6411 RNA_def_property_ui_text(prop, "Color", "Color the pass");
6413
6414 prop = RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
6415 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_DIFFUSE);
6416 RNA_def_property_ui_text(prop, "Diffuse", "Add diffuse contribution");
6418
6419 prop = RNA_def_property(srna, "use_pass_glossy", PROP_BOOLEAN, PROP_NONE);
6420 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_GLOSSY);
6421 RNA_def_property_ui_text(prop, "Glossy", "Add glossy contribution");
6423
6424 prop = RNA_def_property(srna, "use_pass_transmission", PROP_BOOLEAN, PROP_NONE);
6425 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_TRANSM);
6426 RNA_def_property_ui_text(prop, "Transmission", "Add transmission contribution");
6428
6429 prop = RNA_def_property(srna, "pass_filter", PROP_ENUM, PROP_NONE);
6430 RNA_def_property_enum_sdna(prop, nullptr, "pass_filter");
6433 RNA_def_property_ui_text(prop, "Pass Filter", "Passes to include in the active baking pass");
6435
6436 prop = RNA_def_property(srna, "use_multires", PROP_BOOLEAN, PROP_NONE);
6437 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_MULTIRES);
6438 RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object");
6440
6441 prop = RNA_def_property(srna, "use_lores_mesh", PROP_BOOLEAN, PROP_NONE);
6442 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_LORES_MESH);
6444 prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh");
6446
6447 prop = RNA_def_property(srna, "displacement_space", PROP_ENUM, PROP_NONE);
6448 RNA_def_property_enum_sdna(prop, nullptr, "displacement_space");
6449 RNA_def_property_enum_items(prop, displacement_space_items);
6450 RNA_def_property_ui_text(prop, "Displacement Space", "Choose displacement space for baking");
6452}
6453
6455{
6456 StructRNA *srna;
6457 FunctionRNA *func;
6458 PropertyRNA *parm;
6459
6460 RNA_def_property_srna(cprop, "ViewLayers");
6461 srna = RNA_def_struct(brna, "ViewLayers", nullptr);
6462 RNA_def_struct_sdna(srna, "Scene");
6463 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
6464
6465 func = RNA_def_function(srna, "new", "rna_ViewLayer_new");
6466 RNA_def_function_ui_description(func, "Add a view layer to scene");
6468 parm = RNA_def_string(
6469 func, "name", "ViewLayer", 0, "", "New name for the view layer (not unique)");
6471 parm = RNA_def_pointer(func, "result", "ViewLayer", "", "Newly created view layer");
6473 RNA_def_function_return(func, parm);
6474
6475 func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove");
6476 RNA_def_function_ui_description(func, "Remove a view layer");
6478 parm = RNA_def_pointer(func, "layer", "ViewLayer", "", "View layer to remove");
6481
6482 func = RNA_def_function(srna, "move", "rna_ViewLayer_move");
6483 RNA_def_function_ui_description(func, "Move a view layer");
6485 parm = RNA_def_int(
6486 func, "from_index", -1, INT_MIN, INT_MAX, "From Index", "Index to move", 0, 10000);
6488 parm = RNA_def_int(func, "to_index", -1, INT_MIN, INT_MAX, "To Index", "Target index", 0, 10000);
6490}
6491
6492/* Render Views - MultiView */
6494{
6495 StructRNA *srna;
6496 PropertyRNA *prop;
6497
6498 srna = RNA_def_struct(brna, "SceneRenderView", nullptr);
6500 srna, "Scene Render View", "Render viewpoint for 3D stereo and multiview rendering");
6501 RNA_def_struct_ui_icon(srna, ICON_RESTRICT_RENDER_OFF);
6502 RNA_def_struct_path_func(srna, "rna_SceneRenderView_path");
6503
6504 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
6505 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_SceneRenderView_name_set");
6506 RNA_def_property_ui_text(prop, "Name", "Render view name");
6507 RNA_def_struct_name_property(srna, prop);
6509
6510 prop = RNA_def_property(srna, "file_suffix", PROP_STRING, PROP_NONE);
6511 RNA_def_property_string_sdna(prop, nullptr, "suffix");
6512 RNA_def_property_ui_text(prop, "File Suffix", "Suffix added to the render images for this view");
6514
6515 prop = RNA_def_property(srna, "camera_suffix", PROP_STRING, PROP_NONE);
6516 RNA_def_property_string_sdna(prop, nullptr, "suffix");
6518 prop,
6519 "Camera Suffix",
6520 "Suffix to identify the cameras to use, and added to the render images for this view");
6522
6523 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
6524 RNA_def_property_boolean_negative_sdna(prop, nullptr, "viewflag", SCE_VIEW_DISABLE);
6526 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render view");
6528 prop, NC_SCENE | ND_RENDER_OPTIONS | NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
6529}
6530
6532{
6533 StructRNA *srna;
6534 PropertyRNA *prop;
6535
6536 FunctionRNA *func;
6537 PropertyRNA *parm;
6538
6539 RNA_def_property_srna(cprop, "RenderViews");
6540 srna = RNA_def_struct(brna, "RenderViews", nullptr);
6541 RNA_def_struct_sdna(srna, "RenderData");
6542 RNA_def_struct_ui_text(srna, "Render Views", "Collection of render views");
6543
6544 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
6545 RNA_def_property_int_sdna(prop, nullptr, "actview");
6547 "rna_RenderSettings_active_view_index_get",
6548 "rna_RenderSettings_active_view_index_set",
6549 "rna_RenderSettings_active_view_index_range");
6550 RNA_def_property_ui_text(prop, "Active View Index", "Active index in render view array");
6552
6553 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
6554 RNA_def_property_struct_type(prop, "SceneRenderView");
6556 "rna_RenderSettings_active_view_get",
6557 "rna_RenderSettings_active_view_set",
6558 nullptr,
6559 nullptr);
6561 RNA_def_property_ui_text(prop, "Active Render View", "Active Render View");
6563
6564 func = RNA_def_function(srna, "new", "rna_RenderView_new");
6565 RNA_def_function_ui_description(func, "Add a render view to scene");
6567 parm = RNA_def_string(
6568 func, "name", "RenderView", 0, "", "New name for the render view (not unique)");
6570 parm = RNA_def_pointer(func, "result", "SceneRenderView", "", "Newly created render view");
6572 RNA_def_function_return(func, parm);
6573
6574 func = RNA_def_function(srna, "remove", "rna_RenderView_remove");
6575 RNA_def_function_ui_description(func, "Remove a render view");
6577 parm = RNA_def_pointer(func, "view", "SceneRenderView", "", "Render view to remove");
6580}
6581
6583{
6584 StructRNA *srna;
6585 PropertyRNA *prop;
6586
6587 /* rna_enum_stereo3d_display_items, without (S3D_DISPLAY_PAGEFLIP) */
6588 static const EnumPropertyItem stereo3d_display_items[] = {
6590 "ANAGLYPH",
6591 0,
6592 "Anaglyph",
6593 "Render views for left and right eyes as two differently filtered colors in a single image "
6594 "(anaglyph glasses are required)"},
6596 "INTERLACE",
6597 0,
6598 "Interlace",
6599 "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
6600 "required)"},
6602 "SIDEBYSIDE",
6603 0,
6604 "Side-by-Side",
6605 "Render views for left and right eyes side-by-side"},
6607 "TOPBOTTOM",
6608 0,
6609 "Top-Bottom",
6610 "Render views for left and right eyes one above another"},
6611 {0, nullptr, 0, nullptr, nullptr},
6612 };
6613
6614 srna = RNA_def_struct(brna, "Stereo3dFormat", nullptr);
6615 RNA_def_struct_sdna(srna, "Stereo3dFormat");
6616 RNA_def_struct_ui_text(srna, "Stereo Output", "Settings for stereo output");
6617
6618 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
6619 RNA_def_property_enum_sdna(prop, nullptr, "display_mode");
6620 RNA_def_property_enum_items(prop, stereo3d_display_items);
6621 RNA_def_property_ui_text(prop, "Stereo Mode", "");
6622 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6623
6624 prop = RNA_def_property(srna, "anaglyph_type", PROP_ENUM, PROP_NONE);
6626 RNA_def_property_ui_text(prop, "Anaglyph Type", "");
6627 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6628
6629 prop = RNA_def_property(srna, "interlace_type", PROP_ENUM, PROP_NONE);
6631 RNA_def_property_ui_text(prop, "Interlace Type", "");
6632 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6633
6634 prop = RNA_def_property(srna, "use_interlace_swap", PROP_BOOLEAN, PROP_BOOLEAN);
6635 RNA_def_property_boolean_sdna(prop, nullptr, "flag", S3D_INTERLACE_SWAP);
6636 RNA_def_property_ui_text(prop, "Swap Left/Right", "Swap left and right stereo channels");
6637 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6638
6639 prop = RNA_def_property(srna, "use_sidebyside_crosseyed", PROP_BOOLEAN, PROP_BOOLEAN);
6641 RNA_def_property_ui_text(prop, "Cross-Eyed", "Right eye should see left image and vice versa");
6642 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6643
6644 prop = RNA_def_property(srna, "use_squeezed_frame", PROP_BOOLEAN, PROP_BOOLEAN);
6645 RNA_def_property_boolean_sdna(prop, nullptr, "flag", S3D_SQUEEZED_FRAME);
6646 RNA_def_property_ui_text(prop, "Squeezed Frame", "Combine both views in a squeezed image");
6647 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6648}
6649
6650/* use for render output and image save operator,
6651 * NOTE: there are some cases where the members act differently when this is
6652 * used from a scene, video formats can only be selected for render output
6653 * for example, this is checked by seeing if the ptr->owner_id is a Scene id */
6654
6656{
6657# ifdef WITH_IMAGE_OPENJPEG
6658 static const EnumPropertyItem jp2_codec_items[] = {
6659 {R_IMF_JP2_CODEC_JP2, "JP2", 0, "JP2", ""},
6660 {R_IMF_JP2_CODEC_J2K, "J2K", 0, "J2K", ""},
6661 {0, nullptr, 0, nullptr, nullptr},
6662 };
6663# endif
6664
6665 static const EnumPropertyItem tiff_codec_items[] = {
6666 {R_IMF_TIFF_CODEC_NONE, "NONE", 0, "None", ""},
6667 {R_IMF_TIFF_CODEC_DEFLATE, "DEFLATE", 0, "Deflate", ""},
6668 {R_IMF_TIFF_CODEC_LZW, "LZW", 0, "LZW", ""},
6669 {R_IMF_TIFF_CODEC_PACKBITS, "PACKBITS", 0, "Pack Bits", ""},
6670 {0, nullptr, 0, nullptr, nullptr},
6671 };
6672
6673 static const EnumPropertyItem color_management_items[] = {
6674 {R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE, "FOLLOW_SCENE", 0, "Follow Scene", ""},
6675 {R_IMF_COLOR_MANAGEMENT_OVERRIDE, "OVERRIDE", 0, "Override", ""},
6676 {0, nullptr, 0, nullptr, nullptr},
6677 };
6678
6679 StructRNA *srna;
6680 PropertyRNA *prop;
6681
6683
6684 srna = RNA_def_struct(brna, "ImageFormatSettings", nullptr);
6685 RNA_def_struct_sdna(srna, "ImageFormatData");
6686 RNA_def_struct_nested(brna, srna, "Scene");
6687 RNA_def_struct_path_func(srna, "rna_ImageFormatSettings_path");
6688 RNA_def_struct_ui_text(srna, "Image Format", "Settings for image formats");
6689
6690 prop = RNA_def_property(srna, "media_type", PROP_ENUM, PROP_NONE);
6691 RNA_def_property_enum_sdna(prop, nullptr, "media_type");
6694 nullptr,
6695 "rna_ImageFormatSettings_media_type_set",
6696 "rna_ImageFormatSettings_media_type_itemf");
6697 RNA_def_property_ui_text(prop, "Media Type", "The type of media to save");
6699
6700 prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
6701 RNA_def_property_enum_sdna(prop, nullptr, "imtype");
6704 nullptr,
6705 "rna_ImageFormatSettings_file_format_set",
6706 "rna_ImageFormatSettings_file_format_itemf");
6707 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
6709
6710 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
6711 RNA_def_property_enum_sdna(prop, nullptr, "color_mode");
6713 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_color_mode_itemf");
6715 prop,
6716 "Color Mode",
6717 "Choose BW for saving grayscale images, RGB for saving red, green and blue channels, "
6718 "and RGBA for saving red, green, blue and alpha channels");
6720
6721 prop = RNA_def_property(srna, "color_depth", PROP_ENUM, PROP_NONE);
6722 RNA_def_property_enum_sdna(prop, nullptr, "depth");
6724 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_color_depth_itemf");
6725 RNA_def_property_ui_text(prop, "Color Depth", "Bit depth per channel");
6727
6728 /* was 'file_quality' */
6729 prop = RNA_def_property(srna, "quality", PROP_INT, PROP_PERCENTAGE);
6730 RNA_def_property_int_sdna(prop, nullptr, "quality");
6731 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
6733 prop, "Quality", "Quality for image formats that support lossy compression");
6735
6736 /* was shared with file_quality */
6737 prop = RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE);
6738 RNA_def_property_int_sdna(prop, nullptr, "compress");
6739 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
6741 "Compression",
6742 "Amount of time to determine best compression: "
6743 "0 = no compression with fast file output, "
6744 "100 = maximum lossless compression with slow file output");
6746
6747 prop = RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE);
6750 prop, "Preview", "When rendering animations, save JPG preview images in same directory");
6752
6753 /* format specific */
6754
6755 /* OpenEXR */
6756 prop = RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
6757 RNA_def_property_enum_sdna(prop, nullptr, "exr_codec");
6759 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_exr_codec_itemf");
6760 RNA_def_property_ui_text(prop, "Codec", "Compression codec settings for OpenEXR");
6762
6763 prop = RNA_def_property(srna, "use_exr_interleave", PROP_BOOLEAN, PROP_NONE);
6766 prop,
6767 "Interleave",
6768 "Use legacy interleaved storage of views, layers and passes for compatibility with "
6769 "applications that do not support more efficient multi-part OpenEXR files.");
6771
6772# ifdef WITH_IMAGE_OPENJPEG
6773 /* JPEG 2000 */
6774 prop = RNA_def_property(srna, "use_jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
6775 RNA_def_property_boolean_sdna(prop, nullptr, "jp2_flag", R_IMF_JP2_FLAG_YCC);
6777 prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
6779
6780 prop = RNA_def_property(srna, "use_jpeg2k_cinema_preset", PROP_BOOLEAN, PROP_NONE);
6782 RNA_def_property_ui_text(prop, "Cinema", "Use OpenJPEG Cinema Preset");
6784
6785 prop = RNA_def_property(srna, "use_jpeg2k_cinema_48", PROP_BOOLEAN, PROP_NONE);
6786 RNA_def_property_boolean_sdna(prop, nullptr, "jp2_flag", R_IMF_JP2_FLAG_CINE_48);
6787 RNA_def_property_ui_text(prop, "Cinema (48)", "Use OpenJPEG Cinema Preset (48fps)");
6789
6790 prop = RNA_def_property(srna, "jpeg2k_codec", PROP_ENUM, PROP_NONE);
6791 RNA_def_property_enum_sdna(prop, nullptr, "jp2_codec");
6792 RNA_def_property_enum_items(prop, jp2_codec_items);
6793 RNA_def_property_ui_text(prop, "Codec", "Codec settings for JPEG 2000");
6795# endif
6796
6797 /* TIFF */
6798 prop = RNA_def_property(srna, "tiff_codec", PROP_ENUM, PROP_NONE);
6799 RNA_def_property_enum_sdna(prop, nullptr, "tiff_codec");
6800 RNA_def_property_enum_items(prop, tiff_codec_items);
6801 RNA_def_property_ui_text(prop, "Compression", "Compression mode for TIFF");
6803
6804 /* Cineon and DPX */
6805
6806 prop = RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
6807 RNA_def_property_boolean_sdna(prop, nullptr, "cineon_flag", R_IMF_CINEON_FLAG_LOG);
6808 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
6810
6811 prop = RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
6812 RNA_def_property_int_sdna(prop, nullptr, "cineon_black");
6813 RNA_def_property_range(prop, 0, 1024);
6814 RNA_def_property_ui_text(prop, "Black", "Log conversion reference blackpoint");
6816
6817 prop = RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
6818 RNA_def_property_int_sdna(prop, nullptr, "cineon_white");
6819 RNA_def_property_range(prop, 0, 1024);
6820 RNA_def_property_ui_text(prop, "White", "Log conversion reference whitepoint");
6822
6823 prop = RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
6824 RNA_def_property_float_sdna(prop, nullptr, "cineon_gamma");
6825 RNA_def_property_range(prop, 0.0f, 10.0f);
6826 RNA_def_property_ui_text(prop, "Gamma", "Log conversion gamma");
6828
6829 /* multiview */
6830 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
6831 RNA_def_property_enum_sdna(prop, nullptr, "views_format");
6834 prop, nullptr, nullptr, "rna_ImageFormatSettings_views_format_itemf");
6835 RNA_def_property_ui_text(prop, "Views Format", "Format of multiview media");
6837
6838 prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
6839 RNA_def_property_pointer_sdna(prop, nullptr, "stereo3d_format");
6841 RNA_def_property_struct_type(prop, "Stereo3dFormat");
6842 RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3D");
6843
6844 /* color management */
6845 prop = RNA_def_property(srna, "color_management", PROP_ENUM, PROP_NONE);
6846 RNA_def_property_enum_items(prop, color_management_items);
6848 prop, "Color Management", "Which color management settings to use for file saving");
6850 prop, nullptr, "rna_ImageFormatSettings_color_management_set", nullptr);
6852
6853 prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
6854 RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
6856 prop, "View Settings", "Color management settings applied on image before saving");
6857
6858 prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
6859 RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
6861 prop, "Display Settings", "Settings of device saved image would be displayed on");
6862
6863 prop = RNA_def_property(srna, "linear_colorspace_settings", PROP_POINTER, PROP_NONE);
6864 RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
6865 RNA_def_property_ui_text(prop, "Color Space Settings", "Output color space settings");
6866
6867 prop = RNA_def_property(srna, "has_linear_colorspace", PROP_BOOLEAN, PROP_NONE);
6869 prop, "rna_ImageFormatSettings_has_linear_colorspace_get", nullptr);
6872 prop, "Has Linear Color Space", "File format expects linear color space");
6873}
6874
6876{
6877 StructRNA *srna;
6878 PropertyRNA *prop;
6879
6880# ifdef WITH_FFMPEG
6881 /* Container types */
6882 static const EnumPropertyItem ffmpeg_format_items[] = {
6883 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
6884 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
6885 {FFMPEG_WEBM, "WEBM", 0, "WebM", ""},
6886 /* Legacy containers. */
6888 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
6889 {FFMPEG_DV, "DV", 0, "DV", ""},
6890 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
6891 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
6892 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
6893 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
6894 {FFMPEG_MOV, "QUICKTIME", 0, "QuickTime", ""},
6895 {0, nullptr, 0, nullptr, nullptr},
6896 };
6897
6898 static const EnumPropertyItem ffmpeg_codec_items[] = {
6900 "NONE",
6901 0,
6902 "No Video",
6903 "Disables video output, for audio-only renders"},
6904 {FFMPEG_CODEC_ID_AV1, "AV1", 0, "AV1", ""},
6905 {FFMPEG_CODEC_ID_H264, "H264", 0, "H.264", ""},
6906 {FFMPEG_CODEC_ID_H265, "H265", 0, "H.265 / HEVC", ""},
6907 {FFMPEG_CODEC_ID_VP9, "WEBM", 0, "WebM / VP9", ""},
6908 /* Legacy / rare codecs. */
6910 {FFMPEG_CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""},
6911 {FFMPEG_CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
6912 {FFMPEG_CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
6913 {FFMPEG_CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
6914 {FFMPEG_CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
6915 {FFMPEG_CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
6916 {FFMPEG_CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
6917 {FFMPEG_CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4 (divx)", ""},
6918 {FFMPEG_CODEC_ID_PNG, "PNG", 0, "PNG", ""},
6919 {FFMPEG_CODEC_ID_PRORES, "PRORES", 0, "ProRes", ""},
6920 {FFMPEG_CODEC_ID_QTRLE, "QTRLE", 0, "QuickTime Animation", ""},
6921 {FFMPEG_CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
6922 {0, nullptr, 0, nullptr, nullptr},
6923 };
6924
6925 /* Recommendations come from the FFmpeg wiki, https://trac.ffmpeg.org/wiki/Encode/VP9.
6926 * The label for BEST has been changed to "Slowest" so that it fits the "Encoding Speed"
6927 * property label in the UI. */
6928 static const EnumPropertyItem ffmpeg_preset_items[] = {
6930 "BEST",
6931 0,
6932 "Slowest",
6933 "Recommended if you have lots of time and want the best compression efficiency"},
6934 {FFM_PRESET_GOOD, "GOOD", 0, "Good", "The default and recommended for most applications"},
6935 {FFM_PRESET_REALTIME, "REALTIME", 0, "Realtime", "Recommended for fast encoding"},
6936 {0, nullptr, 0, nullptr, nullptr},
6937 };
6938
6939 static const EnumPropertyItem ffmpeg_prores_profiles_items[] = {
6940 {FFM_PRORES_PROFILE_422_PROXY, "422_PROXY", 0, "ProRes 422 Proxy", ""},
6941 {FFM_PRORES_PROFILE_422_LT, "422_LT", 0, "ProRes 422 LT", ""},
6942 {FFM_PRORES_PROFILE_422_STD, "422_STD", 0, "ProRes 422", ""},
6943 {FFM_PRORES_PROFILE_422_HQ, "422_HQ", 0, "ProRes 422 HQ", ""},
6944 {FFM_PRORES_PROFILE_4444, "4444", 0, "ProRes 4444", ""},
6945 {FFM_PRORES_PROFILE_4444_XQ, "4444_XQ", 0, "ProRes 4444 XQ", ""},
6946 {0, nullptr, 0, nullptr, nullptr},
6947 };
6948
6949 static const EnumPropertyItem ffmpeg_crf_items[] = {
6950 {FFM_CRF_NONE,
6951 "NONE",
6952 0,
6953 "Constant Bitrate",
6954 "Configure constant bit rate, rather than constant output quality"},
6955 {FFM_CRF_LOSSLESS, "LOSSLESS", 0, "Lossless", ""},
6956 {FFM_CRF_PERC_LOSSLESS, "PERC_LOSSLESS", 0, "Perceptually Lossless", ""},
6957 {FFM_CRF_HIGH, "HIGH", 0, "High Quality", ""},
6958 {FFM_CRF_MEDIUM, "MEDIUM", 0, "Medium Quality", ""},
6959 {FFM_CRF_LOW, "LOW", 0, "Low Quality", ""},
6960 {FFM_CRF_VERYLOW, "VERYLOW", 0, "Very Low Quality", ""},
6961 {FFM_CRF_LOWEST, "LOWEST", 0, "Lowest Quality", ""},
6962 {FFM_CRF_CUSTOM, "CUSTOM", 0, "Custom Quality", "Set a custom Constant Rate Factor (CRF)."},
6963 {0, nullptr, 0, nullptr, nullptr},
6964 };
6965
6966 static const EnumPropertyItem ffmpeg_audio_codec_items[] = {
6968 "NONE",
6969 0,
6970 "No Audio",
6971 "Disables audio output, for video-only renders"},
6972 {FFMPEG_CODEC_ID_AAC, "AAC", 0, "AAC", ""},
6973 {FFMPEG_CODEC_ID_AC3, "AC3", 0, "AC3", ""},
6974 {FFMPEG_CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
6975 {FFMPEG_CODEC_ID_MP2, "MP2", 0, "MP2", ""},
6976 {FFMPEG_CODEC_ID_MP3, "MP3", 0, "MP3", ""},
6977 {FFMPEG_CODEC_ID_OPUS, "OPUS", 0, "Opus", ""},
6978 {FFMPEG_CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
6979 {FFMPEG_CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
6980 {0, nullptr, 0, nullptr, nullptr},
6981 };
6982# endif
6983
6984 static const EnumPropertyItem audio_channel_items[] = {
6985 {FFM_CHANNELS_MONO, "MONO", 0, "Mono", "Set audio channels to mono"},
6986 {FFM_CHANNELS_STEREO, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
6987 {FFM_CHANNELS_SURROUND4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
6989 "SURROUND51",
6990 0,
6991 "5.1 Surround",
6992 "Set audio channels to 5.1 surround sound"},
6994 "SURROUND71",
6995 0,
6996 "7.1 Surround",
6997 "Set audio channels to 7.1 surround sound"},
6998 {0, nullptr, 0, nullptr, nullptr},
6999 };
7000
7001 srna = RNA_def_struct(brna, "FFmpegSettings", nullptr);
7002 RNA_def_struct_sdna(srna, "FFMpegCodecData");
7003 RNA_def_struct_path_func(srna, "rna_FFmpegSettings_path");
7004 RNA_def_struct_ui_text(srna, "FFmpeg Settings", "FFmpeg related settings for the scene");
7005
7006# ifdef WITH_FFMPEG
7007 prop = RNA_def_property(srna, "format", PROP_ENUM, PROP_NONE);
7008 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "type");
7010 RNA_def_property_enum_items(prop, ffmpeg_format_items);
7012 RNA_def_property_ui_text(prop, "Container", "Output file container");
7013
7014 prop = RNA_def_property(srna, "codec", PROP_ENUM, PROP_NONE);
7015 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "codec");
7017 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
7019 RNA_def_property_ui_text(prop, "Video Codec", "FFmpeg codec to use for video output");
7020 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_FFmpegSettings_codec_update");
7021
7022 prop = RNA_def_property(srna, "video_bitrate", PROP_INT, PROP_NONE);
7023 RNA_def_property_int_sdna(prop, nullptr, "video_bitrate");
7025 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kbit/s)");
7027
7028 prop = RNA_def_property(srna, "minrate", PROP_INT, PROP_NONE);
7029 RNA_def_property_int_sdna(prop, nullptr, "rc_min_rate");
7031 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kbit/s)");
7033
7034 prop = RNA_def_property(srna, "maxrate", PROP_INT, PROP_NONE);
7035 RNA_def_property_int_sdna(prop, nullptr, "rc_max_rate");
7037 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kbit/s)");
7039
7040 prop = RNA_def_property(srna, "muxrate", PROP_INT, PROP_NONE);
7041 RNA_def_property_int_sdna(prop, nullptr, "mux_rate");
7043 RNA_def_property_range(prop, 0, 100000000);
7044 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/second)");
7046
7047 prop = RNA_def_property(srna, "gopsize", PROP_INT, PROP_NONE);
7048 RNA_def_property_int_sdna(prop, nullptr, "gop_size");
7050 RNA_def_property_range(prop, 0, 500);
7053 "Keyframe Interval",
7054 "Distance between key frames, also known as GOP size; "
7055 "influences file size and seekability");
7057
7058 prop = RNA_def_property(srna, "max_b_frames", PROP_INT, PROP_NONE);
7059 RNA_def_property_int_sdna(prop, nullptr, "max_b_frames");
7061 RNA_def_property_range(prop, 0, 16);
7063 prop,
7064 "Max B-Frames",
7065 "Maximum number of B-frames between non-B-frames; influences file size and seekability");
7067
7068 prop = RNA_def_property(srna, "use_max_b_frames", PROP_BOOLEAN, PROP_NONE);
7071 RNA_def_property_ui_text(prop, "Use Max B-Frames", "Set a maximum number of B-frames");
7073
7074 prop = RNA_def_property(srna, "buffersize", PROP_INT, PROP_NONE);
7075 RNA_def_property_int_sdna(prop, nullptr, "rc_buffer_size");
7077 RNA_def_property_range(prop, 0, 2000);
7078 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
7080
7081 prop = RNA_def_property(srna, "packetsize", PROP_INT, PROP_NONE);
7082 RNA_def_property_int_sdna(prop, nullptr, "mux_packet_size");
7084 RNA_def_property_range(prop, 0, 16384);
7085 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
7087
7088 prop = RNA_def_property(srna, "constant_rate_factor", PROP_ENUM, PROP_NONE);
7089 RNA_def_property_enum_sdna(prop, nullptr, "constant_rate_factor");
7091 RNA_def_property_enum_items(prop, ffmpeg_crf_items);
7094 prop,
7095 "Output Quality",
7096 "Constant Rate Factor (CRF); tradeoff between video quality and file size");
7098
7099 prop = RNA_def_property(srna, "custom_constant_rate_factor", PROP_INT, PROP_NONE);
7100 RNA_def_property_int_sdna(prop, nullptr, "custom_constant_rate_factor");
7102 RNA_def_property_range(prop, 0, 63);
7104 prop,
7105 "CRF",
7106 "A smaller Constant Rate Factor (CRF) results in better video quality but larger file size. "
7107 "The range of allowed CRF values is dependent on the codec.");
7109
7110 prop = RNA_def_property(srna, "ffmpeg_preset", PROP_ENUM, PROP_NONE);
7111 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "ffmpeg_preset");
7113 RNA_def_property_enum_items(prop, ffmpeg_preset_items);
7116 prop, "Encoding Speed", "Tradeoff between encoding speed and compression ratio");
7118
7119 prop = RNA_def_property(srna, "ffmpeg_prores_profile", PROP_ENUM, PROP_NONE);
7120 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "ffmpeg_prores_profile");
7122 RNA_def_property_enum_items(prop, ffmpeg_prores_profiles_items);
7124 RNA_def_property_ui_text(prop, "Profile", "ProRes Profile");
7126
7127 prop = RNA_def_property(srna, "use_autosplit", PROP_BOOLEAN, PROP_NONE);
7130 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
7132
7133 prop = RNA_def_property(srna, "use_lossless_output", PROP_BOOLEAN, PROP_NONE);
7136 RNA_def_property_boolean_funcs(prop, nullptr, "rna_FFmpegSettings_lossless_output_set");
7137 RNA_def_property_ui_text(prop, "Lossless Output", "Use lossless output for video streams");
7139
7140 /* FFMPEG Audio. */
7141 prop = RNA_def_property(srna, "audio_codec", PROP_ENUM, PROP_NONE);
7142 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "audio_codec");
7144 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
7145 RNA_def_property_ui_text(prop, "Audio Codec", "FFmpeg audio codec to use");
7147
7148 prop = RNA_def_property(srna, "audio_bitrate", PROP_INT, PROP_NONE);
7149 RNA_def_property_int_sdna(prop, nullptr, "audio_bitrate");
7151 RNA_def_property_range(prop, 32, 2048);
7152 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)");
7154
7155 prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
7156 RNA_def_property_float_sdna(prop, nullptr, "audio_volume");
7158 RNA_def_property_range(prop, 0.0f, 1.0f);
7159 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
7162# endif
7163
7164 /* the following two "ffmpeg" settings are general audio settings */
7165 prop = RNA_def_property(srna, "audio_mixrate", PROP_INT, PROP_NONE);
7166 RNA_def_property_int_sdna(prop, nullptr, "audio_mixrate");
7168 RNA_def_property_range(prop, 8000, 192000);
7169 RNA_def_property_ui_text(prop, "Sample Rate", "Audio sample rate (samples/s)");
7171
7172 prop = RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
7173 RNA_def_property_enum_sdna(prop, nullptr, "audio_channels");
7175 RNA_def_property_enum_items(prop, audio_channel_items);
7176 RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
7177}
7178
7180{
7181 StructRNA *srna;
7182 PropertyRNA *prop;
7183
7184 static const EnumPropertyItem pixel_size_items[] = {
7185 {0, "AUTO", 0, "Automatic", "Automatic pixel size, depends on the user interface scale"},
7186 {1, "1", 0, "1" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at full resolution"},
7187 {2, "2", 0, "2" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 50% resolution"},
7188 {4, "4", 0, "4" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 25% resolution"},
7189 {8, "8", 0, "8" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 12.5% resolution"},
7190 {0, nullptr, 0, nullptr, nullptr},
7191 };
7192
7193 static const EnumPropertyItem anisotropic_items[] = {
7194 {1, "FILTER_0", 0, "Off", "Turn off anisotropic filtering"},
7195 {2,
7196 "FILTER_2",
7197 0,
7199 "Use 2 samples for anisotropic filtering"},
7200 {4,
7201 "FILTER_4",
7202 0,
7204 "Use 4 samples for anisotropic filtering"},
7205 {8,
7206 "FILTER_8",
7207 0,
7209 "Use 8 samples for anisotropic filtering"},
7210 {16,
7211 "FILTER_16",
7212 0,
7214 "Use 16 samples for anisotropic filtering"},
7215 {0, nullptr, 0, nullptr, nullptr},
7216 };
7217
7218 static const EnumPropertyItem threads_mode_items[] = {
7219 {0,
7220 "AUTO",
7221 0,
7222 "Auto-Detect",
7223 "Automatically determine the number of threads, based on CPUs"},
7224 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
7225 {0, nullptr, 0, nullptr, nullptr},
7226 };
7227
7228 static const EnumPropertyItem engine_items[] = {
7229 {0, "BLENDER_EEVEE", 0, "EEVEE", ""},
7230 {0, nullptr, 0, nullptr, nullptr},
7231 };
7232
7233 static const EnumPropertyItem freestyle_thickness_items[] = {
7235 "ABSOLUTE",
7236 0,
7237 "Absolute",
7238 "Specify unit line thickness in pixels"},
7240 "RELATIVE",
7241 0,
7242 "Relative",
7243 "Unit line thickness is scaled by the proportion of the present vertical image "
7244 "resolution to 480 pixels"},
7245 {0, nullptr, 0, nullptr, nullptr},
7246 };
7247
7248 static const EnumPropertyItem views_format_items[] = {
7250 "STEREO_3D",
7251 0,
7252 "Stereo 3D",
7253 "Single stereo camera system, adjust the stereo settings in the camera panel"},
7255 "MULTIVIEW",
7256 0,
7257 "Multi-View",
7258 "Multi camera system, adjust the cameras individually"},
7259 {0, nullptr, 0, nullptr, nullptr},
7260 };
7261
7262 static const EnumPropertyItem motion_blur_position_items[] = {
7263 {SCE_MB_START, "START", 0, "Start on Frame", "The shutter opens at the current frame"},
7265 "CENTER",
7266 0,
7267 "Center on Frame",
7268 "The shutter is open during the current frame"},
7269 {SCE_MB_END, "END", 0, "End on Frame", "The shutter closes at the current frame"},
7270 {0, nullptr, 0, nullptr, nullptr},
7271 };
7272
7273 static const EnumPropertyItem hair_shape_type_items[] = {
7274 {SCE_HAIR_SHAPE_STRAND, "STRAND", 0, "Strand", ""},
7275 {SCE_HAIR_SHAPE_STRIP, "STRIP", 0, "Strip", ""},
7276 {SCE_HAIR_SHAPE_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
7277 {0, nullptr, 0, nullptr, nullptr},
7278 };
7279
7280 static const EnumPropertyItem meta_input_items[] = {
7281 {0, "SCENE", 0, "Scene", "Use metadata from the current scene"},
7283 "STRIPS",
7284 0,
7285 "Sequencer Strips",
7286 "Use metadata from the strips in the sequencer"},
7287 {0, nullptr, 0, nullptr, nullptr},
7288 };
7289
7290 static const EnumPropertyItem compositor_device_items[] = {
7291 {SCE_COMPOSITOR_DEVICE_CPU, "CPU", 0, "CPU", ""},
7292 {SCE_COMPOSITOR_DEVICE_GPU, "GPU", 0, "GPU", ""},
7293 {0, nullptr, 0, nullptr, nullptr},
7294 };
7295
7296 static const EnumPropertyItem compositor_precision_items[] = {
7298 "AUTO",
7299 0,
7300 "Auto",
7301 "Full precision for final renders, half precision otherwise"},
7302 {SCE_COMPOSITOR_PRECISION_FULL, "FULL", 0, "Full", "Full precision"},
7303 {0, nullptr, 0, nullptr, nullptr},
7304 };
7305
7306 static const EnumPropertyItem compositor_denoise_device_items[] = {
7308 "AUTO",
7309 0,
7310 "Auto",
7311 "Use the same device used by the compositor to process the denoise node"},
7313 "CPU",
7314 0,
7315 "CPU",
7316 "Use the CPU to process the denoise node"},
7318 "GPU",
7319 0,
7320 "GPU",
7321 "Use the GPU to process the denoise node if available, otherwise fallback to CPU"},
7322 {0, nullptr, 0, nullptr, nullptr},
7323 };
7324
7325 static const EnumPropertyItem compositor_denoise_quality_items[] = {
7326 {SCE_COMPOSITOR_DENOISE_HIGH, "HIGH", 0, "High", "High quality"},
7328 "BALANCED",
7329 0,
7330 "Balanced",
7331 "Balanced between performance and quality"},
7332 {SCE_COMPOSITOR_DENOISE_FAST, "FAST", 0, "Fast", "High performance"},
7333 {0, nullptr, 0, nullptr, nullptr},
7334 };
7335
7337
7338 srna = RNA_def_struct(brna, "RenderSettings", nullptr);
7339 RNA_def_struct_sdna(srna, "RenderData");
7340 RNA_def_struct_nested(brna, srna, "Scene");
7341 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
7342 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene data-block");
7343
7344 /* Render Data */
7345 prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
7347 RNA_def_property_pointer_sdna(prop, nullptr, "im_format");
7348 RNA_def_property_struct_type(prop, "ImageFormatSettings");
7349 RNA_def_property_ui_text(prop, "Image Format", "");
7350
7351 prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL);
7352 RNA_def_property_int_sdna(prop, nullptr, "xsch");
7355 RNA_def_property_range(prop, 4, 65536);
7357 prop, "Resolution X", "Number of horizontal pixels in the rendered image");
7358 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7359
7360 prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL);
7361 RNA_def_property_int_sdna(prop, nullptr, "ysch");
7364 RNA_def_property_range(prop, 4, 65536);
7366 prop, "Resolution Y", "Number of vertical pixels in the rendered image");
7367 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7368
7369 prop = RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
7370 RNA_def_property_int_sdna(prop, nullptr, "size");
7373 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
7374 RNA_def_property_ui_text(prop, "Resolution Scale", "Percentage scale for render resolution");
7375 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneSequencer_update");
7376
7377 prop = RNA_def_property(srna, "preview_pixel_size", PROP_ENUM, PROP_NONE);
7378 RNA_def_property_enum_sdna(prop, nullptr, "preview_pixel_size");
7379 RNA_def_property_enum_items(prop, pixel_size_items);
7380 RNA_def_property_ui_text(prop, "Pixel Size", "Pixel size for viewport rendering");
7382
7383 prop = RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
7384 RNA_def_property_float_sdna(prop, nullptr, "xasp");
7387 RNA_def_property_range(prop, 1.0f, 200.0f);
7389 "Pixel Aspect X",
7390 "Horizontal aspect ratio - for anamorphic or non-square pixel output");
7391 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7392
7393 prop = RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
7394 RNA_def_property_float_sdna(prop, nullptr, "yasp");
7397 RNA_def_property_range(prop, 1.0f, 200.0f);
7399 prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
7400 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7401
7402 /* Pixels per meters (also DPI). */
7403 prop = RNA_def_property(srna, "ppm_factor", PROP_FLOAT, PROP_NONE);
7404 RNA_def_property_float_sdna(prop, nullptr, "ppm_factor");
7406 RNA_def_property_range(prop, 1e-5f, 1e6f);
7407 RNA_def_property_ui_range(prop, 0.0001f, 10000.0f, 2, 2);
7409 "PPM Factor",
7410 "The pixel density meta-data written to supported image formats. "
7411 "This value is multiplied by the PPM-base which defines the unit "
7412 "(typically inches or meters)");
7413
7414 prop = RNA_def_property(srna, "ppm_base", PROP_FLOAT, PROP_NONE);
7415 RNA_def_property_float_sdna(prop, nullptr, "ppm_base");
7417 RNA_def_property_range(prop, 1e-5f, 1e6f);
7418 /* Important to show at least 3 decimal points because multiple presets set this to 1.001. */
7419 RNA_def_property_ui_range(prop, 0.0001f, 10000.0f, 2, 4);
7420 RNA_def_property_ui_text(prop, "PPM Base", "The base unit for pixels per meter.");
7421
7422 prop = RNA_def_property(srna, "ffmpeg", PROP_POINTER, PROP_NONE);
7423 RNA_def_property_struct_type(prop, "FFmpegSettings");
7424 RNA_def_property_pointer_sdna(prop, nullptr, "ffcodecdata");
7426 RNA_def_property_ui_text(prop, "FFmpeg Settings", "FFmpeg related settings for the scene");
7427
7428 prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
7429 RNA_def_property_int_sdna(prop, nullptr, "frs_sec");
7432 RNA_def_property_ui_range(prop, 1, 240, 1, -1);
7433 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
7434 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
7435
7436 prop = RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
7437 RNA_def_property_float_sdna(prop, nullptr, "frs_sec_base");
7439 RNA_def_property_range(prop, 1e-5f, 1e6f);
7440 /* Important to show at least 3 decimal points because multiple presets set this to 1.001. */
7441 RNA_def_property_ui_range(prop, 0.1f, 120.0f, 2, 3);
7442 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
7443 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
7444
7445 /* frame mapping */
7446 prop = RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
7447 RNA_def_property_int_sdna(prop, nullptr, "framapto");
7449 RNA_def_property_range(prop, 1, 900);
7450 RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames");
7451 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
7452
7453 prop = RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
7454 RNA_def_property_int_sdna(prop, nullptr, "images");
7456 RNA_def_property_range(prop, 1, 900);
7457 RNA_def_property_ui_text(prop, "Frame Map New", "How many frames the Map Old will last");
7458 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
7459
7460 prop = RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
7461 RNA_def_property_float_sdna(prop, nullptr, "dither_intensity");
7462 RNA_def_property_range(prop, 0.0, FLT_MAX);
7463 RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 2);
7465 prop,
7466 "Dither Intensity",
7467 "Amount of dithering noise added to the rendered image to break up banding");
7469
7470 prop = RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_PIXEL);
7471 RNA_def_property_float_sdna(prop, nullptr, "gauss");
7472 RNA_def_property_range(prop, 0.0f, 500.0f);
7473 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 1, 2);
7475 prop, "Filter Size", "Width over which the reconstruction filter combines samples");
7477
7478 prop = RNA_def_property(srna, "film_transparent", PROP_BOOLEAN, PROP_NONE);
7479 RNA_def_property_boolean_sdna(prop, nullptr, "alphamode", R_ALPHAPREMUL);
7481 prop,
7482 "Transparent",
7483 "World background is transparent, for compositing the render over another background");
7484 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7485
7486 prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
7488 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_EDGE_FRS);
7489 RNA_def_property_ui_text(prop, "Use Freestyle", "Draw stylized strokes using Freestyle");
7490 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_freestyle_update");
7491
7492 /* threads */
7493 prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
7494 RNA_def_property_int_sdna(prop, nullptr, "threads");
7496 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", nullptr, nullptr);
7498 "Threads",
7499 "Maximum number of CPU cores to use simultaneously while rendering "
7500 "(for multi-core/CPU systems)");
7502
7503 prop = RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
7504 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "mode");
7505 RNA_def_property_enum_items(prop, threads_mode_items);
7506 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_threads_mode_get", nullptr, nullptr);
7507 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
7509
7510 /* motion blur */
7511 prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
7512 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_MBLUR);
7513 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
7515 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7516
7517 prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR);
7518 RNA_def_property_range(prop, 0.0f, FLT_MAX);
7519 RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 2);
7520 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
7521 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7522
7523 prop = RNA_def_property(srna, "motion_blur_position", PROP_ENUM, PROP_NONE);
7524 RNA_def_property_enum_items(prop, motion_blur_position_items);
7526 "Motion Blur Position",
7527 "Offset for the shutter's time interval, "
7528 "allows to change the motion blur trails");
7531
7532 prop = RNA_def_property(srna, "motion_blur_shutter_curve", PROP_POINTER, PROP_NONE);
7533 RNA_def_property_pointer_sdna(prop, nullptr, "mblur_shutter_curve");
7534 RNA_def_property_struct_type(prop, "CurveMapping");
7536 prop, "Shutter Curve", "Curve defining the shutter's openness over time");
7537
7538 /* Hairs */
7539 prop = RNA_def_property(srna, "hair_type", PROP_ENUM, PROP_NONE);
7540 RNA_def_property_enum_items(prop, hair_shape_type_items);
7541 RNA_def_property_ui_text(prop, "Curves Shape Type", "Curves shape type");
7543 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7544
7545 prop = RNA_def_property(srna, "hair_subdiv", PROP_INT, PROP_NONE);
7546 RNA_def_property_range(prop, 0, 3);
7548 prop, "Additional Subdivision", "Additional subdivision along the curves");
7549 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7550
7551 /* Performance */
7552 prop = RNA_def_property(srna, "use_high_quality_normals", PROP_BOOLEAN, PROP_NONE);
7553 RNA_def_property_boolean_sdna(prop, nullptr, "perf_flag", SCE_PERF_HQ_NORMALS);
7555 "High Quality Normals",
7556 "Use high quality tangent space at the cost of lower performance");
7557 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_mesh_quality_update");
7558
7559 prop = RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
7560 RNA_def_property_enum_sdna(prop, nullptr, "anisotropic_filter");
7561 RNA_def_property_enum_items(prop, anisotropic_items);
7563 prop, "Anisotropic Filtering", "Quality of anisotropic filtering in materials");
7564 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7565
7566 /* border */
7567 prop = RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
7568 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_BORDER);
7571 prop, "Render Region", "Render a user-defined render region, within the frame size");
7573
7574 prop = RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
7575 RNA_def_property_float_sdna(prop, nullptr, "border.xmin");
7576 RNA_def_property_range(prop, 0.0f, 1.0f);
7578 RNA_def_property_ui_text(prop, "Region Minimum X", "Minimum X value for the render region");
7580
7581 prop = RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
7582 RNA_def_property_float_sdna(prop, nullptr, "border.ymin");
7583 RNA_def_property_range(prop, 0.0f, 1.0f);
7585 RNA_def_property_ui_text(prop, "Region Minimum Y", "Minimum Y value for the render region");
7587
7588 prop = RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
7589 RNA_def_property_float_sdna(prop, nullptr, "border.xmax");
7590 RNA_def_property_range(prop, 0.0f, 1.0f);
7592 RNA_def_property_ui_text(prop, "Region Maximum X", "Maximum X value for the render region");
7594
7595 prop = RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
7596 RNA_def_property_float_sdna(prop, nullptr, "border.ymax");
7597 RNA_def_property_range(prop, 0.0f, 1.0f);
7599 RNA_def_property_ui_text(prop, "Region Maximum Y", "Maximum Y value for the render region");
7601
7602 prop = RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
7603 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_CROP);
7606 prop, "Crop to Render Region", "Crop the rendered frame to the defined render region size");
7608
7609 prop = RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
7610 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_TOUCH);
7613 prop,
7614 "Placeholders",
7615 "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
7617
7618 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
7620 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
7622
7623 prop = RNA_def_property(srna, "save_output", PROP_BOOLEAN, PROP_NONE);
7624 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_SAVE_OUTPUT);
7625 RNA_def_property_ui_text(prop, "Save Output", "Write frames to disk for animation renders");
7628
7629 prop = RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
7630 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_DOCOMP);
7633 "Compositing",
7634 "Process the render result through the compositing pipeline, "
7635 "if a compositing node group is assigned to the scene");
7637
7638 prop = RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
7639 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_DOSEQ);
7642 "Sequencer",
7643 "Process the render (and composited) result through the video sequence "
7644 "editor pipeline, if sequencer strips exist");
7646
7647 prop = RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
7648 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_EXTENSION);
7651 prop,
7652 "File Extensions",
7653 "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
7655
7656# if 0 /* moved */
7657 prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
7658 RNA_def_property_enum_sdna(prop, nullptr, "imtype");
7660 RNA_def_property_enum_funcs(prop, nullptr, "rna_RenderSettings_file_format_set", nullptr);
7661 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
7663# endif
7664
7665 prop = RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
7667 prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", nullptr);
7668 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
7670
7671 prop = RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
7672 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_format_get", nullptr);
7674 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
7675
7676 prop = RNA_def_property(srna, "use_lock_interface", PROP_BOOLEAN, PROP_NONE);
7677 RNA_def_property_boolean_sdna(prop, nullptr, "use_lock_interface", 1);
7679 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
7681 prop,
7682 "Lock Interface",
7683 "Lock interface during rendering in favor of giving more memory to the renderer");
7685
7686 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
7687 RNA_def_property_string_sdna(prop, nullptr, "pic");
7692 "Output Path",
7693 "Directory/name to save animations, # characters define the position "
7694 "and padding of frame numbers");
7696
7697 /* Render result EXR cache. */
7698 prop = RNA_def_property(srna, "use_render_cache", PROP_BOOLEAN, PROP_NONE);
7699 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_EXR_CACHE_FILE);
7702 "Cache Result",
7703 "Save render cache to EXR files (useful for heavy compositing, "
7704 "Note: affects indirectly rendered scenes)");
7706
7707 /* stamp */
7708
7709 prop = RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
7710 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_TIME);
7712 prop, "Stamp Time", "Include the rendered frame timecode as HH:MM:SS.FF in image metadata");
7714
7715 prop = RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
7716 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_DATE);
7717 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image/video metadata");
7719
7720 prop = RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
7721 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FRAME);
7722 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
7724
7725 prop = RNA_def_property(srna, "use_stamp_frame_range", PROP_BOOLEAN, PROP_NONE);
7726 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FRAME_RANGE);
7728 prop, "Stamp Frame", "Include the rendered frame range in image/video metadata");
7730
7731 prop = RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
7732 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_CAMERA);
7734 prop, "Stamp Camera", "Include the name of the active camera in image metadata");
7736
7737 prop = RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
7738 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_CAMERALENS);
7740 prop, "Stamp Lens", "Include the active camera's lens in image metadata");
7742
7743 prop = RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
7744 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_SCENE);
7746 prop, "Stamp Scene", "Include the name of the active scene in image/video metadata");
7748
7749 prop = RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
7750 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_NOTE);
7751 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image/video metadata");
7753
7754 prop = RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
7755 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_MARKER);
7757 prop, "Stamp Marker", "Include the name of the last marker in image metadata");
7759
7760 prop = RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
7761 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FILENAME);
7763 prop, "Stamp Filename", "Include the .blend filename in image/video metadata");
7765
7766 prop = RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
7767 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_SEQSTRIP);
7769 "Stamp Sequence Strip",
7770 "Include the name of the foreground sequence strip in image metadata");
7772
7773 prop = RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
7774 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_RENDERTIME);
7775 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in image metadata");
7777
7778 prop = RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
7779 RNA_def_property_string_sdna(prop, nullptr, "stamp_udata");
7780 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
7782
7783 prop = RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
7784 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_DRAW);
7786 prop, "Stamp Output", "Render the stamp info text in the rendered image");
7788
7789 prop = RNA_def_property(srna, "use_stamp_labels", PROP_BOOLEAN, PROP_NONE);
7792 prop, "Stamp Labels", "Display stamp labels (\"Camera\" in front of camera name, etc.)");
7794
7795 prop = RNA_def_property(srna, "metadata_input", PROP_ENUM, PROP_NONE); /* as an enum */
7796 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "stamp");
7797 RNA_def_property_enum_items(prop, meta_input_items);
7798 RNA_def_property_ui_text(prop, "Metadata Input", "Where to take the metadata from");
7800
7801 prop = RNA_def_property(srna, "use_stamp_memory", PROP_BOOLEAN, PROP_NONE);
7802 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_MEMORY);
7804 prop, "Stamp Peak Memory", "Include the peak memory usage in image metadata");
7806
7807 prop = RNA_def_property(srna, "use_stamp_hostname", PROP_BOOLEAN, PROP_NONE);
7808 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_HOSTNAME);
7810 prop, "Stamp Hostname", "Include the hostname of the machine that rendered the frame");
7812
7813 prop = RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_PIXEL);
7814 RNA_def_property_int_sdna(prop, nullptr, "stamp_font_id");
7815 RNA_def_property_range(prop, 8, 64);
7816 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
7818
7819 prop = RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR_GAMMA);
7820 RNA_def_property_float_sdna(prop, nullptr, "fg_stamp");
7821 RNA_def_property_array(prop, 4);
7822 RNA_def_property_range(prop, 0.0, 1.0);
7823 RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text");
7825
7826 prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR_GAMMA);
7827 RNA_def_property_float_sdna(prop, nullptr, "bg_stamp");
7828 RNA_def_property_array(prop, 4);
7829 RNA_def_property_range(prop, 0.0, 1.0);
7830 RNA_def_property_ui_text(prop, "Background", "Color to use behind stamp text");
7832
7833 /* sequencer draw options */
7834
7835 prop = RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
7836 RNA_def_property_enum_sdna(prop, nullptr, "seq_prev_type");
7839 prop, "Sequencer Preview Shading", "Display method used in the sequencer view");
7840 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
7841
7842 prop = RNA_def_property(srna, "use_sequencer_override_scene_strip", PROP_BOOLEAN, PROP_NONE);
7845 "Override Scene Settings",
7846 "Use Workbench render and world settings from the sequencer scene, "
7847 "instead of each strip's scene");
7848 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
7849
7850 prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
7851 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_SINGLE_LAYER);
7853 "Render Single Layer",
7854 "Only render the active layer. Only affects rendering from the "
7855 "interface, ignored for rendering from command line.");
7858
7859 /* views (stereoscopy et al) */
7860 prop = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE);
7861 RNA_def_property_struct_type(prop, "SceneRenderView");
7862 RNA_def_property_ui_text(prop, "Render Views", "");
7863 rna_def_render_views(brna, prop);
7864
7865 prop = RNA_def_property(srna, "stereo_views", PROP_COLLECTION, PROP_NONE);
7866 RNA_def_property_collection_sdna(prop, nullptr, "views", nullptr);
7868 "rna_RenderSettings_stereoViews_begin",
7869 "rna_iterator_listbase_next",
7870 "rna_iterator_listbase_end",
7871 "rna_iterator_listbase_get",
7872 nullptr,
7873 nullptr,
7874 nullptr,
7875 nullptr);
7876 RNA_def_property_struct_type(prop, "SceneRenderView");
7877 RNA_def_property_ui_text(prop, "Render Views", "");
7878
7879 prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
7880 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_MULTIVIEW);
7881 RNA_def_property_ui_text(prop, "Multiple Views", "Use multiple views in the scene");
7882 RNA_def_property_update(prop, NC_WINDOW, nullptr);
7883
7884 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
7885 RNA_def_property_enum_items(prop, views_format_items);
7887 RNA_def_property_ui_text(prop, "Setup Stereo Mode", "");
7888 RNA_def_property_enum_funcs(prop, nullptr, "rna_RenderSettings_views_format_set", nullptr);
7889 RNA_def_property_update(prop, NC_WINDOW, nullptr);
7890
7891 /* engine */
7892 prop = RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
7893 RNA_def_property_enum_items(prop, engine_items);
7895 "rna_RenderSettings_engine_get",
7896 "rna_RenderSettings_engine_set",
7897 "rna_RenderSettings_engine_itemf");
7899 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
7900 RNA_def_property_update(prop, NC_WINDOW, "rna_RenderSettings_engine_update");
7901
7902 prop = RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
7903 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", nullptr);
7906 prop, "Multiple Engines", "More than one rendering engine is available");
7907
7908 prop = RNA_def_property(srna, "use_spherical_stereo", PROP_BOOLEAN, PROP_NONE);
7909 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_spherical_stereo_get", nullptr);
7912 prop, "Use Spherical Stereo", "Active render engine supports spherical stereo rendering");
7913
7914 /* simplify */
7915 prop = RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
7916 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_SIMPLIFY);
7918 prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
7920 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
7921
7922 prop = RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
7923 RNA_def_property_int_sdna(prop, nullptr, "simplify_subsurf");
7924 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
7925 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
7926 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7927
7928 prop = RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
7929 RNA_def_property_float_sdna(prop, nullptr, "simplify_particles");
7930 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
7931 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7932
7933 prop = RNA_def_property(srna, "simplify_subdivision_render", PROP_INT, PROP_UNSIGNED);
7934 RNA_def_property_int_sdna(prop, nullptr, "simplify_subsurf_render");
7935 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
7937 prop, "Simplify Subdivision", "Global maximum subdivision level during rendering");
7938 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7939
7940 prop = RNA_def_property(srna, "simplify_child_particles_render", PROP_FLOAT, PROP_FACTOR);
7941 RNA_def_property_float_sdna(prop, nullptr, "simplify_particles_render");
7943 prop, "Simplify Child Particles", "Global child particles percentage during rendering");
7944 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7945
7946 prop = RNA_def_property(srna, "simplify_volumes", PROP_FLOAT, PROP_FACTOR);
7947 RNA_def_property_range(prop, 0.0, 1.0f);
7949 prop, "Simplify Volumes", "Resolution percentage of volume objects in viewport");
7951 RNA_def_property_update(prop, 0, "rna_Scene_simplify_volume_update");
7952
7953 prop = RNA_def_property(srna, "use_simplify_normals", PROP_BOOLEAN, PROP_NONE);
7954 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_SIMPLIFY_NORMALS);
7956 "Mesh Normals",
7957 "Skip computing custom normals and face corner normals for displaying "
7958 "meshes in the viewport");
7959 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_normals_update");
7960
7961 /* Texture Cache */
7962 prop = RNA_def_property(srna, "use_texture_cache", PROP_BOOLEAN, PROP_NONE);
7963 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_USE_TEXTURE_CACHE);
7966 prop,
7967 "Texture Cache",
7968 "Load texture tiles at appropriate resolution on demand to reduce memory usage. This avoids "
7969 "loading all textures into memory, at the cost of extra disk space and some performance");
7971
7972 prop = RNA_def_property(srna, "use_auto_generate_texture_cache", PROP_BOOLEAN, PROP_NONE);
7976 "Auto Generate Texture Cache",
7977 "Automatically create tx files from image files when rendering, if the "
7978 "files do not exist or are outdated. The path to store the texture "
7979 "cache files is configured in the preferences");
7981
7982 /* Grease Pencil - Simplify Options */
7983 prop = RNA_def_property(srna, "simplify_gpencil", PROP_BOOLEAN, PROP_NONE);
7984 RNA_def_property_boolean_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_ENABLE);
7985 RNA_def_property_ui_text(prop, "Simplify", "Simplify Grease Pencil drawing");
7986 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7987
7988 prop = RNA_def_property(srna, "simplify_gpencil_onplay", PROP_BOOLEAN, PROP_NONE);
7989 RNA_def_property_boolean_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_ON_PLAY);
7991 prop, "Playback Only", "Simplify Grease Pencil only during animation playback");
7992 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7993
7994 prop = RNA_def_property(srna, "simplify_gpencil_antialiasing", PROP_BOOLEAN, PROP_NONE);
7995 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_AA);
7996 RNA_def_property_ui_text(prop, "Antialiasing", "Use Antialiasing to smooth stroke edges");
7997 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7998
7999 prop = RNA_def_property(srna, "simplify_gpencil_view_fill", PROP_BOOLEAN, PROP_NONE);
8000 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_FILL);
8001 RNA_def_property_ui_text(prop, "Fill", "Display fill strokes in the viewport");
8002 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
8003
8004 prop = RNA_def_property(srna, "simplify_gpencil_modifier", PROP_BOOLEAN, PROP_NONE);
8006 prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_MODIFIER);
8007 RNA_def_property_ui_text(prop, "Modifiers", "Display modifiers");
8008 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
8009
8010 prop = RNA_def_property(srna, "simplify_gpencil_shader_fx", PROP_BOOLEAN, PROP_NONE);
8011 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_FX);
8012 RNA_def_property_ui_text(prop, "Shader Effects", "Display Shader Effects");
8013 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
8014
8015 prop = RNA_def_property(srna, "simplify_gpencil_tint", PROP_BOOLEAN, PROP_NONE);
8016 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_TINT);
8017 RNA_def_property_ui_text(prop, "Layers Tinting", "Display layer tint");
8018 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
8019
8020 /* persistent data */
8021 prop = RNA_def_property(srna, "use_persistent_data", PROP_BOOLEAN, PROP_NONE);
8022 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_PERSISTENT_DATA);
8024 "Persistent Data",
8025 "Keep render data around for faster re-renders and animation renders, "
8026 "at the cost of increased memory usage");
8027 RNA_def_property_update(prop, 0, "rna_Scene_use_persistent_data_update");
8028
8029 /* Freestyle line thickness options */
8030 prop = RNA_def_property(srna, "line_thickness_mode", PROP_ENUM, PROP_NONE);
8031 RNA_def_property_enum_sdna(prop, nullptr, "line_thickness_mode");
8032 RNA_def_property_enum_items(prop, freestyle_thickness_items);
8034 prop, "Line Thickness Mode", "Line thickness mode for Freestyle line drawing");
8035 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
8036
8037 prop = RNA_def_property(srna, "line_thickness", PROP_FLOAT, PROP_PIXEL);
8038 RNA_def_property_float_sdna(prop, nullptr, "unit_line_thickness");
8039 RNA_def_property_range(prop, 0.0f, 10000.0f);
8040 RNA_def_property_ui_text(prop, "Line Thickness", "Line thickness in pixels");
8041 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
8042
8043 /* Bake Settings */
8044 prop = RNA_def_property(srna, "bake", PROP_POINTER, PROP_NONE);
8046 RNA_def_property_pointer_sdna(prop, nullptr, "bake");
8047 RNA_def_property_struct_type(prop, "BakeSettings");
8048 RNA_def_property_ui_text(prop, "Bake Data", "");
8049
8050 /* Compositor. */
8051
8052 prop = RNA_def_property(srna, "compositor_device", PROP_ENUM, PROP_NONE);
8053 RNA_def_property_enum_items(prop, compositor_device_items);
8054 RNA_def_property_ui_text(prop, "Compositor Device", "Set how compositing is executed");
8055 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
8056
8057 prop = RNA_def_property(srna, "use_compositor_frames_cache", PROP_BOOLEAN, PROP_NONE);
8059 prop, nullptr, "compositor_cache_flags", SCE_COMPOSITOR_CACHE_FRAMES);
8061 "Compositor Frames Cache",
8062 "Cache the result of the interactive compositor across frames");
8063 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
8064
8065 prop = RNA_def_property(srna, "compositor_precision", PROP_ENUM, PROP_NONE);
8066 RNA_def_property_enum_sdna(prop, nullptr, "compositor_precision");
8067 RNA_def_property_enum_items(prop, compositor_precision_items);
8069 prop, "Compositor Precision", "The precision of compositor intermediate result");
8070 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
8071
8072 prop = RNA_def_property(srna, "compositor_denoise_device", PROP_ENUM, PROP_NONE);
8073 RNA_def_property_enum_sdna(prop, nullptr, "compositor_denoise_device");
8074 RNA_def_property_enum_items(prop, compositor_denoise_device_items);
8077 "Compositor Denoise Node Device",
8078 "The device to use to process the denoise nodes in the compositor");
8079 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
8080
8081 prop = RNA_def_property(srna, "compositor_denoise_preview_quality", PROP_ENUM, PROP_NONE);
8082 RNA_def_property_enum_sdna(prop, nullptr, "compositor_denoise_preview_quality");
8083 RNA_def_property_enum_items(prop, compositor_denoise_quality_items);
8086 "Compositor Preview Denoise Quality",
8087 "The quality used by denoise nodes during viewport and interactive "
8088 "compositing if the nodes' quality option is set to Follow Scene");
8089 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
8090
8091 prop = RNA_def_property(srna, "compositor_denoise_final_quality", PROP_ENUM, PROP_NONE);
8092 RNA_def_property_enum_sdna(prop, nullptr, "compositor_denoise_final_quality");
8093 RNA_def_property_enum_items(prop, compositor_denoise_quality_items);
8096 "Compositor Final Denoise Quality",
8097 "The quality used by denoise nodes during the compositing of final "
8098 "renders if the nodes' quality option is set to Follow Scene");
8099 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
8100
8101 /* Nestled Data. */
8102 /* *** Non-Animated *** */
8104 rna_def_bake_data(brna);
8106
8107 /* *** Animated *** */
8108
8109 /* Scene API */
8111}
8112
8113/* scene.objects */
8115{
8116 StructRNA *srna;
8117
8118 RNA_def_property_srna(cprop, "SceneObjects");
8119 srna = RNA_def_struct(brna, "SceneObjects", nullptr);
8120 RNA_def_struct_sdna(srna, "Scene");
8121 RNA_def_struct_ui_text(srna, "Scene Objects", "All of the scene objects");
8122}
8123
8124/* scene.timeline_markers */
8126{
8127 StructRNA *srna;
8128
8129 FunctionRNA *func;
8130 PropertyRNA *parm;
8131
8132 RNA_def_property_srna(cprop, "TimelineMarkers");
8133 srna = RNA_def_struct(brna, "TimelineMarkers", nullptr);
8134 RNA_def_struct_sdna(srna, "Scene");
8135 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
8136
8137 func = RNA_def_function(srna, "new", "rna_TimeLine_add");
8138 RNA_def_function_ui_description(func, "Add a timeline marker");
8139 parm = RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
8141 parm = RNA_def_int(func,
8142 "frame",
8143 1,
8144 -MAXFRAME,
8145 MAXFRAME,
8146 "",
8147 "The frame for the new marker",
8148 -MAXFRAME,
8149 MAXFRAME);
8150 parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
8152 RNA_def_function_return(func, parm);
8153
8154 func = RNA_def_function(srna, "remove", "rna_TimeLine_remove");
8155 RNA_def_function_ui_description(func, "Remove a timeline marker");
8157 parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
8160
8161 func = RNA_def_function(srna, "clear", "rna_TimeLine_clear");
8162 RNA_def_function_ui_description(func, "Remove all timeline markers");
8163}
8164
8165/* scene.keying_sets */
8167{
8168 StructRNA *srna;
8169 PropertyRNA *prop;
8170
8171 FunctionRNA *func;
8172 PropertyRNA *parm;
8173
8174 RNA_def_property_srna(cprop, "KeyingSets");
8175 srna = RNA_def_struct(brna, "KeyingSets", nullptr);
8176 RNA_def_struct_sdna(srna, "Scene");
8177 RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
8178
8179 /* Add Keying Set */
8180 func = RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
8181 RNA_def_function_ui_description(func, "Add a new Keying Set to Scene");
8183 /* name */
8185 func, "idname", "KeyingSet", MAX_NAME, "IDName", "Internal identifier of Keying Set");
8186 RNA_def_string(func, "name", "KeyingSet", MAX_NAME, "Name", "User visible name of Keying Set");
8187 /* returns the new KeyingSet */
8188 parm = RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set");
8190 RNA_def_function_return(func, parm);
8191
8192 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
8193 RNA_def_property_struct_type(prop, "KeyingSet");
8196 "rna_Scene_active_keying_set_get",
8197 "rna_Scene_active_keying_set_set",
8198 nullptr,
8199 nullptr);
8201 prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
8203
8204 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
8205 RNA_def_property_int_sdna(prop, nullptr, "active_keyingset");
8207 "rna_Scene_active_keying_set_index_get",
8208 "rna_Scene_active_keying_set_index_set",
8209 nullptr);
8211 prop,
8212 "Active Keying Set Index",
8213 "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
8215}
8216
8218{
8219 StructRNA *srna;
8220 PropertyRNA *prop;
8221
8222 RNA_def_property_srna(cprop, "KeyingSetsAll");
8223 srna = RNA_def_struct(brna, "KeyingSetsAll", nullptr);
8224 RNA_def_struct_sdna(srna, "Scene");
8225 RNA_def_struct_path_func(srna, "rna_Scene_KeyingsSetsAll_path");
8226 RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
8227
8228 /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
8229
8230 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
8231 RNA_def_property_struct_type(prop, "KeyingSet");
8234 "rna_Scene_active_keying_set_get",
8235 "rna_Scene_active_keying_set_set",
8236 nullptr,
8237 nullptr);
8239 prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
8241
8242 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
8243 RNA_def_property_int_sdna(prop, nullptr, "active_keyingset");
8245 "rna_Scene_active_keying_set_index_get",
8246 "rna_Scene_active_keying_set_index_set",
8247 nullptr);
8249 prop,
8250 "Active Keying Set Index",
8251 "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
8253}
8254
8255/* Runtime property, used to remember uv indices, used only in UV stitch for now.
8256 */
8258{
8259 StructRNA *srna;
8260 PropertyRNA *prop;
8261
8262 srna = RNA_def_struct(brna, "SelectedUvElement", "PropertyGroup");
8263 RNA_def_struct_ui_text(srna, "Selected UV Element", "");
8264
8265 /* store the index to the UV element selected */
8266 prop = RNA_def_property(srna, "element_index", PROP_INT, PROP_UNSIGNED);
8268 RNA_def_property_ui_text(prop, "Element Index", "");
8269
8270 prop = RNA_def_property(srna, "face_index", PROP_INT, PROP_UNSIGNED);
8272 RNA_def_property_ui_text(prop, "Face Index", "");
8273}
8274
8276{
8277 StructRNA *srna;
8278 PropertyRNA *prop;
8279
8280 srna = RNA_def_struct(brna, "DisplaySafeAreas", nullptr);
8281 RNA_def_struct_ui_text(srna, "Safe Areas", "Safe areas used in 3D view and the sequencer");
8282 RNA_def_struct_sdna(srna, "DisplaySafeAreas");
8283
8284 /* SAFE AREAS */
8285 prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_XYZ);
8286 RNA_def_property_float_sdna(prop, nullptr, "title");
8287 RNA_def_property_array(prop, 2);
8288 RNA_def_property_range(prop, 0.0f, 1.0f);
8289 RNA_def_property_ui_text(prop, "Title Safe Margins", "Safe area for text and graphics");
8291
8292 prop = RNA_def_property(srna, "action", PROP_FLOAT, PROP_XYZ);
8293 RNA_def_property_float_sdna(prop, nullptr, "action");
8294 RNA_def_property_array(prop, 2);
8295 RNA_def_property_range(prop, 0.0f, 1.0f);
8296 RNA_def_property_ui_text(prop, "Action Safe Margins", "Safe area for general elements");
8298
8299 prop = RNA_def_property(srna, "title_center", PROP_FLOAT, PROP_XYZ);
8300 RNA_def_property_float_sdna(prop, nullptr, "title_center");
8301 RNA_def_property_array(prop, 2);
8302 RNA_def_property_range(prop, 0.0f, 1.0f);
8304 "Center Title Safe Margins",
8305 "Safe area for text and graphics in a different aspect ratio");
8307
8308 prop = RNA_def_property(srna, "action_center", PROP_FLOAT, PROP_XYZ);
8309 RNA_def_property_float_sdna(prop, nullptr, "action_center");
8310 RNA_def_property_array(prop, 2);
8311 RNA_def_property_range(prop, 0.0f, 1.0f);
8313 "Center Action Safe Margins",
8314 "Safe area for general elements in a different aspect ratio");
8316}
8317
8319{
8320 StructRNA *srna;
8321 PropertyRNA *prop;
8322
8323 srna = RNA_def_struct(brna, "SceneDisplay", nullptr);
8324 RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
8325 RNA_def_struct_sdna(srna, "SceneDisplay");
8326
8327 prop = RNA_def_property(srna, "light_direction", PROP_FLOAT, PROP_DIRECTION);
8328 RNA_def_property_float_sdna(prop, nullptr, "light_direction");
8330 RNA_def_property_array(prop, 3);
8332 prop, "Light Direction", "Direction of the light for shadows and highlights");
8333 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
8334
8335 prop = RNA_def_property(srna, "shadow_shift", PROP_FLOAT, PROP_ANGLE);
8336 RNA_def_property_ui_text(prop, "Shadow Shift", "Shadow termination angle");
8337 RNA_def_property_range(prop, 0.0f, 1.0f);
8338 RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 2);
8340 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
8341
8342 prop = RNA_def_property(srna, "shadow_focus", PROP_FLOAT, PROP_FACTOR);
8344 RNA_def_property_ui_text(prop, "Shadow Focus", "Shadow factor hardness");
8345 RNA_def_property_range(prop, 0.0f, 1.0f);
8346 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
8348 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
8349
8350 prop = RNA_def_property(srna, "matcap_ssao_distance", PROP_FLOAT, PROP_DISTANCE);
8352 prop, "Distance", "Distance of object that contribute to the cavity/edge effect");
8353 RNA_def_property_range(prop, 0.0f, 100000.0f);
8354 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
8355
8356 prop = RNA_def_property(srna, "matcap_ssao_attenuation", PROP_FLOAT, PROP_NONE);
8357 RNA_def_property_ui_text(prop, "Attenuation", "Attenuation constant");
8358 RNA_def_property_range(prop, 0.0f, 100000.0f);
8359 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
8360
8361 prop = RNA_def_property(srna, "matcap_ssao_samples", PROP_INT, PROP_NONE);
8362 RNA_def_property_ui_text(prop, "Samples", "Number of samples");
8363 RNA_def_property_range(prop, 1, 500);
8364
8365 prop = RNA_def_property(srna, "render_aa", PROP_ENUM, PROP_NONE);
8368 prop, "Render Anti-Aliasing", "Method of anti-aliasing when rendering final image");
8370
8371 prop = RNA_def_property(srna, "viewport_aa", PROP_ENUM, PROP_NONE);
8374 prop, "Viewport Anti-Aliasing", "Method of anti-aliasing when rendering 3d viewport");
8376
8377 /* OpenGL render engine settings. */
8378 prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
8379 RNA_def_property_ui_text(prop, "Shading Settings", "Shading settings for OpenGL render engine");
8380}
8381
8383{
8384 StructRNA *srna;
8385 PropertyRNA *prop;
8386
8387 srna = RNA_def_struct(brna, "RaytraceEEVEE", nullptr);
8388 RNA_def_struct_path_func(srna, "rna_RaytraceEEVEE_path");
8390 srna, "EEVEE Raytrace Options", "Quality options for the raytracing pipeline");
8391
8392 prop = RNA_def_property(srna, "resolution_scale", PROP_ENUM, PROP_NONE);
8395 "Resolution",
8396 "Determines the number of rays per pixel. "
8397 "Higher resolution uses more memory.");
8400
8401 prop = RNA_def_property(srna, "use_backface_hit", PROP_BOOLEAN, PROP_NONE);
8403 RNA_def_property_ui_text(prop, "Hit Backfaces", "Consider rays hitting backfaces as valid");
8406
8407 prop = RNA_def_property(srna, "backface_radiance_scale", PROP_FLOAT, PROP_FACTOR);
8409 "Backface Radiance Scale",
8410 "Amount of the front face lighting to reuse for backface "
8411 "lighting approximation");
8412 RNA_def_property_range(prop, 0.0f, 1.0f);
8415
8416 prop = RNA_def_property(srna, "use_denoise", PROP_BOOLEAN, PROP_NONE);
8419 prop, "Denoise", "Enable noise reduction techniques for raytraced effects");
8422
8423 prop = RNA_def_property(srna, "denoise_spatial", PROP_BOOLEAN, PROP_NONE);
8424 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_SPATIAL);
8425 RNA_def_property_ui_text(prop, "Spatial Reuse", "Reuse neighbor pixels' rays");
8428
8429 prop = RNA_def_property(srna, "denoise_temporal", PROP_BOOLEAN, PROP_NONE);
8430 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_TEMPORAL);
8432 prop, "Temporal Accumulation", "Accumulate samples by reprojecting last tracing results");
8435
8436 prop = RNA_def_property(srna, "denoise_bilateral", PROP_BOOLEAN, PROP_NONE);
8437 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_BILATERAL);
8439 prop, "Bilateral Filter", "Blur the resolved radiance using a bilateral filter");
8442
8443 prop = RNA_def_property(srna, "screen_trace_thickness", PROP_FLOAT, PROP_DISTANCE);
8445 prop,
8446 "Screen-Trace Thickness",
8447 "Surface thickness used to detect intersection when using screen-tracing");
8448 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8449 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3);
8452
8453 prop = RNA_def_property(srna, "trace_max_roughness", PROP_FLOAT, PROP_FACTOR);
8455 "Raytrace Max Roughness",
8456 "Maximum roughness to use the tracing pipeline for. Higher "
8457 "roughness surfaces will use fast GI approximation. A value of 1 will "
8458 "disable fast GI approximation.");
8459 RNA_def_property_range(prop, 0.0f, 1.0f);
8462
8463 prop = RNA_def_property(srna, "screen_trace_quality", PROP_FLOAT, PROP_FACTOR);
8465 prop, "Screen-Trace Precision", "Precision of the screen space ray-tracing");
8466 RNA_def_property_range(prop, 0.0f, 1.0f);
8469}
8470
8472{
8473 StructRNA *srna;
8474 PropertyRNA *prop;
8475
8476 static const EnumPropertyItem eevee_shadow_size_items[] = {
8477 {128, "128", 0, "128 px", ""},
8478 {256, "256", 0, "256 px", ""},
8479 {512, "512", 0, "512 px", ""},
8480 {1024, "1024", 0, "1024 px", ""},
8481 {2048, "2048", 0, "2048 px", ""},
8482 {4096, "4096", 0, "4096 px", ""},
8483 {0, nullptr, 0, nullptr, nullptr},
8484 };
8485
8486 static const EnumPropertyItem eevee_pool_size_items[] = {
8487 {16, "16", 0, "16 MB", ""},
8488 {32, "32", 0, "32 MB", ""},
8489 {64, "64", 0, "64 MB", ""},
8490 {128, "128", 0, "128 MB", ""},
8491 {256, "256", 0, "256 MB", ""},
8492 {512, "512", 0, "512 MB", ""},
8493 {1024, "1024", 0, "1 GB", ""},
8494 {0, nullptr, 0, nullptr, nullptr},
8495 };
8496
8497 static const EnumPropertyItem eevee_shadow_pool_size_items[] = {
8498 {16, "16", 0, "16 MB", ""},
8499 {32, "32", 0, "32 MB", ""},
8500 {64, "64", 0, "64 MB", ""},
8501 {128, "128", 0, "128 MB", ""},
8502 {256, "256", 0, "256 MB", ""},
8503 {512, "512", 0, "512 MB", ""},
8504 {1024, "1024", 0, "1 GB", ""},
8505 {1536, "1536", 0, "1.5 GB", ""},
8506 {2048, "2048", 0, "2 GB", ""},
8507 {0, nullptr, 0, nullptr, nullptr},
8508 };
8509
8510 static const EnumPropertyItem eevee_gi_visibility_size_items[] = {
8511 {8, "8", 0, "8 px", ""},
8512 {16, "16", 0, "16 px", ""},
8513 {32, "32", 0, "32 px", ""},
8514 {64, "64", 0, "64 px", ""},
8515 {0, nullptr, 0, nullptr, nullptr},
8516 };
8517
8518 static const EnumPropertyItem ray_tracing_method_items[] = {
8520 "PROBE",
8521 0,
8522 "Light Probe",
8523 "Use light probes to find scene intersection"},
8525 "SCREEN",
8526 0,
8527 "Screen-Trace",
8528 "Raytrace against the depth buffer. Fallback to light probes for invalid rays."},
8529 {0, nullptr, 0, nullptr, nullptr},
8530 };
8531
8532 static const EnumPropertyItem fast_gi_method_items[] = {
8534 "AMBIENT_OCCLUSION_ONLY",
8535 0,
8536 "Ambient Occlusion",
8537 "Use ambient occlusion instead of full global illumination"},
8538 {FAST_GI_FULL,
8539 "GLOBAL_ILLUMINATION",
8540 0,
8541 "Global Illumination",
8542 "Compute global illumination taking into account light bouncing off surrounding objects"},
8543 {0, nullptr, 0, nullptr, nullptr},
8544 };
8545
8546 srna = RNA_def_struct(brna, "SceneEEVEE", nullptr);
8547 RNA_def_struct_path_func(srna, "rna_SceneEEVEE_path");
8548 RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
8549
8550 /* Indirect Lighting */
8551 prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE);
8553 "Diffuse Bounces",
8554 "Number of times the light is reinjected inside light grids, "
8555 "0 disable indirect diffuse light");
8558
8559 prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
8560 RNA_def_property_enum_items(prop, eevee_shadow_size_items);
8561 RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
8563 RNA_def_property_update(prop, 0, "rna_SceneEEVEE_gi_cubemap_resolution_update");
8564
8565 prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE);
8566 RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items);
8568 "Irradiance Visibility Size",
8569 "Size of the shadow map applied to each irradiance sample");
8571
8572 prop = RNA_def_property(srna, "gi_glossy_clamp", PROP_FLOAT, PROP_NONE);
8574 "Clamp Glossy",
8575 "Clamp pixel intensity to reduce noise inside glossy reflections "
8576 "from reflection cubemaps (0 to disable)");
8577 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8579
8580 prop = RNA_def_property(srna, "gi_irradiance_pool_size", PROP_ENUM, PROP_NONE);
8581 RNA_def_property_enum_items(prop, eevee_pool_size_items);
8583 "Irradiance Pool Size",
8584 "Size of the irradiance pool, "
8585 "a bigger pool size allows for more irradiance grid in the scene "
8586 "but might not fit into GPU memory and decrease performance");
8589
8590 /* Temporal Anti-Aliasing (super sampling) */
8591 prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
8592 RNA_def_property_ui_text(prop, "Viewport Samples", "Number of samples, unlimited if 0");
8597
8598 prop = RNA_def_property(srna, "taa_render_samples", PROP_INT, PROP_NONE);
8599 RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixel for rendering");
8604
8605 prop = RNA_def_property(srna, "use_taa_reprojection", PROP_BOOLEAN, PROP_NONE);
8608 "Viewport Denoising",
8609 "Denoise image using temporal reprojection "
8610 "(can leave some ghosting)");
8614
8615 prop = RNA_def_property(srna, "ray_tracing_method", PROP_ENUM, PROP_NONE);
8616 RNA_def_property_enum_items(prop, ray_tracing_method_items);
8618 prop, "Tracing Method", "Select the tracing method used to find scene-ray intersections");
8620
8621 prop = RNA_def_property(srna, "use_shadow_jitter_viewport", PROP_BOOLEAN, PROP_NONE);
8624 "Jittered Shadows (Viewport)",
8625 "Enable jittered shadows on the viewport. (Jittered shadows are always "
8626 "enabled for final renders).");
8628
8629 prop = RNA_def_property(srna, "time_limit", PROP_FLOAT, PROP_TIME_ABSOLUTE);
8630 RNA_def_property_ui_text(prop, "Time Limit", "Limit the render time. Zero disables the limit.");
8631 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8634
8635 /* Clamping */
8636 prop = RNA_def_property(srna, "clamp_surface_direct", PROP_FLOAT, PROP_NONE);
8638 "Clamp Surface Direct",
8639 "If non-zero, the maximum value for lights contribution on a surface. "
8640 "Higher values will be scaled down to avoid too "
8641 "much noise and slow convergence at the cost of accuracy. "
8642 "Used by light objects.");
8643 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8646
8647 prop = RNA_def_property(srna, "clamp_surface_indirect", PROP_FLOAT, PROP_NONE);
8649 "Clamp Surface Indirect",
8650 "If non-zero, the maximum value for indirect lighting on surface. "
8651 "Higher values will be scaled down to avoid too "
8652 "much noise and slow convergence at the cost of accuracy. "
8653 "Used by ray-tracing and light-probes.");
8654 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8657 prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneEEVEE_clamp_surface_indirect_update");
8658
8659 prop = RNA_def_property(srna, "clamp_volume_direct", PROP_FLOAT, PROP_NONE);
8661 "Clamp Volume Direct",
8662 "If non-zero, the maximum value for lights contribution in volumes. "
8663 "Higher values will be scaled down to avoid too "
8664 "much noise and slow convergence at the cost of accuracy. "
8665 "Used by light objects.");
8666 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8669
8670 prop = RNA_def_property(srna, "clamp_volume_indirect", PROP_FLOAT, PROP_NONE);
8672 "Clamp Volume Indirect",
8673 "If non-zero, the maximum value for indirect lighting in volumes. "
8674 "Higher values will be scaled down to avoid too "
8675 "much noise and slow convergence at the cost of accuracy. "
8676 "Used by light-probes.");
8677 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8680
8681 prop = RNA_def_property(srna, "direct_light_intensity", PROP_FLOAT, PROP_NONE);
8683 prop, "Direct Light Strength", "Scale the contribution of direct lighting");
8685 RNA_def_property_ui_range(prop, 0.0f, 3.0f, 1, 3);
8689
8690 prop = RNA_def_property(srna, "indirect_light_intensity", PROP_FLOAT, PROP_NONE);
8692 prop, "Indirect Light Strength", "Scale the contribution of indirect lighting");
8694 RNA_def_property_ui_range(prop, 0.0f, 3.0f, 1, 3);
8698
8699 /* Volumetrics */
8700 prop = RNA_def_property(srna, "volumetric_start", PROP_FLOAT, PROP_DISTANCE);
8701 RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect");
8702 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8703 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
8706
8707 prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE);
8708 RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect");
8709 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8710 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
8713
8714 prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE);
8717 "Resolution",
8718 "Control the quality of the volumetric effects. "
8719 "Higher resolution uses more memory.");
8722
8723 prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE);
8725 "Steps",
8726 "Number of steps to compute volumetric effects. "
8727 "Higher step count increase VRAM usage and quality.");
8728 RNA_def_property_range(prop, 1, 256);
8731
8732 prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR);
8734 prop, "Exponential Sampling", "Distribute more samples closer to the camera");
8737
8738 prop = RNA_def_property(srna, "volumetric_ray_depth", PROP_INT, PROP_NONE);
8740 "Volume Max Ray Depth",
8741 "Maximum surface intersection count used by the accurate volume "
8742 "intersection method. Will create artifact if it is exceeded. "
8743 "Higher count increases VRAM usage.");
8744 RNA_def_property_range(prop, 1, 16);
8747
8748 prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE);
8749 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8750 RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise");
8753
8754 prop = RNA_def_property(srna, "use_volumetric_shadows", PROP_BOOLEAN, PROP_NONE);
8757 prop,
8758 "Volumetric Shadows",
8759 "Cast shadows from volumetric materials onto volumetric materials (Very expensive)");
8762
8763 prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE);
8764 RNA_def_property_range(prop, 1, 128);
8766 prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing");
8769
8770 prop = RNA_def_property(srna, "use_volume_custom_range", PROP_BOOLEAN, PROP_NONE);
8773 "Volume Custom Range",
8774 "Enable custom start and end clip distances for volume computation");
8776
8777 /* Fast GI approximation */
8778
8779 prop = RNA_def_property(srna, "use_fast_gi", PROP_BOOLEAN, PROP_NONE);
8782 "Fast GI Approximation",
8783 "Use faster global illumination technique for high roughness surfaces");
8786
8787 /* Could be renamed to `fast_gi_thickness`, but would break API. */
8788 prop = RNA_def_property(srna, "fast_gi_thickness_near", PROP_FLOAT, PROP_DISTANCE);
8789 RNA_def_property_float_sdna(prop, nullptr, "fast_gi_thickness_near");
8791 prop,
8792 "Thickness",
8793 "Geometric thickness of the surfaces when computing fast GI and ambient occlusion. "
8794 "Reduces light leaking and missing contact occlusion.");
8795 RNA_def_property_range(prop, 0.0f, 100000.0f);
8796 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1.0f, 3);
8799
8800 prop = RNA_def_property(srna, "fast_gi_quality", PROP_FLOAT, PROP_FACTOR);
8801 RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the fast GI ray marching");
8802 RNA_def_property_range(prop, 0.0f, 1.0f);
8805
8806 prop = RNA_def_property(srna, "fast_gi_step_count", PROP_INT, PROP_UNSIGNED);
8807 RNA_def_property_range(prop, 1, 64);
8808 RNA_def_property_ui_text(prop, "Step Count", "Amount of screen sample per GI ray");
8811
8812 prop = RNA_def_property(srna, "fast_gi_ray_count", PROP_INT, PROP_UNSIGNED);
8813 RNA_def_property_range(prop, 1, 16);
8814 RNA_def_property_ui_text(prop, "Ray Count", "Amount of GI ray to trace for each pixel");
8817
8818 prop = RNA_def_property(srna, "fast_gi_method", PROP_ENUM, PROP_NONE);
8819 RNA_def_property_enum_items(prop, fast_gi_method_items);
8820 RNA_def_property_ui_text(prop, "Method", "Fast GI approximation method");
8822
8823 prop = RNA_def_property(srna, "fast_gi_distance", PROP_FLOAT, PROP_DISTANCE);
8824 RNA_def_property_range(prop, 0.0f, 100000.0f);
8825 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
8827 "Distance",
8828 "If non-zero, the maximum distance at which other surfaces will "
8829 "contribute to the fast GI approximation");
8831
8832 prop = RNA_def_property(srna, "fast_gi_bias", PROP_FLOAT, PROP_FACTOR);
8834 prop, "Bias", "Bias the shading normal to reduce self intersection artifacts");
8835 RNA_def_property_range(prop, 0.0f, 1.0f);
8836 RNA_def_property_ui_range(prop, 0.0f, 0.5f, 1.0f, 2);
8839
8840 prop = RNA_def_property(srna, "fast_gi_resolution", PROP_ENUM, PROP_NONE);
8843 "Resolution",
8844 "Control the quality of the fast GI lighting. "
8845 "Higher resolution uses more memory.");
8848
8849 /* Depth of Field */
8850
8851 prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_PIXEL);
8853 prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)");
8854 RNA_def_property_range(prop, 0.0f, 2000.0f);
8855 RNA_def_property_ui_range(prop, 0.0f, 200.0f, 100.0f, 1);
8857
8858 prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR);
8860 prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field");
8861 RNA_def_property_range(prop, 0.0f, 100000.0f);
8862 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 2);
8865
8866 prop = RNA_def_property(srna, "bokeh_neighbor_max", PROP_FLOAT, PROP_FACTOR);
8868 "Neighbor Rejection",
8869 "Maximum brightness to consider when rejecting bokeh sprites "
8870 "based on neighborhood (lower is faster)");
8871 RNA_def_property_range(prop, 0.0f, 100000.0f);
8872 RNA_def_property_ui_range(prop, 0.0f, 40.0f, 10, 2);
8875
8876 prop = RNA_def_property(srna, "use_bokeh_jittered", PROP_BOOLEAN, PROP_NONE);
8879 "Jitter Camera",
8880 "Jitter camera position to create accurate blurring "
8881 "using render samples (only for final render)");
8884
8885 prop = RNA_def_property(srna, "bokeh_overblur", PROP_FLOAT, PROP_PERCENTAGE);
8887 "Over-blur",
8888 "Apply blur to each jittered sample to reduce "
8889 "under-sampling artifacts");
8890 RNA_def_property_range(prop, 0, 100);
8891 RNA_def_property_ui_range(prop, 0.0f, 20.0f, 1, 1);
8893
8894 /* Motion blur */
8895 prop = RNA_def_property(srna, "motion_blur_depth_scale", PROP_FLOAT, PROP_NONE);
8897 "Bleeding Bias",
8898 "Lower values will reduce background"
8899 " bleeding onto foreground elements");
8900 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8901 RNA_def_property_ui_range(prop, 0.01f, 1000.0f, 1, 2);
8904
8905 prop = RNA_def_property(srna, "motion_blur_max", PROP_INT, PROP_PIXEL);
8906 RNA_def_property_ui_text(prop, "Max Blur", "Maximum blur distance a pixel can spread over");
8907 RNA_def_property_range(prop, 0, 2048);
8908 RNA_def_property_ui_range(prop, 0, 512, 1, -1);
8911
8912 prop = RNA_def_property(srna, "motion_blur_steps", PROP_INT, PROP_NONE);
8914 "Motion steps",
8915 "Controls accuracy of motion blur, "
8916 "more steps means longer render time");
8918 RNA_def_property_ui_range(prop, 1, 64, 1, -1);
8921
8922 /* Shadows */
8923 prop = RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
8925 RNA_def_property_ui_text(prop, "Shadows", "Enable shadow casting from lights");
8928
8929 prop = RNA_def_property(srna, "shadow_pool_size", PROP_ENUM, PROP_NONE);
8930 RNA_def_property_enum_items(prop, eevee_shadow_pool_size_items);
8932 "Shadow Pool Size",
8933 "Size of the shadow pool, "
8934 "a bigger pool size allows for more shadows in the scene "
8935 "but might not fit into GPU memory");
8938
8939 prop = RNA_def_property(srna, "shadow_ray_count", PROP_INT, PROP_UNSIGNED);
8940 RNA_def_property_range(prop, 1, 4);
8942 prop, "Shadow Ray Count", "Amount of shadow ray to trace for each light");
8945
8946 prop = RNA_def_property(srna, "shadow_step_count", PROP_INT, PROP_UNSIGNED);
8947 RNA_def_property_range(prop, 1, 16);
8949 prop, "Shadow Step Count", "Amount of shadow map sample per shadow ray");
8952
8953 prop = RNA_def_property(srna, "light_threshold", PROP_FLOAT, PROP_UNSIGNED);
8955 "Light Threshold",
8956 "Minimum light intensity for a light to contribute to the lighting");
8957 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8958 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
8961
8962 /* Overscan */
8963 prop = RNA_def_property(srna, "use_overscan", PROP_BOOLEAN, PROP_NONE);
8964 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_EEVEE_OVERSCAN);
8966 "Overscan",
8967 "Internally render past the image border to avoid "
8968 "screen-space effects disappearing");
8970
8971 prop = RNA_def_property(srna, "overscan_size", PROP_FLOAT, PROP_PERCENTAGE);
8972 RNA_def_property_float_sdna(prop, nullptr, "overscan");
8974 "Overscan Size",
8975 "Percentage of render size to add as overscan to the "
8976 "internal render buffers");
8977 RNA_def_property_range(prop, 0.0f, 50.0f);
8978 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 2);
8980
8981 prop = RNA_def_property(srna, "ray_tracing_options", PROP_POINTER, PROP_NONE);
8982 RNA_def_property_struct_type(prop, "RaytraceEEVEE");
8984 prop, "Reflection Trace Options", "EEVEE settings for tracing reflections");
8985
8986 prop = RNA_def_property(srna, "use_raytracing", PROP_BOOLEAN, PROP_NONE);
8987 /* Reuse the same property as legacy EEVEE for compatibility. */
8989 RNA_def_property_ui_text(prop, "Use Ray-Tracing", "Enable the ray-tracing module");
8992
8993 prop = RNA_def_property(srna, "shadow_resolution_scale", PROP_FLOAT, PROP_FACTOR);
8994 RNA_def_property_range(prop, 0.0f, 1.0f);
8996 prop, "Shadows Resolution Scale", "Resolution percentage of shadow maps");
8998 RNA_def_property_update(prop, 0, "rna_SceneEEVEE_shadow_resolution_update");
8999}
9000
9002{
9003 StructRNA *srna;
9004 PropertyRNA *prop;
9005
9006 srna = RNA_def_struct(brna, "SceneGpencil", nullptr);
9007 RNA_def_struct_path_func(srna, "rna_SceneGpencil_path");
9008 RNA_def_struct_ui_text(srna, "Grease Pencil Render", "Render settings");
9009
9010 prop = RNA_def_property(srna, "antialias_threshold", PROP_FLOAT, PROP_NONE);
9011 RNA_def_property_float_sdna(prop, nullptr, "smaa_threshold");
9012 RNA_def_property_range(prop, 0.0f, FLT_MAX);
9013 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
9015 "SMAA Threshold Viewport",
9016 "Threshold for edge detection algorithm (higher values might over-blur "
9017 "some part of the image)");
9019
9020 prop = RNA_def_property(srna, "antialias_threshold_render", PROP_FLOAT, PROP_NONE);
9021 RNA_def_property_float_sdna(prop, nullptr, "smaa_threshold_render");
9022 RNA_def_property_range(prop, 0.0f, FLT_MAX);
9023 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
9025 "SMAA Threshold Render",
9026 "Threshold for edge detection algorithm (higher values might over-blur "
9027 "some part of the image). Only applies to final render");
9029
9030 prop = RNA_def_property(srna, "aa_samples", PROP_INT, PROP_NONE);
9032 prop,
9033 "Anti-Aliasing Samples",
9034 "Number of supersampling anti-aliasing samples per pixel for final render");
9036 RNA_def_property_ui_range(prop, 1, 256, 1, 3);
9040
9041 prop = RNA_def_property(srna, "motion_blur_steps", PROP_INT, PROP_NONE);
9043 "Motion Blur Steps",
9044 "Controls accuracy of motion blur, more steps result in longer render "
9045 "time. Only used when Motion Blur is enabled. Set to 0 to disable "
9046 "motion blur for Grease Pencil");
9048 RNA_def_property_ui_range(prop, 0, 64, 1, -1);
9052
9055}
9056
9058{
9059 StructRNA *srna;
9060
9061 srna = RNA_def_struct(brna, "SceneCompositorEffectProperties", nullptr);
9062 RNA_def_struct_ui_text(srna, "Scene Effect Properties", "");
9063 RNA_def_struct_refine_func(srna, "rna_SceneCompositorEffectProperties_refine");
9064 RNA_def_struct_system_idprops_func(srna, "rna_SceneCompositorEffect_idprops");
9065 RNA_def_struct_path_func(srna, "rna_SceneCompositorEffectProperties_path");
9066
9067 srna = RNA_def_struct(brna, "SceneCompositorEffectPropertiesEmpty", nullptr);
9068 RNA_def_struct_ui_text(srna, "Scene Effect Empty Properties", "");
9069 RNA_def_struct_system_idprops_func(srna, "rna_SceneCompositorEffect_idprops");
9070 RNA_def_struct_path_func(srna, "rna_SceneCompositorEffectProperties_path");
9071}
9072
9074{
9075 StructRNA *srna;
9076 PropertyRNA *prop;
9077
9078 srna = RNA_def_struct(brna, "SceneCompositorEffect", nullptr);
9079 RNA_def_struct_sdna(srna, "SceneCompositorEffect");
9080 RNA_def_struct_ui_text(srna, "Scene Effect", "Compositor effect for scene");
9081 RNA_def_struct_ui_icon(srna, ICON_NODE_COMPOSITING);
9082 RNA_def_struct_path_func(srna, "rna_SceneCompositorEffect_path");
9083
9084 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
9085 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_SceneCompositorEffect_name_set");
9086 RNA_def_property_ui_text(prop, "Name", "");
9087 RNA_def_struct_name_property(srna, prop);
9088 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, nullptr);
9089
9090 prop = RNA_def_property(srna, "enable_for_render", PROP_BOOLEAN, PROP_NONE);
9092 prop, nullptr, "flags", uint8_t(SceneCompositorEffectFlags::EnableForRender));
9093 RNA_def_property_ui_text(prop, "Render", "Use effect during render");
9094 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_ON, 1);
9096 RNA_def_property_update(prop, NC_SCENE | ND_COMPO_RESULT, "rna_Scene_compositor_update");
9097
9098 prop = RNA_def_property(srna, "enable_for_preview", PROP_BOOLEAN, PROP_NONE);
9100 prop, nullptr, "flags", uint8_t(SceneCompositorEffectFlags::EnableForPreview));
9101 RNA_def_property_ui_text(prop, "Preview", "Use effect during preview");
9102 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_ON, 1);
9104 RNA_def_property_update(prop, NC_SCENE | ND_COMPO_RESULT, "rna_Scene_compositor_update");
9105
9106 prop = RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
9108 prop, nullptr, "flags", uint8_t(SceneCompositorEffectFlags::IsActive));
9109 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SceneCompositorEffect_is_active_set");
9111 RNA_def_property_ui_text(prop, "Is Active", "This effect is active");
9113 RNA_def_property_update(prop, NC_SCENE | ND_COMPO_RESULT, "rna_Scene_compositor_update");
9114
9115 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
9118 prop, nullptr, "ui_panel_data_expansion", UI_PANEL_DATA_EXPAND_ROOT);
9119 RNA_def_property_ui_text(prop, "Expanded", "Show effect expanded");
9122
9123 prop = RNA_def_property(srna, "show_node_group_selector", PROP_BOOLEAN, PROP_NONE);
9126 RNA_def_property_ui_text(prop, "Show Node Group Selector", "");
9129
9130 prop = RNA_def_property(srna, "node_group", PROP_POINTER, PROP_NONE);
9131 RNA_def_property_ui_text(prop, "Node Group", "Node group that controls what this effect does");
9133 prop, nullptr, nullptr, nullptr, "rna_SceneCompositorEffect_node_group_poll");
9136 prop, NC_SCENE | ND_SEQUENCER, "rna_SceneCompositorEffect_node_group_update");
9137
9139
9140 prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
9141 RNA_def_property_struct_type(prop, "SceneCompositorEffectProperties");
9142 RNA_def_property_ui_text(prop, "Properties", "");
9144 prop, "rna_SceneCompositorEffectProperties_get", nullptr, nullptr, nullptr);
9145}
9146
9148{
9149 StructRNA *srna;
9150 PropertyRNA *prop;
9151
9152 FunctionRNA *func;
9153 PropertyRNA *parm;
9154
9155 RNA_def_property_srna(cprop, "SceneCompositorEffects");
9156 srna = RNA_def_struct(brna, "SceneCompositorEffects", nullptr);
9157 RNA_def_struct_sdna(srna, "Scene");
9158 RNA_def_struct_ui_text(srna, "Scene Effects", "Collection of scene effects");
9159
9160 /* add effect */
9161 func = RNA_def_function(srna, "new", "rna_SceneCompositorEffects_new");
9163 RNA_def_function_ui_description(func, "Add a new effect");
9164 parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the effect");
9166 /* return type */
9167 parm = RNA_def_pointer(func, "effect", "SceneCompositorEffect", "", "Newly created effect");
9169 RNA_def_function_return(func, parm);
9170
9171 /* remove effect */
9172 func = RNA_def_function(srna, "remove", "rna_SceneCompositorEffects_remove");
9174 RNA_def_function_ui_description(func, "Remove an existing effect from the scene");
9175 /* effect to remove */
9176 parm = RNA_def_pointer(func, "effect", "SceneCompositorEffect", "", "Effect to remove");
9179
9180 /* clear all effects */
9181 func = RNA_def_function(srna, "clear", "rna_SceneCompositorEffects_clear");
9183 RNA_def_function_ui_description(func, "Remove all effects from the strip");
9184
9185 /* Active effect. */
9186 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
9187 RNA_def_property_struct_type(prop, "SceneCompositorEffect");
9189 "rna_SceneCompositorEffects_active_get",
9190 "rna_SceneCompositorEffects_active_set",
9191 nullptr,
9192 nullptr);
9194 RNA_def_property_ui_text(prop, "Active Effect", "The active strip effect in the list");
9195 RNA_def_property_update(prop, NC_SCENE | ND_COMPO_RESULT, "rna_Scene_compositor_update");
9196}
9197
9199{
9200 StructRNA *srna;
9201 PropertyRNA *prop;
9202
9203 static const EnumPropertyItem hydra_export_method_items[] = {
9205 "HYDRA",
9206 0,
9207 "Hydra",
9208 "Fast interactive editing through native Hydra integration"},
9210 "USD",
9211 0,
9212 "USD",
9213 "Export scene through USD file, for accurate comparison with USD file export"},
9214 {0, nullptr, 0, nullptr, nullptr},
9215 };
9216
9217 srna = RNA_def_struct(brna, "SceneHydra", nullptr);
9218 RNA_def_struct_path_func(srna, "rna_SceneHydra_path");
9219 RNA_def_struct_ui_text(srna, "Scene Hydra", "Scene Hydra render engine settings");
9220
9221 prop = RNA_def_property(srna, "export_method", PROP_ENUM, PROP_NONE);
9222 RNA_def_property_enum_items(prop, hydra_export_method_items);
9224 prop, "Export Method", "How to export the Blender scene to the Hydra render engine");
9226}
9227
9229{
9230 StructRNA *srna;
9231 PropertyRNA *prop;
9232
9233 FunctionRNA *func;
9234 PropertyRNA *parm;
9235
9236 static const EnumPropertyItem audio_distance_model_items[] = {
9237 {0, "NONE", 0, "None", "No distance attenuation"},
9238 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
9239 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
9240 {3, "LINEAR", 0, "Linear", "Linear distance model"},
9241 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
9242 {5, "EXPONENT", 0, "Exponential", "Exponential distance model"},
9243 {6,
9244 "EXPONENT_CLAMPED",
9245 0,
9246 "Exponential Clamped",
9247 "Exponential distance model with clamping"},
9248 {0, nullptr, 0, nullptr, nullptr},
9249 };
9250
9251 static const EnumPropertyItem sync_mode_items[] = {
9252 {0, "NONE", 0, "Play Every Frame", "Do not sync, play every frame"},
9253 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
9254 {AUDIO_SYNC, "AUDIO_SYNC", 0, "Sync to Audio", "Sync to audio playback, dropping frames"},
9255 {0, nullptr, 0, nullptr, nullptr},
9256 };
9257
9258 static const EnumPropertyItem playback_loop_mode_items[] = {
9260 "INFINITE",
9261 0,
9262 "Infinite",
9263 "After the last frame, jump back to the first and keep playing, infinitely"},
9265 "STOP_END_FRAME",
9266 0,
9267 "Stop at End Frame",
9268 "Stop playback at the last frame, without looping"},
9270 "STOP_START_FRAME",
9271 0,
9272 "Stop at Start Frame",
9273 "After the last frame, jump back to the first and stop playback"},
9275 "RESTORE",
9276 0,
9277 "Restore Frame",
9278 "After the last frame, stop at the frame the playback started from"},
9279 {SCE_LOOP_MODE_BOUNCE, "BOUNCE", 0, "Bounce", "At the last frame, reverse playback"},
9280 {0, nullptr, 0, nullptr, nullptr},
9281 };
9282
9283 static const EnumPropertyItem time_jump_unit_items[] = {
9284 {SCE_TIME_JUMP_FRAME, "FRAME", 0, "Frame", "Jump by frames"},
9285 {SCE_TIME_JUMP_SECOND, "SECOND", 0, "Second", "Jump by seconds"},
9286 {0, nullptr, 0, nullptr, nullptr},
9287 };
9288
9289 /* Struct definition */
9290 srna = RNA_def_struct(brna, "Scene", "ID");
9292 "Scene",
9293 "Scene data-block, consisting in objects and "
9294 "defining time and render related settings");
9295 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
9297
9298 /* Global Settings */
9299 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
9302 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Camera_object_poll");
9303 RNA_def_property_ui_text(prop, "Camera", "Active camera, used for rendering the scene");
9304 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_camera_update");
9305
9306 prop = RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
9307 RNA_def_property_pointer_sdna(prop, nullptr, "set");
9308 RNA_def_property_struct_type(prop, "Scene");
9311 RNA_def_property_pointer_funcs(prop, nullptr, "rna_Scene_set_set", nullptr, nullptr);
9312 RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
9313 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
9314
9315 prop = RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
9318 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
9320 RNA_def_property_update(prop, NC_SCENE | ND_WORLD, "rna_Scene_world_update");
9321
9322 prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
9323 RNA_def_property_struct_type(prop, "Object");
9324 RNA_def_property_ui_text(prop, "Objects", "");
9326 "rna_Scene_objects_begin",
9327 "rna_Scene_objects_next",
9328 "rna_Scene_objects_end",
9329 "rna_Scene_objects_get",
9330 nullptr,
9331 nullptr,
9332 nullptr,
9333 nullptr);
9334 rna_def_scene_objects(brna, prop);
9335
9336 /* Frame Range Stuff */
9337 prop = RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
9339 RNA_def_property_int_sdna(prop, nullptr, "r.cfra");
9341 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_frame_current_set", nullptr);
9343 prop,
9344 "Current Frame",
9345 "Current frame, to update animation data from Python frame_set() instead");
9347 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update_context");
9348
9349 prop = RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME);
9350 RNA_def_property_float_sdna(prop, nullptr, "r.subframe");
9351 RNA_def_property_ui_text(prop, "Current Subframe", "");
9353 RNA_def_property_range(prop, 0.0f, 1.0f);
9354 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2);
9355 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
9356
9357 prop = RNA_def_property(srna, "frame_float", PROP_FLOAT, PROP_TIME);
9358 RNA_def_property_ui_text(prop, "Current Subframe", "");
9363 prop, "rna_Scene_frame_float_get", "rna_Scene_frame_float_set", nullptr);
9364 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
9365
9366 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
9368 RNA_def_property_int_sdna(prop, nullptr, "r.sfra");
9369 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_start_frame_set", nullptr);
9371 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
9372 RNA_def_property_update(prop, NC_SCENE | ND_FRAME_RANGE, "rna_Scene_frame_range_update");
9373
9374 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
9376 RNA_def_property_int_sdna(prop, nullptr, "r.efra");
9377 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_end_frame_set", nullptr);
9379 RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
9380 RNA_def_property_update(prop, NC_SCENE | ND_FRAME_RANGE, "rna_Scene_frame_range_update");
9381
9382 prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
9384 RNA_def_property_int_sdna(prop, nullptr, "r.frame_step");
9386 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
9388 prop,
9389 "Frame Step",
9390 "Number of frames to skip forward while rendering/playing back each frame");
9391 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
9392
9393 prop = RNA_def_property(srna, "time_jump_unit", PROP_ENUM, PROP_NONE);
9394 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "r.time_jump_unit");
9396 RNA_def_property_enum_items(prop, time_jump_unit_items);
9398 prop, "Time Jump Unit", "Which unit to use for time jumps in the timeline");
9401
9402 prop = RNA_def_property(srna, "time_jump_delta", PROP_FLOAT, PROP_TIME);
9404 RNA_def_property_float_sdna(prop, nullptr, "r.time_jump_delta");
9405 RNA_def_property_range(prop, 0.1f, FLT_MAX);
9407 prop, "Time Jump Delta", "Number of frames or seconds to jump forward or backward");
9409
9410 prop = RNA_def_property(srna, "frame_current_final", PROP_FLOAT, PROP_TIME);
9413 RNA_def_property_float_funcs(prop, "rna_Scene_frame_current_final_get", nullptr, nullptr);
9415 prop, "Current Frame Final", "Current frame with subframe and time remapping applied");
9416
9417 prop = RNA_def_property(srna, "lock_frame_selection_to_range", PROP_BOOLEAN, PROP_NONE);
9421 "Lock Frame Selection",
9422 "Don't allow frame to be selected with mouse outside of frame range");
9423 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
9424
9425 prop = RNA_def_property(srna, "allow_preroll", PROP_BOOLEAN, PROP_NONE);
9427 RNA_def_property_boolean_sdna(prop, nullptr, "r.flag", SCER_ALLOW_PREROLL);
9429 prop, "Allow Preroll", "Allows playing back frames before the playback start frame");
9430 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
9431
9432 /* Preview Range (frame-range for UI playback) */
9433 prop = RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
9435 RNA_def_property_boolean_sdna(prop, nullptr, "r.flag", SCER_PRV_RANGE);
9436 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Scene_use_preview_range_set");
9438 prop,
9439 "Use Preview Range",
9440 "Use an alternative start/end frame range for animation playback and view renders");
9441 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
9442 RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
9443
9444 prop = RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
9446 RNA_def_property_int_sdna(prop, nullptr, "r.psfra");
9447 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_preview_range_start_frame_set", nullptr);
9449 prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
9450 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
9451
9452 prop = RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
9454 RNA_def_property_int_sdna(prop, nullptr, "r.pefra");
9455 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_preview_range_end_frame_set", nullptr);
9457 prop, "Preview Range End Frame", "Alternative end frame for UI playback");
9458 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
9459
9460 /* Sub-frame for motion-blur debug. */
9461 prop = RNA_def_property(srna, "show_subframe", PROP_BOOLEAN, PROP_NONE);
9463 RNA_def_property_boolean_sdna(prop, nullptr, "r.flag", SCER_SHOW_SUBFRAME);
9465 prop,
9466 "Show Subframe",
9467 "Display and allow setting fractional frame values for the current frame");
9468 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_show_subframe_update");
9469
9470 /* Timeline / Time Navigation settings */
9471 prop = RNA_def_property(srna, "show_keys_from_selected_only", PROP_BOOLEAN, PROP_NONE);
9474 prop, "Only Show Selected", "Only include channels relating to selected objects and data");
9475 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
9476
9477 prop = RNA_def_property(srna, "wrap_timeline_navigation", PROP_BOOLEAN, PROP_NONE);
9481 prop,
9482 "Wrap Timeline",
9483 "Wrap the playhead around the playback range when navigating the timeline");
9484 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
9485
9486 /* Stamp */
9487 prop = RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
9488 RNA_def_property_string_sdna(prop, nullptr, "r.stamp_udata");
9489 RNA_def_property_ui_text(prop, "Stamp Note", "User defined note for the render stamping");
9491
9492 /* Animation Data (for Scene) */
9494
9495 /* Readonly Properties */
9496 prop = RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
9497 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_NLA_EDIT_ON);
9499 PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
9501 prop,
9502 "NLA Tweak Mode",
9503 "Whether there is any action referenced by NLA being edited (strictly read-only)");
9505
9506 /* Frame dropping flag for playback and sync enum */
9507# if 0 /* XXX: Is this actually needed? */
9508 prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
9509 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_FRAME_DROP);
9511 prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
9512 RNA_def_property_update(prop, NC_SCENE, nullptr);
9513# endif
9514
9515 prop = RNA_def_property(srna, "use_custom_simulation_range", PROP_BOOLEAN, PROP_NONE);
9518 "Custom Simulation Range",
9519 "Use a simulation range that is different from the scene range for "
9520 "simulation nodes that don't override the frame range themselves");
9522 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
9523
9524 prop = RNA_def_property(srna, "simulation_frame_start", PROP_INT, PROP_NONE);
9525 RNA_def_property_ui_text(prop, "Simulation Frame Start", "Frame at which simulations start");
9527 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
9528
9529 prop = RNA_def_property(srna, "simulation_frame_end", PROP_INT, PROP_NONE);
9530 RNA_def_property_ui_text(prop, "Simulation Frame End", "Frame at which simulations end");
9532 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
9533
9534 prop = RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
9535 RNA_def_property_enum_funcs(prop, "rna_Scene_sync_mode_get", "rna_Scene_sync_mode_set", nullptr);
9536 RNA_def_property_enum_items(prop, sync_mode_items);
9538 RNA_def_property_ui_text(prop, "Sync Mode", "How to sync playback");
9539 RNA_def_property_update(prop, NC_SCENE, nullptr);
9540
9541 prop = RNA_def_property(srna, "playback_loop_mode", PROP_ENUM, PROP_NONE);
9542 RNA_def_property_enum_items(prop, playback_loop_mode_items);
9544 RNA_def_property_ui_text(prop, "Loop Mode", "What to do when playback reaches the last frame");
9545 RNA_def_property_update(prop, NC_SCENE, nullptr);
9546
9547 prop = RNA_def_property(srna, "compositor_effects", PROP_COLLECTION, PROP_NONE);
9548 RNA_def_property_struct_type(prop, "SceneCompositorEffect");
9549 RNA_def_property_ui_text(prop, "Scene Effects", "Compositor effects for this scene");
9550 rna_def_compositor_effects(brna, prop);
9551
9552 /* Nodes (Compositing) */
9553 prop = RNA_def_property(srna, "compositing_node_group", PROP_POINTER, PROP_NONE);
9554 RNA_def_property_struct_type(prop, "NodeTree");
9558 "Node Tree",
9559 "Returns and sets the node group of the active scene compositor "
9560 "effect. Creates a new effect if none exists");
9561 RNA_def_property_update(prop, 0, "rna_Scene_compositing_node_group_update");
9563 "rna_Scene_compositing_node_group_get",
9564 "rna_Scene_compositing_node_group_set",
9565 nullptr,
9566 "rna_Scene_compositing_node_group_poll");
9567 RNA_def_property_deprecated(prop, "Use compositor_effects instead.", 500, 600);
9568
9569 /* Todo(#140111): Remove in 6.0. */
9570 prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
9571 RNA_def_property_boolean_sdna(prop, nullptr, "use_nodes", 1);
9573 RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node group.");
9574 RNA_def_property_boolean_funcs(prop, "rna_Scene_use_nodes_get", "rna_Scene_use_nodes_set");
9576 prop,
9577 "Unused but kept for compatibility reasons. Setting the property "
9578 "has no effect, and getting it always returns True. Use #scene.render.use_compositing to "
9579 "turn compositing to enable or disable compositing.",
9580 500,
9581 600);
9582
9583 /* Sequencer */
9584 prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
9585 RNA_def_property_pointer_sdna(prop, nullptr, "ed");
9586 RNA_def_property_struct_type(prop, "SequenceEditor");
9587 RNA_def_property_ui_text(prop, "Sequence Editor", "");
9588
9589 /* Keying Sets */
9590 prop = RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
9591 RNA_def_property_collection_sdna(prop, nullptr, "keyingsets", nullptr);
9592 RNA_def_property_struct_type(prop, "KeyingSet");
9593 RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
9595 rna_def_scene_keying_sets(brna, prop);
9596
9597 prop = RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
9599 "rna_Scene_all_keyingsets_begin",
9600 "rna_Scene_all_keyingsets_next",
9601 "rna_iterator_listbase_end",
9602 "rna_iterator_listbase_get",
9603 nullptr,
9604 nullptr,
9605 nullptr,
9606 nullptr);
9607 RNA_def_property_struct_type(prop, "KeyingSet");
9609 prop,
9610 "All Keying Sets",
9611 "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
9614
9615 /* Rigid Body Simulation */
9616 prop = RNA_def_property(srna, "rigidbody_world", PROP_POINTER, PROP_NONE);
9617 RNA_def_property_pointer_sdna(prop, nullptr, "rigidbody_world");
9618 RNA_def_property_struct_type(prop, "RigidBodyWorld");
9619 RNA_def_property_ui_text(prop, "Rigid Body World", "");
9620 RNA_def_property_update(prop, NC_SCENE, "rna_Physics_relations_update");
9621
9622 /* Tool Settings */
9623 prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
9626 RNA_def_property_pointer_sdna(prop, nullptr, "toolsettings");
9627 RNA_def_property_struct_type(prop, "ToolSettings");
9628 RNA_def_property_ui_text(prop, "Tool Settings", "");
9629
9630 /* Unit Settings */
9631 prop = RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
9633 RNA_def_property_pointer_sdna(prop, nullptr, "unit");
9634 RNA_def_property_struct_type(prop, "UnitSettings");
9635 RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
9636
9637 /* Physics Settings */
9638 prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
9639 RNA_def_property_float_sdna(prop, nullptr, "physics_settings.gravity");
9640 RNA_def_property_array(prop, 3);
9641 RNA_def_property_ui_range(prop, -200.0f, 200.0f, 1, 2);
9642 RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
9643 RNA_def_property_update(prop, 0, "rna_Physics_update");
9644
9645 prop = RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
9646 RNA_def_property_boolean_sdna(prop, nullptr, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
9647 RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics");
9648 RNA_def_property_update(prop, 0, "rna_Physics_update");
9649
9650 /* Render Data */
9651 prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
9653 RNA_def_property_pointer_sdna(prop, nullptr, "r");
9654 RNA_def_property_struct_type(prop, "RenderSettings");
9655 RNA_def_property_ui_text(prop, "Render Data", "");
9656
9657 /* Safe Areas */
9658 prop = RNA_def_property(srna, "safe_areas", PROP_POINTER, PROP_NONE);
9659 RNA_def_property_pointer_sdna(prop, nullptr, "safe_areas");
9661 RNA_def_property_struct_type(prop, "DisplaySafeAreas");
9662 RNA_def_property_ui_text(prop, "Safe Areas", "");
9663
9664 /* Markers */
9665 prop = RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
9666 RNA_def_property_collection_sdna(prop, nullptr, "markers", nullptr);
9667 RNA_def_property_struct_type(prop, "TimelineMarker");
9669 prop, "Timeline Markers", "Markers used in all timelines for the current scene");
9670 rna_def_timeline_markers(brna, prop);
9671
9672 /* Transform Orientations */
9673 prop = RNA_def_property(srna, "transform_orientation_slots", PROP_COLLECTION, PROP_NONE);
9675 "rna_Scene_transform_orientation_slots_begin",
9676 "rna_iterator_array_next",
9677 "rna_iterator_array_end",
9678 "rna_iterator_array_get",
9679 "rna_Scene_transform_orientation_slots_length",
9680 nullptr,
9681 nullptr,
9682 nullptr);
9683 RNA_def_property_struct_type(prop, "TransformOrientationSlot");
9684 RNA_def_property_ui_text(prop, "Transform Orientation Slots", "");
9685
9686 /* 3D View Cursor */
9687 prop = RNA_def_property(srna, "cursor", PROP_POINTER, PROP_NONE);
9689 RNA_def_property_pointer_sdna(prop, nullptr, "cursor");
9690 RNA_def_property_struct_type(prop, "View3DCursor");
9691 RNA_def_property_ui_text(prop, "3D Cursor", "");
9692
9693 /* Audio Settings */
9694 prop = RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE);
9695 RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set");
9697 prop, "Play Audio", "Play back of audio from Sequence Editor, otherwise mute audio");
9698 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_use_audio_update");
9699
9700# if 0 /* XXX: Is this actually needed? */
9701 prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
9702 RNA_def_property_boolean_sdna(prop, nullptr, "audio.flag", AUDIO_SYNC);
9704 prop,
9705 "Audio Sync",
9706 "Play back and sync with audio clock, dropping frames if frame display is too slow");
9707 RNA_def_property_update(prop, NC_SCENE, nullptr);
9708# endif
9709
9710 prop = RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
9711 RNA_def_property_boolean_sdna(prop, nullptr, "audio.flag", AUDIO_SCRUB);
9713 prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing");
9714 RNA_def_property_update(prop, NC_SCENE, nullptr);
9715
9716 prop = RNA_def_property(srna, "audio_doppler_speed", PROP_FLOAT, PROP_NONE);
9717 RNA_def_property_float_sdna(prop, nullptr, "audio.speed_of_sound");
9719 RNA_def_property_range(prop, 0.01f, FLT_MAX);
9721 prop, "Speed of Sound", "Speed of sound for Doppler effect calculation");
9722 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
9723
9724 prop = RNA_def_property(srna, "audio_doppler_factor", PROP_FLOAT, PROP_NONE);
9725 RNA_def_property_float_sdna(prop, nullptr, "audio.doppler_factor");
9727 RNA_def_property_range(prop, 0.0, FLT_MAX);
9728 RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for Doppler effect calculation");
9729 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
9730
9731 prop = RNA_def_property(srna, "audio_distance_model", PROP_ENUM, PROP_NONE);
9732 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "audio.distance_model");
9734 RNA_def_property_enum_items(prop, audio_distance_model_items);
9736 prop, "Distance Model", "Distance model for distance attenuation calculation");
9737 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
9738
9739 prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
9740 RNA_def_property_float_sdna(prop, nullptr, "audio.volume");
9741 RNA_def_property_range(prop, 0.0f, 100.0f);
9742 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
9744 RNA_def_property_update(prop, NC_SCENE, nullptr);
9745 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_volume_update");
9746
9747 func = RNA_def_function(srna, "update_render_engine", "rna_Scene_update_render_engine");
9749 RNA_def_function_ui_description(func, "Trigger a render engine update");
9750
9751 /* Statistics */
9752 func = RNA_def_function(srna, "statistics", "rna_Scene_statistics_string_get");
9754 parm = RNA_def_pointer(func, "view_layer", "ViewLayer", "View Layer", "");
9756 parm = RNA_def_string(func, "statistics", nullptr, 0, "Statistics", "");
9757 RNA_def_function_return(func, parm);
9758
9759 /* Grease Pencil */
9760 prop = RNA_def_property(srna, "annotation", PROP_POINTER, PROP_NONE);
9761 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
9762 RNA_def_property_struct_type(prop, "Annotation");
9764 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
9767 RNA_def_property_ui_text(prop, "Annotations", "Data-block used for annotations in the 3D view");
9769
9770 /* active MovieClip */
9771 prop = RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE);
9772 RNA_def_property_pointer_sdna(prop, nullptr, "clip");
9774 RNA_def_property_struct_type(prop, "MovieClip");
9776 "Active Movie Clip",
9777 "Active Movie Clip that can be used by motion tracking constraints "
9778 "or as a camera's background image");
9780
9781 /* color management */
9782 prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
9783 RNA_def_property_pointer_sdna(prop, nullptr, "view_settings");
9784 RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
9786 prop, "View Settings", "Color management settings applied on image before saving");
9787
9788 prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
9789 RNA_def_property_pointer_sdna(prop, nullptr, "display_settings");
9790 RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
9792 prop, "Display Settings", "Settings of device saved image would be displayed on");
9793
9794 prop = RNA_def_property(srna, "sequencer_colorspace_settings", PROP_POINTER, PROP_NONE);
9795 RNA_def_property_pointer_sdna(prop, nullptr, "sequencer_colorspace_settings");
9796 RNA_def_property_struct_type(prop, "ColorManagedSequencerColorspaceSettings");
9798 prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
9799
9800 /* Layer and Collections */
9801 prop = RNA_def_property(srna, "view_layers", PROP_COLLECTION, PROP_NONE);
9802 RNA_def_property_collection_sdna(prop, nullptr, "view_layers", nullptr);
9803 RNA_def_property_struct_type(prop, "ViewLayer");
9804 RNA_def_property_ui_text(prop, "View Layers", "");
9805 rna_def_view_layers(brna, prop);
9806
9807 prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
9809 RNA_def_property_pointer_sdna(prop, nullptr, "master_collection");
9810 RNA_def_property_struct_type(prop, "Collection");
9814 "Collection",
9815 "Scene root collection that owns all the objects and other collections "
9816 "instantiated in the scene");
9817
9818 /* Scene Display */
9819 prop = RNA_def_property(srna, "display", PROP_POINTER, PROP_NONE);
9820 RNA_def_property_pointer_sdna(prop, nullptr, "display");
9821 RNA_def_property_struct_type(prop, "SceneDisplay");
9822 RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3D viewport");
9823
9824 /* EEVEE */
9825 prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
9826 RNA_def_property_struct_type(prop, "SceneEEVEE");
9827 RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene");
9828
9829 /* Grease Pencil */
9830 prop = RNA_def_property(srna, "grease_pencil_settings", PROP_POINTER, PROP_NONE);
9831 RNA_def_property_struct_type(prop, "SceneGpencil");
9832 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil settings for the scene");
9833
9834 /* Hydra */
9835 prop = RNA_def_property(srna, "hydra", PROP_POINTER, PROP_NONE);
9836 RNA_def_property_struct_type(prop, "SceneHydra");
9837 RNA_def_property_ui_text(prop, "Hydra", "Hydra settings for the scene");
9838
9839 /* Nestled Data. */
9840 /* *** Non-Animated *** */
9846 rna_def_statvis(brna);
9856 rna_def_scene_eevee(brna);
9857 rna_def_scene_hydra(brna);
9863 /* *** Animated *** */
9867
9868 /* Scene API */
9869 RNA_api_scene(srna);
9870}
9871
9872} // namespace blender
9873
9874#endif
Functionality to interact with keying sets.
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_SCENE_OBJECT_END
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance)
#define G_MAIN
#define IMA_SIGNAL_FREE
Definition BKE_image.hh:179
#define IMA_CHAN_FLAG_RGB
#define IMA_CHAN_FLAG_RGBA
#define IMA_CHAN_FLAG_BW
#define BKE_IMAGE_PATH_EXT_MAX
#define SELECT
Definition BKE_mask.hh:19
#define CMP_NODE_OUTPUT_FILE
#define PTCACHE_RESET_DEPSGRAPH
#define SETLOOPER_SET_ONLY(_bmain, _sce_basis, _sce_iter, _base)
Definition BKE_scene.hh:55
#define DEG2RAD(_deg)
#define DEG2RADF(_deg)
#define M_PI
#define STR_ELEM(...)
#define STRNCPY_UTF8(dst, src)
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
#define BLENDER_MAX_THREADS
#define BLT_I18NCONTEXT_EDITOR_VIEW3D
#define BLT_I18NCONTEXT_ID_WORLD
#define BLT_I18NCONTEXT_ID_ACTION
#define BLT_I18NCONTEXT_ID_CURVES
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_ID_SOUND
#define BLT_I18NCONTEXT_UNIT
#define BLT_I18NCONTEXT_ID_SCENE
#define DATA_(msgid)
#define ID_MISSING(_id)
Definition DNA_ID.h:695
#define MAX_NAME
Definition DNA_defs.h:63
Object is a sort of wrapper for general info.
#define OB_TYPE_IS_GEOMETRY(_type)
#define STEREO_LEFT_NAME
#define MINFRAME
#define MINAFRAME
#define SCE_SNAP_TO_GEOM
#define SCE_SNAP_TO_VERTEX
#define STEREO_RIGHT_NAME
#define USER_UNIT_ADAPTIVE
#define MAXFRAME
#define FRAMENUMBER_MIN_CLAMP(cfra)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
Read Blender memory allocation and freeing.
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:762
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:272
#define C
Definition RandGen.cpp:29
#define ND_SEQUENCER
Definition WM_types.hh:456
#define NC_WORLD
Definition WM_types.hh:400
#define ND_WORLD
Definition WM_types.hh:471
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:578
#define NC_WINDOW
Definition WM_types.hh:388
#define NC_NODE
Definition WM_types.hh:407
#define NC_GEOM
Definition WM_types.hh:406
#define ND_DRAW
Definition WM_types.hh:502
#define ND_DATA
Definition WM_types.hh:552
#define ND_RENDER_OPTIONS
Definition WM_types.hh:454
#define NC_ANIMATION
Definition WM_types.hh:401
#define ND_DISPLAY
Definition WM_types.hh:534
#define ND_COMPO_RESULT
Definition WM_types.hh:466
#define ND_SPACE_PROPERTIES
Definition WM_types.hh:572
#define ND_KEYINGSET
Definition WM_types.hh:467
#define NC_SCENE
Definition WM_types.hh:391
#define ND_TOOLSETTINGS
Definition WM_types.hh:468
#define ND_SPACE_IMAGE
Definition WM_types.hh:565
#define NA_EDITED
Definition WM_types.hh:634
#define ND_SPACE_GRAPH
Definition WM_types.hh:575
#define ND_FRAME_RANGE
Definition WM_types.hh:470
#define NC_IMAGE
Definition WM_types.hh:397
#define ND_MARKERS
Definition WM_types.hh:452
#define ND_FRAME
Definition WM_types.hh:453
#define NC_GPENCIL
Definition WM_types.hh:412
#define ND_TRANSFORM
Definition WM_types.hh:475
#define ND_LAYER
Definition WM_types.hh:469
#define ND_KEYFRAME_AUTO
Definition WM_types.hh:544
#define ND_SPACE_VIEW3D
Definition WM_types.hh:571
#define NC_OBJECT
Definition WM_types.hh:392
#define NC_SPACE
Definition WM_types.hh:405
#define ND_DRAW_RENDER_VIEWPORT
Definition WM_types.hh:511
volatile int lock
#define CLAMP(a, b, c)
#define BLI_assert_unreachable()
#define BLI_assert(a)
#define ELEM(...)
#define STREQ(a, b)
btScalar max
Definition scene.h:133
string name
Definition scene.h:136
Camera * camera
Definition scene.h:145
#define offsetof(t, d)
#define SHRT_MAX
#define FLT_MAX
#define INT_MAX
#define storage(slot, qualifiers)
#define index(i)
MatBase< 4, 4 > float4x4
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
Definition math_dual.h:263
ccl_device_inline void copy_v3_v3(ccl_private float *r, const float3 val)
KeyingSet * scene_get_active_keyingset(const Scene *scene)
void scene_simulation_states_reset(Scene &scene)
SceneCompositorEffect * get_active_effect(const Scene &scene)
SceneCompositorEffect & new_effect(Scene &scene, StringRef name)
void update_effect_node_group_interface(Main &main, Scene &scene, SceneCompositorEffect &effect)
bool ensure_selection_domain(ToolSettings *ts, Object *object)
void sync_active_scene_and_time_with_scene_strip(bContext &C)
void foreach_strip(ListBaseT< Strip > *seqbase, ForEachFunc callback, void *user_data)
Definition iterator.cc:60
void relations_invalidate_scene_strips(const Main *bmain, const Scene *scene_target)
void sound_update_length(Main *bmain, Scene *scene)
BMesh Iterators.
const EnumPropertyItem rna_enum_image_color_mode_items[]
Definition rna_scene.cc:404
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
const EnumPropertyItem rna_enum_normal_space_items[]
Definition rna_scene.cc:436
const char * ED_info_statistics_string(Main *bmain, Scene *scene, ViewLayer *view_layer)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
@ SCE_CUSTOM_SIMULATION_RANGE
void id_lib_extern(ID *id, bool enforce_fix=false)
Definition lib_id.cc:328
static void rna_def_view_layer_lightgroups(BlenderRNA *brna, PropertyRNA *cprop)
@ UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED
@ UVCALC_TRANSFORM_CORRECT
static void rna_def_scene_render_data(BlenderRNA *brna)
@ UI_PANEL_DATA_EXPAND_ROOT
const EnumPropertyItem rna_enum_mesh_select_mode_items[]
Definition rna_scene.cc:135
void ED_uvedit_sticky_selectmode_update(bContext *C)
static void rna_def_view_layer_eevee(BlenderRNA *brna)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_deprecated(PropertyRNA *prop, const char *note, const short version, const short removal_version)
const EnumPropertyItem rna_enum_shading_type_items[]
Definition rna_space.cc:484
void BKE_scene_objects_iterator_end(BLI_Iterator *iter)
bool BKE_scene_use_spherical_stereo(Scene *scene)
Definition scene.cc:3071
@ SCE_COMPOSITOR_DENOISE_FAST
@ SCE_COMPOSITOR_DENOISE_BALANCED
@ SCE_COMPOSITOR_DENOISE_HIGH
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
void BKE_ntree_update(Main &bmain, std::optional< Span< bNodeTree * > > modified_trees=std::nullopt, const NodeTreeUpdateExtraParams &params={})
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
static void rna_def_view_layers(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem * rna_enum_snap_element_individual_items
Definition rna_scene.cc:185
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
@ FFM_CRF_PERC_LOSSLESS
void RNA_def_property_boolean_bitset_array_sdna(PropertyRNA *prop, const char *structname, const char *propname, const int64_t booleanbit, const int length)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
const EnumPropertyItem rna_enum_transform_pivot_full_items[]
Definition rna_scene.cc:591
static const EnumPropertyItem snap_uv_element_items[]
Definition rna_scene.cc:197
const EnumPropertyItem rna_enum_bake_pass_filter_type_items[]
Definition rna_scene.cc:573
@ STRUCT_ID_REFCOUNT
void BKE_image_format_set(ImageFormatData *imf, ID *owner_id, const char imtype)
static const EnumPropertyItem rna_enum_scene_display_aa_methods[]
Definition rna_scene.cc:217
@ RAYTRACE_EEVEE_USE_DENOISE
@ RAYTRACE_EEVEE_USE_BACKFACE
const char * BKE_unit_identifier_get(const void *usys_pt, int index)
Definition unit.cc:2627
void BKE_image_format_media_type_set(ImageFormatData *format, ID *owner_id, const MediaType media_type)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
Definition editmesh.cc:79
void rna_def_freestyle_settings(BlenderRNA *brna)
@ SCE_COMPOSITOR_DENOISE_DEVICE_CPU
@ SCE_COMPOSITOR_DENOISE_DEVICE_GPU
@ SCE_COMPOSITOR_DENOISE_DEVICE_AUTO
@ GP_SCULPT_MASK_SELECTMODE_POINT
@ GP_SCULPT_MASK_SELECTMODE_STROKE
@ GP_SCULPT_MASK_SELECTMODE_SEGMENT
void FRS_free_view_map_cache(void)
int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode)
int rna_ViewLayer_active_aov_index_get(PointerRNA *ptr)
@ R_BAKE_ADJACENT_FACES
static void rna_def_gpencil_interpolate(BlenderRNA *brna)
@ R_BAKE_PASS_FILTER_TRANSM
@ R_BAKE_PASS_FILTER_INDIRECT
@ R_BAKE_PASS_FILTER_DIFFUSE
@ R_BAKE_PASS_FILTER_EMIT
@ R_BAKE_PASS_FILTER_NONE
@ R_BAKE_PASS_FILTER_COLOR
@ R_BAKE_PASS_FILTER_GLOSSY
@ R_BAKE_PASS_FILTER_DIRECT
const EnumPropertyItem rna_enum_snap_source_items[]
Definition rna_scene.cc:94
void BKE_image_format_color_management_copy_from_scene(ImageFormatData *imf, const Scene *scene)
void BKE_ntree_update_tag_id_changed(Main *bmain, ID *id)
static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_scene(BlenderRNA *brna)
@ SCE_XFORM_SKIP_CHILDREN
void rna_ViewLayer_active_lightgroup_index_set(PointerRNA *ptr, int value)
static void rna_def_render_views(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void ED_uvedit_selectmode_clean_multi(bContext *C)
void id_us_plus(ID *id)
Definition lib_id.cc:433
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
PointerRNA RNA_id_pointer_create(ID *id)
static void rna_def_scene_gpencil(BlenderRNA *brna)
bool MOV_codec_supports_alpha(IMB_Ffmpeg_Codec_ID codec_id, int ffmpeg_profile)
@ MEDIA_TYPE_MULTI_LAYER_IMAGE
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
static void rna_def_scene_image_format_data(BlenderRNA *brna)
void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, bool scene)
void rna_ViewLayer_active_lightgroup_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
@ SCE_SNAP_SOURCE_CLOSEST
void ED_uvedit_select_sync_multi(bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
KeyingSet * BKE_keyingset_add(ListBaseT< KeyingSet > *list, const char idname[], const char name[], eKS_Settings flag, eInsertKeyFlags keyingflag)
Definition anim_sys.cc:137
ViewLayer * BKE_view_layer_find_with_lightgroup(Scene *scene, ViewLayerLightgroup *lightgroup)
bool BKE_scene_has_view_layer(const Scene *scene, const ViewLayer *layer)
Definition scene.cc:2422
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
void RNA_def_struct_system_idprops_func(StructRNA *srna, const char *system_idproperties)
static void rna_def_selected_uv_element(BlenderRNA *brna)
ViewLayer * BKE_view_layer_find_with_aov(Scene *scene, ViewLayerAOV *aov)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
bool BKE_unit_is_suppressed(const void *usys_pt, int index)
Definition unit.cc:2645
const EnumPropertyItem rna_enum_image_color_depth_items[]
Definition rna_scene.cc:425
std::optional< std::string > rna_ColorManagedInputColorspaceSettings_path(const PointerRNA *ptr)
const EnumPropertyItem rna_enum_object_rotation_mode_items[]
float BKE_scene_frame_to_ctime(const Scene *scene, int frame)
Definition scene.cc:2586
@ S3D_DISPLAY_SIDEBYSIDE
@ S3D_DISPLAY_TOPBOTTOM
@ S3D_DISPLAY_INTERLACE
void rna_FreestyleSettings_module_remove(ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *module_ptr)
static const EnumPropertyItem rna_enum_media_type_all_items[]
Definition rna_scene.cc:276
static const EnumPropertyItem eevee_resolution_scale_items[]
Definition rna_scene.cc:709
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_AROUND_CENTER_MEDIAN
@ FUNC_USE_REPORTS
@ FUNC_USE_SELF_ID
Definition RNA_types.hh:980
@ FUNC_USE_MAIN
@ FUNC_NO_SELF
Definition RNA_types.hh:998
void rna_ViewLayer_active_aov_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
static const EnumPropertyItem plane_orientation_items[]
Definition rna_scene.cc:678
void rna_Scene_freestyle_update(Main *bmain, Scene *scene, PointerRNA *ptr)
void RNA_def_property_path_template_type(PropertyRNA *prop, PropertyPathTemplateType path_template_type)
static void rna_def_view_layer_aov(BlenderRNA *brna)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
@ FREESTYLE_RIDGES_AND_VALLEYS_FLAG
@ FREESTYLE_SUGGESTIVE_CONTOURS_FLAG
@ FREESTYLE_FACE_SMOOTHNESS_FLAG
@ FREESTYLE_MATERIAL_BOUNDARIES_FLAG
@ WT_VGROUP_BONE_DEFORM
@ WT_VGROUP_BONE_DEFORM_OFF
@ FFM_CHANNELS_SURROUND4
@ FFM_CHANNELS_SURROUND51
@ FFM_CHANNELS_SURROUND71
static void rna_def_freestyle_linesets(BlenderRNA *brna, PropertyRNA *cprop)
@ R_IMF_COLOR_MANAGEMENT_OVERRIDE
@ R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE
static void rna_def_view3d_cursor(BlenderRNA *brna)
@ SCE_LOOP_MODE_STOP_START_FRAME
@ SCE_LOOP_MODE_STOP_END_FRAME
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
MINLINE int max_ii(int a, int b)
void RE_FreePersistentData(const Scene *scene)
const EnumPropertyItem rna_enum_curve_fit_method_items[]
Definition rna_scene.cc:257
short BKE_freestyle_lineset_get_active_index(struct FreestyleConfig *config)
Definition freestyle.cc:224
void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
bool ED_scene_view_layer_delete(Main *bmain, Scene *scene, ViewLayer *layer, ReportList *reports) ATTR_NONNULL(1
int BKE_unit_base_of_type_get(int system, int type)
Definition unit.cc:2594
struct FreestyleLineSet * BKE_freestyle_lineset_add(struct Main *bmain, struct FreestyleConfig *config, const char *name)
Definition freestyle.cc:165
static void rna_def_freestyle_modules(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_unit_settings(BlenderRNA *brna)
Strip * rna_strip_find_by_colorspace_settings(Editing *ed, const ColorManagedColorspaceSettings *colorspace_settings)
std::optional< std::string > rna_ColorManagedDisplaySettings_path(const PointerRNA *ptr)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
const EnumPropertyItem rna_enum_bake_target_items[]
Definition rna_scene.cc:462
static void rna_def_transform_orientation(BlenderRNA *brna)
int rna_ViewLayer_active_lightgroup_index_get(PointerRNA *ptr)
void MEM_delete_void(void *vmemh)
void rna_ViewLayer_active_aov_index_set(PointerRNA *ptr, int value)
@ R_BAKE_VIEW_FROM_ABOVE_SURFACE
@ R_BAKE_VIEW_FROM_ACTIVE_CAMERA
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_animate_sdna(bool animate)
@ PROP_VARIABLES_RENDER_OUTPUT
Definition RNA_types.hh:572
ViewLayer * CTX_data_view_layer(const bContext *C)
void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value, ReportList *reports)
const float rna_default_axis_angle[4]
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
@ SCE_COMPOSITOR_CACHE_FRAMES
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:588
@ PROPOVERRIDE_NO_COMPARISON
Definition RNA_types.hh:596
void RNA_def_property_float_default(PropertyRNA *prop, float value)
@ R_IMF_FLAG_PREVIEW_JPG
void rna_def_animdata_common(StructRNA *srna)
static const EnumPropertyItem curve_type_items[]
Definition rna_curve.cc:124
void RE_engine_free(RenderEngine *engine)
void BKE_view_layer_rename_lightgroup(Scene *scene, ViewLayer *view_layer, ViewLayerLightgroup *lightgroup, const char *name)
const EnumPropertyItem rna_enum_snap_playhead_element_items[]
Definition rna_scene.cc:208
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
@ SCE_EEVEE_FAST_GI_ENABLED
@ SCE_EEVEE_TAA_REPROJECTION
@ SCE_EEVEE_VOLUMETRIC_SHADOWS
@ SCE_EEVEE_SHADOW_JITTERED_VIEWPORT
@ SCE_EEVEE_VOLUME_CUSTOM_RANGE
@ SCE_EEVEE_SHADOW_ENABLED
@ SCE_PASS_SUBSURFACE_INDIRECT
@ SCE_PASS_GLOSSY_COLOR
@ SCE_PASS_TRANSM_COLOR
@ SCE_PASS_GLOSSY_DIRECT
@ SCE_PASS_GLOSSY_INDIRECT
@ SCE_PASS_TRANSM_INDIRECT
@ SCE_PASS_DIFFUSE_COLOR
@ SCE_PASS_TRANSM_DIRECT
@ SCE_PASS_DIFFUSE_INDIRECT
@ SCE_PASS_DIFFUSE_DIRECT
@ SCE_PASS_SUBSURFACE_COLOR
@ SCE_PASS_SUBSURFACE_DIRECT
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:541
void BLI_uniquename(const ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
int BKE_render_num_threads(const RenderData *r)
Definition scene.cc:3141
PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:593
PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr)
@ GP_TOOL_FLAG_CREATE_WEIGHTS
@ GP_TOOL_FLAG_PAINT_ONBACK
@ GP_TOOL_FLAG_RETAIN_LAST
@ GP_TOOL_FLAG_AUTOMERGE_STROKE
@ GP_TOOL_FLAG_THUMBNAIL_LIST
@ GP_USE_MULTI_FRAME_EDITING
@ CURVE_PAINT_PROJECT_SURFACE
@ CURVE_PAINT_PROJECT_CURSOR
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
const EnumPropertyItem rna_enum_exr_codec_items[]
Definition rna_scene.cc:46
@ GP_VERTEX_MASK_SELECTMODE_STROKE
@ GP_VERTEX_MASK_SELECTMODE_POINT
@ GP_VERTEX_MASK_SELECTMODE_SEGMENT
Scene * WM_window_get_active_scene(const wmWindow *win)
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *keyingset)
@ R_TEXTURE_CACHE_AUTO_GENERATE
@ SCE_LAY_GREASE_PENCIL
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW
@ CURVE_PAINT_SURFACE_PLANE_VIEW
const EnumPropertyItem rna_enum_image_type_all_items[]
Definition rna_scene.cc:398
@ PROP_BOOLEAN
Definition RNA_types.hh:210
@ PROP_POINTER
Definition RNA_types.hh:215
@ PROP_STRING
Definition RNA_types.hh:213
@ PROP_COLLECTION
Definition RNA_types.hh:216
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
@ FFM_PRESET_REALTIME
void ED_render_engine_changed(Main *bmain, bool update_scene_data)
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
FreestyleModuleConfig * rna_FreestyleSettings_module_add(ID *id, FreestyleSettings *config)
bool BKE_image_is_stereo(const Image *ima)
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)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
@ SCE_COMPOSITOR_DEVICE_CPU
@ SCE_COMPOSITOR_DEVICE_GPU
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
void rna_FreestyleSettings_lineset_remove(ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *lineset_ptr)
BMesh const char void * data
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
const EnumPropertyItem rna_enum_bake_margin_type_items[]
Definition rna_scene.cc:452
void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value)
Mesh * BKE_mesh_from_object(Object *ob)
void RNA_api_scene_render(StructRNA *srna)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ FIX_TO_CAM_FLAG_USE_SCALE
struct FreestyleLineSet * BKE_freestyle_lineset_get_active(struct FreestyleConfig *config)
Definition freestyle.cc:214
bool BKE_freestyle_module_delete(struct FreestyleConfig *config, struct FreestyleModuleConfig *module_conf)
Definition freestyle.cc:133
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
const EnumPropertyItem rna_enum_object_axis_items[]
bool BLI_listbase_move_index(ListBase *listbase, int from, int to) ATTR_NONNULL()
Definition listbase.cc:474
void BKE_view_layer_verify_aov(RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
char char size_t BLI_str_escape(char *__restrict dst, StringRef src, size_t dst_maxncpy) ATTR_NONNULL(1)
FreestyleLineSet * rna_FreestyleSettings_lineset_add(ID *id, FreestyleSettings *config, Main *bmain, const char *name)
@ R_IMF_JP2_FLAG_CINE_PRESET
@ R_IMF_JP2_FLAG_CINE_48
bool BKE_freestyle_lineset_delete(struct FreestyleConfig *config, struct FreestyleLineSet *lineset)
Definition freestyle.cc:197
@ FFMPEG_OGG
Definition MOV_enums.hh:24
@ FFMPEG_MPEG4
Definition MOV_enums.hh:16
@ FFMPEG_MKV
Definition MOV_enums.hh:23
@ FFMPEG_WEBM
Definition MOV_enums.hh:26
@ FFMPEG_MPEG2
Definition MOV_enums.hh:15
@ FFMPEG_MPEG1
Definition MOV_enums.hh:14
@ FFMPEG_FLV
Definition MOV_enums.hh:22
@ FFMPEG_DV
Definition MOV_enums.hh:19
@ FFMPEG_AVI
Definition MOV_enums.hh:17
@ FFMPEG_MOV
Definition MOV_enums.hh:18
int rna_FreestyleSettings_active_lineset_index_get(PointerRNA *ptr)
unsigned char uint8_t
Definition BKE_text.h:79
void BKE_view_layer_rename(Main *bmain, Scene *scene, ViewLayer *view_layer, const char *newname)
@ SCE_SNAP_INDIVIDUAL_NEAREST
@ SCE_SNAP_INDIVIDUAL_PROJECT
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
@ SIMPLIFY_GPENCIL_MODIFIER
@ SIMPLIFY_GPENCIL_ON_PLAY
@ SIMPLIFY_GPENCIL_ENABLE
static void rna_def_tool_settings(BlenderRNA *brna)
const EnumPropertyItem rna_enum_stereo3d_display_items[]
Definition rna_scene.cc:527
const EnumPropertyItem rna_enum_beztriple_keyframe_type_items[]
Definition rna_fcurve.cc:84
@ S3D_INTERLACE_CHECKERBOARD
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void rna_Scene_render_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@ S3D_SIDEBYSIDE_CROSSEYED
const EnumPropertyItem rna_enum_views_format_items[]
Definition rna_scene.cc:511
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
const EnumPropertyItem rna_enum_transform_orientation_items[]
Definition rna_scene.cc:617
static void rna_def_scene_render_view(BlenderRNA *brna)
static void rna_def_statvis(BlenderRNA *brna)
static void rna_def_scene_hydra(BlenderRNA *brna)
const EnumPropertyItem rna_enum_proportional_falloff_curve_only_items[]
Definition rna_scene.cc:119
@ CURVE_PAINT_FIT_METHOD_REFIT
@ CURVE_PAINT_FIT_METHOD_SPLIT
static void rna_def_image_format_stereo3d_format(BlenderRNA *brna)
@ RAYTRACE_EEVEE_METHOD_SCREEN
@ RAYTRACE_EEVEE_METHOD_PROBE
static void rna_def_bake_data(BlenderRNA *brna)
static void rna_def_view_layer_lightgroup(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_snap_element_base_items[]
Definition rna_scene.cc:178
void RNA_def_struct_clear_flag(StructRNA *srna, StructFlag flag)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:34
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
const EnumPropertyItem rna_enum_strip_scale_method_items[]
void BKE_free_time_marker(TimeMarker &marker, bool do_id_user)
Definition anim_sys.cc:3974
void BKE_unit_system_get(int system, int type, const void **r_usys_pt, int *r_len)
Definition unit.cc:2576
ListBaseT< RenderEngineType > R_engines
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
const EnumPropertyItem * rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
static void rna_def_scene_eevee(BlenderRNA *brna)
@ R_SEQ_OVERRIDE_SCENE_SETTINGS
static void rna_def_transform_orientation_slot(BlenderRNA *brna)
const EnumPropertyItem rna_enum_normal_swizzle_items[]
Definition rna_scene.cc:442
@ R_IMF_EXR_CODEC_PXR24
@ R_IMF_EXR_CODEC_HTJ2K
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_compositor_effect_nodes_properties(BlenderRNA *brna)
RenderEngineType * RE_engines_find(const char *idname)
bool MOV_codec_supports_crf(IMB_Ffmpeg_Codec_ID codec_id)
TransformOrientation * BKE_scene_transform_orientation_find(const Scene *scene, int index)
Definition scene.cc:3753
@ SEQ_RIPPLE_CLEAR_RANGES
@ SEQ_RIPPLE_ALL_CHANNELS
@ SCER_LOCK_FRAME_SELECTION
@ SCER_WRAP_TIMELINE_NAVIGATION
@ SEQ_SNAP_CURRENT_FRAME_TO_STRIPS
@ SEQ_SNAP_TO_ALL_CHANNEL_STRIPS
@ R_LINE_THICKNESS_RELATIVE
@ R_LINE_THICKNESS_ABSOLUTE
void BKE_scene_objects_iterator_next(BLI_Iterator *iter)
static void rna_def_compositor_effects(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
ListBaseT< KeyingSet > builtin_keyingsets
@ SCE_WORKSPACE_TOOL_DEFAULT
@ SCE_WORKSPACE_TOOL_FALLBACK
bool BKE_imtype_requires_linear_float(char imtype)
static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_sequencer_tool_settings(BlenderRNA *brna)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
Definition editmesh.cc:59
bool BKE_imtype_is_movie(char imtype)
void rna_FreestyleSettings_active_lineset_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, eRotationModes oldMode, eRotationModes newMode)
@ V3D_PLACE_DEPTH_SURFACE
@ V3D_PLACE_DEPTH_CURSOR_VIEW
@ V3D_PLACE_DEPTH_CURSOR_PLANE
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void WM_windows_scene_data_sync(const ListBaseT< wmWindow > *win_lb, Scene *scene)
static void rna_def_display_safe_areas(BlenderRNA *brna)
SceneRenderView * BKE_scene_add_render_view(Scene *sce, const char *name)
Definition scene.cc:2965
@ R_BAKE_VECTOR_DISPLACEMENT
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void rna_FreestyleSettings_active_lineset_index_set(PointerRNA *ptr, int value)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
static void rna_def_curve_paint_settings(BlenderRNA *brna)
const EnumPropertyItem rna_enum_grease_pencil_selectmode_items[]
Definition rna_scene.cc:698
eImageFormatDepth BKE_imtype_first_valid_depth(eImageFormatDepth valid_depths)
RenderEngine * RE_engine_create(RenderEngineType *type)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
const EnumPropertyItem rna_enum_stereo3d_interlace_type_items[]
Definition rna_scene.cc:566
static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
Main * CTX_data_main(const bContext *C)
@ R_IMF_CINEON_FLAG_LOG
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
void BKE_scene_orientation_slot_set_index(TransformOrientationSlot *orient_slot, int orientation)
Definition scene.cc:2664
const EnumPropertyItem rna_enum_snap_animation_element_items[]
Definition rna_scene.cc:189
const EnumPropertyItem rna_enum_bake_save_mode_items[]
Definition rna_scene.cc:476
@ EEVEE_RENDER_PASS_VOLUME_LIGHT
@ EEVEE_RENDER_PASS_TRANSPARENT
int BLI_system_num_threads_override_get()
Definition threads.cc:299
static void rna_def_scene_display(BlenderRNA *brna)
const EnumPropertyItem rna_enum_snap_element_items[]
Definition rna_scene.cc:163
void BKE_free_time_markers(ListBaseT< TimeMarker > &markers, bool do_id_user)
Definition anim_sys.cc:3982
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
const EnumPropertyItem rna_enum_stereo3d_anaglyph_type_items[]
Definition rna_scene.cc:559
@ FFMPEG_AUTOSPLIT_OUTPUT
@ FFMPEG_LOSSLESS_OUTPUT
@ FFMPEG_USE_MAX_B_FRAMES
@ S3D_ANAGLYPH_YELLOWBLUE
@ S3D_ANAGLYPH_GREENMAGENTA
@ ID_RECALC_AUDIO_LISTENER
Definition DNA_ID.h:1130
@ ID_RECALC_AUDIO_FPS
Definition DNA_ID.h:1127
@ ID_RECALC_PSYS_CHILD
Definition DNA_ID.h:1085
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1118
@ ID_RECALC_FRAME_CHANGE
Definition DNA_ID.h:1125
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1122
@ ID_RECALC_COMPOSITOR
Definition DNA_ID.h:1161
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1104
@ ID_RECALC_AUDIO_VOLUME
Definition DNA_ID.h:1128
ID_Type GS(const char *name)
Definition DNA_ID.h:410
@ PROP_DEG_SYNC_ONLY
Definition RNA_types.hh:515
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:477
@ PROP_EDITABLE
Definition RNA_types.hh:376
@ PROP_ENUM_FLAG
Definition RNA_types.hh:474
@ PROP_PROPORTIONAL
Definition RNA_types.hh:419
@ PROP_PATH_OUTPUT
Definition RNA_types.hh:521
@ PROP_PATH_SUPPORTS_TEMPLATES
Definition RNA_types.hh:540
@ PROP_FORCE_UNDO
Definition RNA_types.hh:552
@ PROP_THICK_WRAP
Definition RNA_types.hh:493
@ PROP_IDPROPERTY
Definition RNA_types.hh:496
@ PROP_SKIP_SAVE
Definition RNA_types.hh:414
@ PROP_PTR_NO_OWNERSHIP
Definition RNA_types.hh:465
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:526
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:454
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:434
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:440
@ PROP_NEVER_NULL
Definition RNA_types.hh:447
@ PROP_ANIMATABLE
Definition RNA_types.hh:389
@ PROP_NO_DEG_UPDATE
Definition RNA_types.hh:509
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ SEQ_SNAP_TO_PREVIEW_BORDERS
@ SEQ_SNAP_TO_PREVIEW_CENTER
@ SEQ_SNAP_TO_STRIPS_PREVIEW
@ SEQ_SNAP_TO_CURRENT_FRAME
@ SEQ_SNAP_TO_FRAME_RANGE
@ VIEW_LAYER_CRYPTOMATTE_ASSET
@ VIEW_LAYER_CRYPTOMATTE_ACCURATE
@ VIEW_LAYER_CRYPTOMATTE_MATERIAL
@ VIEW_LAYER_CRYPTOMATTE_OBJECT
@ SCE_SNAP_TRANSFORM_MODE_TRANSLATE
@ SCE_SNAP_TRANSFORM_MODE_SCALE
@ SCE_SNAP_TRANSFORM_MODE_ROTATE
struct FreestyleModuleConfig * BKE_freestyle_module_add(struct FreestyleConfig *config)
Definition freestyle.cc:118
bool BKE_scene_remove_render_view(Scene *scene, SceneRenderView *srv)
Definition scene.cc:2984
void BKE_freestyle_lineset_set_active_index(struct FreestyleConfig *config, short index)
Definition freestyle.cc:237
static void rna_def_view_layer_aovs(BlenderRNA *brna, PropertyRNA *cprop)
Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
void BKE_main_id_tag_listbase(ListBaseT< ID > *lb, int tag, bool value)
Definition lib_id.cc:1291
@ R_IMF_EXR_FLAG_MULTIPART
const EnumPropertyItem rna_enum_mesh_select_mode_uv_items[]
Definition rna_scene.cc:142
@ FFMPEG_CODEC_ID_PCM_S16LE
@ FFMPEG_CODEC_ID_MPEG1VIDEO
@ FFMPEG_CODEC_ID_PRORES
@ FFMPEG_CODEC_ID_MPEG4
@ FFMPEG_CODEC_ID_DNXHD
@ FFMPEG_CODEC_ID_THEORA
@ FFMPEG_CODEC_ID_QTRLE
@ FFMPEG_CODEC_ID_DVVIDEO
@ FFMPEG_CODEC_ID_HUFFYUV
@ FFMPEG_CODEC_ID_MPEG2VIDEO
@ FFMPEG_CODEC_ID_VORBIS
@ FREESTYLE_FE_EXTERNAL_CONTOUR
@ FREESTYLE_FE_SUGGESTIVE_CONTOUR
@ FREESTYLE_FE_MATERIAL_BOUNDARY
void RNA_api_scene(StructRNA *srna)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
static const EnumPropertyItem plane_depth_items[]
Definition rna_scene.cc:658
ID * BKE_id_owner_get(ID *id, const bool debug_relationship_assert=true)
Definition lib_id.cc:2770
void DEG_relations_tag_update(Main *bmain)
static void rna_def_compositor_effect(BlenderRNA *brna)
ViewLayer * BKE_view_layer_add(const Main *bmain, Scene *scene, const char *name, ViewLayer *view_layer_source, int type)
bool BLI_remlink_safe(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:161
const EnumPropertyItem rna_enum_strip_overlap_mode_items[]
int BKE_scene_orientation_slot_get_index(const TransformOrientationSlot *orient_slot)
Definition scene.cc:2671
Scene * CTX_data_scene(const bContext *C)
@ SCE_VIEWS_FORMAT_MULTIVIEW
@ SCE_VIEWS_FORMAT_STEREO_3D
@ EEVEE_DENOISING_PASS_STORE
@ EEVEE_DENOISING_PASS_USE_ALBEDO_ROUGHNESS_WEIGHTING
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
@ GP_PROJECT_DEPTH_STROKE_ENDPOINTS
@ GP_PROJECT_DEPTH_STROKE
@ GP_PROJECT_DEPTH_STROKE_FIRST
@ GP_PROJECT_DEPTH_ONLY_SELECTED
@ SCE_SNAP_BACKFACE_CULLING
@ SCE_SNAP_TO_INCLUDE_EDITED
@ SCE_SNAP_KEEP_ON_SAME_OBJECT
@ SCE_SNAP_TO_INCLUDE_NONEDITED
@ SCE_SNAP_TO_ONLY_SELECTABLE
@ AUTOKEY_FLAG_ONLYKEYINGSET
@ AUTOKEY_FLAG_LAYERED_RECORD
@ SCE_DISPLAY_AA_SAMPLES_8
@ SCE_DISPLAY_AA_SAMPLES_32
@ SCE_DISPLAY_AA_SAMPLES_5
@ SCE_DISPLAY_AA_SAMPLES_16
@ SCE_DISPLAY_AA_SAMPLES_11
const EnumPropertyItem rna_enum_views_format_multiview_items[]
Definition rna_scene.cc:519
void copy_m4_m4(float m1[4][4], const float m2[4][4])
@ SCE_COMPOSITOR_PRECISION_AUTO
@ SCE_COMPOSITOR_PRECISION_FULL
@ CURVE_PAINT_FLAG_DEPTH_ONLY_SELECTED
@ CURVE_PAINT_FLAG_CORNERS_DETECT
@ CURVE_PAINT_FLAG_PRESSURE_RADIUS
@ CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS
@ CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS
static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
@ SCE_HAIR_SHAPE_STRAND
@ SCE_HAIR_SHAPE_CYLINDER
char BKE_imtype_valid_channels(char imtype)
const EnumPropertyItem rna_enum_views_format_multilayer_items[]
Definition rna_scene.cc:515
const char * BKE_unit_display_name_get(const void *usys_pt, int index)
Definition unit.cc:2615
void normalize_m4_m4(float rmat[4][4], const float mat[4][4]) ATTR_NONNULL()
@ PROP_ACCELERATION
Definition RNA_types.hh:321
@ PROP_PERCENTAGE
Definition RNA_types.hh:307
@ PROP_TIME_ABSOLUTE
Definition RNA_types.hh:311
@ PROP_XYZ_LENGTH
Definition RNA_types.hh:327
@ PROP_FACTOR
Definition RNA_types.hh:308
@ PROP_MATRIX
Definition RNA_types.hh:322
@ PROP_DISTANCE
Definition RNA_types.hh:313
@ PROP_FILEPATH
Definition RNA_types.hh:284
@ PROP_QUATERNION
Definition RNA_types.hh:324
@ PROP_AXISANGLE
Definition RNA_types.hh:325
@ PROP_DIRECTION
Definition RNA_types.hh:319
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:329
@ PROP_UNSIGNED
Definition RNA_types.hh:306
@ PARM_REQUIRED
Definition RNA_types.hh:631
@ PARM_RNAPTR
Definition RNA_types.hh:633
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void rna_ViewLayer_override_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
@ R_BAKE_TARGET_VERTEX_COLORS
@ R_BAKE_TARGET_IMAGE_TEXTURES
static const EnumPropertyItem snap_to_items[]
Definition rna_scene.cc:692
static const EnumPropertyItem rna_enum_view_layer_aov_type_items[]
Definition rna_scene.cc:585
@ FFM_PRORES_PROFILE_422_HQ
@ FFM_PRORES_PROFILE_4444_XQ
@ FFM_PRORES_PROFILE_4444
@ FFM_PRORES_PROFILE_422_PROXY
@ FFM_PRORES_PROFILE_422_LT
@ FFM_PRORES_PROFILE_422_STD
@ OB_DRAW_GROUPUSER_ACTIVE
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
static void rna_def_raytrace_eevee(BlenderRNA *brna)
size_t rna_ViewLayer_path_buffer_get(const ViewLayer *view_layer, char *r_rna_path, const size_t r_rna_path_maxncpy)
bool BKE_id_is_in_global_main(ID *id)
Definition lib_id.cc:2759
int BKE_image_path_ext_from_imformat(const ImageFormatData *im_format, const char *r_ext[BKE_IMAGE_PATH_EXT_MAX])
@ V3D_PLACE_ORIENT_DEFAULT
@ V3D_PLACE_ORIENT_SURFACE
Object * CTX_data_active_object(const bContext *C)
void id_us_min(ID *id)
Definition lib_id.cc:441
eImageFormatDepth BKE_imtype_valid_depths_with_video(char imtype, const ID *owner_id)
@ UV_FLAG_SHOW_SAME_IMAGE
void RNA_def_property_array(PropertyRNA *prop, int length)
const int rna_matrix_dimsize_4x4[]
@ RAYTRACE_EEVEE_DENOISE_SPATIAL
@ RAYTRACE_EEVEE_DENOISE_BILATERAL
@ RAYTRACE_EEVEE_DENOISE_TEMPORAL
std::optional< std::string > rna_ColorManagedViewSettings_path(const PointerRNA *ptr)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
void EDBM_selectmode_set(BMEditMesh *em, BMesh *bm, short selectmode)
const EnumPropertyItem rna_enum_proportional_falloff_items[]
Definition rna_scene.cc:102
View3D * CTX_wm_view3d(const bContext *C)
@ R_IMF_TIFF_CODEC_DEFLATE
@ R_IMF_TIFF_CODEC_PACKBITS
@ R_IMF_TIFF_CODEC_NONE
const EnumPropertyItem rna_enum_axis_xyz_items[]
void rna_Scene_use_view_map_cache_update(Main *bmain, Scene *scene, PointerRNA *ptr)
const int rna_matrix_dimsize_3x3[]
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
static const EnumPropertyItem rna_enum_bake_view_from_items[]
Definition rna_scene.cc:486
@ FREESTYLE_CONTROL_EDITOR_MODE
@ FREESTYLE_CONTROL_SCRIPT_MODE
std::string format(const std::string &fmt, Args &&...args)
Definition diagnostic.hh:43
static struct PyModuleDef module
Definition python.cpp:944
#define IMAGE_TYPE_ITEMS_IMAGE
Definition rna_scene.cc:363
#define MEDIA_TYPE_ENUM_VIDEO
Definition rna_scene.cc:274
#define IMAGE_TYPE_ITEMS_VIDEO
Definition rna_scene.cc:376
#define MEDIA_TYPE_ENUM_MULTI_LAYER_IMAGE
Definition rna_scene.cc:272
#define IMAGE_TYPE_ITEMS_MULTI_LAYER_IMAGE
Definition rna_scene.cc:374
#define R_IMF_VIEWS_ENUM_MV
Definition rna_scene.cc:508
#define MEDIA_TYPE_ENUM_IMAGE
Definition rna_scene.cc:271
#define R_IMF_VIEWS_ENUM_IND
Definition rna_scene.cc:500
#define R_IMF_VIEWS_ENUM_S3D
Definition rna_scene.cc:506
#define RNA_SNAP_ELEMENTS_BASE
Definition rna_scene.cc:150
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
#define min(a, b)
Definition sort.cc:38
const NodeType * type
Definition graph/node.h:179
const c_style_mat & ptr() const
eGP_Sculpt_SelectMaskFlag gpencil_selectmode_sculpt
eGP_Vertex_SelectMaskFlag gpencil_selectmode_vertex
eNodeTree_Type type
#define N_(msgid)