Blender V5.0
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
21#include "BLI_math_rotation.h"
23
24#include "BLT_translation.hh"
25
26#include "BKE_paint.hh"
27
28#include "ED_object.hh"
29
30#include "RNA_define.hh"
31#include "RNA_enum_types.hh"
32
33#include "rna_internal.hh"
34
35/* Include for Bake Options */
36#include "RE_pipeline.h"
37
38#include "WM_api.hh"
39#include "WM_types.hh"
40
41#include "BLI_threads.h"
42
43#ifdef WITH_IMAGE_OPENEXR
44const EnumPropertyItem rna_enum_exr_codec_items[] = {
45 {R_IMF_EXR_CODEC_NONE, "NONE", 0, "None", "No compression"},
46 {R_IMF_EXR_CODEC_ZIP, "ZIP", 0, "ZIP", "Lossless zip compression of 16 row image blocks"},
48 "PIZ",
49 0,
50 "PIZ",
51 "Lossless wavelet compression, effective for noisy/grainy images"},
53 "DWAA",
54 0,
55 "DWAA (lossy)",
56 "JPEG-like lossy compression on 32 row image blocks"},
58 "DWAB",
59 0,
60 "DWAB (lossy)",
61 "JPEG-like lossy compression on 256 row image blocks"},
63 "ZIPS",
64 0,
65 "ZIPS",
66 "Lossless zip compression, each image row compressed separately"},
67 {R_IMF_EXR_CODEC_RLE, "RLE", 0, "RLE", "Lossless run length encoding compression"},
69 "PXR24",
70 0,
71 "Pxr24 (lossy)",
72 "Lossy compression for 32 bit float images (stores 24 bits of each float)"},
74 "B44",
75 0,
76 "B44 (lossy)",
77 "Lossy compression for 16 bit float images, at fixed 2.3:1 ratio"},
79 "B44A",
80 0,
81 "B44A (lossy)",
82 "Lossy compression for 16 bit float images, at fixed 2.3:1 ratio"},
83 {0, nullptr, 0, nullptr, nullptr},
84};
85#endif
86
88 {SCE_SNAP_SOURCE_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
89 {SCE_SNAP_SOURCE_CENTER, "CENTER", 0, "Center", "Snap transformation center onto target"},
90 {SCE_SNAP_SOURCE_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
91 {SCE_SNAP_SOURCE_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
92 {0, nullptr, 0, nullptr, nullptr},
93};
94
96 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
97 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
98 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
100 "INVERSE_SQUARE",
101 ICON_INVERSESQUARECURVE,
102 "Inverse Square",
103 "Inverse Square falloff"},
104 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
105 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
106 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Constant falloff"},
107 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", "Random falloff"},
108 {0, nullptr, 0, nullptr, nullptr},
109};
110
111/* subset of the enum - only curves, missing random and const */
113 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
114 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
115 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
116 {PROP_INVSQUARE, "INVERSE_SQUARE", ICON_ROOTCURVE, "Inverse Square", "Inverse Square falloff"},
117 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
118 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
119 {0, nullptr, 0, nullptr, nullptr},
120};
121
122/* Keep for operators, not used here. */
123
125 {SCE_SELECT_VERTEX, "VERT", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
126 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
127 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
128 {0, nullptr, 0, nullptr, nullptr},
129};
130
132 {UV_SELECT_VERT, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
133 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
134 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
135 {0, nullptr, 0, nullptr, nullptr},
136};
137
138/* clang-format off */
139#define RNA_SNAP_ELEMENTS_BASE \
140 {SCE_SNAP_TO_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments"}, \
141 {SCE_SNAP_TO_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"}, \
142 {SCE_SNAP_TO_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"}, \
143 {SCE_SNAP_TO_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"}, \
144 {SCE_SNAP_TO_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap by projecting onto faces"}, \
145 {SCE_SNAP_TO_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"}, \
146 {SCE_SNAP_TO_EDGE_MIDPOINT, "EDGE_MIDPOINT", ICON_SNAP_MIDPOINT, "Edge Center", "Snap to the middle of edges"}, \
147 {SCE_SNAP_TO_EDGE_PERPENDICULAR, "EDGE_PERPENDICULAR", ICON_SNAP_PERPENDICULAR, "Edge Perpendicular", "Snap to the nearest point on an edge"}
148/* clang-format on */
149
153 "FACE_PROJECT",
154 ICON_SNAP_FACE,
155 "Face Project",
156 "Snap by projecting onto faces"},
158 "FACE_NEAREST",
159 ICON_SNAP_FACE_NEAREST,
160 "Face Nearest",
161 "Snap to nearest point on faces"},
162 {0, nullptr, 0, nullptr, nullptr},
163};
164
167 {0, nullptr, 0, nullptr, nullptr},
168};
169
170#ifndef RNA_RUNTIME
171/* Last two snap elements from #rna_enum_snap_element_items. */
174#endif
175
177 {SCE_SNAP_TO_FRAME, "FRAME", 0, "Frame", "Snap to frame"},
178 {SCE_SNAP_TO_SECOND, "SECOND", 0, "Second", "Snap to seconds"},
179 {SCE_SNAP_TO_MARKERS, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
180 {0, nullptr, 0, nullptr, nullptr},
181};
182
183#ifndef RNA_RUNTIME
186 "INCREMENT",
187 ICON_SNAP_INCREMENT,
188 "Increment",
189 "Snap to increments of grid"},
190 {SCE_SNAP_TO_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"},
191 {SCE_SNAP_TO_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
192 {0, nullptr, 0, nullptr, nullptr},
193};
194
196 {SCE_SNAP_TO_FRAME, "FRAME", 0, "Frames", "Snap to frame increments"},
197 {SCE_SNAP_TO_SECOND, "SECOND", 0, "Seconds", "Snap to second increments"},
198 {SCE_SNAP_TO_MARKERS, "MARKER", 0, "Markers", "Snap to markers"},
199 {SCE_SNAP_TO_KEYS, "KEY", 0, "Keyframes", "Snap to keyframes"},
200 {SCE_SNAP_TO_STRIPS, "Strip", 0, "Strips", "Snap to Strips"},
201 {0, nullptr, 0, nullptr, nullptr},
202};
203
206 "OFF",
207 0,
208 "No Anti-Aliasing",
209 "Scene will be rendering without any anti-aliasing"},
211 "FXAA",
212 0,
213 "Single Pass Anti-Aliasing",
214 "Scene will be rendered using a single pass anti-aliasing method (FXAA)"},
216 "5",
217 0,
218 "5 Samples",
219 "Scene will be rendered using 5 anti-aliasing samples"},
221 "8",
222 0,
223 "8 Samples",
224 "Scene will be rendered using 8 anti-aliasing samples"},
226 "11",
227 0,
228 "11 Samples",
229 "Scene will be rendered using 11 anti-aliasing samples"},
231 "16",
232 0,
233 "16 Samples",
234 "Scene will be rendered using 16 anti-aliasing samples"},
236 "32",
237 0,
238 "32 Samples",
239 "Scene will be rendered using 32 anti-aliasing samples"},
240 {0, nullptr, 0, nullptr, nullptr},
241};
242#endif
243
246 "REFIT",
247 0,
248 "Refit",
249 "Incrementally refit the curve (high quality)"},
251 "SPLIT",
252 0,
253 "Split",
254 "Split the curve until the tolerance is met (fast)"},
255 {0, nullptr, 0, nullptr, nullptr},
256};
257
258#define MEDIA_TYPE_ENUM_IMAGE {MEDIA_TYPE_IMAGE, "IMAGE", ICON_NONE, "Image", ""}
259#define MEDIA_TYPE_ENUM_MULTI_LAYER_IMAGE \
260 {MEDIA_TYPE_MULTI_LAYER_IMAGE, "MULTI_LAYER_IMAGE", ICON_NONE, "Multi-Layer EXR", ""}
261#define MEDIA_TYPE_ENUM_VIDEO {MEDIA_TYPE_VIDEO, "VIDEO", ICON_NONE, "Video", ""}
262
267 {0, nullptr, 0, nullptr, nullptr},
268};
269
270#ifdef RNA_RUNTIME
271static const EnumPropertyItem rna_enum_media_type_image_items[] = {
274 {0, nullptr, 0, nullptr, nullptr},
275};
276#endif
277
278/* workaround for duplicate enums,
279 * have each enum line as a define then conditionally set it or not
280 */
281
282#define R_IMF_ENUM_BMP \
283 {R_IMF_IMTYPE_BMP, "BMP", 0, "Bitmap (.bmp)", "Output image in bitmap format"},
284#define R_IMF_ENUM_IRIS \
285 {R_IMF_IMTYPE_IRIS, "IRIS", 0, "Iris (.rgb)", "Output image in SGI IRIS format"},
286#define R_IMF_ENUM_PNG {R_IMF_IMTYPE_PNG, "PNG", 0, "PNG (.png)", "Output image in PNG format"},
287#define R_IMF_ENUM_JPEG \
288 {R_IMF_IMTYPE_JPEG90, "JPEG", 0, "JPEG (.jpg)", "Output image in JPEG format"},
289#define R_IMF_ENUM_TAGA \
290 {R_IMF_IMTYPE_TARGA, "TARGA", 0, "Targa (.tga)", "Output image in Targa format"},
291#define R_IMF_ENUM_TAGA_RAW \
292 {R_IMF_IMTYPE_RAWTGA, \
293 "TARGA_RAW", \
294 0, \
295 "Targa Raw (.tga)", \
296 "Output image in uncompressed Targa format"},
297
298#if 0 /* UNUSED (so far) */
299# define R_IMF_ENUM_DDS \
300 {R_IMF_IMTYPE_DDS, "DDS", 0, "DirectDraw Surface (.dds)", "Output image in DDS format"},
301#endif
302
303#ifdef WITH_IMAGE_OPENJPEG
304# define R_IMF_ENUM_JPEG2K \
305 {R_IMF_IMTYPE_JP2, "JPEG2000", 0, "JPEG 2000 (.jp2)", "Output image in JPEG 2000 format"},
306#else
307# define R_IMF_ENUM_JPEG2K
308#endif
309
310#ifdef WITH_IMAGE_CINEON
311# define R_IMF_ENUM_CINEON \
312 {R_IMF_IMTYPE_CINEON, "CINEON", 0, "Cineon (.cin)", "Output image in Cineon format"},
313# define R_IMF_ENUM_DPX {R_IMF_IMTYPE_DPX, "DPX", 0, "DPX (.dpx)", "Output image in DPX format"},
314#else
315# define R_IMF_ENUM_CINEON
316# define R_IMF_ENUM_DPX
317#endif
318
319#ifdef WITH_IMAGE_OPENEXR
320# define R_IMF_ENUM_EXR_MULTILAYER \
321 {R_IMF_IMTYPE_MULTILAYER, \
322 "OPEN_EXR_MULTILAYER", \
323 0, \
324 "OpenEXR MultiLayer (.exr)", \
325 "Output image in multilayer OpenEXR format"},
326# define R_IMF_ENUM_EXR \
327 {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", 0, "OpenEXR (.exr)", "Output image in OpenEXR format"},
328#else
329# define R_IMF_ENUM_EXR_MULTILAYER
330# define R_IMF_ENUM_EXR
331#endif
332
333#define R_IMF_ENUM_HDR \
334 {R_IMF_IMTYPE_RADHDR, "HDR", 0, "Radiance HDR (.hdr)", "Output image in Radiance HDR format"},
335
336#define R_IMF_ENUM_TIFF \
337 {R_IMF_IMTYPE_TIFF, "TIFF", 0, "TIFF (.tif)", "Output image in TIFF format"},
338
339#ifdef WITH_IMAGE_WEBP
340# define R_IMF_ENUM_WEBP \
341 {R_IMF_IMTYPE_WEBP, "WEBP", 0, "WebP (.webp)", "Output image in WebP format"},
342#else
343# define R_IMF_ENUM_WEBP
344#endif
345
346#ifdef WITH_FFMPEG
347# define R_IMF_ENUM_FFMPEG {R_IMF_IMTYPE_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFmpeg Video", ""},
348#else
349# define R_IMF_ENUM_FFMPEG
350#endif
351
352#define IMAGE_TYPE_ITEMS_IMAGE \
353 /* DDS save not supported yet R_IMF_ENUM_DDS */ \
354 R_IMF_ENUM_JPEG \
355 R_IMF_ENUM_EXR \
356 R_IMF_ENUM_PNG \
357 R_IMF_ENUM_WEBP \
358 RNA_ENUM_ITEM_SEPR, \
359 R_IMF_ENUM_BMP R_IMF_ENUM_CINEON R_IMF_ENUM_DPX R_IMF_ENUM_IRIS R_IMF_ENUM_JPEG2K \
360 R_IMF_ENUM_HDR R_IMF_ENUM_TAGA R_IMF_ENUM_TAGA_RAW R_IMF_ENUM_TIFF
361
362#define IMAGE_TYPE_ITEMS_MULTI_LAYER_IMAGE R_IMF_ENUM_EXR_MULTILAYER
363
364#define IMAGE_TYPE_ITEMS_VIDEO R_IMF_ENUM_FFMPEG
365
366#ifdef RNA_RUNTIME
367static const EnumPropertyItem image_type_items[] = {
369
370 {0, nullptr, 0, nullptr, nullptr},
371};
372
373static const EnumPropertyItem multi_layer_image_type_items[] = {
375
376 {0, nullptr, 0, nullptr, nullptr},
377};
378
379static const EnumPropertyItem video_image_type_items[] = {
381
382 {0, nullptr, 0, nullptr, nullptr},
383};
384#endif
385
391
394 "BW",
395 0,
396 "BW",
397 "Images get saved in 8-bit grayscale (only PNG, JPEG, TGA, TIF)"},
398 {R_IMF_PLANES_RGB, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
400 "RGBA",
401 0,
402 "RGBA",
403 "Images are saved with RGB and Alpha data (if supported)"},
404 {0, nullptr, 0, nullptr, nullptr},
405};
406
407#ifdef RNA_RUNTIME
408# define IMAGE_COLOR_MODE_BW rna_enum_image_color_mode_items[0]
409# define IMAGE_COLOR_MODE_RGB rna_enum_image_color_mode_items[1]
410# define IMAGE_COLOR_MODE_RGBA rna_enum_image_color_mode_items[2]
411#endif
412
414 /* 1 (monochrome) not used */
415 {R_IMF_CHAN_DEPTH_8, "8", 0, "8", "8-bit color channels"},
416 {R_IMF_CHAN_DEPTH_10, "10", 0, "10", "10-bit color channels"},
417 {R_IMF_CHAN_DEPTH_12, "12", 0, "12", "12-bit color channels"},
418 {R_IMF_CHAN_DEPTH_16, "16", 0, "16", "16-bit color channels"},
419 /* 24 not used */
420 {R_IMF_CHAN_DEPTH_32, "32", 0, "32", "32-bit color channels"},
421 {0, nullptr, 0, nullptr, nullptr},
422};
423
425 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
426 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
427 {0, nullptr, 0, nullptr, nullptr},
428};
429
431 {R_BAKE_POSX, "POS_X", 0, "+X", ""},
432 {R_BAKE_POSY, "POS_Y", 0, "+Y", ""},
433 {R_BAKE_POSZ, "POS_Z", 0, "+Z", ""},
434 {R_BAKE_NEGX, "NEG_X", 0, "-X", ""},
435 {R_BAKE_NEGY, "NEG_Y", 0, "-Y", ""},
436 {R_BAKE_NEGZ, "NEG_Z", 0, "-Z", ""},
437 {0, nullptr, 0, nullptr, nullptr},
438};
439
442 "ADJACENT_FACES",
443 0,
444 "Adjacent Faces",
445 "Use pixels from adjacent faces across UV seams"},
446 {R_BAKE_EXTEND, "EXTEND", 0, "Extend", "Extend border pixels outwards"},
447 {0, nullptr, 0, nullptr, nullptr},
448};
449
452 "IMAGE_TEXTURES",
453 0,
454 "Image Textures",
455 "Bake to image data-blocks associated with active image texture nodes in materials"},
457 "VERTEX_COLORS",
458 0,
459 "Active Color Attribute",
460 "Bake to the active color attribute on meshes"},
461 {0, nullptr, 0, nullptr, nullptr},
462};
463
466 "INTERNAL",
467 0,
468 "Internal",
469 "Save the baking map in an internal image data-block"},
470 {R_BAKE_SAVE_EXTERNAL, "EXTERNAL", 0, "External", "Save the baking map in an external file"},
471 {0, nullptr, 0, nullptr, nullptr},
472};
473
476 "ABOVE_SURFACE",
477 0,
478 "Above Surface",
479 "Cast rays from above the surface"},
481 "ACTIVE_CAMERA",
482 0,
483 "Active Camera",
484 "Use the active camera's position to cast rays"},
485 {0, nullptr, 0, nullptr, nullptr},
486};
487
488#define R_IMF_VIEWS_ENUM_IND \
489 {R_IMF_VIEWS_INDIVIDUAL, \
490 "INDIVIDUAL", \
491 0, \
492 "Individual", \
493 "Individual files for each view with the prefix as defined by the scene views"},
494#define R_IMF_VIEWS_ENUM_S3D \
495 {R_IMF_VIEWS_STEREO_3D, "STEREO_3D", 0, "Stereo 3D", "Single file with an encoded stereo pair"},
496#define R_IMF_VIEWS_ENUM_MV \
497 {R_IMF_VIEWS_MULTIVIEW, "MULTIVIEW", 0, "Multi-View", "Single file with all the views"},
498
500 R_IMF_VIEWS_ENUM_IND R_IMF_VIEWS_ENUM_S3D{0, nullptr, 0, nullptr, nullptr},
501};
502
506
510
511#undef R_IMF_VIEWS_ENUM_IND
512#undef R_IMF_VIEWS_ENUM_S3D
513#undef R_IMF_VIEWS_ENUM_MV
514
517 "ANAGLYPH",
518 0,
519 "Anaglyph",
520 "Render views for left and right eyes as two differently filtered colors in a single image "
521 "(anaglyph glasses are required)"},
523 "INTERLACE",
524 0,
525 "Interlace",
526 "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
527 "required)"},
529 "TIMESEQUENTIAL",
530 0,
531 "Time Sequential",
532 "Render alternate eyes (also known as page flip, quad buffer support in the graphic card is "
533 "required)"},
535 "SIDEBYSIDE",
536 0,
537 "Side-by-Side",
538 "Render views for left and right eyes side-by-side"},
540 "TOPBOTTOM",
541 0,
542 "Top-Bottom",
543 "Render views for left and right eyes one above another"},
544 {0, nullptr, 0, nullptr, nullptr},
545};
546
548 {S3D_ANAGLYPH_REDCYAN, "RED_CYAN", 0, "Red-Cyan", ""},
549 {S3D_ANAGLYPH_GREENMAGENTA, "GREEN_MAGENTA", 0, "Green-Magenta", ""},
550 {S3D_ANAGLYPH_YELLOWBLUE, "YELLOW_BLUE", 0, "Yellow-Blue", ""},
551 {0, nullptr, 0, nullptr, nullptr},
552};
553
555 {S3D_INTERLACE_ROW, "ROW_INTERLEAVED", 0, "Row Interleaved", ""},
556 {S3D_INTERLACE_COLUMN, "COLUMN_INTERLEAVED", 0, "Column Interleaved", ""},
557 {S3D_INTERLACE_CHECKERBOARD, "CHECKERBOARD_INTERLEAVED", 0, "Checkerboard Interleaved", ""},
558 {0, nullptr, 0, nullptr, nullptr},
559};
560
562 {R_BAKE_PASS_FILTER_NONE, "NONE", 0, "None", ""},
563 {R_BAKE_PASS_FILTER_EMIT, "EMIT", 0, "Emit", ""},
564 {R_BAKE_PASS_FILTER_DIRECT, "DIRECT", 0, "Direct", ""},
565 {R_BAKE_PASS_FILTER_INDIRECT, "INDIRECT", 0, "Indirect", ""},
566 {R_BAKE_PASS_FILTER_COLOR, "COLOR", 0, "Color", ""},
567 {R_BAKE_PASS_FILTER_DIFFUSE, "DIFFUSE", 0, "Diffuse", ""},
568 {R_BAKE_PASS_FILTER_GLOSSY, "GLOSSY", 0, "Glossy", ""},
569 {R_BAKE_PASS_FILTER_TRANSM, "TRANSMISSION", 0, "Transmission", ""},
570 {0, nullptr, 0, nullptr, nullptr},
571};
572
574 {AOV_TYPE_COLOR, "COLOR", 0, "Color", ""},
575 {AOV_TYPE_VALUE, "VALUE", 0, "Value", ""},
576 {0, nullptr, 0, nullptr, nullptr},
577};
578
581 "BOUNDING_BOX_CENTER",
582 ICON_PIVOT_BOUNDBOX,
583 "Bounding Box Center",
584 "Pivot around bounding box center of selected object(s)"},
585 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
587 "INDIVIDUAL_ORIGINS",
588 ICON_PIVOT_INDIVIDUAL,
589 "Individual Origins",
590 "Pivot around each object's own origin"},
592 "MEDIAN_POINT",
593 ICON_PIVOT_MEDIAN,
594 "Median Point",
595 "Pivot around the median point of selected objects"},
597 "ACTIVE_ELEMENT",
598 ICON_PIVOT_ACTIVE,
599 "Active Element",
600 "Pivot around active object"},
601 {0, nullptr, 0, nullptr, nullptr},
602};
603
604/* Icons could be made a consistent set of images. */
607 "GLOBAL",
608 ICON_ORIENTATION_GLOBAL,
609 "Global",
610 "Align the transformation axes to world space"},
612 "LOCAL",
613 ICON_ORIENTATION_LOCAL,
614 "Local",
615 "Align the transformation axes to the selected objects' local space"},
617 "NORMAL",
618 ICON_ORIENTATION_NORMAL,
619 "Normal",
620 "Align the transformation axes to average normal of selected elements "
621 "(bone Y axis for pose mode)"},
623 "GIMBAL",
624 ICON_ORIENTATION_GIMBAL,
625 "Gimbal",
626 "Align each axis to the Euler rotation axis as used for input"},
628 "VIEW",
629 ICON_ORIENTATION_VIEW,
630 "View",
631 "Align the transformation axes to the window"},
633 "CURSOR",
634 ICON_ORIENTATION_CURSOR,
635 "Cursor",
636 "Align the transformation axes to the 3D cursor"},
638 "PARENT",
639 ICON_ORIENTATION_PARENT,
640 "Parent",
641 "Align the transformation axes to the object's parent space"},
642 // {V3D_ORIENT_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
643 {0, nullptr, 0, nullptr, nullptr},
644};
645
648 "SURFACE",
649 0,
650 "Surface",
651 "Start placing on the surface, using the 3D cursor position as a fallback"},
653 "CURSOR_PLANE",
654 0,
655 "Cursor Plane",
656 "Start placement using a point projected onto the orientation axis "
657 "at the 3D cursor position"},
659 "CURSOR_VIEW",
660 0,
661 "Cursor View",
662 "Start placement using a point projected onto the view plane at the 3D cursor position"},
663 {0, nullptr, 0, nullptr, nullptr},
664};
665
668 "SURFACE",
669 ICON_SNAP_NORMAL,
670 "Surface",
671 "Use the surface normal (using the transform orientation as a fallback)"},
673 "DEFAULT",
674 ICON_ORIENTATION_GLOBAL,
675 "Default",
676 "Use the current transform orientation"},
677 {0, nullptr, 0, nullptr, nullptr},
678};
679
681 {SCE_SNAP_TO_GEOM, "GEOMETRY", 0, "Geometry", "Snap to all geometry"},
682 {SCE_SNAP_TO_NONE, "DEFAULT", 0, "Default", "Use the current snap settings"},
683 {0, nullptr, 0, nullptr, nullptr},
684};
685
687 {GP_SELECTMODE_POINT, "POINT", ICON_GP_SELECT_POINTS, "Point", "Select only points"},
688 {GP_SELECTMODE_STROKE, "STROKE", ICON_GP_SELECT_STROKES, "Stroke", "Select all stroke points"},
690 "SEGMENT",
691 ICON_GP_SELECT_BETWEEN_STROKES,
692 "Segment",
693 "Select all stroke points between other strokes"},
694 {0, nullptr, 0, nullptr, nullptr},
695};
696
698 {1, "1", 0, "1:1", "Full resolution"},
699 {2, "2", 0, "1:2", "Render this effect at 50% render resolution"},
700 {4, "4", 0, "1:4", "Render this effect at 25% render resolution"},
701 {8, "8", 0, "1:8", "Render this effect at 12.5% render resolution"},
702 {16, "16", 0, "1:16", "Render this effect at 6.25% render resolution"},
703 {0, nullptr, 0, nullptr, nullptr},
704};
705
706#ifdef RNA_RUNTIME
707
708# include <algorithm>
709
710# include <fmt/format.h>
711
712# include "BLI_index_range.hh"
713# include "BLI_string_utils.hh"
714
715# include "DNA_anim_types.h"
716# include "DNA_cachefile_types.h"
717# include "DNA_color_types.h"
719# include "DNA_linestyle_types.h"
720# include "DNA_mesh_types.h"
721# include "DNA_node_types.h"
722# include "DNA_object_types.h"
723# include "DNA_particle_types.h"
724# include "DNA_text_types.h"
725# include "DNA_workspace_types.h"
726# include "DNA_world_types.h"
727
728# include "RNA_access.hh"
729
730# include "MEM_guardedalloc.h"
731
732# include "MOV_util.hh"
733
734# include "BKE_animsys.h"
735# include "BKE_armature.hh"
737# include "BKE_brush.hh"
738# include "BKE_collection.hh"
739# include "BKE_context.hh"
740# include "BKE_editmesh.hh"
741# include "BKE_freestyle.h"
742# include "BKE_global.hh"
743# include "BKE_gpencil_legacy.h"
744# include "BKE_idprop.hh"
745# include "BKE_image.hh"
746# include "BKE_image_format.hh"
747# include "BKE_layer.hh"
748# include "BKE_main.hh"
749# include "BKE_main_invariants.hh"
750# include "BKE_mesh.hh"
751# include "BKE_node.hh"
752# include "BKE_node_legacy_types.hh"
753# include "BKE_node_runtime.hh"
754# include "BKE_pointcache.h"
755# include "BKE_scene.hh"
756# include "BKE_screen.hh"
757# include "BKE_unit.hh"
758
759# include "NOD_composite.hh"
761
762# include "ED_grease_pencil.hh"
763# include "ED_image.hh"
764# include "ED_info.hh"
765# include "ED_keyframing.hh"
766# include "ED_mesh.hh"
767# include "ED_node.hh"
768# include "ED_render.hh"
769# include "ED_scene.hh"
770# include "ED_sequencer.hh"
771# include "ED_uvedit.hh"
772# include "ED_view3d.hh"
773
774# include "DEG_depsgraph.hh"
775# include "DEG_depsgraph_build.hh"
776# include "DEG_depsgraph_query.hh"
777
778# include "SEQ_relations.hh"
779# include "SEQ_sequencer.hh"
780# include "SEQ_sound.hh"
781
782# ifdef WITH_FREESTYLE
783# include "FRS_freestyle.h"
784# endif
785
786# ifdef WITH_ALEMBIC
787# include "ABC_alembic.h"
788# endif
789
790# include "RE_engine.h"
791
792# include "ANIM_keyingsets.hh"
793
794using blender::Vector;
796
797static int rna_ToolSettings_snap_mode_get(PointerRNA *ptr)
798{
799 ToolSettings *ts = (ToolSettings *)(ptr->data);
800 return ts->snap_mode;
801}
802
803static void rna_ToolSettings_snap_mode_set(PointerRNA *ptr, int value)
804{
805 ToolSettings *ts = (ToolSettings *)ptr->data;
806 if (value != 0) {
807 ts->snap_mode = value;
808 }
809}
810
811static void rna_ToolSettings_snap_uv_mode_set(PointerRNA *ptr, int value)
812{
813 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
814 if (value != 0) {
815 ts->snap_uv_mode = value;
816 }
817}
818
819static void rna_Gpencil_mask_point_update(bContext *C, PointerRNA *ptr)
820{
821 ToolSettings *ts = (ToolSettings *)ptr->data;
822
825
827 if (ob && ob->type == OB_GREASE_PENCIL) {
829 }
830}
831
832static void rna_Gpencil_mask_stroke_update(bContext *C, PointerRNA *ptr)
833{
834 ToolSettings *ts = (ToolSettings *)ptr->data;
835
838
840 if (ob && ob->type == OB_GREASE_PENCIL) {
842 }
843}
844
845static void rna_Gpencil_mask_segment_update(bContext *C, PointerRNA *ptr)
846{
847 ToolSettings *ts = (ToolSettings *)ptr->data;
848
851
853 if (ob && ob->type == OB_GREASE_PENCIL) {
855 }
856}
857
858static void rna_Gpencil_vertex_mask_point_update(bContext *C, PointerRNA *ptr)
859{
860 ToolSettings *ts = (ToolSettings *)ptr->data;
861
864
866 if (ob && ob->type == OB_GREASE_PENCIL) {
868 }
869}
870
871static void rna_Gpencil_vertex_mask_stroke_update(bContext *C, PointerRNA *ptr)
872{
873 ToolSettings *ts = (ToolSettings *)ptr->data;
874
877
879 if (ob && ob->type == OB_GREASE_PENCIL) {
881 }
882}
883
884static void rna_Gpencil_vertex_mask_segment_update(bContext *C, PointerRNA *ptr)
885{
886 ToolSettings *ts = (ToolSettings *)ptr->data;
887
890
892 if (ob && ob->type == OB_GREASE_PENCIL) {
894 }
895}
896
897static void rna_all_grease_pencil_update(bContext *C, PointerRNA * /*ptr*/)
898{
899 /* FIXME: We shouldn't have to tag all the Grease Pencil IDs for an update! */
900 Main *bmain = CTX_data_main(C);
901 LISTBASE_FOREACH (GreasePencil *, grease_pencil, &bmain->grease_pencils) {
902 DEG_id_tag_update(&grease_pencil->id, ID_RECALC_GEOMETRY);
903 }
905}
906
907/* Read-only Iterator of all the scene objects. */
908
909static void rna_Scene_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
910{
911 Scene *scene = (Scene *)ptr->data;
912 iter->internal.custom = MEM_callocN<BLI_Iterator>(__func__);
913
914 BKE_scene_objects_iterator_begin(static_cast<BLI_Iterator *>(iter->internal.custom),
915 (void *)scene);
916 iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
917}
918
919static void rna_Scene_objects_next(CollectionPropertyIterator *iter)
920{
922 iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
923}
924
925static void rna_Scene_objects_end(CollectionPropertyIterator *iter)
926{
929}
930
931static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
932{
933 Object *ob = static_cast<Object *>(((BLI_Iterator *)iter->internal.custom)->current);
934 return RNA_id_pointer_create(reinterpret_cast<ID *>(ob));
935}
936
937/* End of read-only Iterator of all the scene objects. */
938
939static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
940{
941 Scene *scene = (Scene *)ptr->data;
942 Scene *set = (Scene *)value.data;
943 Scene *nested_set;
944
945 for (nested_set = set; nested_set; nested_set = nested_set->set) {
946 if (nested_set == scene) {
947 return;
948 }
949 /* prevent eternal loops, set can point to next, and next to set, without problems usually */
950 if (nested_set->set == set) {
951 return;
952 }
953 }
954
955 id_lib_extern((ID *)set);
956 scene->set = set;
957}
958
959void rna_Scene_set_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
960{
961 Scene *scene = (Scene *)ptr->owner_id;
962
964 DEG_id_tag_update_ex(bmain, &scene->id, ID_RECALC_BASE_FLAGS);
965 if (scene->set != nullptr) {
966 /* Objects which are pulled into main scene's depsgraph needs to have
967 * their base flags updated.
968 */
969 DEG_id_tag_update_ex(bmain, &scene->set->id, ID_RECALC_BASE_FLAGS);
970 }
971}
972
973static void rna_Scene_camera_update(Main *bmain, Scene * /*scene_unused*/, PointerRNA *ptr)
974{
975 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
976 Scene *scene = (Scene *)ptr->data;
977
978 WM_windows_scene_data_sync(&wm->windows, scene);
981}
982
983static void rna_Scene_fps_update(Main *bmain, Scene * /*active_scene*/, PointerRNA *ptr)
984{
985 Scene *scene = (Scene *)ptr->owner_id;
987 /* NOTE: Tag via dependency graph will take care of all the updates ion the evaluated domain,
988 * however, changes in FPS actually modifies an original skip length,
989 * so this we take care about here. */
991 /* Reset simulation states because new frame interval doesn't apply anymore. */
993}
994
995static void rna_Scene_listener_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
996{
998}
999
1000static void rna_Scene_volume_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1001{
1002 Scene *scene = (Scene *)ptr->owner_id;
1004}
1005
1006static const char *rna_Scene_statistics_string_get(Scene *scene,
1007 Main *bmain,
1008 ReportList *reports,
1009 ViewLayer *view_layer)
1010{
1011 if (!BKE_scene_has_view_layer(scene, view_layer)) {
1012 BKE_reportf(reports,
1013 RPT_ERROR,
1014 "View Layer '%s' not found in scene '%s'",
1015 view_layer->name,
1016 scene->id.name + 2);
1017 return "";
1018 }
1019
1020 return ED_info_statistics_string(bmain, scene, view_layer);
1021}
1022
1023static void rna_Scene_framelen_update(Main * /*bmain*/, Scene * /*active_scene*/, PointerRNA *ptr)
1024{
1025 Scene *scene = (Scene *)ptr->owner_id;
1026 scene->r.framelen = float(scene->r.framapto) / float(scene->r.images);
1027}
1028
1029static void rna_Scene_frame_current_set(PointerRNA *ptr, int value)
1030{
1031 Scene *data = (Scene *)ptr->data;
1032
1033 /* if negative frames aren't allowed, then we can't use them */
1034 FRAMENUMBER_MIN_CLAMP(value);
1035 data->r.cfra = value;
1036}
1037
1038static float rna_Scene_frame_float_get(PointerRNA *ptr)
1039{
1040 Scene *data = (Scene *)ptr->data;
1041 return float(data->r.cfra) + data->r.subframe;
1042}
1043
1044static void rna_Scene_frame_float_set(PointerRNA *ptr, float value)
1045{
1046 Scene *data = (Scene *)ptr->data;
1047 /* if negative frames aren't allowed, then we can't use them */
1048 FRAMENUMBER_MIN_CLAMP(value);
1049 data->r.cfra = int(value);
1050 data->r.subframe = value - data->r.cfra;
1051}
1052
1053static float rna_Scene_frame_current_final_get(PointerRNA *ptr)
1054{
1055 Scene *scene = (Scene *)ptr->data;
1056
1057 return BKE_scene_frame_to_ctime(scene, float(scene->r.cfra));
1058}
1059
1060static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
1061{
1062 Scene *data = (Scene *)ptr->data;
1063 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
1064 CLAMP(value, MINFRAME, MAXFRAME);
1065 data->r.sfra = value;
1066
1067 if (value > data->r.efra) {
1068 data->r.efra = std::min(value, MAXFRAME);
1069 }
1070}
1071
1072static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
1073{
1074 Scene *data = (Scene *)ptr->data;
1075 CLAMP(value, MINFRAME, MAXFRAME);
1076 data->r.efra = value;
1077
1078 if (data->r.sfra > value) {
1079 data->r.sfra = std::max(value, MINFRAME);
1080 }
1081}
1082
1083static void rna_Scene_use_preview_range_set(PointerRNA *ptr, bool value)
1084{
1085 Scene *data = (Scene *)ptr->data;
1086
1087 if (value) {
1088 /* copy range from scene if not set before */
1089 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
1090 data->r.psfra = data->r.sfra;
1091 data->r.pefra = data->r.efra;
1092 }
1093
1094 data->r.flag |= SCER_PRV_RANGE;
1095 }
1096 else {
1097 data->r.flag &= ~SCER_PRV_RANGE;
1098 }
1099}
1100
1101static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
1102{
1103 Scene *data = (Scene *)ptr->data;
1104
1105 /* check if enabled already */
1106 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
1107 /* set end of preview range to end frame, then clamp as per normal */
1108 /* TODO: or just refuse to set instead? */
1109 data->r.pefra = data->r.efra;
1110 }
1111 CLAMP(value, MINAFRAME, MAXFRAME);
1112 data->r.psfra = value;
1113
1114 if (value > data->r.pefra) {
1115 data->r.pefra = std::min(value, MAXFRAME);
1116 }
1117}
1118
1119static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
1120{
1121 Scene *data = (Scene *)ptr->data;
1122
1123 /* check if enabled already */
1124 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
1125 /* set start of preview range to start frame, then clamp as per normal */
1126 /* TODO: or just refuse to set instead? */
1127 data->r.psfra = data->r.sfra;
1128 }
1129 CLAMP(value, MINAFRAME, MAXFRAME);
1130 data->r.pefra = value;
1131
1132 if (data->r.psfra > value) {
1133 data->r.psfra = std::max(value, MINAFRAME);
1134 }
1135}
1136
1137static void rna_Scene_show_subframe_update(Main * /*bmain*/,
1138 Scene * /*current_scene*/,
1139 PointerRNA *ptr)
1140{
1141 Scene *scene = (Scene *)ptr->owner_id;
1142 scene->r.subframe = 0.0f;
1143}
1144
1145static void rna_Scene_frame_update_context(bContext *C, PointerRNA *ptr)
1146{
1147 Scene *scene = (Scene *)ptr->owner_id;
1151}
1152
1153static void rna_Scene_frame_update(Main * /*bmain*/, Scene * /*current_scene*/, PointerRNA *ptr)
1154{
1155 Scene *scene = (Scene *)ptr->owner_id;
1158}
1159
1160static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
1161{
1162 Scene *scene = (Scene *)ptr->data;
1164 *ptr, &RNA_KeyingSet, blender::animrig::scene_get_active_keyingset(scene));
1165}
1166
1167static void rna_Scene_active_keying_set_set(PointerRNA *ptr,
1168 PointerRNA value,
1169 ReportList * /*reports*/)
1170{
1171 Scene *scene = (Scene *)ptr->data;
1172 KeyingSet *ks = (KeyingSet *)value.data;
1173
1174 scene->active_keyingset = ANIM_scene_get_keyingset_index(scene, ks);
1175}
1176
1177/* get KeyingSet index stuff for list of Keying Sets editing UI
1178 * - active_keyingset-1 since 0 is reserved for 'none'
1179 * - don't clamp, otherwise can never set builtin's types as active...
1180 */
1181static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
1182{
1183 Scene *scene = (Scene *)ptr->data;
1184 return scene->active_keyingset - 1;
1185}
1186
1187/* get KeyingSet index stuff for list of Keying Sets editing UI
1188 * - value+1 since 0 is reserved for 'none'
1189 */
1190static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
1191{
1192 Scene *scene = (Scene *)ptr->data;
1193 scene->active_keyingset = value + 1;
1194}
1195
1196/* XXX: evil... builtin_keyingsets is defined in `blender::animrig::keyingsets.cc`! */
1197/* TODO: make API function to retrieve this... */
1199
1200static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1201{
1202 Scene *scene = (Scene *)ptr->data;
1203
1204 /* start going over the scene KeyingSets first, while we still have pointer to it
1205 * but only if we have any Keying Sets to use...
1206 */
1207 if (scene->keyingsets.first) {
1208 rna_iterator_listbase_begin(iter, ptr, &scene->keyingsets, nullptr);
1209 }
1210 else {
1212 }
1213}
1214
1215static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
1216{
1217 ListBaseIterator *internal = &iter->internal.listbase;
1218 KeyingSet *ks = (KeyingSet *)internal->link;
1219
1220 /* If we've run out of links in Scene list,
1221 * jump over to the builtins list unless we're there already. */
1222 if ((ks->next == nullptr) && (ks != builtin_keyingsets.last)) {
1223 internal->link = (Link *)builtin_keyingsets.first;
1224 }
1225 else {
1226 internal->link = (Link *)ks->next;
1227 }
1228
1229 iter->valid = (internal->link != nullptr);
1230}
1231
1232static bool rna_Scene_compositing_node_group_poll(PointerRNA * /*ptr*/, PointerRNA value)
1233{
1234 bNodeTree *ntree = static_cast<bNodeTree *>(value.data);
1235 return ntree->type == NTREE_COMPOSIT;
1236}
1237
1238static void rna_Scene_compositing_node_group_set(PointerRNA *ptr,
1239 const PointerRNA value,
1240 ReportList *reports)
1241{
1242 Scene *scene = static_cast<Scene *>(ptr->data);
1243 bNodeTree *ntree = static_cast<bNodeTree *>(value.data);
1244 if (ntree && ntree->type != NTREE_COMPOSIT) {
1246 reports, RPT_ERROR, "Node tree '%s' is not a compositing node group.", ntree->id.name + 2);
1247 return;
1248 }
1249 if (scene->compositing_node_group) {
1251 }
1252 scene->compositing_node_group = ntree;
1254}
1255
1256static std::optional<std::string> rna_SceneEEVEE_path(const PointerRNA * /*ptr*/)
1257{
1258 return "eevee";
1259}
1260
1261static std::optional<std::string> rna_RaytraceEEVEE_path(const PointerRNA * /*ptr*/)
1262{
1263 return "eevee.ray_tracing_options";
1264}
1265
1266static std::optional<std::string> rna_SceneGpencil_path(const PointerRNA * /*ptr*/)
1267{
1268 return "grease_pencil_settings";
1269}
1270
1271static std::optional<std::string> rna_SceneHydra_path(const PointerRNA * /*ptr*/)
1272{
1273 return "hydra";
1274}
1275
1276static bool rna_RenderSettings_stereoViews_skip(CollectionPropertyIterator *iter, void * /*data*/)
1277{
1278 ListBaseIterator *internal = &iter->internal.listbase;
1279 SceneRenderView *srv = (SceneRenderView *)internal->link;
1280
1281 if (STR_ELEM(srv->name, STEREO_LEFT_NAME, STEREO_RIGHT_NAME)) {
1282 return false;
1283 }
1284
1285 return true;
1286};
1287
1288static void rna_RenderSettings_stereoViews_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1289{
1290 RenderData *rd = (RenderData *)ptr->data;
1291 rna_iterator_listbase_begin(iter, ptr, &rd->views, rna_RenderSettings_stereoViews_skip);
1292}
1293
1294static std::optional<std::string> rna_RenderSettings_path(const PointerRNA * /*ptr*/)
1295{
1296 return "render";
1297}
1298
1299static std::optional<std::string> rna_BakeSettings_path(const PointerRNA * /*ptr*/)
1300{
1301 return "render.bake";
1302}
1303
1304static std::optional<std::string> rna_ImageFormatSettings_path(
1305 const PointerRNA *ptr, blender::FunctionRef<bool(ImageFormatData *)> match)
1306{
1307 ID *id = ptr->owner_id;
1308
1309 switch (GS(id->name)) {
1310 case ID_SCE: {
1311 Scene *scene = (Scene *)id;
1312
1313 if (match(&scene->r.im_format)) {
1314 return "render.image_settings";
1315 }
1316 else if (match(&scene->r.bake.im_format)) {
1317 return "render.bake.image_settings";
1318 }
1319 return std::nullopt;
1320 }
1321 case ID_NT: {
1322 bNodeTree *ntree = (bNodeTree *)id;
1323
1324 for (bNode *node : ntree->all_nodes()) {
1325 if (node->type_legacy == CMP_NODE_OUTPUT_FILE) {
1326 NodeCompositorFileOutput &storage = *static_cast<NodeCompositorFileOutput *>(
1327 node->storage);
1328 if (match(&storage.format)) {
1329 char node_name_esc[sizeof(node->name) * 2];
1330 BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
1331 return fmt::format("nodes[\"{}\"].format", node_name_esc);
1332 }
1333 else {
1334 for (const int i : blender::IndexRange(storage.items_count)) {
1335 NodeCompositorFileOutputItem &item = storage.items[i];
1336 if (match(&item.format)) {
1337 char node_name_esc[sizeof(node->name) * 2];
1338 BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
1339
1340 const std::string identifier = FileOutputItemsAccessor::socket_identifier_for_item(
1341 item);
1342 const std::string escaped_identifier = BLI_str_escape(identifier.c_str());
1343 return fmt::format("nodes[\"{}\"].file_output_items[\"{}\"].format",
1344 node_name_esc,
1345 escaped_identifier.c_str());
1346 }
1347 }
1348 }
1349 }
1350 }
1351 return std::nullopt;
1352 }
1353 default:
1354 return std::nullopt;
1355 }
1356}
1357
1358static std::optional<std::string> rna_ImageFormatSettings_path(const PointerRNA *ptr)
1359{
1360 ImageFormatData *data = static_cast<ImageFormatData *>(ptr->data);
1361 return rna_ImageFormatSettings_path(ptr, [&](ImageFormatData *imf) { return imf == data; });
1362}
1363
1364std::optional<std::string> rna_ColorManagedDisplaySettings_path(const PointerRNA *ptr)
1365{
1367 std::optional<std::string> path = rna_ImageFormatSettings_path(
1368 ptr, [&](ImageFormatData *imf) { return &imf->display_settings == data; });
1369 if (path) {
1370 return *path + ".display_settings";
1371 }
1372 if (GS(ptr->owner_id->name) == ID_SCE) {
1373 return "display_settings";
1374 }
1375
1376 return std::nullopt;
1377}
1378
1379std::optional<std::string> rna_ColorManagedViewSettings_path(const PointerRNA *ptr)
1380{
1382 std::optional<std::string> path = rna_ImageFormatSettings_path(
1383 ptr, [&](ImageFormatData *imf) { return &imf->view_settings == data; });
1384 if (path) {
1385 return *path + ".view_settings";
1386 }
1387 if (GS(ptr->owner_id->name) == ID_SCE) {
1388 return "view_settings";
1389 }
1390 return std::nullopt;
1391}
1392
1393std::optional<std::string> rna_ColorManagedInputColorspaceSettings_path(const PointerRNA *ptr)
1394{
1396 std::optional<std::string> path = rna_ImageFormatSettings_path(
1397 ptr, [&](ImageFormatData *imf) { return &imf->linear_colorspace_settings == data; });
1398 if (path) {
1399 return *path + ".linear_colorspace_settings";
1400 }
1401 return std::nullopt;
1402}
1403
1404static int rna_RenderSettings_threads_get(PointerRNA *ptr)
1405{
1406 RenderData *rd = (RenderData *)ptr->data;
1407 return BKE_render_num_threads(rd);
1408}
1409
1410static int rna_RenderSettings_threads_mode_get(PointerRNA *ptr)
1411{
1412 RenderData *rd = (RenderData *)ptr->data;
1413 int override = BLI_system_num_threads_override_get();
1414
1415 if (override > 0) {
1416 return R_FIXED_THREADS;
1417 }
1418 else {
1419 return (rd->mode & R_FIXED_THREADS);
1420 }
1421}
1422
1423static bool rna_RenderSettings_is_movie_format_get(PointerRNA *ptr)
1424{
1425 RenderData *rd = (RenderData *)ptr->data;
1426 return BKE_imtype_is_movie(rd->im_format.imtype);
1427}
1428
1429static const EnumPropertyItem *rna_ImageFormatSettings_media_type_itemf(bContext * /*C*/,
1430 PointerRNA *ptr,
1431 PropertyRNA * /*prop*/,
1432 bool * /*r_free*/)
1433{
1434 ID *id = ptr->owner_id;
1435 /* Scene format setting include video, so we return all items. Otherwise, only image types are
1436 * returned. */
1437 if (id && GS(id->name) == ID_SCE) {
1439 }
1440 else {
1441 return rna_enum_media_type_image_items;
1442 }
1443}
1444
1445/* If the existing imtype does not match the new media type, assign an appropriate default media
1446 * type. */
1447static void rna_ImageFormatSettings_media_type_set(PointerRNA *ptr, int value)
1448{
1450 BKE_image_format_media_type_set(format, ptr->owner_id, static_cast<MediaType>(value));
1451}
1452
1453static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
1454{
1455 BKE_image_format_set((ImageFormatData *)ptr->data, ptr->owner_id, value);
1456}
1457
1458static const EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf(bContext * /*C*/,
1459 PointerRNA *ptr,
1460 PropertyRNA * /*prop*/,
1461 bool * /*r_free*/)
1462{
1463 const ImageFormatData *format = ptr->data_as<ImageFormatData>();
1464 switch (static_cast<MediaType>(format->media_type)) {
1465 case MEDIA_TYPE_IMAGE:
1466 return image_type_items;
1468 return multi_layer_image_type_items;
1469 case MEDIA_TYPE_VIDEO:
1470 return video_image_type_items;
1471 }
1472
1474}
1475
1476static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext * /*C*/,
1477 PointerRNA *ptr,
1478 PropertyRNA * /*prop*/,
1479 bool *r_free)
1480{
1481 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1482 ID *id = ptr->owner_id;
1483 const bool is_render = (id && GS(id->name) == ID_SCE);
1484
1485 /* NOTE(@ideasman42): we need to act differently for render
1486 * where 'BW' will force grayscale even if the output format writes
1487 * as RGBA, this is age old blender convention and not sure how useful
1488 * it really is but keep it for now. */
1489 char chan_flag = BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
1490
1491 /* a WAY more crappy case than B&W flag: depending on codec, file format MIGHT support
1492 * alpha channel. for example MPEG format with h264 codec can't do alpha channel, but
1493 * the same MPEG format with QTRLE codec can easily handle alpha channel.
1494 * not sure how to deal with such cases in a nicer way (sergey) */
1495 if (is_render) {
1496 Scene *scene = (Scene *)ptr->owner_id;
1497 RenderData *rd = &scene->r;
1498
1499 if (MOV_codec_supports_alpha(rd->ffcodecdata.codec_id_get(),
1501 {
1502 chan_flag |= IMA_CHAN_FLAG_RGBA;
1503 }
1504 }
1505
1506 if (chan_flag == (IMA_CHAN_FLAG_BW | IMA_CHAN_FLAG_RGB | IMA_CHAN_FLAG_RGBA)) {
1508 }
1509 else {
1510 int totitem = 0;
1511 EnumPropertyItem *item = nullptr;
1512
1513 if (chan_flag & IMA_CHAN_FLAG_BW) {
1514 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_BW);
1515 }
1516 if (chan_flag & IMA_CHAN_FLAG_RGB) {
1517 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB);
1518 }
1519 if (chan_flag & IMA_CHAN_FLAG_RGBA) {
1520 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA);
1521 }
1522
1523 RNA_enum_item_end(&item, &totitem);
1524 *r_free = true;
1525
1526 return item;
1527 }
1528}
1529
1530static const EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext * /*C*/,
1531 PointerRNA *ptr,
1532 PropertyRNA * /*prop*/,
1533 bool *r_free)
1534{
1535 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1536
1537 if (imf == nullptr) {
1539 }
1540 else {
1541 const int depth_ok = BKE_imtype_valid_depths_with_video(imf->imtype, ptr->owner_id);
1542 const int is_float = ELEM(
1544
1546 const EnumPropertyItem *item_10bit = &rna_enum_image_color_depth_items[1];
1547 const EnumPropertyItem *item_12bit = &rna_enum_image_color_depth_items[2];
1548 const EnumPropertyItem *item_16bit = &rna_enum_image_color_depth_items[3];
1549 const EnumPropertyItem *item_32bit = &rna_enum_image_color_depth_items[4];
1550
1551 int totitem = 0;
1552 EnumPropertyItem *item = nullptr;
1553 EnumPropertyItem tmp = {0, "", 0, "", ""};
1554
1555 if (depth_ok & R_IMF_CHAN_DEPTH_8) {
1556 RNA_enum_item_add(&item, &totitem, item_8bit);
1557 }
1558
1559 if (depth_ok & R_IMF_CHAN_DEPTH_10) {
1560 RNA_enum_item_add(&item, &totitem, item_10bit);
1561 }
1562
1563 if (depth_ok & R_IMF_CHAN_DEPTH_12) {
1564 RNA_enum_item_add(&item, &totitem, item_12bit);
1565 }
1566
1567 if (depth_ok & R_IMF_CHAN_DEPTH_16) {
1568 if (is_float) {
1569 tmp = *item_16bit;
1570 tmp.name = N_("Float (Half)");
1572 tmp.description = N_(
1573 "16-bit color channels. Data passes like Depth will still be saved using full "
1574 "32-bit precision.");
1575 }
1576 RNA_enum_item_add(&item, &totitem, &tmp);
1577 }
1578 else {
1579 RNA_enum_item_add(&item, &totitem, item_16bit);
1580 }
1581 }
1582
1583 if (depth_ok & R_IMF_CHAN_DEPTH_32) {
1584 if (is_float) {
1585 tmp = *item_32bit;
1586 tmp.name = N_("Float (Full)");
1587 RNA_enum_item_add(&item, &totitem, &tmp);
1588 }
1589 else {
1590 RNA_enum_item_add(&item, &totitem, item_32bit);
1591 }
1592 }
1593
1594 RNA_enum_item_end(&item, &totitem);
1595 *r_free = true;
1596
1597 return item;
1598 }
1599}
1600
1601static const EnumPropertyItem *rna_ImageFormatSettings_views_format_itemf(bContext * /*C*/,
1602 PointerRNA *ptr,
1603 PropertyRNA * /*prop*/,
1604 bool * /*r_free*/)
1605{
1606 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1607
1608 if (imf == nullptr) {
1610 }
1611 else if (imf->imtype == R_IMF_IMTYPE_OPENEXR) {
1613 }
1614 else if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) {
1616 }
1617 else {
1619 }
1620}
1621
1622# ifdef WITH_IMAGE_OPENEXR
1623/* OpenEXR */
1624
1625static const EnumPropertyItem *rna_ImageFormatSettings_exr_codec_itemf(bContext * /*C*/,
1626 PointerRNA *ptr,
1627 PropertyRNA * /*prop*/,
1628 bool *r_free)
1629{
1630 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1631
1632 EnumPropertyItem *item = nullptr;
1633 int i = 1, totitem = 0;
1634
1635 if (imf->depth == 16) {
1636 return rna_enum_exr_codec_items; /* All compression types are defined for half-float. */
1637 }
1638
1639 for (i = 0; i < R_IMF_EXR_CODEC_MAX; i++) {
1640 if (ELEM(rna_enum_exr_codec_items[i].value, R_IMF_EXR_CODEC_B44, R_IMF_EXR_CODEC_B44A)) {
1641 continue; /* B44 and B44A are not defined for 32 bit floats */
1642 }
1643
1644 RNA_enum_item_add(&item, &totitem, &rna_enum_exr_codec_items[i]);
1645 }
1646
1647 RNA_enum_item_end(&item, &totitem);
1648 *r_free = true;
1649
1650 return item;
1651}
1652
1653# endif
1654
1655static bool rna_ImageFormatSettings_has_linear_colorspace_get(PointerRNA *ptr)
1656{
1657 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1659}
1660
1661static void rna_ImageFormatSettings_color_management_set(PointerRNA *ptr, int value)
1662{
1663 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1664
1665 if (imf->color_management != value) {
1666 imf->color_management = value;
1667
1668 /* Copy from scene when enabling override. */
1670 ID *owner_id = ptr->owner_id;
1671 if (owner_id && GS(owner_id->name) == ID_NT) {
1672 /* For compositing nodes, find the corresponding scene. */
1673 owner_id = BKE_id_owner_get(owner_id);
1674 }
1675 if (owner_id && GS(owner_id->name) == ID_SCE) {
1677 }
1678 }
1679 }
1680}
1681
1682static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
1683{
1684 const RenderData *rd = (RenderData *)ptr->data;
1685 const char *ext_array[BKE_IMAGE_PATH_EXT_MAX];
1686 int ext_num = BKE_image_path_ext_from_imformat(&rd->im_format, ext_array);
1687 return ext_num ? strlen(ext_array[0]) : 0;
1688}
1689
1690static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *value)
1691{
1692 const RenderData *rd = (RenderData *)ptr->data;
1693 const char *ext_array[BKE_IMAGE_PATH_EXT_MAX];
1694 int ext_num = BKE_image_path_ext_from_imformat(&rd->im_format, ext_array);
1695 strcpy(value, ext_num ? ext_array[0] : "");
1696}
1697
1698# ifdef WITH_FFMPEG
1699static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, bool value)
1700{
1701 Scene *scene = (Scene *)ptr->owner_id;
1702 RenderData *rd = &scene->r;
1703
1704 if (value) {
1706 }
1707 else {
1709 }
1710}
1711# endif
1712
1713static int rna_RenderSettings_active_view_index_get(PointerRNA *ptr)
1714{
1715 RenderData *rd = (RenderData *)ptr->data;
1716 return rd->actview;
1717}
1718
1719static void rna_RenderSettings_active_view_index_set(PointerRNA *ptr, int value)
1720{
1721 RenderData *rd = (RenderData *)ptr->data;
1722 rd->actview = value;
1723}
1724
1725static void rna_RenderSettings_active_view_index_range(
1726 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
1727{
1728 RenderData *rd = (RenderData *)ptr->data;
1729
1730 *min = 0;
1731 *max = max_ii(0, BLI_listbase_count(&rd->views) - 1);
1732}
1733
1734static PointerRNA rna_RenderSettings_active_view_get(PointerRNA *ptr)
1735{
1736 RenderData *rd = (RenderData *)ptr->data;
1737 SceneRenderView *srv = static_cast<SceneRenderView *>(BLI_findlink(&rd->views, rd->actview));
1738
1739 return RNA_pointer_create_with_parent(*ptr, &RNA_SceneRenderView, srv);
1740}
1741
1742static void rna_RenderSettings_active_view_set(PointerRNA *ptr,
1743 PointerRNA value,
1744 ReportList * /*reports*/)
1745{
1746 RenderData *rd = (RenderData *)ptr->data;
1747 SceneRenderView *srv = (SceneRenderView *)value.data;
1748 const int index = BLI_findindex(&rd->views, srv);
1749 if (index != -1) {
1750 rd->actview = index;
1751 }
1752}
1753
1754static SceneRenderView *rna_RenderView_new(ID *id, RenderData * /*rd*/, const char *name)
1755{
1756 Scene *scene = (Scene *)id;
1758
1760
1761 return srv;
1762}
1763
1764static void rna_RenderView_remove(
1765 ID *id, RenderData * /*rd*/, Main * /*bmain*/, ReportList *reports, PointerRNA *srv_ptr)
1766{
1767 SceneRenderView *srv = static_cast<SceneRenderView *>(srv_ptr->data);
1768 Scene *scene = (Scene *)id;
1769
1770 if (!BKE_scene_remove_render_view(scene, srv)) {
1771 BKE_reportf(reports,
1772 RPT_ERROR,
1773 "Render view '%s' could not be removed from scene '%s'",
1774 srv->name,
1775 scene->id.name + 2);
1776 return;
1777 }
1778
1779 srv_ptr->invalidate();
1780
1782}
1783
1784static void rna_RenderSettings_views_format_set(PointerRNA *ptr, int value)
1785{
1786 RenderData *rd = (RenderData *)ptr->data;
1787
1789 /* make sure the actview is visible */
1790 if (rd->actview > 1) {
1791 rd->actview = 1;
1792 }
1793 }
1794
1795 rd->views_format = value;
1796}
1797
1798static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
1799{
1800 RenderData *rd = (RenderData *)ptr->data;
1801 RenderEngineType *type = static_cast<RenderEngineType *>(BLI_findlink(&R_engines, value));
1802
1803 if (type) {
1804 STRNCPY_UTF8(rd->engine, type->idname);
1806 }
1807}
1808
1809static const EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext * /*C*/,
1810 PointerRNA * /*ptr*/,
1811 PropertyRNA * /*prop*/,
1812 bool *r_free)
1813{
1814 RenderEngineType *type;
1815 EnumPropertyItem *item = nullptr;
1816 EnumPropertyItem tmp = {0, "", 0, "", ""};
1817 int a = 0, totitem = 0;
1818
1819 for (type = static_cast<RenderEngineType *>(R_engines.first); type; type = type->next, a++) {
1820 tmp.value = a;
1821 tmp.identifier = type->idname;
1822 tmp.name = type->name;
1823 RNA_enum_item_add(&item, &totitem, &tmp);
1824 }
1825
1826 RNA_enum_item_end(&item, &totitem);
1827 *r_free = true;
1828
1829 return item;
1830}
1831
1832static int rna_RenderSettings_engine_get(PointerRNA *ptr)
1833{
1834 RenderData *rd = (RenderData *)ptr->data;
1835 RenderEngineType *type;
1836 int a = 0;
1837
1838 for (type = static_cast<RenderEngineType *>(R_engines.first); type; type = type->next, a++) {
1839 if (STREQ(type->idname, rd->engine)) {
1840 return a;
1841 }
1842 }
1843
1844 return 0;
1845}
1846
1847static void rna_RenderSettings_engine_update(Main *bmain, Scene * /*unused*/, PointerRNA * /*ptr*/)
1848{
1849 ED_render_engine_changed(bmain, true);
1850}
1851
1852static void rna_Scene_update_render_engine(Main *bmain)
1853{
1854 ED_render_engine_changed(bmain, true);
1855}
1856
1857static bool rna_RenderSettings_multiple_engines_get(PointerRNA * /*ptr*/)
1858{
1859 return (BLI_listbase_count(&R_engines) > 1);
1860}
1861
1862static bool rna_RenderSettings_use_spherical_stereo_get(PointerRNA *ptr)
1863{
1864 Scene *scene = (Scene *)ptr->owner_id;
1865 return BKE_scene_use_spherical_stereo(scene);
1866}
1867
1868void rna_Scene_render_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1869{
1870 Scene *scene = (Scene *)ptr->owner_id;
1871
1873}
1874
1875static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1876{
1877 Scene *screen = (Scene *)ptr->owner_id;
1878
1879 rna_Scene_render_update(bmain, scene, ptr);
1880 WM_main_add_notifier(NC_WORLD | ND_WORLD, &screen->id);
1882}
1883
1884static void rna_Scene_mesh_quality_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1885{
1886 Scene *scene = (Scene *)ptr->owner_id;
1887
1888 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1889 if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_VOLUME, OB_MBALL)) {
1891 }
1892 }
1894
1895 rna_Scene_render_update(bmain, scene, ptr);
1896}
1897
1898void rna_Scene_freestyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1899{
1900 Scene *scene = (Scene *)ptr->owner_id;
1901
1903}
1904
1905void rna_Scene_use_freestyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1906{
1907 Scene *scene = (Scene *)ptr->owner_id;
1908
1910
1911 if (scene->compositing_node_group) {
1913 }
1914}
1915
1916void rna_Scene_compositor_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1917{
1918 Scene *scene = (Scene *)ptr->owner_id;
1919
1920 if (scene->compositing_node_group) {
1921 bNodeTree *ntree = reinterpret_cast<bNodeTree *>(scene->compositing_node_group);
1924 BKE_main_ensure_invariants(*bmain, ntree->id);
1925 }
1926}
1927
1928void rna_Scene_use_view_map_cache_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1929{
1930# ifdef WITH_FREESTYLE
1932# endif
1933}
1934
1935void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value)
1936{
1937 Scene *scene = (Scene *)ptr->owner_id;
1938 ViewLayer *view_layer = (ViewLayer *)ptr->data;
1940 BKE_view_layer_rename(G_MAIN, scene, view_layer, value);
1941}
1942
1943static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value)
1944{
1945 Scene *scene = (Scene *)ptr->owner_id;
1946 SceneRenderView *rv = (SceneRenderView *)ptr->data;
1947 STRNCPY_UTF8(rv->name, value);
1948 BLI_uniquename(&scene->r.views,
1949 rv,
1950 DATA_("RenderView"),
1951 '.',
1953 sizeof(rv->name));
1954}
1955
1956void rna_ViewLayer_override_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1957{
1958 Scene *scene = (Scene *)ptr->owner_id;
1959 rna_Scene_render_update(bmain, scene, ptr);
1961}
1962
1963void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
1964{
1965 Scene *scene = (Scene *)ptr->owner_id;
1966
1967 ViewLayer *view_layer = nullptr;
1968 if (ptr->type == &RNA_ViewLayer) {
1969 view_layer = (ViewLayer *)ptr->data;
1970 }
1971 else if (ptr->type == &RNA_AOV) {
1972 ViewLayerAOV *aov = (ViewLayerAOV *)ptr->data;
1973 view_layer = BKE_view_layer_find_with_aov(scene, aov);
1974 }
1975 else if (ptr->type == &RNA_Lightgroup) {
1976 ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
1977 view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
1978 }
1979
1980 if (view_layer) {
1981 RenderEngineType *engine_type = RE_engines_find(scene->r.engine);
1982 if (engine_type->update_render_passes) {
1983 RenderEngine *engine = RE_engine_create(engine_type);
1984 if (engine) {
1985 BKE_view_layer_verify_aov(engine, scene, view_layer);
1986 }
1987 RE_engine_free(engine);
1988 engine = nullptr;
1989 }
1990 }
1991
1992 if (scene->compositing_node_group) {
1994 }
1995
1996 rna_Scene_render_update(bmain, activescene, ptr);
1997}
1998
1999static std::optional<std::string> rna_ViewLayerEEVEE_path(const PointerRNA *ptr)
2000{
2001 const ViewLayerEEVEE *view_layer_eevee = (ViewLayerEEVEE *)ptr->data;
2002 const ViewLayer *view_layer = (ViewLayer *)((uint8_t *)view_layer_eevee -
2003 offsetof(ViewLayer, eevee));
2004 char rna_path[sizeof(view_layer->name) * 3];
2005
2006 const size_t view_layer_path_len = rna_ViewLayer_path_buffer_get(
2007 view_layer, rna_path, sizeof(rna_path));
2008
2009 BLI_strncpy(rna_path + view_layer_path_len, ".eevee", sizeof(rna_path) - view_layer_path_len);
2010
2011 return rna_path;
2012}
2013
2014static void rna_SceneEEVEE_gi_cubemap_resolution_update(Main * /*main*/,
2015 Scene *scene,
2016 PointerRNA * /*ptr*/)
2017{
2018 /* Tag all light probes to recalc transform. This signals EEVEE to update the light probes. */
2019 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
2020 if (ob->type == OB_LIGHTPROBE) {
2022 }
2023 }
2025}
2026
2027static void rna_SceneEEVEE_clamp_surface_indirect_update(Main * /*main*/,
2028 Scene *scene,
2029 PointerRNA * /*ptr*/)
2030{
2031 /* Tag all light probes to recalc transform. This signals EEVEE to update the light probes. */
2032 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
2033 if (ob->type == OB_LIGHTPROBE) {
2035 }
2036 }
2038
2039 /* Also tag the world. */
2041}
2042
2043static void rna_SceneEEVEE_shadow_resolution_update(Main * /*bmain*/,
2044 Scene *scene,
2045 PointerRNA * /*ptr*/)
2046{
2047 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
2048 if (ob->type == OB_LAMP) {
2050 }
2051 }
2053
2057}
2058
2059static std::optional<std::string> rna_SceneRenderView_path(const PointerRNA *ptr)
2060{
2061 const SceneRenderView *srv = (SceneRenderView *)ptr->data;
2062 char srv_name_esc[sizeof(srv->name) * 2];
2063 BLI_str_escape(srv_name_esc, srv->name, sizeof(srv_name_esc));
2064 return fmt::format("render.views[\"{}\"]", srv_name_esc);
2065}
2066
2067static bool rna_Scene_use_nodes_get(PointerRNA * /*ptr*/)
2068{
2069 /* #use_nodes is deprecated. Always return true for consistency with Materials and World. */
2070 return true;
2071}
2072
2073static void rna_Scene_use_nodes_set(PointerRNA * /*ptr*/, const bool /*use_nodes*/)
2074{
2075 /* #use_nodes is deprecated. Setting the property has no effect.
2076 * Note: Users will get a warning through the RNA deprecation warning, so no need to log a
2077 * warning here. */
2078 return;
2079}
2080
2081static void rna_Physics_relations_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
2082{
2084}
2085
2086static void rna_Physics_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2087{
2088 Scene *scene = (Scene *)ptr->owner_id;
2089 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
2091 }
2093
2095}
2096
2097static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const bool *value)
2098{
2099 ToolSettings *ts = (ToolSettings *)ptr->data;
2100 const int selectmode = (value[0] ? SCE_SELECT_VERTEX : 0) | (value[1] ? SCE_SELECT_EDGE : 0) |
2101 (value[2] ? SCE_SELECT_FACE : 0);
2102
2103 if (selectmode) {
2104 ts->selectmode = selectmode;
2105
2106 /* Update select mode in all the workspaces in mesh edit mode. */
2107 wmWindowManager *wm = static_cast<wmWindowManager *>(G_MAIN->wm.first);
2108 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
2109 const Scene *scene = WM_window_get_active_scene(win);
2110 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
2111 if (view_layer) {
2112 BKE_view_layer_synced_ensure(scene, view_layer);
2113 Object *object = BKE_view_layer_active_object_get(view_layer);
2114 if (object && object->type == OB_MESH) {
2115 if (BMEditMesh *em = BKE_editmesh_from_object(object)) {
2116 if (em->selectmode != selectmode) {
2117 EDBM_selectmode_set(em, selectmode);
2118 }
2119 }
2120 }
2121 }
2122 }
2123 }
2124}
2125
2126static void rna_Scene_editmesh_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2127{
2128 const Scene *scene = CTX_data_scene(C);
2129 ViewLayer *view_layer = CTX_data_view_layer(C);
2130 Mesh *mesh = nullptr;
2131
2132 BKE_view_layer_synced_ensure(scene, view_layer);
2133 Object *object = BKE_view_layer_active_object_get(view_layer);
2134 if (object) {
2135 mesh = BKE_mesh_from_object(object);
2136 if (mesh && mesh->runtime->edit_mesh == nullptr) {
2137 mesh = nullptr;
2138 }
2139 }
2140
2141 if (mesh) {
2144 }
2145}
2146
2147static void rna_Scene_uv_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2148{
2149 /* Makes sure that the UV selection states are consistent with the current UV select mode and
2150 * sticky mode. */
2152}
2153
2154static void rna_Scene_uv_select_sync_update(bContext *C, PointerRNA * /*ptr*/)
2155{
2157}
2158
2159static void rna_Scene_uv_sticky_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2160{
2161 /* Some changes to sticky select mode require rebuilding. */
2163}
2164
2165static void object_simplify_update(Scene *scene,
2166 Object *ob,
2167 bool update_normals,
2168 Depsgraph *depsgraph)
2169{
2170 ModifierData *md;
2171 ParticleSystem *psys;
2172
2173 if ((ob->id.tag & ID_TAG_DOIT) == 0) {
2174 return;
2175 }
2176
2177 ob->id.tag &= ~ID_TAG_DOIT;
2178
2179 for (md = static_cast<ModifierData *>(ob->modifiers.first); md; md = md->next) {
2180 if (md->type == eModifierType_Nodes && depsgraph != nullptr) {
2181 Object *ob_eval = DEG_get_evaluated(depsgraph, ob);
2182 const blender::bke::GeometrySet *geometry_set = ob_eval->runtime->geometry_set_eval;
2183 if (geometry_set != nullptr && geometry_set->has_volume()) {
2185 }
2186 continue;
2187 }
2188 if (ELEM(
2190 {
2192 }
2193 }
2194
2195 for (psys = static_cast<ParticleSystem *>(ob->particlesystem.first); psys; psys = psys->next) {
2197 }
2198
2199 if (ob->instance_collection) {
2201 object_simplify_update(scene, ob_collection, update_normals, depsgraph);
2202 }
2204 }
2205
2206 if (ob->type == OB_VOLUME) {
2208 }
2209
2210 if (scene->r.mode & R_SIMPLIFY_NORMALS || update_normals) {
2211 if (OB_TYPE_IS_GEOMETRY(ob->type)) {
2213 }
2214 }
2215
2216 if (ob->type == OB_LAMP) {
2218 }
2219}
2220
2221static void rna_Scene_simplify_update_impl(Main *bmain,
2222 Scene *sce,
2223 bool update_normals,
2224 Depsgraph *depsgraph)
2225{
2226 Scene *sce_iter;
2227 Base *base;
2228
2230 FOREACH_SCENE_OBJECT_BEGIN (sce, ob) {
2231 object_simplify_update(sce, ob, update_normals, depsgraph);
2232 }
2234
2235 for (SETLOOPER_SET_ONLY(sce, sce_iter, base)) {
2236 object_simplify_update(sce, base->object, update_normals, depsgraph);
2237 }
2238
2242}
2243
2244static void rna_Scene_use_simplify_update(bContext *C, PointerRNA *ptr)
2245{
2246 Scene *scene = (Scene *)ptr->owner_id;
2247 Main *bmain = CTX_data_main(C);
2249 rna_Scene_simplify_update_impl(bmain, scene, false, depsgraph);
2250}
2251
2252static void rna_Scene_simplify_volume_update(bContext *C, PointerRNA *ptr)
2253{
2254 Scene *scene = (Scene *)ptr->owner_id;
2255 Main *bmain = CTX_data_main(C);
2257 if (scene->r.mode & R_SIMPLIFY) {
2258 rna_Scene_simplify_update_impl(bmain, scene, false, depsgraph);
2259 }
2260}
2261
2262static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
2263{
2264 if (scene->r.mode & R_SIMPLIFY) {
2265 rna_Scene_simplify_update_impl(bmain, scene, false, nullptr);
2266 }
2267}
2268
2269static void rna_Scene_use_simplify_normals_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
2270{
2271 /* NOTE: Ideally this would just force recalculation of the draw batch cache normals.
2272 * That's complicated enough to not be worth it here. */
2273 if (scene->r.mode & R_SIMPLIFY) {
2274 rna_Scene_simplify_update_impl(bmain, scene, true, nullptr);
2275 }
2276}
2277
2278static void rna_Scene_use_persistent_data_update(Main * /*bmain*/,
2279 Scene * /*scene*/,
2280 PointerRNA *ptr)
2281{
2282 Scene *scene = (Scene *)ptr->owner_id;
2283
2284 if (!(scene->r.mode & R_PERSISTENT_DATA)) {
2285 RE_FreePersistentData(scene);
2286 }
2287}
2288
2289/* Scene.transform_orientation_slots */
2290static void rna_Scene_transform_orientation_slots_begin(CollectionPropertyIterator *iter,
2291 PointerRNA *ptr)
2292{
2293 Scene *scene = (Scene *)ptr->owner_id;
2294 TransformOrientationSlot *orient_slot = &scene->orientation_slots[0];
2296 ptr,
2297 orient_slot,
2298 sizeof(*orient_slot),
2300 0,
2301 nullptr);
2302}
2303
2304static int rna_Scene_transform_orientation_slots_length(PointerRNA * /*ptr*/)
2305{
2306 return ARRAY_SIZE(((Scene *)nullptr)->orientation_slots);
2307}
2308
2309static bool rna_Scene_use_audio_get(PointerRNA *ptr)
2310{
2311 Scene *scene = (Scene *)ptr->data;
2312 return (scene->audio.flag & AUDIO_MUTE) == 0;
2313}
2314
2315static void rna_Scene_use_audio_set(PointerRNA *ptr, bool value)
2316{
2317 Scene *scene = (Scene *)ptr->data;
2318
2319 if (!value) {
2320 scene->audio.flag |= AUDIO_MUTE;
2321 }
2322 else {
2323 scene->audio.flag &= ~AUDIO_MUTE;
2324 }
2325}
2326
2327static void rna_Scene_use_audio_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2328{
2330}
2331
2332static int rna_Scene_sync_mode_get(PointerRNA *ptr)
2333{
2334 Scene *scene = (Scene *)ptr->data;
2335 if (scene->audio.flag & AUDIO_SYNC) {
2336 return AUDIO_SYNC;
2337 }
2338 return scene->flag & SCE_FRAME_DROP;
2339}
2340
2341static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
2342{
2343 Scene *scene = (Scene *)ptr->data;
2344
2345 if (value == AUDIO_SYNC) {
2346 scene->audio.flag |= AUDIO_SYNC;
2347 }
2348 else if (value == SCE_FRAME_DROP) {
2349 scene->audio.flag &= ~AUDIO_SYNC;
2350 scene->flag |= SCE_FRAME_DROP;
2351 }
2352 else {
2353 scene->audio.flag &= ~AUDIO_SYNC;
2354 scene->flag &= ~SCE_FRAME_DROP;
2355 }
2356}
2357
2358static void rna_View3DCursor_rotation_mode_set(PointerRNA *ptr, int value)
2359{
2360 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2361
2362 /* use API Method for conversions... */
2364 cursor->rotation_euler,
2365 cursor->rotation_axis,
2366 &cursor->rotation_angle,
2367 cursor->rotation_mode,
2368 short(value));
2369
2370 /* finally, set the new rotation type */
2371 cursor->rotation_mode = value;
2372}
2373
2374static void rna_View3DCursor_rotation_axis_angle_get(PointerRNA *ptr, float *value)
2375{
2376 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2377 value[0] = cursor->rotation_angle;
2378 copy_v3_v3(&value[1], cursor->rotation_axis);
2379}
2380
2381static void rna_View3DCursor_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
2382{
2383 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2384 cursor->rotation_angle = value[0];
2385 copy_v3_v3(cursor->rotation_axis, &value[1]);
2386}
2387
2388static void rna_View3DCursor_matrix_get(PointerRNA *ptr, float *values)
2389{
2390 const View3DCursor *cursor = static_cast<const View3DCursor *>(ptr->data);
2391 copy_m4_m4((float (*)[4])values, cursor->matrix<blender::float4x4>().ptr());
2392}
2393
2394static void rna_View3DCursor_matrix_set(PointerRNA *ptr, const float *values)
2395{
2396 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2397 float unit_mat[4][4];
2398 normalize_m4_m4(unit_mat, (const float (*)[4])values);
2399 cursor->set_matrix(blender::float4x4(unit_mat), false);
2400}
2401
2402static std::optional<std::string> rna_TransformOrientationSlot_path(const PointerRNA *ptr)
2403{
2404 const Scene *scene = (Scene *)ptr->owner_id;
2405 const TransformOrientationSlot *orientation_slot = static_cast<const TransformOrientationSlot *>(
2406 ptr->data);
2407
2408 if (!ELEM(nullptr, scene, orientation_slot)) {
2409 for (int i = 0; i < ARRAY_SIZE(scene->orientation_slots); i++) {
2410 if (&scene->orientation_slots[i] == orientation_slot) {
2411 return fmt::format("transform_orientation_slots[{}]", i);
2412 }
2413 }
2414 }
2415
2416 /* Should not happen, but in case, just return default path. */
2418 return "transform_orientation_slots[0]";
2419}
2420
2421static std::optional<std::string> rna_View3DCursor_path(const PointerRNA * /*ptr*/)
2422{
2423 return "cursor";
2424}
2425
2426static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[], int frame)
2427{
2428 TimeMarker *marker = MEM_callocN<TimeMarker>("TimeMarker");
2429 marker->flag = SELECT;
2430 marker->frame = frame;
2431 STRNCPY_UTF8(marker->name, name);
2432 BLI_addtail(&scene->markers, marker);
2433
2436
2437 return marker;
2438}
2439
2440static void rna_TimeLine_remove(Scene *scene, ReportList *reports, PointerRNA *marker_ptr)
2441{
2442 TimeMarker *marker = static_cast<TimeMarker *>(marker_ptr->data);
2443 if (BLI_remlink_safe(&scene->markers, marker) == false) {
2444 BKE_reportf(reports,
2445 RPT_ERROR,
2446 "Timeline marker '%s' not found in scene '%s'",
2447 marker->name,
2448 scene->id.name + 2);
2449 return;
2450 }
2451
2452 MEM_freeN(marker);
2453 marker_ptr->invalidate();
2454
2457}
2458
2459static void rna_TimeLine_clear(Scene *scene)
2460{
2461 BLI_freelistN(&scene->markers);
2462
2465}
2466
2467static std::optional<std::string> rna_Scene_KeyingsSetsAll_path(const PointerRNA * /*ptr*/)
2468{
2469 return "keying_sets_all";
2470}
2471
2472static KeyingSet *rna_Scene_keying_set_new(Scene *sce,
2473 ReportList *reports,
2474 const char idname[],
2475 const char name[])
2476{
2477 KeyingSet *ks = nullptr;
2478
2479 /* call the API func, and set the active keyingset index */
2480 ks = BKE_keyingset_add(&sce->keyingsets, idname, name, KEYINGSET_ABSOLUTE, 0);
2481
2482 if (ks) {
2484 return ks;
2485 }
2486 else {
2487 BKE_report(reports, RPT_ERROR, "Keying set could not be added");
2488 return nullptr;
2489 }
2490}
2491
2492static std::optional<std::string> rna_CurvePaintSettings_path(const PointerRNA * /*ptr*/)
2493{
2494 return "tool_settings.curve_paint_settings";
2495}
2496
2497static std::optional<std::string> rna_SequencerToolSettings_path(const PointerRNA * /*ptr*/)
2498{
2499 return "tool_settings.sequencer_tool_settings";
2500}
2501
2502/* generic function to recalc geometry */
2503static void rna_EditMesh_update(bContext *C, PointerRNA * /*ptr*/)
2504{
2505 const Scene *scene = CTX_data_scene(C);
2506 ViewLayer *view_layer = CTX_data_view_layer(C);
2507 BKE_view_layer_synced_ensure(scene, view_layer);
2508
2510 scene, view_layer, CTX_wm_view3d(C));
2511 for (Object *obedit : objects) {
2512 Mesh *mesh = BKE_mesh_from_object(obedit);
2513
2516 }
2517}
2518
2519static std::optional<std::string> rna_MeshStatVis_path(const PointerRNA * /*ptr*/)
2520{
2521 return "tool_settings.statvis";
2522}
2523
2524/* NOTE: without this, when Multi-Paint is activated/deactivated, the colors
2525 * will not change right away when multiple bones are selected, this function
2526 * is not for general use and only for the few cases where changing scene
2527 * settings and NOT for general purpose updates, possibly this should be
2528 * given its own notifier. */
2529static void rna_Scene_update_active_object_data(bContext *C, PointerRNA * /*ptr*/)
2530{
2531 const Scene *scene = CTX_data_scene(C);
2532 ViewLayer *view_layer = CTX_data_view_layer(C);
2533 BKE_view_layer_synced_ensure(scene, view_layer);
2534 Object *ob = BKE_view_layer_active_object_get(view_layer);
2535
2536 if (ob) {
2539 }
2540}
2541
2542static void rna_SceneCamera_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2543{
2544 Scene *scene = (Scene *)ptr->owner_id;
2545 Object *camera = scene->camera;
2546
2548
2549 if (camera && (camera->type == OB_CAMERA)) {
2551 }
2552}
2553
2554static void rna_SceneSequencer_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2555{
2557}
2558
2559static std::optional<std::string> rna_ToolSettings_path(const PointerRNA * /*ptr*/)
2560{
2561 return "tool_settings";
2562}
2563
2565{
2566 FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
2567
2568 return RNA_id_pointer_create(reinterpret_cast<ID *>(lineset->linestyle));
2569}
2570
2572 PointerRNA value,
2573 ReportList * /*reports*/)
2574{
2575 FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
2576
2577 if (lineset->linestyle) {
2578 id_us_min(&lineset->linestyle->id);
2579 }
2580 lineset->linestyle = (FreestyleLineStyle *)value.data;
2581 id_us_plus(&lineset->linestyle->id);
2582}
2583
2585 FreestyleSettings *config,
2586 Main *bmain,
2587 const char *name)
2588{
2589 Scene *scene = (Scene *)id;
2590 FreestyleLineSet *lineset = BKE_freestyle_lineset_add(bmain, (FreestyleConfig *)config, name);
2591
2594
2595 return lineset;
2596}
2597
2599 FreestyleSettings *config,
2600 ReportList *reports,
2601 PointerRNA *lineset_ptr)
2602{
2603 FreestyleLineSet *lineset = static_cast<FreestyleLineSet *>(lineset_ptr->data);
2604 Scene *scene = (Scene *)id;
2605
2606 if (!BKE_freestyle_lineset_delete((FreestyleConfig *)config, lineset)) {
2607 BKE_reportf(reports, RPT_ERROR, "Line set '%s' could not be removed", lineset->name);
2608 return;
2609 }
2610
2611 lineset_ptr->invalidate();
2612
2615}
2616
2618{
2619 FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2621 return RNA_pointer_create_with_parent(*ptr, &RNA_FreestyleLineSet, lineset);
2622}
2623
2625 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2626{
2627 FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2628
2629 *min = 0;
2630 *max = max_ii(0, BLI_listbase_count(&config->linesets) - 1);
2631}
2632
2634{
2635 FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2637}
2638
2640{
2641 FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2643}
2644
2646{
2647 Scene *scene = (Scene *)id;
2649
2652
2653 return module;
2654}
2655
2657 FreestyleSettings *config,
2658 ReportList *reports,
2659 PointerRNA *module_ptr)
2660{
2661 Scene *scene = (Scene *)id;
2662 FreestyleModuleConfig *module = static_cast<FreestyleModuleConfig *>(module_ptr->data);
2663
2665 if (module->script) {
2666 BKE_reportf(reports,
2667 RPT_ERROR,
2668 "Style module '%s' could not be removed",
2669 module->script->id.name + 2);
2670 }
2671 else {
2672 BKE_report(reports, RPT_ERROR, "Style module could not be removed");
2673 }
2674 return;
2675 }
2676
2677 module_ptr->invalidate();
2678
2681}
2682
2683static void rna_Stereo3dFormat_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
2684{
2685 ID *id = ptr->owner_id;
2686
2687 if (id && GS(id->name) == ID_IM) {
2688 Image *ima = (Image *)id;
2689 ImBuf *ibuf;
2690 void *lock;
2691
2692 if (!BKE_image_is_stereo(ima)) {
2693 return;
2694 }
2695
2696 ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
2697
2698 if (ibuf) {
2699 BKE_image_signal(bmain, ima, nullptr, IMA_SIGNAL_FREE);
2700 }
2701 BKE_image_release_ibuf(ima, ibuf, lock);
2702 }
2703}
2704
2705static ViewLayer *rna_ViewLayer_new(ID *id, Scene * /*sce*/, Main *bmain, const char *name)
2706{
2707 Scene *scene = (Scene *)id;
2708 ViewLayer *view_layer = BKE_view_layer_add(scene, name, nullptr, VIEWLAYER_ADD_NEW);
2709
2713
2714 return view_layer;
2715}
2716
2717static void rna_ViewLayer_remove(
2718 ID *id, Scene * /*sce*/, Main *bmain, ReportList *reports, PointerRNA *sl_ptr)
2719{
2720 Scene *scene = (Scene *)id;
2721 ViewLayer *view_layer = static_cast<ViewLayer *>(sl_ptr->data);
2722
2723 if (ED_scene_view_layer_delete(bmain, scene, view_layer, reports)) {
2724 sl_ptr->invalidate();
2725 }
2726}
2727
2728static void rna_ViewLayer_move(
2729 ID *id, Scene * /*sce*/, Main *bmain, ReportList *reports, int from, int to)
2730{
2731 if (from == to) {
2732 return;
2733 }
2734
2735 Scene *scene = (Scene *)id;
2736
2737 if (!BLI_listbase_move_index(&scene->view_layers, from, to)) {
2738 BKE_reportf(reports, RPT_ERROR, "Could not move layer from index '%d' to '%d'", from, to);
2739 return;
2740 }
2741
2745}
2746
2748 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2749{
2750 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2751
2752 *min = 0;
2753 *max = max_ii(0, BLI_listbase_count(&view_layer->aovs) - 1);
2754}
2755
2757{
2758 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2759 return BLI_findindex(&view_layer->aovs, view_layer->active_aov);
2760}
2761
2763{
2764 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2765 ViewLayerAOV *aov = static_cast<ViewLayerAOV *>(BLI_findlink(&view_layer->aovs, value));
2766 view_layer->active_aov = aov;
2767}
2768
2770 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2771{
2772 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2773
2774 *min = 0;
2775 *max = max_ii(0, BLI_listbase_count(&view_layer->lightgroups) - 1);
2776}
2777
2779{
2780 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2781 return BLI_findindex(&view_layer->lightgroups, view_layer->active_lightgroup);
2782}
2783
2785{
2786 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2787 ViewLayerLightgroup *lightgroup = static_cast<ViewLayerLightgroup *>(
2788 BLI_findlink(&view_layer->lightgroups, value));
2789 view_layer->active_lightgroup = lightgroup;
2790}
2791
2792static void rna_ViewLayerLightgroup_name_get(PointerRNA *ptr, char *value)
2793{
2794 ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
2795 strcpy(value, lightgroup->name);
2796}
2797
2798static int rna_ViewLayerLightgroup_name_length(PointerRNA *ptr)
2799{
2800 ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
2801 return strlen(lightgroup->name);
2802}
2803
2804static void rna_ViewLayerLightgroup_name_set(PointerRNA *ptr, const char *value)
2805{
2806 ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
2807 Scene *scene = (Scene *)ptr->owner_id;
2808 ViewLayer *view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
2809
2810 BKE_view_layer_rename_lightgroup(scene, view_layer, lightgroup, value);
2811}
2812
2813/* Fake value, used internally (not saved to DNA). */
2814# define V3D_ORIENT_DEFAULT -1
2815
2816static int rna_TransformOrientationSlot_type_get(PointerRNA *ptr)
2817{
2818 Scene *scene = (Scene *)ptr->owner_id;
2819 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2820 if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2821 if ((orient_slot->flag & SELECT) == 0) {
2822 return V3D_ORIENT_DEFAULT;
2823 }
2824 }
2825 return BKE_scene_orientation_slot_get_index(orient_slot);
2826}
2827
2828void rna_TransformOrientationSlot_type_set(PointerRNA *ptr, int value)
2829{
2830 Scene *scene = (Scene *)ptr->owner_id;
2831 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2832
2833 if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2834 if (value == V3D_ORIENT_DEFAULT) {
2835 orient_slot->flag &= ~SELECT;
2836 return;
2837 }
2838 else {
2839 orient_slot->flag |= SELECT;
2840 }
2841 }
2842
2843 BKE_scene_orientation_slot_set_index(orient_slot, value);
2844}
2845
2846static PointerRNA rna_TransformOrientationSlot_get(PointerRNA *ptr)
2847{
2848 Scene *scene = (Scene *)ptr->owner_id;
2849 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2850 TransformOrientation *orientation;
2851 if (orient_slot->type < V3D_ORIENT_CUSTOM) {
2852 orientation = nullptr;
2853 }
2854 else {
2855 orientation = BKE_scene_transform_orientation_find(scene, orient_slot->index_custom);
2856 }
2857 return RNA_pointer_create_with_parent(*ptr, &RNA_TransformOrientation, orientation);
2858}
2859
2860static const EnumPropertyItem *rna_TransformOrientation_impl_itemf(Scene *scene,
2861 const bool include_default,
2862 bool *r_free)
2863{
2864 EnumPropertyItem tmp = {0, "", 0, "", ""};
2865 EnumPropertyItem *item = nullptr;
2866 int i = V3D_ORIENT_CUSTOM, totitem = 0;
2867
2868 if (include_default) {
2869 tmp.identifier = "DEFAULT";
2870 tmp.name = N_("Default");
2871 tmp.description = N_("Use the scene orientation");
2872 tmp.value = V3D_ORIENT_DEFAULT;
2873 tmp.icon = ICON_OBJECT_ORIGIN;
2874 RNA_enum_item_add(&item, &totitem, &tmp);
2875 tmp.icon = 0;
2876
2877 RNA_enum_item_add_separator(&item, &totitem);
2878 }
2879
2881
2882 const ListBase *transform_orientations = scene ? &scene->transform_spaces : nullptr;
2883
2884 if (transform_orientations && (BLI_listbase_is_empty(transform_orientations) == false)) {
2885 RNA_enum_item_add_separator(&item, &totitem);
2886
2887 LISTBASE_FOREACH (TransformOrientation *, ts, transform_orientations) {
2888 tmp.identifier = ts->name;
2889 tmp.name = ts->name;
2890 tmp.value = i++;
2891 RNA_enum_item_add(&item, &totitem, &tmp);
2892 }
2893 }
2894
2895 RNA_enum_item_end(&item, &totitem);
2896 *r_free = true;
2897
2898 return item;
2899}
2901 PointerRNA *ptr,
2902 PropertyRNA * /*prop*/,
2903 bool *r_free)
2904{
2905 if (C == nullptr) {
2907 }
2908
2909 Scene *scene;
2910 if (ptr->owner_id && (GS(ptr->owner_id->name) == ID_SCE)) {
2911 scene = (Scene *)ptr->owner_id;
2912 }
2913 else {
2914 scene = CTX_data_scene(C);
2915 }
2916 return rna_TransformOrientation_impl_itemf(scene, false, r_free);
2917}
2918
2919const EnumPropertyItem *rna_TransformOrientation_with_scene_itemf(bContext *C,
2920 PointerRNA *ptr,
2921 PropertyRNA * /*prop*/,
2922 bool *r_free)
2923{
2924 if (C == nullptr) {
2926 }
2927
2928 Scene *scene = (Scene *)ptr->owner_id;
2929 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2930 bool include_default = (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]);
2931 return rna_TransformOrientation_impl_itemf(scene, include_default, r_free);
2932}
2933
2934# undef V3D_ORIENT_DEFAULT
2935
2936static const EnumPropertyItem *rna_UnitSettings_itemf_wrapper(const int system,
2937 const int type,
2938 bool *r_free)
2939{
2940 const void *usys;
2941 int len;
2942 BKE_unit_system_get(system, type, &usys, &len);
2943
2944 EnumPropertyItem *items = nullptr;
2945 int totitem = 0;
2946
2947 EnumPropertyItem adaptive = {0};
2948 adaptive.identifier = "ADAPTIVE";
2949 adaptive.name = N_("Adaptive");
2950 adaptive.value = USER_UNIT_ADAPTIVE;
2951 RNA_enum_item_add(&items, &totitem, &adaptive);
2952
2953 for (int i = 0; i < len; i++) {
2954 if (!BKE_unit_is_suppressed(usys, i)) {
2955 EnumPropertyItem tmp = {0};
2957 tmp.name = BKE_unit_display_name_get(usys, i);
2958 tmp.value = i;
2959 RNA_enum_item_add(&items, &totitem, &tmp);
2960 }
2961 }
2962
2963 RNA_enum_item_end(&items, &totitem);
2964 *r_free = true;
2965
2966 return items;
2967}
2968
2969const EnumPropertyItem *rna_UnitSettings_length_unit_itemf(bContext * /*C*/,
2970 PointerRNA *ptr,
2971 PropertyRNA * /*prop*/,
2972 bool *r_free)
2973{
2974 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2975 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_LENGTH, r_free);
2976}
2977
2978const EnumPropertyItem *rna_UnitSettings_mass_unit_itemf(bContext * /*C*/,
2979 PointerRNA *ptr,
2980 PropertyRNA * /*prop*/,
2981 bool *r_free)
2982{
2983 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2984 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_MASS, r_free);
2985}
2986
2987const EnumPropertyItem *rna_UnitSettings_time_unit_itemf(bContext * /*C*/,
2988 PointerRNA *ptr,
2989 PropertyRNA * /*prop*/,
2990 bool *r_free)
2991{
2992 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2993 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TIME, r_free);
2994}
2995
2996const EnumPropertyItem *rna_UnitSettings_temperature_unit_itemf(bContext * /*C*/,
2997 PointerRNA *ptr,
2998 PropertyRNA * /*prop*/,
2999 bool *r_free)
3000{
3001 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
3002 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TEMPERATURE, r_free);
3003}
3004
3005static void rna_UnitSettings_system_update(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
3006{
3007 UnitSettings *unit = &scene->unit;
3008 if (unit->system == USER_UNIT_NONE) {
3011 }
3012 else {
3015 }
3016}
3017
3018static std::optional<std::string> rna_UnitSettings_path(const PointerRNA * /*ptr*/)
3019{
3020 return "unit_settings";
3021}
3022
3023static std::optional<std::string> rna_FFmpegSettings_path(const PointerRNA * /*ptr*/)
3024{
3025 return "render.ffmpeg";
3026}
3027
3028# ifdef WITH_FFMPEG
3029/* FFMpeg Codec setting update hook. */
3030static void rna_FFmpegSettings_codec_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
3031{
3032 FFMpegCodecData *codec_data = (FFMpegCodecData *)ptr->data;
3033 if (!MOV_codec_supports_crf(codec_data->codec_id_get())) {
3034 /* Constant Rate Factor (CRF) setting is only available for some codecs. Change encoder quality
3035 * mode to CBR for others. */
3036 codec_data->constant_rate_factor = FFM_CRF_NONE;
3037 }
3038
3039 /* Ensure valid color depth when changing the codec. */
3040 const ID *id = ptr->owner_id;
3041 const bool is_render = (id && GS(id->name) == ID_SCE);
3042 if (is_render) {
3043 Scene *scene = (Scene *)ptr->owner_id;
3044 const int valid_depths = BKE_imtype_valid_depths_with_video(scene->r.im_format.imtype, id);
3045 if ((scene->r.im_format.depth & valid_depths) == 0) {
3046 scene->r.im_format.depth = BKE_imtype_first_valid_depth(valid_depths);
3047 }
3048 }
3049}
3050# endif
3051
3052#else
3053
3054/* Grease Pencil Interpolation tool settings */
3056{
3057 StructRNA *srna;
3058 PropertyRNA *prop;
3059
3060 srna = RNA_def_struct(brna, "GPencilInterpolateSettings", nullptr);
3061 RNA_def_struct_sdna(srna, "GP_Interpolate_Settings");
3063 "Grease Pencil Interpolate Settings",
3064 "Settings for Grease Pencil interpolation tools");
3066
3067 /* Custom curve-map. */
3068 prop = RNA_def_property(srna, "interpolation_curve", PROP_POINTER, PROP_NONE);
3069 RNA_def_property_pointer_sdna(prop, nullptr, "custom_ipo");
3070 RNA_def_property_struct_type(prop, "CurveMapping");
3072 prop,
3073 "Interpolation Curve",
3074 "Custom curve to control 'sequence' interpolation between Grease Pencil frames");
3075}
3076
3078{
3079 StructRNA *srna;
3080 PropertyRNA *prop;
3081
3082 srna = RNA_def_struct(brna, "TransformOrientation", nullptr);
3083
3084 prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
3085 RNA_def_property_float_sdna(prop, nullptr, "mat");
3088
3089 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
3090 RNA_def_struct_name_property(srna, prop);
3091 RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation");
3093}
3094
3096{
3097 StructRNA *srna;
3098 PropertyRNA *prop;
3099
3100 srna = RNA_def_struct(brna, "TransformOrientationSlot", nullptr);
3101 RNA_def_struct_sdna(srna, "TransformOrientationSlot");
3102 RNA_def_struct_path_func(srna, "rna_TransformOrientationSlot_path");
3103 RNA_def_struct_ui_text(srna, "Orientation Slot", "");
3104
3105 /* Orientations */
3106 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3109 "rna_TransformOrientationSlot_type_get",
3110 "rna_TransformOrientationSlot_type_set",
3111 "rna_TransformOrientation_with_scene_itemf");
3112 RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
3114
3115 prop = RNA_def_property(srna, "custom_orientation", PROP_POINTER, PROP_NONE);
3116 RNA_def_property_struct_type(prop, "TransformOrientation");
3118 prop, "rna_TransformOrientationSlot_get", nullptr, nullptr, nullptr);
3119 RNA_def_property_ui_text(prop, "Current Transform Orientation", "");
3120
3121 /* flag */
3122 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
3123 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SELECT);
3124 RNA_def_property_ui_text(prop, "Use", "Use scene orientation instead of a custom setting");
3126}
3127
3129{
3130 StructRNA *srna;
3131 PropertyRNA *prop;
3132
3133 srna = RNA_def_struct(brna, "View3DCursor", nullptr);
3134 RNA_def_struct_sdna(srna, "View3DCursor");
3135 RNA_def_struct_path_func(srna, "rna_View3DCursor_path");
3136 RNA_def_struct_ui_text(srna, "3D Cursor", "");
3137 RNA_def_struct_ui_icon(srna, ICON_CURSOR);
3139
3140 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ_LENGTH);
3142 RNA_def_property_float_sdna(prop, nullptr, "location");
3143 RNA_def_property_ui_text(prop, "Location", "");
3144 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
3145 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3146
3147 prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
3149 RNA_def_property_float_sdna(prop, nullptr, "rotation_quaternion");
3151 prop, "Quaternion Rotation", "Rotation in quaternions (keep normalized)");
3152 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3153
3154 prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
3156 RNA_def_property_array(prop, 4);
3158 "rna_View3DCursor_rotation_axis_angle_get",
3159 "rna_View3DCursor_rotation_axis_angle_set",
3160 nullptr);
3163 prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
3164 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3165
3166 prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
3168 RNA_def_property_float_sdna(prop, nullptr, "rotation_euler");
3169 RNA_def_property_ui_text(prop, "Euler Rotation", "3D rotation");
3171 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3172
3173 prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
3175 RNA_def_property_enum_sdna(prop, nullptr, "rotation_mode");
3177 RNA_def_property_enum_funcs(prop, nullptr, "rna_View3DCursor_rotation_mode_set", nullptr);
3179 prop,
3180 "Rotation Mode",
3181 /* This description is shared by other "rotation_mode" properties. */
3182 "The kind of rotation to apply, values from other rotation modes are not used");
3183 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3184
3185 /* Matrix access to avoid having to check current rotation mode. */
3186 prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
3188 RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */
3190 prop, "Transform Matrix", "Matrix combining location and rotation of the cursor");
3192 prop, "rna_View3DCursor_matrix_get", "rna_View3DCursor_matrix_set", nullptr);
3193 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3194}
3195
3197{
3198 StructRNA *srna;
3199 PropertyRNA *prop;
3200
3201 /* the construction of this enum is quite special - everything is stored as bitflags,
3202 * with 1st position only for on/off (and exposed as boolean), while others are mutually
3203 * exclusive options but which will only have any effect when autokey is enabled
3204 */
3205 static const EnumPropertyItem auto_key_items[] = {
3206 {AUTOKEY_MODE_NORMAL & ~AUTOKEY_ON, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
3207 {AUTOKEY_MODE_EDITKEYS & ~AUTOKEY_ON, "REPLACE_KEYS", 0, "Replace", ""},
3208 {0, nullptr, 0, nullptr, nullptr},
3209 };
3210
3211 static const EnumPropertyItem draw_groupuser_items[] = {
3212 {OB_DRAW_GROUPUSER_NONE, "NONE", 0, "None", ""},
3214 "ACTIVE",
3215 0,
3216 "Active",
3217 "Show vertices with no weights in the active group"},
3218 {OB_DRAW_GROUPUSER_ALL, "ALL", 0, "All", "Show vertices with no weights in any group"},
3219 {0, nullptr, 0, nullptr, nullptr},
3220 };
3221
3222 static const EnumPropertyItem vertex_group_select_items[] = {
3223 {WT_VGROUP_ALL, "ALL", 0, "All", "All Vertex Groups"},
3225 "BONE_DEFORM",
3226 0,
3227 "Deform",
3228 "Vertex Groups assigned to Deform Bones"},
3230 "OTHER_DEFORM",
3231 0,
3232 "Other",
3233 "Vertex Groups assigned to non Deform Bones"},
3234 {0, nullptr, 0, nullptr, nullptr},
3235 };
3236
3237 static const EnumPropertyItem gpencil_stroke_placement_items[] = {
3239 "ORIGIN",
3240 ICON_OBJECT_ORIGIN,
3241 "Origin",
3242 "Draw stroke at Object origin"},
3244 "CURSOR",
3245 ICON_PIVOT_CURSOR,
3246 "3D Cursor",
3247 "Draw stroke at 3D cursor location"},
3249 "SURFACE",
3250 ICON_SNAP_FACE,
3251 "Surface",
3252 "Stick stroke to surfaces"},
3254 "STROKE",
3255 ICON_STROKE,
3256 "Stroke",
3257 "Stick stroke to other strokes"},
3258 {0, nullptr, 0, nullptr, nullptr},
3259 };
3260
3261 static const EnumPropertyItem gpencil_stroke_snap_items[] = {
3262 {0, "NONE", 0, "All Points", "Snap to all points"},
3264 "ENDS",
3265 0,
3266 "End Points",
3267 "Snap to first and last points and interpolate"},
3268 {GP_PROJECT_DEPTH_STROKE_FIRST, "FIRST", 0, "First Point", "Snap to first point"},
3269 {0, nullptr, 0, nullptr, nullptr},
3270 };
3271
3272 static const EnumPropertyItem annotation_stroke_placement_view2d_items[] = {
3274 "IMAGE",
3275 ICON_IMAGE_DATA,
3276 "Image",
3277 "Stick stroke to the image"},
3278 /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
3279 {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
3280 {0, nullptr, 0, nullptr, nullptr},
3281 };
3282
3283 static const EnumPropertyItem annotation_stroke_placement_view3d_items[] = {
3285 "CURSOR",
3286 ICON_PIVOT_CURSOR,
3287 "3D Cursor",
3288 "Draw stroke at 3D cursor location"},
3289 /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
3290 {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
3292 "SURFACE",
3293 ICON_FACESEL,
3294 "Surface",
3295 "Stick stroke to surfaces"},
3296 {0, nullptr, 0, nullptr, nullptr},
3297 };
3298
3299 static const EnumPropertyItem uv_sticky_mode_items[] = {
3301 "DISABLED",
3302 ICON_STICKY_UVS_DISABLE,
3303 "Disabled",
3304 "Sticky vertex selection disabled"},
3306 "SHARED_LOCATION",
3307 ICON_STICKY_UVS_LOC,
3308 "Shared Location",
3309 "Select UVs that are at the same location and share a mesh vertex"},
3311 "SHARED_VERTEX",
3312 ICON_STICKY_UVS_VERT,
3313 "Shared Vertex",
3314 "Select UVs that share a mesh vertex, whether or not they are at the same location"},
3315 {0, nullptr, 0, nullptr, nullptr},
3316 };
3317
3318 srna = RNA_def_struct(brna, "ToolSettings", nullptr);
3319 RNA_def_struct_path_func(srna, "rna_ToolSettings_path");
3320 RNA_def_struct_ui_text(srna, "Tool Settings", "");
3321 /*
3322 * `STRUCT_UNDO` only applies to the top level attributes and not nested structs, any struct
3323 * contained within the `ToolSettings` struct should also clear this flag to avoid pushing empty
3324 * undo steps.
3325 */
3327
3328 prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
3329 RNA_def_property_struct_type(prop, "Sculpt");
3330 RNA_def_property_ui_text(prop, "Sculpt", "");
3331
3332 prop = RNA_def_property(srna, "curves_sculpt", PROP_POINTER, PROP_NONE);
3333 RNA_def_property_struct_type(prop, "CurvesSculpt");
3334 RNA_def_property_ui_text(prop, "Curves Sculpt", "");
3335
3336 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
3338 RNA_def_property_boolean_sdna(prop, nullptr, "auto_normalize", 1);
3340 "Weight Paint Auto-Normalize",
3341 "Ensure all bone-deforming vertex groups add up "
3342 "to 1.0 while weight painting or assigning to vertices");
3343 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3344
3345 prop = RNA_def_property(srna, "use_lock_relative", PROP_BOOLEAN, PROP_NONE);
3347 RNA_def_property_boolean_sdna(prop, nullptr, "wpaint_lock_relative", 1);
3349 "Weight Paint Lock-Relative",
3350 "Display bone-deforming groups as if all locked deform groups "
3351 "were deleted, and the remaining ones were re-normalized");
3352 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3353
3354 prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
3356 RNA_def_property_boolean_sdna(prop, nullptr, "multipaint", 1);
3358 "Weight Paint Multi-Paint",
3359 "Paint across the weights of all selected bones, "
3360 "maintaining their relative influence");
3361 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3362
3363 prop = RNA_def_property(srna, "vertex_group_user", PROP_ENUM, PROP_NONE);
3365 RNA_def_property_enum_sdna(prop, nullptr, "weightuser");
3366 RNA_def_property_enum_items(prop, draw_groupuser_items);
3368 RNA_def_property_ui_text(prop, "Mask Non-Group Vertices", "Display unweighted vertices");
3369 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3370
3371 prop = RNA_def_property(srna, "vertex_group_subset", PROP_ENUM, PROP_NONE);
3373 RNA_def_property_enum_sdna(prop, nullptr, "vgroupsubset");
3374 RNA_def_property_enum_items(prop, vertex_group_select_items);
3375 RNA_def_property_ui_text(prop, "Subset", "Filter Vertex groups for Display");
3376 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3377
3378 prop = RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
3379 RNA_def_property_pointer_sdna(prop, nullptr, "vpaint");
3380 RNA_def_property_ui_text(prop, "Vertex Paint", "");
3381
3382 prop = RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
3383 RNA_def_property_pointer_sdna(prop, nullptr, "wpaint");
3384 RNA_def_property_ui_text(prop, "Weight Paint", "");
3385
3386 prop = RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
3387 RNA_def_property_pointer_sdna(prop, nullptr, "imapaint");
3388 RNA_def_property_ui_text(prop, "Image Paint", "");
3389
3390 prop = RNA_def_property(srna, "paint_mode", PROP_POINTER, PROP_NONE);
3391 RNA_def_property_pointer_sdna(prop, nullptr, "paint_mode");
3392 RNA_def_property_ui_text(prop, "Paint Mode", "");
3393
3394 prop = RNA_def_property(srna, "uv_sculpt", PROP_POINTER, PROP_NONE);
3395 RNA_def_property_pointer_sdna(prop, nullptr, "uvsculpt");
3396 RNA_def_property_ui_text(prop, "UV Sculpt", "");
3397
3398 prop = RNA_def_property(srna, "gpencil_paint", PROP_POINTER, PROP_NONE);
3399 RNA_def_property_pointer_sdna(prop, nullptr, "gp_paint");
3400 RNA_def_property_ui_text(prop, "Grease Pencil Paint", "");
3401
3402 prop = RNA_def_property(srna, "gpencil_vertex_paint", PROP_POINTER, PROP_NONE);
3403 RNA_def_property_pointer_sdna(prop, nullptr, "gp_vertexpaint");
3404 RNA_def_property_ui_text(prop, "Grease Pencil Vertex Paint", "");
3405
3406 prop = RNA_def_property(srna, "gpencil_sculpt_paint", PROP_POINTER, PROP_NONE);
3407 RNA_def_property_pointer_sdna(prop, nullptr, "gp_sculptpaint");
3408 RNA_def_property_ui_text(prop, "Grease Pencil Sculpt Paint", "");
3409
3410 prop = RNA_def_property(srna, "gpencil_weight_paint", PROP_POINTER, PROP_NONE);
3411 RNA_def_property_pointer_sdna(prop, nullptr, "gp_weightpaint");
3412 RNA_def_property_ui_text(prop, "Grease Pencil Weight Paint", "");
3413
3414 prop = RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
3415 RNA_def_property_pointer_sdna(prop, nullptr, "particle");
3416 RNA_def_property_ui_text(prop, "Particle Edit", "");
3417
3418 prop = RNA_def_property(srna, "uv_sculpt_lock_borders", PROP_BOOLEAN, PROP_NONE);
3419 RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_LOCK_BORDERS);
3421 RNA_def_property_ui_text(prop, "Lock Borders", "Disable editing of boundary edges");
3422
3423 prop = RNA_def_property(srna, "uv_sculpt_all_islands", PROP_BOOLEAN, PROP_NONE);
3424 RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_ALL_ISLANDS);
3426 RNA_def_property_ui_text(prop, "Sculpt All Islands", "Brush operates on all islands");
3427
3428 prop = RNA_def_property(srna, "lock_object_mode", PROP_BOOLEAN, PROP_NONE);
3429 RNA_def_property_boolean_sdna(prop, nullptr, "object_flag", SCE_OBJECT_MODE_LOCK);
3432 "Lock Object Modes",
3433 "Restrict selection to objects using the same mode as the active "
3434 "object, to prevent accidental mode switch when selecting");
3436
3437 static const EnumPropertyItem workspace_tool_items[] = {
3438 {SCE_WORKSPACE_TOOL_DEFAULT, "DEFAULT", 0, "Active Tool", ""},
3439 {SCE_WORKSPACE_TOOL_FALLBACK, "FALLBACK", 0, "Select", ""},
3440 {0, nullptr, 0, nullptr, nullptr},
3441 };
3442
3443 prop = RNA_def_property(srna, "workspace_tool_type", PROP_ENUM, PROP_NONE);
3444 RNA_def_property_enum_sdna(prop, nullptr, "workspace_tool_type");
3446 RNA_def_property_enum_items(prop, workspace_tool_items);
3448 RNA_def_property_ui_text(prop, "Drag", "Action when dragging in the viewport");
3449
3450 /* Transform */
3451 prop = RNA_def_property(srna, "use_proportional_edit", PROP_BOOLEAN, PROP_NONE);
3452 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_USE);
3454 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional edit mode");
3455 RNA_def_property_ui_icon(prop, ICON_PROP_ON, 0);
3456 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3457
3458 prop = RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
3459 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_objects", 0);
3462 prop, "Proportional Editing Objects", "Proportional editing object mode");
3463 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3464 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3465
3466 prop = RNA_def_property(srna, "use_proportional_projected", PROP_BOOLEAN, PROP_NONE);
3467 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_PROJECTED);
3470 prop, "Projected from View", "Proportional Editing using screen space locations");
3471 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3472
3473 prop = RNA_def_property(srna, "use_proportional_connected", PROP_BOOLEAN, PROP_NONE);
3474 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_CONNECTED);
3477 prop, "Connected Only", "Proportional Editing using connected geometry only");
3478 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3479
3480 prop = RNA_def_property(srna, "use_proportional_edit_mask", PROP_BOOLEAN, PROP_NONE);
3481 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_mask", 0);
3483 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing mask mode");
3484 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3485 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3486
3487 prop = RNA_def_property(srna, "use_proportional_action", PROP_BOOLEAN, PROP_NONE);
3488 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_action", 0);
3491 prop, "Proportional Editing Actions", "Proportional editing in action editor");
3492 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3493 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3494
3495 prop = RNA_def_property(srna, "use_proportional_fcurve", PROP_BOOLEAN, PROP_NONE);
3496 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_fcurve", 0);
3499 prop, "Proportional Editing F-Curves", "Proportional editing in F-Curve editor");
3500 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3501 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3502
3503 prop = RNA_def_property(srna, "lock_markers", PROP_BOOLEAN, PROP_NONE);
3504 RNA_def_property_boolean_sdna(prop, nullptr, "lock_markers", 0);
3506 RNA_def_property_ui_text(prop, "Lock Markers", "Prevent marker editing");
3507
3508 prop = RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
3509 RNA_def_property_enum_sdna(prop, nullptr, "prop_mode");
3513 prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
3514 /* Abusing id_curve :/ */
3516 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3517
3518 prop = RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_NONE);
3519 RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
3522 prop, "Proportional Size", "Display size for proportional editing circle");
3523 RNA_def_property_range(prop, 0.00001, 5000.0);
3524
3525 prop = RNA_def_property(srna, "proportional_distance", PROP_FLOAT, PROP_DISTANCE);
3526 RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
3529 prop, "Proportional Size", "Display size for proportional editing circle");
3530 RNA_def_property_range(prop, 0.00001, 5000.0);
3531
3532 prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE);
3533 RNA_def_property_float_sdna(prop, nullptr, "doublimit");
3535 RNA_def_property_ui_text(prop, "Merge Threshold", "Threshold distance for Auto Merge");
3536 RNA_def_property_range(prop, 0.0, 1.0);
3537 RNA_def_property_ui_range(prop, 0.0, 0.1, 0.01, 6);
3538
3539 /* Pivot Point */
3540 prop = RNA_def_property(srna, "transform_pivot_point", PROP_ENUM, PROP_NONE);
3541 RNA_def_property_enum_sdna(prop, nullptr, "transform_pivot_point");
3544 RNA_def_property_ui_text(prop, "Transform Pivot Point", "Pivot center for rotation/scaling");
3546
3547 prop = RNA_def_property(srna, "use_transform_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
3548 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_AXIS_ALIGN);
3551 prop,
3552 "Only Locations",
3553 "Only transform object locations, without affecting rotation or scaling");
3555
3556 prop = RNA_def_property(srna, "use_transform_data_origin", PROP_BOOLEAN, PROP_NONE);
3557 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_DATA_ORIGIN);
3560 prop, "Transform Origins", "Transform object origins, while leaving the shape in place");
3562
3563 prop = RNA_def_property(srna, "use_transform_skip_children", PROP_BOOLEAN, PROP_NONE);
3564 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_SKIP_CHILDREN);
3567 prop, "Transform Parents", "Transform the parents, leaving the children in place");
3569
3570 prop = RNA_def_property(srna, "use_transform_correct_face_attributes", PROP_BOOLEAN, PROP_NONE);
3571 RNA_def_property_boolean_sdna(prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT);
3574 "Correct Face Attributes",
3575 "Correct data such as UVs and color attributes when transforming");
3577
3578 prop = RNA_def_property(srna, "use_transform_correct_keep_connected", PROP_BOOLEAN, PROP_NONE);
3580 prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED);
3583 prop,
3584 "Keep Connected",
3585 "During the Face Attributes correction, merge attributes connected to the same vertex");
3587
3588 prop = RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
3589 RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE);
3592 prop, "Auto Merge Vertices", "Automatically merge vertices moved to the same location");
3593 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3594 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3595
3596 prop = RNA_def_property(srna, "use_mesh_automerge_and_split", PROP_BOOLEAN, PROP_NONE);
3597 RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE_AND_SPLIT);
3599 RNA_def_property_ui_text(prop, "Split Edges & Faces", "Automatically split edges and faces");
3600 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3601 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3602
3603 prop = RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
3604 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP);
3606 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
3607 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3608 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3609
3610 prop = RNA_def_property(srna, "use_snap_node", PROP_BOOLEAN, PROP_NONE);
3611 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_node", SCE_SNAP);
3613 RNA_def_property_ui_text(prop, "Snap", "Snap Node during transform");
3614 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3615 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3616
3617 prop = RNA_def_property(srna, "use_snap_sequencer", PROP_BOOLEAN, PROP_NONE);
3618 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_seq", SCE_SNAP);
3620 RNA_def_property_ui_text(prop, "Use Snapping", "Snap strips during transform");
3621 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3622 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* Publish message-bus. */
3623
3624 prop = RNA_def_property(srna, "use_snap_uv", PROP_BOOLEAN, PROP_NONE);
3625 RNA_def_property_boolean_sdna(prop, nullptr, "snap_uv_flag", SCE_SNAP);
3627 RNA_def_property_ui_text(prop, "Snap", "Snap UV during transform");
3628 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3629 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3630
3631 prop = RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
3632 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ROTATE);
3635 prop, "Align Rotation to Target", "Align rotation with the snapping target");
3636 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3637
3638 prop = RNA_def_property(srna, "use_snap_grid_absolute", PROP_BOOLEAN, PROP_NONE);
3639 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ABS_GRID);
3642 prop,
3643 "Absolute Increment Snap",
3644 "Absolute grid alignment while translating (based on the pivot center)");
3645 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3646
3647 prop = RNA_def_property(srna, "snap_angle_increment_2d", PROP_FLOAT, PROP_ANGLE);
3648 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_2d");
3650 prop, "Rotation Increment", "Angle used for rotation increments in 2D editors");
3651 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3652 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 100.0f, 2);
3653 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3654
3655 prop = RNA_def_property(srna, "snap_angle_increment_2d_precision", PROP_FLOAT, PROP_ANGLE);
3656 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_2d_precision");
3658 "Rotation Precision Increment",
3659 "Precision angle used for rotation increments in 2D editors");
3660 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3661 RNA_def_property_ui_range(prop, DEG2RADF(0.1f), DEG2RADF(180.0f), 10.0f, 3);
3662 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3663
3664 prop = RNA_def_property(srna, "snap_angle_increment_3d", PROP_FLOAT, PROP_ANGLE);
3665 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_3d");
3667 prop, "Rotation Increment", "Angle used for rotation increments in 3D editors");
3668 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3669 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 100.0f, 2);
3670 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3671
3672 prop = RNA_def_property(srna, "snap_angle_increment_3d_precision", PROP_FLOAT, PROP_ANGLE);
3673 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_3d_precision");
3675 "Rotation Precision Increment",
3676 "Precision angle used for rotation increments in 3D editors");
3677 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3678 RNA_def_property_ui_range(prop, DEG2RADF(0.1f), DEG2RADF(180.0f), 10.0f, 3);
3679 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3680
3681 prop = RNA_def_property(srna, "snap_elements", PROP_ENUM, PROP_NONE);
3682 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3686 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3687 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
3688 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3689
3690 prop = RNA_def_property(srna, "snap_elements_base", PROP_ENUM, PROP_NONE);
3691 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3695 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3697 prop, "Snap Element", "Type of element for the \"Snap Base\" to snap to");
3698 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3699
3700 prop = RNA_def_property(srna, "snap_elements_individual", PROP_ENUM, PROP_NONE);
3701 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3705 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3707 prop, "Project Mode", "Type of element for individual transformed elements to snap to");
3708 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3709
3710 prop = RNA_def_property(srna, "snap_face_nearest_steps", PROP_INT, PROP_FACTOR);
3711 RNA_def_property_int_sdna(prop, nullptr, "snap_face_nearest_steps");
3713 RNA_def_property_range(prop, 1, 100);
3715 prop,
3716 "Face Nearest Steps",
3717 "Number of steps to break transformation into for face nearest snapping");
3718
3719 prop = RNA_def_property(srna, "use_snap_to_same_target", PROP_BOOLEAN, PROP_NONE);
3723 prop,
3724 "Snap to Same Target",
3725 "Snap only to target that source was initially near (\"Face Nearest\" only)");
3726
3727 prop = RNA_def_property(srna, "use_snap_anim", PROP_BOOLEAN, PROP_NONE);
3728 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP);
3730 RNA_def_property_ui_text(prop, "Snap", "Enable snapping when transforming keyframes");
3731 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3732 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3733
3734 prop = RNA_def_property(srna, "use_snap_driver", PROP_BOOLEAN, PROP_NONE);
3735 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_driver", SCE_SNAP);
3738 prop, "Snap", "Enable snapping when transforming keys in the Driver Editor");
3739 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3740 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3741
3742 prop = RNA_def_property(srna, "use_snap_time_absolute", PROP_BOOLEAN, PROP_NONE);
3743 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP_ABS_TIME_STEP);
3746 prop, "Absolute Time Snap", "Absolute time alignment when transforming keyframes");
3747 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3748
3749 prop = RNA_def_property(srna, "use_snap_driver_absolute", PROP_BOOLEAN, PROP_NONE);
3750 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_driver", SCE_SNAP_ABS_TIME_STEP);
3752 RNA_def_property_ui_text(prop, "Absolute Snap", "Snap to full values");
3753 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3754
3755 prop = RNA_def_property(srna, "snap_anim_element", PROP_ENUM, PROP_NONE);
3756 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_anim_mode");
3759 RNA_def_property_ui_text(prop, "Snap Animation Element", "Type of element to snap to");
3761 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3762
3763 prop = RNA_def_property(srna, "use_snap_playhead", PROP_BOOLEAN, PROP_NONE);
3764 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_playhead", SCE_SNAP);
3765 RNA_def_property_ui_icon(prop, ICON_PLAYHEAD_SNAP_OFF, 1);
3767 RNA_def_property_ui_text(prop, "Use Snapping", "Snap playhead when scrubbing");
3770
3771 prop = RNA_def_property(srna, "snap_playhead_element", PROP_ENUM, PROP_NONE);
3772 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_playhead_mode");
3776 RNA_def_property_ui_text(prop, "Snap Playhead Element", "Type of element to snap to");
3779
3780 prop = RNA_def_property(srna, "snap_playhead_frame_step", PROP_INT, PROP_NONE);
3781 RNA_def_property_int_sdna(prop, nullptr, "snap_step_frames");
3782 RNA_def_property_range(prop, 1, 32768);
3783 RNA_def_property_ui_text(prop, "Frame Step", "At which interval to snap to frames");
3785
3786 prop = RNA_def_property(srna, "snap_playhead_second_step", PROP_INT, PROP_NONE);
3787 RNA_def_property_int_sdna(prop, nullptr, "snap_step_seconds");
3788 RNA_def_property_ui_text(prop, "Second Step", "At which interval to snap to seconds");
3789 RNA_def_property_range(prop, 1, 32768);
3791
3792 prop = RNA_def_property(srna, "playhead_snap_distance", PROP_INT, PROP_PIXEL);
3793 RNA_def_property_int_sdna(prop, nullptr, "playhead_snap_distance");
3794 RNA_def_property_ui_range(prop, 1, 100, 1, 1);
3795 RNA_def_property_ui_text(prop, "Snap Distance", "Maximum distance for snapping in pixels");
3796
3797 /* image editor uses its own set of snap modes */
3798 prop = RNA_def_property(srna, "snap_uv_element", PROP_ENUM, PROP_NONE);
3799 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_uv_mode");
3801 RNA_def_property_enum_funcs(prop, nullptr, "rna_ToolSettings_snap_uv_mode_set", nullptr);
3803 RNA_def_property_ui_text(prop, "Snap UV Element", "Type of element to snap to");
3804 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3805
3806 /* TODO(@gfxcoder): Rename `snap_target` to `snap_source` to avoid previous ambiguity of "target"
3807 * (now, "source" is geometry to be moved and "target" is geometry to which moved geometry is
3808 * snapped). */
3809 prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
3810 RNA_def_property_enum_sdna(prop, nullptr, "snap_target");
3813 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
3814 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3815
3816 prop = RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
3817 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_PEEL_OBJECT);
3820 prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
3821 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3822
3823 prop = RNA_def_property(srna, "use_snap_backface_culling", PROP_BOOLEAN, PROP_NONE);
3824 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_BACKFACE_CULLING);
3826 RNA_def_property_ui_text(prop, "Backface Culling", "Exclude back facing geometry from snapping");
3827 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3828
3829 /* TODO(@gfxcoder): Rename `use_snap_self` to `use_snap_active`, because active is correct but
3830 * self is not (breaks API). This only makes a difference when more than one mesh is edited. */
3831 prop = RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
3835 prop, "Snap onto Active", "Snap onto itself only if enabled (edit mode only)");
3836 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3837
3838 prop = RNA_def_property(srna, "use_snap_edit", PROP_BOOLEAN, PROP_NONE);
3839 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_TO_INCLUDE_EDITED);
3842 prop, "Snap onto Edited", "Snap onto non-active objects in edit mode (edit mode only)");
3843 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3844
3845 prop = RNA_def_property(srna, "use_snap_nonedit", PROP_BOOLEAN, PROP_NONE);
3849 prop, "Snap onto Non-edited", "Snap onto objects not in edit mode (edit mode only)");
3850 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3851
3852 prop = RNA_def_property(srna, "use_snap_selectable", PROP_BOOLEAN, PROP_NONE);
3856 prop, "Snap onto Selectable Only", "Snap only onto objects that are selectable");
3857 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3858
3859 prop = RNA_def_property(srna, "use_snap_translate", PROP_BOOLEAN, PROP_NONE);
3861 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_TRANSLATE);
3864 prop, "Use Snap for Translation", "Move is affected by snapping settings");
3865 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3866
3867 prop = RNA_def_property(srna, "use_snap_rotate", PROP_BOOLEAN, PROP_NONE);
3869 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_ROTATE);
3873 prop, "Use Snap for Rotation", "Rotate is affected by the snapping settings");
3874 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3875
3876 prop = RNA_def_property(srna, "use_snap_scale", PROP_BOOLEAN, PROP_NONE);
3878 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_SCALE);
3881 RNA_def_property_ui_text(prop, "Use Snap for Scale", "Scale is affected by snapping settings");
3882 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3883
3884 prop = RNA_def_property(srna, "plane_axis", PROP_ENUM, PROP_NONE);
3885 RNA_def_property_enum_sdna(prop, nullptr, "plane_axis");
3889 RNA_def_property_ui_text(prop, "Plane Axis", "The axis used for placing the base region");
3890
3891 prop = RNA_def_property(srna, "plane_axis_auto", PROP_BOOLEAN, PROP_NONE);
3892 RNA_def_property_boolean_sdna(prop, nullptr, "use_plane_axis_auto", 1);
3896 "Auto Axis",
3897 "Select the closest axis when placing objects "
3898 "(surface overrides)");
3899
3900 prop = RNA_def_property(srna, "plane_depth", PROP_ENUM, PROP_NONE);
3901 RNA_def_property_enum_sdna(prop, nullptr, "plane_depth");
3905 RNA_def_property_ui_text(prop, "Position", "The initial depth used when placing the cursor");
3906
3907 prop = RNA_def_property(srna, "plane_orientation", PROP_ENUM, PROP_NONE);
3908 RNA_def_property_enum_sdna(prop, nullptr, "plane_orient");
3912 RNA_def_property_ui_text(prop, "Orientation", "The initial depth used when placing the cursor");
3913
3914 prop = RNA_def_property(srna, "snap_elements_tool", PROP_ENUM, PROP_NONE);
3915 RNA_def_property_enum_sdna(prop, nullptr, "snap_mode_tools");
3919 RNA_def_property_ui_text(prop, "Snap to", "The target to use while snapping");
3920
3921 /* Grease Pencil */
3922 prop = RNA_def_property(srna, "use_gpencil_draw_additive", PROP_BOOLEAN, PROP_NONE);
3923 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_RETAIN_LAST);
3926 "Use Additive Drawing",
3927 "When creating new frames, the strokes from the previous/active frame "
3928 "are included as the basis for the new one");
3930
3931 prop = RNA_def_property(srna, "use_gpencil_draw_onback", PROP_BOOLEAN, PROP_NONE);
3932 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_PAINT_ONBACK);
3935 prop, "Draw Strokes on Back", "New strokes are drawn below of all strokes in the layer");
3937
3938 prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE);
3940 prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_THUMBNAIL_LIST);
3943 prop, "Compact List", "Show compact list of colors instead of thumbnails");
3945
3946 prop = RNA_def_property(srna, "use_gpencil_weight_data_add", PROP_BOOLEAN, PROP_NONE);
3947 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_CREATE_WEIGHTS);
3950 "Add weight data for new strokes",
3951 "Weight data for new strokes is added according to the current vertex "
3952 "group and weight. If no vertex group selected, weight is not added.");
3954
3955 prop = RNA_def_property(srna, "use_gpencil_automerge_strokes", PROP_BOOLEAN, PROP_NONE);
3956 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_AUTOMERGE_STROKE);
3959 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3961 prop,
3962 "Automerge",
3963 "Join the last drawn stroke with previous strokes in the active layer by distance");
3966
3967 prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE);
3968 RNA_def_property_pointer_sdna(prop, nullptr, "gp_sculpt");
3970 RNA_def_property_struct_type(prop, "GPencilSculptSettings");
3972 prop, "Grease Pencil Sculpt", "Settings for stroke sculpting tools and brushes");
3973
3974 prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE);
3975 RNA_def_property_pointer_sdna(prop, nullptr, "gp_interpolate");
3977 RNA_def_property_struct_type(prop, "GPencilInterpolateSettings");
3979 prop, "Grease Pencil Interpolate", "Settings for Grease Pencil interpolation tools");
3980
3981 /* Grease Pencil - 3D View Stroke Placement */
3982 prop = RNA_def_property(srna, "gpencil_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
3983 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
3985 RNA_def_property_enum_items(prop, gpencil_stroke_placement_items);
3986 RNA_def_property_ui_text(prop, "Stroke Placement (3D View)", "");
3987 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3988
3989 prop = RNA_def_property(srna, "gpencil_stroke_snap_mode", PROP_ENUM, PROP_NONE);
3990 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
3992 RNA_def_property_enum_items(prop, gpencil_stroke_snap_items);
3993 RNA_def_property_ui_text(prop, "Stroke Snap", "");
3994 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3995
3996 prop = RNA_def_property(srna, "gpencil_surface_offset", PROP_FLOAT, PROP_DISTANCE);
3997 RNA_def_property_float_sdna(prop, nullptr, "gpencil_surface_offset");
4000 prop, "Surface Offset", "Offset along the normal when drawing on surfaces");
4001 RNA_def_property_range(prop, 0.0f, 1.0f);
4002 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 3);
4003 RNA_def_property_float_default(prop, 0.150f);
4004
4005 prop = RNA_def_property(srna, "use_gpencil_project_only_selected", PROP_BOOLEAN, PROP_NONE);
4007 prop, nullptr, "gpencil_v3d_align", GP_PROJECT_DEPTH_ONLY_SELECTED);
4010 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
4011 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4012
4013 /* Grease Pencil - Select mode Edit */
4014 prop = RNA_def_property(srna, "gpencil_selectmode_edit", PROP_ENUM, PROP_NONE);
4015 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_selectmode_edit");
4018 RNA_def_property_ui_text(prop, "Select Mode", "");
4022
4023 /* Grease Pencil - Select mode Sculpt */
4024 prop = RNA_def_property(srna, "use_gpencil_select_mask_point", PROP_BOOLEAN, PROP_NONE);
4026 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_POINT);
4028 RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points");
4029 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
4032 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_point_update");
4033
4034 prop = RNA_def_property(srna, "use_gpencil_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
4036 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_STROKE);
4038 RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected strokes");
4039 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
4042 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_stroke_update");
4043
4044 prop = RNA_def_property(srna, "use_gpencil_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
4046 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_SEGMENT);
4049 prop, "Selection Mask", "Only sculpt selected stroke points between other strokes");
4050 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
4053 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_segment_update");
4054
4055 /* Grease Pencil - Select mode Vertex Paint */
4056 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_point", PROP_BOOLEAN, PROP_NONE);
4058 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_POINT);
4060 RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected stroke points");
4061 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
4065 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_point_update");
4066
4067 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
4069 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_STROKE);
4071 RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected strokes");
4072 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
4076 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_stroke_update");
4077
4078 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
4080 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_SEGMENT);
4083 prop, "Selection Mask", "Only paint selected stroke points between other strokes");
4084 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
4088 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_segment_update");
4089
4090 prop = RNA_def_property(srna, "use_grease_pencil_multi_frame_editing", PROP_BOOLEAN, PROP_NONE);
4091 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_USE_MULTI_FRAME_EDITING);
4093 RNA_def_property_ui_text(prop, "Multi-frame Editing", "Enable multi-frame editing");
4094 RNA_def_property_ui_icon(prop, ICON_GP_MULTIFRAME_EDITING, 0);
4096 /* FIXME: We shouldn't have to tag all the Grease Pencil IDs for an update! */
4098 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_all_grease_pencil_update");
4099
4100 /* Annotations - 2D Views Stroke Placement */
4101 prop = RNA_def_property(srna, "annotation_stroke_placement_view2d", PROP_ENUM, PROP_NONE);
4102 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v2d_align");
4104 RNA_def_property_enum_items(prop, annotation_stroke_placement_view2d_items);
4105 RNA_def_property_ui_text(prop, "Stroke Placement (2D View)", "");
4106 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4107
4108 /* Annotations - 3D View Stroke Placement */
4109 /* XXX: Do we need to decouple the stroke_endpoints setting too? */
4110 prop = RNA_def_property(srna, "annotation_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
4111 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "annotate_v3d_align");
4113 RNA_def_property_enum_items(prop, annotation_stroke_placement_view3d_items);
4116 "Annotation Stroke Placement (3D View)",
4117 "How annotation strokes are orientated in 3D space");
4118 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4119
4120 prop = RNA_def_property(srna, "use_annotation_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
4122 prop, nullptr, "annotate_v3d_align", GP_PROJECT_DEPTH_STROKE_ENDPOINTS);
4125 prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");
4126 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4127
4128 prop = RNA_def_property(srna, "use_annotation_project_only_selected", PROP_BOOLEAN, PROP_NONE);
4130 prop, nullptr, "annotate_v3d_align", GP_PROJECT_DEPTH_ONLY_SELECTED);
4133 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
4134 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4135
4136 /* Annotations - Stroke Thickness */
4137 prop = RNA_def_property(srna, "annotation_thickness", PROP_INT, PROP_PIXEL);
4138 RNA_def_property_int_sdna(prop, nullptr, "annotate_thickness");
4140 RNA_def_property_range(prop, 1, 10);
4141 RNA_def_property_ui_text(prop, "Annotation Stroke Thickness", "Thickness of annotation strokes");
4142 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4143
4144 /* Auto Keying */
4145 prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
4146 RNA_def_property_boolean_sdna(prop, nullptr, "autokey_mode", AUTOKEY_ON);
4149 prop, "Auto Keying", "Automatic keyframe insertion for objects, bones and masks");
4150 RNA_def_property_ui_icon(prop, ICON_RECORD_OFF, 1);
4152
4153 prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
4154 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "autokey_mode");
4156 RNA_def_property_enum_items(prop, auto_key_items);
4158 "Auto-Keying Mode",
4159 "Mode of automatic keyframe insertion for objects, bones and masks");
4160
4161 prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
4162 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_LAYERED_RECORD);
4165 prop,
4166 "Layered",
4167 "Add a new NLA Track + Strip for every loop/pass made over the animation "
4168 "to allow non-destructive tweaking");
4169
4170 prop = RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
4171 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
4174 "Auto Keyframe Insert Keying Set",
4175 "Automatic keyframe insertion using active Keying Set only");
4176 RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0);
4177
4178 prop = RNA_def_property(srna, "use_keyframe_cycle_aware", PROP_BOOLEAN, PROP_NONE);
4179 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", KEYING_FLAG_CYCLEAWARE);
4182 prop,
4183 "Cycle-Aware Keying",
4184 "For channels with cyclic extrapolation, keyframe insertion is automatically "
4185 "remapped inside the cycle time range, and keeps ends in sync. Curves newly added to "
4186 "actions with a Manual Frame Range and Cyclic Animation are automatically made cyclic.");
4187
4188 /* Keyframing */
4189 prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE);
4190 RNA_def_property_enum_sdna(prop, nullptr, "keyframe_type");
4194 prop, "New Keyframe Type", "Type of keyframes to create when inserting keyframes");
4196
4197 /* Animation */
4198 prop = RNA_def_property(srna, "anim_mirror_object", PROP_POINTER, PROP_NONE);
4200 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
4202 "Mirror Object",
4203 "Object to mirror over. Leave empty and name a bone to always mirror "
4204 "over that bone of the active armature");
4205
4206 prop = RNA_def_property(srna, "anim_mirror_bone", PROP_STRING, PROP_NONE);
4207 RNA_def_struct_name_property(srna, prop);
4208 RNA_def_property_ui_text(prop, "Mirror Bone", "Bone to use for the mirroring");
4209
4210 prop = RNA_def_property(srna, "anim_relative_object", PROP_POINTER, PROP_NONE);
4212 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, nullptr);
4213 RNA_def_property_ui_text(prop, "Relative Object", "Object to which matrices are made relative");
4214
4215 prop = RNA_def_property(srna, "anim_fix_to_cam_use_loc", PROP_BOOLEAN, PROP_NONE);
4216 RNA_def_property_boolean_sdna(prop, nullptr, "fix_to_cam_flag", FIX_TO_CAM_FLAG_USE_LOC);
4219 prop, "Use Location for Camera Fix", "Create location keys when fixing to the scene camera");
4220
4221 prop = RNA_def_property(srna, "anim_fix_to_cam_use_rot", PROP_BOOLEAN, PROP_NONE);
4222 RNA_def_property_boolean_sdna(prop, nullptr, "fix_to_cam_flag", FIX_TO_CAM_FLAG_USE_ROT);
4225 prop, "Use Rotation for Camera Fix", "Create rotation keys when fixing to the scene camera");
4226
4227 prop = RNA_def_property(srna, "anim_fix_to_cam_use_scale", PROP_BOOLEAN, PROP_NONE);
4228 RNA_def_property_boolean_sdna(prop, nullptr, "fix_to_cam_flag", FIX_TO_CAM_FLAG_USE_SCALE);
4231 prop, "Use Scale for Camera Fix", "Create scale keys when fixing to the scene camera");
4232
4233 /* UV */
4234 prop = RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
4235 RNA_def_property_enum_sdna(prop, nullptr, "uv_selectmode");
4238 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
4240 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_select_mode_update");
4241
4242 prop = RNA_def_property(srna, "uv_sticky_select_mode", PROP_ENUM, PROP_NONE);
4243 RNA_def_property_enum_sdna(prop, nullptr, "uv_sticky");
4245 RNA_def_property_enum_items(prop, uv_sticky_mode_items);
4247 prop, "Sticky Selection Mode", "Method for extending UV vertex selection");
4250 prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_sticky_select_mode_update");
4251
4252 prop = RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
4253 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_FLAG_SELECT_SYNC);
4256 prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
4257 RNA_def_property_ui_icon(prop, ICON_UV_SYNC_SELECT, 0);
4259 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_select_sync_update");
4260
4261 prop = RNA_def_property(srna, "use_uv_select_island", PROP_BOOLEAN, PROP_NONE);
4262 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_FLAG_SELECT_ISLAND);
4264 RNA_def_property_ui_text(prop, "UV Island Selection", "Island selection");
4265 RNA_def_property_ui_icon(prop, ICON_UV_ISLANDSEL, 0);
4267
4268 prop = RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
4269 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_FLAG_SHOW_SAME_IMAGE);
4272 prop, "UV Local View", "Display only faces with the currently displayed image assigned");
4274
4275 prop = RNA_def_property(srna, "use_uv_custom_region", PROP_BOOLEAN, PROP_NONE);
4276 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_FLAG_CUSTOM_REGION);
4278 RNA_def_property_ui_text(prop, "UV Custom Region", "Custom defined region");
4280
4281 /* Mesh */
4282 prop = RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
4283 RNA_def_property_boolean_bitset_array_sdna(prop, nullptr, "selectmode", 1 << 0, 3);
4285 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Scene_editmesh_select_mode_set");
4286 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
4288 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
4289
4290 prop = RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
4291 RNA_def_property_float_sdna(prop, nullptr, "vgroup_weight");
4293 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
4294
4295 prop = RNA_def_property(srna, "use_edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
4296 RNA_def_property_boolean_sdna(prop, nullptr, "edge_mode_live_unwrap", 1);
4298 RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edge seams recalculates UV unwrap");
4299
4300 prop = RNA_def_property(srna, "normal_vector", PROP_FLOAT, PROP_XYZ);
4301 RNA_def_property_ui_text(prop, "Normal Vector", "Normal vector used to copy, add or multiply");
4302 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, 3);
4303
4304 /* Curve Paint Settings */
4305 prop = RNA_def_property(srna, "curve_paint_settings", PROP_POINTER, PROP_NONE);
4307 RNA_def_property_struct_type(prop, "CurvePaintSettings");
4308 RNA_def_property_ui_text(prop, "Curve Paint Settings", nullptr);
4309
4310 /* Mesh Statistics */
4311 prop = RNA_def_property(srna, "statvis", PROP_POINTER, PROP_NONE);
4313 RNA_def_property_struct_type(prop, "MeshStatVis");
4314 RNA_def_property_ui_text(prop, "Mesh Statistics Visualization", nullptr);
4315
4316 /* CurveProfile */
4317 prop = RNA_def_property(srna, "custom_bevel_profile_preset", PROP_POINTER, PROP_NONE);
4318 RNA_def_property_pointer_sdna(prop, nullptr, "custom_bevel_profile_preset");
4319 RNA_def_property_struct_type(prop, "CurveProfile");
4320 RNA_def_property_ui_text(prop, "Curve Profile Widget", "Used for defining a profile's path");
4321
4322 /* Sequencer tool settings */
4323 prop = RNA_def_property(srna, "sequencer_tool_settings", PROP_POINTER, PROP_NONE);
4325 RNA_def_property_struct_type(prop, "SequencerToolSettings");
4326 RNA_def_property_ui_text(prop, "Sequencer Tool Settings", nullptr);
4327}
4328
4330{
4331 StructRNA *srna;
4332 PropertyRNA *prop;
4333
4334 static const EnumPropertyItem scale_overlap_modes[] = {
4335 {SEQ_OVERLAP_EXPAND, "EXPAND", 0, "Expand", "Move strips so transformed strips fit"},
4337 "OVERWRITE",
4338 0,
4339 "Overwrite",
4340 "Trim or split strips to resolve overlap"},
4342 "SHUFFLE",
4343 0,
4344 "Shuffle",
4345 "Move transformed strips to nearest free space to resolve overlap"},
4346 {0, nullptr, 0, nullptr, nullptr},
4347 };
4348
4349 static const EnumPropertyItem pivot_points[] = {
4350 {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
4351 {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
4352 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
4354 "INDIVIDUAL_ORIGINS",
4355 ICON_PIVOT_INDIVIDUAL,
4356 "Individual Origins",
4357 "Pivot around each selected island's own median point"},
4358 {0, nullptr, 0, nullptr, nullptr},
4359
4360 };
4361 srna = RNA_def_struct(brna, "SequencerToolSettings", nullptr);
4362 RNA_def_struct_path_func(srna, "rna_SequencerToolSettings_path");
4363 RNA_def_struct_ui_text(srna, "Sequencer Tool Settings", "");
4365
4366 /* Add strip settings. */
4367 prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_NONE);
4369 RNA_def_property_ui_text(prop, "Fit Method", "Scale fit method");
4370
4371 /* Transform snapping. */
4372 prop = RNA_def_property(srna, "snap_to_current_frame", PROP_BOOLEAN, PROP_NONE);
4373 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_CURRENT_FRAME);
4374 RNA_def_property_ui_text(prop, "Current Frame", "Snap to current frame");
4375 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4376
4377 prop = RNA_def_property(srna, "snap_to_hold_offset", PROP_BOOLEAN, PROP_NONE);
4378 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_STRIP_HOLD);
4379 RNA_def_property_ui_text(prop, "Hold Offset", "Snap to strip hold offsets");
4380 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4381
4382 prop = RNA_def_property(srna, "snap_to_markers", PROP_BOOLEAN, PROP_NONE);
4383 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_MARKERS);
4384 RNA_def_property_ui_text(prop, "Markers", "Snap to markers");
4385 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4386
4387 prop = RNA_def_property(srna, "snap_to_retiming_keys", PROP_BOOLEAN, PROP_NONE);
4388 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_RETIMING);
4389 RNA_def_property_ui_text(prop, "Retiming Keys", "Snap to retiming keys");
4390 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4391
4392 prop = RNA_def_property(srna, "snap_to_frame_range", PROP_BOOLEAN, PROP_NONE);
4393 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_FRAME_RANGE);
4394 RNA_def_property_ui_text(prop, "Frame Range", "Snap to preview or scene start and end frame");
4395 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4396
4397 prop = RNA_def_property(srna, "snap_to_borders", PROP_BOOLEAN, PROP_NONE);
4399 RNA_def_property_ui_text(prop, "Borders", "Snap to preview borders");
4400 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4401
4402 prop = RNA_def_property(srna, "snap_to_center", PROP_BOOLEAN, PROP_NONE);
4403 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_PREVIEW_CENTER);
4404 RNA_def_property_ui_text(prop, "Center", "Snap to preview center");
4405 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4406
4407 prop = RNA_def_property(srna, "snap_to_strips_preview", PROP_BOOLEAN, PROP_NONE);
4408 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_STRIPS_PREVIEW);
4410 prop, "Other Strips", "Snap to borders and origins of deselected, visible strips");
4411 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4412
4413 prop = RNA_def_property(srna, "snap_ignore_muted", PROP_BOOLEAN, PROP_NONE);
4414 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SEQ_SNAP_IGNORE_MUTED);
4415 RNA_def_property_ui_text(prop, "Ignore Muted Strips", "Don't snap to hidden strips");
4416
4417 prop = RNA_def_property(srna, "snap_ignore_sound", PROP_BOOLEAN, PROP_NONE);
4418 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SEQ_SNAP_IGNORE_SOUND);
4419 RNA_def_property_ui_text(prop, "Ignore Sound Strips", "Don't snap to sound strips");
4420
4421 prop = RNA_def_property(srna, "use_snap_current_frame_to_strips", PROP_BOOLEAN, PROP_NONE);
4424 prop, "Snap Current Frame to Strips", "Snap current frame to strip start or end");
4425
4426 prop = RNA_def_property(srna, "snap_distance", PROP_INT, PROP_PIXEL);
4427 RNA_def_property_int_sdna(prop, nullptr, "snap_distance");
4429 RNA_def_property_ui_range(prop, 0, 50, 1, 1);
4430 RNA_def_property_ui_text(prop, "Snapping Distance", "Maximum distance for snapping in pixels");
4431
4432 /* Transform overlap handling. */
4433 prop = RNA_def_property(srna, "overlap_mode", PROP_ENUM, PROP_NONE);
4434 RNA_def_property_enum_items(prop, scale_overlap_modes);
4435 RNA_def_property_ui_text(prop, "Overlap Mode", "How to resolve overlap after transformation");
4436
4437 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
4438 RNA_def_property_enum_items(prop, pivot_points);
4439 RNA_def_property_ui_text(prop, "Pivot Point", "Rotation or scaling pivot point");
4441}
4442
4444{
4445 StructRNA *srna;
4446 PropertyRNA *prop;
4447
4448 srna = RNA_def_struct(brna, "CurvePaintSettings", nullptr);
4449 RNA_def_struct_path_func(srna, "rna_CurvePaintSettings_path");
4450 RNA_def_struct_ui_text(srna, "Curve Paint Settings", "");
4452
4453 static const EnumPropertyItem curve_type_items[] = {
4454 {CU_POLY, "POLY", 0, "Poly", ""},
4455 {CU_BEZIER, "BEZIER", 0, "Bézier", ""},
4456 {0, nullptr, 0, nullptr, nullptr},
4457 };
4458
4459 prop = RNA_def_property(srna, "curve_type", PROP_ENUM, PROP_NONE);
4461 RNA_def_property_enum_sdna(prop, nullptr, "curve_type");
4463 RNA_def_property_ui_text(prop, "Type", "Type of curve to use for new strokes");
4464
4465 prop = RNA_def_property(srna, "use_corners_detect", PROP_BOOLEAN, PROP_NONE);
4468 RNA_def_property_ui_text(prop, "Detect Corners", "Detect corners and use non-aligned handles");
4469
4470 prop = RNA_def_property(srna, "use_pressure_radius", PROP_BOOLEAN, PROP_NONE);
4473 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
4474 RNA_def_property_ui_text(prop, "Use Pressure", "Map tablet pressure to curve radius");
4475
4476 prop = RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
4479 RNA_def_property_ui_text(prop, "Only First", "Use the start of the stroke for the depth");
4480
4481 prop = RNA_def_property(srna, "use_offset_absolute", PROP_BOOLEAN, PROP_NONE);
4485 prop, "Absolute Offset", "Apply a fixed offset (don't scale by the radius)");
4486
4487 prop = RNA_def_property(srna, "use_project_only_selected", PROP_BOOLEAN, PROP_NONE);
4491 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
4492
4493 prop = RNA_def_property(srna, "error_threshold", PROP_INT, PROP_PIXEL);
4495 RNA_def_property_range(prop, 1, 100);
4496 RNA_def_property_ui_text(prop, "Tolerance", "Allow deviation for a smoother, less precise line");
4497
4498 prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_PIXEL);
4500 RNA_def_property_enum_sdna(prop, nullptr, "fit_method");
4502 RNA_def_property_ui_text(prop, "Method", "Curve fitting method");
4503
4504 prop = RNA_def_property(srna, "corner_angle", PROP_FLOAT, PROP_ANGLE);
4506 RNA_def_property_range(prop, 0, M_PI);
4507 RNA_def_property_ui_text(prop, "Corner Angle", "Angles above this are considered corners");
4508
4509 prop = RNA_def_property(srna, "radius_min", PROP_FLOAT, PROP_NONE);
4511 RNA_def_property_range(prop, 0.0, 100.0);
4512 RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
4514 prop,
4515 "Radius Min",
4516 "Minimum radius when the minimum pressure is applied (also the minimum when tapering)");
4517
4518 prop = RNA_def_property(srna, "radius_max", PROP_FLOAT, PROP_NONE);
4520 RNA_def_property_range(prop, 0.0, 100.0);
4521 RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
4523 prop,
4524 "Radius Max",
4525 "Radius to use when the maximum pressure is applied (or when a tablet isn't used)");
4526
4527 prop = RNA_def_property(srna, "radius_taper_start", PROP_FLOAT, PROP_NONE);
4529 RNA_def_property_range(prop, 0.0, 1.0);
4530 RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
4532 prop, "Radius Min", "Taper factor for the radius of each point along the curve");
4533
4534 prop = RNA_def_property(srna, "radius_taper_end", PROP_FLOAT, PROP_NONE);
4536 RNA_def_property_range(prop, 0.0, 10.0);
4537 RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
4539 prop, "Radius Max", "Taper factor for the radius of each point along the curve");
4540
4541 prop = RNA_def_property(srna, "surface_offset", PROP_FLOAT, PROP_NONE);
4543 RNA_def_property_range(prop, -10.0, 10.0);
4544 RNA_def_property_ui_range(prop, -1.0f, 1.0, 1, 2);
4545 RNA_def_property_ui_text(prop, "Offset", "Offset the stroke from the surface");
4546
4547 static const EnumPropertyItem depth_mode_items[] = {
4548 {CURVE_PAINT_PROJECT_CURSOR, "CURSOR", 0, "Cursor", ""},
4549 {CURVE_PAINT_PROJECT_SURFACE, "SURFACE", 0, "Surface", ""},
4550 {0, nullptr, 0, nullptr, nullptr},
4551 };
4552
4553 prop = RNA_def_property(srna, "depth_mode", PROP_ENUM, PROP_NONE);
4555 RNA_def_property_enum_sdna(prop, nullptr, "depth_mode");
4556 RNA_def_property_enum_items(prop, depth_mode_items);
4557 RNA_def_property_ui_text(prop, "Depth", "Method of projecting depth");
4558
4559 static const EnumPropertyItem surface_plane_items[] = {
4561 "NORMAL_VIEW",
4562 0,
4563 "Normal to Surface",
4564 "Draw in a plane perpendicular to the surface"},
4566 "NORMAL_SURFACE",
4567 0,
4568 "Tangent to Surface",
4569 "Draw in the surface plane"},
4571 "VIEW",
4572 0,
4573 "View",
4574 "Draw in a plane aligned to the viewport"},
4575 {0, nullptr, 0, nullptr, nullptr},
4576 };
4577
4578 prop = RNA_def_property(srna, "surface_plane", PROP_ENUM, PROP_NONE);
4580 RNA_def_property_enum_sdna(prop, nullptr, "surface_plane");
4581 RNA_def_property_enum_items(prop, surface_plane_items);
4582 RNA_def_property_ui_text(prop, "Plane", "Plane for projected stroke");
4583}
4584
4585static void rna_def_statvis(BlenderRNA *brna)
4586{
4587 StructRNA *srna;
4588 PropertyRNA *prop;
4589
4590 static const EnumPropertyItem stat_type[] = {
4591 {SCE_STATVIS_OVERHANG, "OVERHANG", 0, "Overhang", ""},
4592 {SCE_STATVIS_THICKNESS, "THICKNESS", 0, "Thickness", ""},
4593 {SCE_STATVIS_INTERSECT, "INTERSECT", 0, "Intersect", ""},
4594 {SCE_STATVIS_DISTORT, "DISTORT", 0, "Distortion", ""},
4595 {SCE_STATVIS_SHARP, "SHARP", 0, "Sharp", ""},
4596 {0, nullptr, 0, nullptr, nullptr},
4597 };
4598
4599 srna = RNA_def_struct(brna, "MeshStatVis", nullptr);
4600 RNA_def_struct_path_func(srna, "rna_MeshStatVis_path");
4601 RNA_def_struct_ui_text(srna, "Mesh Visualize Statistics", "");
4603
4604 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4605 RNA_def_property_enum_items(prop, stat_type);
4606 RNA_def_property_ui_text(prop, "Type", "Type of data to visualize/check");
4608 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4609
4610 /* overhang */
4611 prop = RNA_def_property(srna, "overhang_min", PROP_FLOAT, PROP_ANGLE);
4612 RNA_def_property_float_sdna(prop, nullptr, "overhang_min");
4613 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4614 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4615 RNA_def_property_ui_text(prop, "Overhang Min", "Minimum angle to display");
4617 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4618
4619 prop = RNA_def_property(srna, "overhang_max", PROP_FLOAT, PROP_ANGLE);
4620 RNA_def_property_float_sdna(prop, nullptr, "overhang_max");
4621 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4622 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4623 RNA_def_property_ui_text(prop, "Overhang Max", "Maximum angle to display");
4625 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4626
4627 prop = RNA_def_property(srna, "overhang_axis", PROP_ENUM, PROP_NONE);
4628 RNA_def_property_enum_sdna(prop, nullptr, "overhang_axis");
4630 RNA_def_property_ui_text(prop, "Axis", "");
4632 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4633
4634 /* thickness */
4635 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_DISTANCE);
4636 RNA_def_property_float_sdna(prop, nullptr, "thickness_min");
4637 RNA_def_property_range(prop, 0.0f, 1000.0);
4638 RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4639 RNA_def_property_ui_text(prop, "Thickness Min", "Minimum for measuring thickness");
4641 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4642
4643 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_DISTANCE);
4644 RNA_def_property_float_sdna(prop, nullptr, "thickness_max");
4645 RNA_def_property_range(prop, 0.0f, 1000.0);
4646 RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4647 RNA_def_property_ui_text(prop, "Thickness Max", "Maximum for measuring thickness");
4649 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4650
4651 prop = RNA_def_property(srna, "thickness_samples", PROP_INT, PROP_UNSIGNED);
4652 RNA_def_property_int_sdna(prop, nullptr, "thickness_samples");
4653 RNA_def_property_range(prop, 1, 32);
4654 RNA_def_property_ui_text(prop, "Samples", "Number of samples to test per face");
4656 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4657
4658 /* distort */
4659 prop = RNA_def_property(srna, "distort_min", PROP_FLOAT, PROP_ANGLE);
4660 RNA_def_property_float_sdna(prop, nullptr, "distort_min");
4661 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4662 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4663 RNA_def_property_ui_text(prop, "Distort Min", "Minimum angle to display");
4665 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4666
4667 prop = RNA_def_property(srna, "distort_max", PROP_FLOAT, PROP_ANGLE);
4668 RNA_def_property_float_sdna(prop, nullptr, "distort_max");
4669 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4670 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4671 RNA_def_property_ui_text(prop, "Distort Max", "Maximum angle to display");
4673 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4674
4675 /* sharp */
4676 prop = RNA_def_property(srna, "sharp_min", PROP_FLOAT, PROP_ANGLE);
4677 RNA_def_property_float_sdna(prop, nullptr, "sharp_min");
4678 RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
4679 RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
4680 RNA_def_property_ui_text(prop, "Sharpness Min", "Minimum angle to display");
4682 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4683
4684 prop = RNA_def_property(srna, "sharp_max", PROP_FLOAT, PROP_ANGLE);
4685 RNA_def_property_float_sdna(prop, nullptr, "sharp_max");
4686 RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
4687 RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
4688 RNA_def_property_ui_text(prop, "Sharpness Max", "Maximum angle to display");
4690 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4691}
4692
4694{
4695 StructRNA *srna;
4696 PropertyRNA *prop;
4697
4698 static const EnumPropertyItem unit_systems[] = {
4699 {USER_UNIT_NONE, "NONE", 0, "None", ""},
4700 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
4701 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
4702 {0, nullptr, 0, nullptr, nullptr},
4703 };
4704
4705 static const EnumPropertyItem rotation_units[] = {
4706 {0, "DEGREES", 0, "Degrees", "Use degrees for measuring angles and rotations"},
4707 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
4708 {0, nullptr, 0, nullptr, nullptr},
4709 };
4710
4711 srna = RNA_def_struct(brna, "UnitSettings", nullptr);
4712 RNA_def_struct_ui_text(srna, "Unit Settings", "");
4713 RNA_def_struct_nested(brna, srna, "Scene");
4714 RNA_def_struct_path_func(srna, "rna_UnitSettings_path");
4715
4716 /* Units */
4717 prop = RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
4718 RNA_def_property_enum_items(prop, unit_systems);
4720 prop, "Unit System", "The unit system to use for user interface controls");
4721 RNA_def_property_update(prop, NC_WINDOW, "rna_UnitSettings_system_update");
4722
4723 prop = RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
4724 RNA_def_property_enum_items(prop, rotation_units);
4726 prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
4727 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4728
4729 prop = RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
4731 prop,
4732 "Unit Scale",
4733 "Scale to use when converting between Blender units and dimensions."
4734 " When working at microscopic or astronomical scale, a small or large unit scale"
4735 " respectively can be used to avoid numerical precision problems");
4736 RNA_def_property_range(prop, 1e-9f, 1e+9f);
4737 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 6);
4738 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4739
4740 prop = RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
4741 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_UNIT_OPT_SPLIT);
4742 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs (e.g. 1m 0cm)");
4743 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4744
4745 prop = RNA_def_property(srna, "length_unit", PROP_ENUM, PROP_NONE);
4747 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_length_unit_itemf");
4748 RNA_def_property_ui_text(prop, "Length Unit", "Unit that will be used to display length values");
4749 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4750
4751 prop = RNA_def_property(srna, "mass_unit", PROP_ENUM, PROP_NONE);
4753 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_mass_unit_itemf");
4754 RNA_def_property_ui_text(prop, "Mass Unit", "Unit that will be used to display mass values");
4755 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4756
4757 prop = RNA_def_property(srna, "time_unit", PROP_ENUM, PROP_NONE);
4759 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_time_unit_itemf");
4760 RNA_def_property_ui_text(prop, "Time Unit", "Unit that will be used to display time values");
4761 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4762
4763 prop = RNA_def_property(srna, "temperature_unit", PROP_ENUM, PROP_NONE);
4765 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_temperature_unit_itemf");
4767 prop, "Temperature Unit", "Unit that will be used to display temperature values");
4768 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4769}
4770
4772{
4773 StructRNA *srna;
4774 PropertyRNA *prop;
4775 srna = RNA_def_struct(brna, "ViewLayerEEVEE", nullptr);
4776 RNA_def_struct_path_func(srna, "rna_ViewLayerEEVEE_path");
4777 RNA_def_struct_ui_text(srna, "EEVEE Settings", "View Layer settings for EEVEE");
4778
4779 prop = RNA_def_property(srna, "use_pass_volume_direct", PROP_BOOLEAN, PROP_NONE);
4780 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", EEVEE_RENDER_PASS_VOLUME_LIGHT);
4781 RNA_def_property_ui_text(prop, "Volume Light", "Deliver volume direct light pass");
4782 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4783
4784# if 1
4785 /* Bloom is deprecated since Blender 4.2, is kept for add-on compatibility reasons and needs to
4786 * be removed in a future release. */
4787 prop = RNA_def_property(srna, "use_pass_bloom", PROP_BOOLEAN, PROP_NONE);
4788 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", 0 /*EEVEE_RENDER_PASS_BLOOM*/);
4789 RNA_def_property_ui_text(prop, "Bloom", "Deliver bloom pass (deprecated)");
4790 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4791# endif
4792
4793 prop = RNA_def_property(srna, "use_pass_transparent", PROP_BOOLEAN, PROP_NONE);
4794 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", EEVEE_RENDER_PASS_TRANSPARENT);
4796 prop, "Transparent", "Deliver alpha blended surfaces in a separate pass");
4797 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4798
4799 prop = RNA_def_property(srna, "ambient_occlusion_distance", PROP_FLOAT, PROP_DISTANCE);
4800 RNA_def_property_range(prop, 0.0f, 100000.0f);
4801 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
4803 prop, "Distance", "Distance of object that contribute to the ambient occlusion effect");
4805}
4806
4808{
4809 StructRNA *srna;
4810 // PropertyRNA *prop;
4811
4812 FunctionRNA *func;
4813 PropertyRNA *parm;
4814
4815 RNA_def_property_srna(cprop, "AOVs");
4816 srna = RNA_def_struct(brna, "AOVs", nullptr);
4817 RNA_def_struct_sdna(srna, "ViewLayer");
4818 RNA_def_struct_ui_text(srna, "List of AOVs", "Collection of AOVs");
4819
4820 func = RNA_def_function(srna, "add", "BKE_view_layer_add_aov");
4821 parm = RNA_def_pointer(func, "aov", "AOV", "", "Newly created AOV");
4822 RNA_def_function_return(func, parm);
4823
4824 /* Defined in `rna_layer.cc`. */
4825 func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove_aov");
4826 parm = RNA_def_pointer(func, "aov", "AOV", "", "AOV to remove");
4827 RNA_def_function_ui_description(func, "Remove an AOV");
4831}
4832
4834{
4835 StructRNA *srna;
4836 PropertyRNA *prop;
4837 srna = RNA_def_struct(brna, "AOV", nullptr);
4838 RNA_def_struct_sdna(srna, "ViewLayerAOV");
4839 RNA_def_struct_ui_text(srna, "Shader AOV", "");
4840
4841 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4842 RNA_def_property_string_sdna(prop, nullptr, "name");
4844 RNA_def_property_ui_text(prop, "Name", "Name of the AOV");
4845 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4846 RNA_def_struct_name_property(srna, prop);
4847
4848 prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
4850 RNA_def_property_ui_text(prop, "Valid", "Is the name of the AOV conflicting");
4851
4852 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4853 RNA_def_property_enum_sdna(prop, nullptr, "type");
4856 RNA_def_property_ui_text(prop, "Type", "Data type of the AOV");
4857 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4858}
4859
4861{
4862 StructRNA *srna;
4863 // PropertyRNA *prop;
4864
4865 FunctionRNA *func;
4866 PropertyRNA *parm;
4867
4868 RNA_def_property_srna(cprop, "Lightgroups");
4869 srna = RNA_def_struct(brna, "Lightgroups", nullptr);
4870 RNA_def_struct_sdna(srna, "ViewLayer");
4871 RNA_def_struct_ui_text(srna, "List of Lightgroups", "Collection of Lightgroups");
4872
4873 func = RNA_def_function(srna, "add", "BKE_view_layer_add_lightgroup");
4874 parm = RNA_def_pointer(func, "lightgroup", "Lightgroup", "", "Newly created Lightgroup");
4875 RNA_def_function_return(func, parm);
4876 parm = RNA_def_string(func, "name", nullptr, 0, "Name", "Name of newly created lightgroup");
4877
4878 func = RNA_def_function(srna, "remove", "BKE_view_layer_remove_lightgroup");
4879 parm = RNA_def_pointer(func, "lightgroup", "Lightgroup", "", "Lightgroup to remove");
4880 RNA_def_function_ui_description(func, "Remove given light group");
4883}
4884
4886{
4887 StructRNA *srna;
4888 PropertyRNA *prop;
4889 srna = RNA_def_struct(brna, "Lightgroup", nullptr);
4890 RNA_def_struct_sdna(srna, "ViewLayerLightgroup");
4891 RNA_def_struct_ui_text(srna, "Light Group", "");
4892
4893 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4896 "rna_ViewLayerLightgroup_name_get",
4897 "rna_ViewLayerLightgroup_name_length",
4898 "rna_ViewLayerLightgroup_name_set");
4899 RNA_def_property_ui_text(prop, "Name", "Name of the Lightgroup");
4900 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4901 RNA_def_struct_name_property(srna, prop);
4902}
4903
4904void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool scene)
4905{
4906 PropertyRNA *prop;
4907
4908 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4909 if (scene) {
4910 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_ViewLayer_name_set");
4911 }
4912 else {
4913 RNA_def_property_string_sdna(prop, nullptr, "name");
4914 }
4915 RNA_def_property_ui_text(prop, "Name", "View layer name");
4916 RNA_def_struct_name_property(srna, prop);
4917 if (scene) {
4919 }
4920 else {
4922 }
4923
4924 if (scene) {
4925 prop = RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
4926 RNA_def_property_pointer_sdna(prop, nullptr, "mat_override");
4927 RNA_def_property_struct_type(prop, "Material");
4931 prop, "Material Override", "Material to override all other materials in this view layer");
4932 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_override_update");
4933
4934 prop = RNA_def_property(srna, "world_override", PROP_POINTER, PROP_NONE);
4935 RNA_def_property_pointer_sdna(prop, nullptr, "world_override");
4936 RNA_def_property_struct_type(prop, "World");
4939 RNA_def_property_ui_text(prop, "World Override", "Override world in this view layer");
4940 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_override_update");
4941
4942 prop = RNA_def_property(srna, "samples", PROP_INT, PROP_UNSIGNED);
4944 "Samples",
4945 "Override number of render samples for this view layer, "
4946 "0 will use the scene setting");
4948
4949 prop = RNA_def_property(srna, "pass_alpha_threshold", PROP_FLOAT, PROP_FACTOR);
4951 prop,
4952 "Alpha Threshold",
4953 "Z, Index, normal, UV and vector passes are only affected by surfaces with "
4954 "alpha transparency equal to or higher than this threshold");
4956
4957 prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
4959 RNA_def_property_struct_type(prop, "ViewLayerEEVEE");
4960 RNA_def_property_ui_text(prop, "EEVEE Settings", "View layer settings for EEVEE");
4961
4962 prop = RNA_def_property(srna, "aovs", PROP_COLLECTION, PROP_NONE);
4963 RNA_def_property_collection_sdna(prop, nullptr, "aovs", nullptr);
4964 RNA_def_property_struct_type(prop, "AOV");
4965 RNA_def_property_ui_text(prop, "Shader AOV", "");
4966 rna_def_view_layer_aovs(brna, prop);
4967
4968 prop = RNA_def_property(srna, "active_aov", PROP_POINTER, PROP_NONE);
4969 RNA_def_property_struct_type(prop, "AOV");
4971 RNA_def_property_ui_text(prop, "Shader AOV", "Active AOV");
4972
4973 prop = RNA_def_property(srna, "active_aov_index", PROP_INT, PROP_UNSIGNED);
4975 "rna_ViewLayer_active_aov_index_get",
4976 "rna_ViewLayer_active_aov_index_set",
4977 "rna_ViewLayer_active_aov_index_range");
4978 RNA_def_property_ui_text(prop, "Active AOV Index", "Index of active AOV");
4980
4981 prop = RNA_def_property(srna, "lightgroups", PROP_COLLECTION, PROP_NONE);
4982 RNA_def_property_collection_sdna(prop, nullptr, "lightgroups", nullptr);
4983 RNA_def_property_struct_type(prop, "Lightgroup");
4984 RNA_def_property_ui_text(prop, "Light Groups", "");
4986
4987 prop = RNA_def_property(srna, "active_lightgroup", PROP_POINTER, PROP_NONE);
4988 RNA_def_property_struct_type(prop, "Lightgroup");
4990 RNA_def_property_ui_text(prop, "Light Groups", "Active Lightgroup");
4991
4992 prop = RNA_def_property(srna, "active_lightgroup_index", PROP_INT, PROP_UNSIGNED);
4994 "rna_ViewLayer_active_lightgroup_index_get",
4995 "rna_ViewLayer_active_lightgroup_index_set",
4996 "rna_ViewLayer_active_lightgroup_index_range");
4997 RNA_def_property_ui_text(prop, "Active Lightgroup Index", "Index of active lightgroup");
4999
5000 prop = RNA_def_property(srna, "use_pass_cryptomatte_object", PROP_BOOLEAN, PROP_NONE);
5002 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_OBJECT);
5004 prop,
5005 "Cryptomatte Object",
5006 "Render cryptomatte object pass, for isolating objects in compositing");
5007 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5008
5009 prop = RNA_def_property(srna, "use_pass_cryptomatte_material", PROP_BOOLEAN, PROP_NONE);
5011 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_MATERIAL);
5013 prop,
5014 "Cryptomatte Material",
5015 "Render cryptomatte material pass, for isolating materials in compositing");
5016 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5017
5018 prop = RNA_def_property(srna, "use_pass_cryptomatte_asset", PROP_BOOLEAN, PROP_NONE);
5019 RNA_def_property_boolean_sdna(prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_ASSET);
5021 prop,
5022 "Cryptomatte Asset",
5023 "Render cryptomatte asset pass, for isolating groups of objects with the same parent");
5024 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5025
5026 prop = RNA_def_property(srna, "pass_cryptomatte_depth", PROP_INT, PROP_NONE);
5027 RNA_def_property_int_sdna(prop, nullptr, "cryptomatte_levels");
5028 RNA_def_property_range(prop, 2.0, 16.0);
5030 prop, "Cryptomatte Levels", "Sets how many unique objects can be distinguished per pixel");
5031 RNA_def_property_ui_range(prop, 2.0, 16.0, 2.0, 0.0);
5032 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5033
5034 prop = RNA_def_property(srna, "use_pass_cryptomatte_accurate", PROP_BOOLEAN, PROP_NONE);
5036 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_ACCURATE);
5038 prop, "Cryptomatte Accurate", "Generate a more accurate cryptomatte pass");
5039 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5040 }
5041
5042 prop = RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
5043 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_SOLID);
5044 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
5045 if (scene) {
5047 }
5048 else {
5050 }
5051 prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
5052 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_SKY);
5053 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
5054 if (scene) {
5055 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
5056 }
5057 else {
5059 }
5060
5061 prop = RNA_def_property(srna, "use_ao", PROP_BOOLEAN, PROP_NONE);
5062 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_AO);
5063 RNA_def_property_ui_text(prop, "Ambient Occlusion", "Render Ambient Occlusion in this Layer");
5064 if (scene) {
5065 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
5066 }
5067 else {
5069 }
5070
5071 prop = RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
5072 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_STRAND);
5073 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
5074 if (scene) {
5076 }
5077 else {
5079 }
5080
5081 prop = RNA_def_property(srna, "use_volumes", PROP_BOOLEAN, PROP_NONE);
5082 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_VOLUMES);
5083 RNA_def_property_ui_text(prop, "Volumes", "Render volumes in this Layer");
5084 if (scene) {
5086 }
5087 else {
5089 }
5090
5091 prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
5092 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_MOTION_BLUR);
5094 prop, "Motion Blur", "Render motion blur in this Layer, if enabled in the scene");
5095 if (scene) {
5097 }
5098 else {
5100 }
5101
5102 prop = RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
5103 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_GREASE_PENCIL);
5104 RNA_def_property_ui_text(prop, "Grease Pencil", "Render Grease Pencil on this layer");
5105 if (scene) {
5107 }
5108 else {
5110 }
5111
5112 /* passes */
5113 prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
5114 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_COMBINED);
5115 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
5116 if (scene) {
5117 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5118 }
5119 else {
5121 }
5122
5123 prop = RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
5124 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DEPTH);
5125 RNA_def_property_ui_text(prop, "Depth", "Deliver depth values pass");
5126 if (scene) {
5127 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5128 }
5129 else {
5131 }
5132
5133 prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
5134 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_VECTOR);
5135 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
5136 if (scene) {
5137 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5138 }
5139 else {
5141 }
5142
5143 prop = RNA_def_property(srna, "use_pass_position", PROP_BOOLEAN, PROP_NONE);
5144 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_POSITION);
5145 RNA_def_property_ui_text(prop, "Position", "Deliver position pass");
5146 if (scene) {
5147 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5148 }
5149 else {
5151 }
5152
5153 prop = RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
5154 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_NORMAL);
5155 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
5156 if (scene) {
5157 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5158 }
5159 else {
5161 }
5162
5163 prop = RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
5164 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_UV);
5165 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
5166 if (scene) {
5167 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5168 }
5169 else {
5171 }
5172
5173 prop = RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
5174 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_MIST);
5175 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0 to 1.0)");
5176 if (scene) {
5177 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5178 }
5179 else {
5181 }
5182
5183 prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
5184 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_INDEXOB);
5185 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
5187 if (scene) {
5188 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5189 }
5190 else {
5192 }
5193
5194 prop = RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
5195 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_INDEXMA);
5196 RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
5197 if (scene) {
5198 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5199 }
5200 else {
5202 }
5203
5204 prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
5205 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_SHADOW);
5206 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
5207 if (scene) {
5208 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5209 }
5210 else {
5212 }
5213
5214 prop = RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
5215 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_AO);
5216 RNA_def_property_ui_text(prop, "Ambient Occlusion", "Deliver Ambient Occlusion pass");
5217 if (scene) {
5218 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5219 }
5220 else {
5222 }
5223
5224 prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
5225 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_EMIT);
5226 RNA_def_property_ui_text(prop, "Emission", "Deliver emission pass");
5227 if (scene) {
5228 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5229 }
5230 else {
5232 }
5233
5234 prop = RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
5235 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_ENVIRONMENT);
5236 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
5237 if (scene) {
5238 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5239 }
5240 else {
5242 }
5243
5244 prop = RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
5245 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_DIRECT);
5246 RNA_def_property_ui_text(prop, "Diffuse Direct", "Deliver diffuse direct pass");
5247 if (scene) {
5248 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5249 }
5250 else {
5252 }
5253
5254 prop = RNA_def_property(srna, "use_pass_diffuse_indirect", PROP_BOOLEAN, PROP_NONE);
5255 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_INDIRECT);
5256 RNA_def_property_ui_text(prop, "Diffuse Indirect", "Deliver diffuse indirect pass");
5257 if (scene) {
5258 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5259 }
5260 else {
5262 }
5263
5264 prop = RNA_def_property(srna, "use_pass_diffuse_color", PROP_BOOLEAN, PROP_NONE);
5265 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_COLOR);
5266 RNA_def_property_ui_text(prop, "Diffuse Color", "Deliver diffuse color pass");
5267 if (scene) {
5268 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5269 }
5270 else {
5272 }
5273
5274 prop = RNA_def_property(srna, "use_pass_glossy_direct", PROP_BOOLEAN, PROP_NONE);
5275 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_DIRECT);
5276 RNA_def_property_ui_text(prop, "Glossy Direct", "Deliver glossy direct pass");
5277 if (scene) {
5278 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5279 }
5280 else {
5282 }
5283
5284 prop = RNA_def_property(srna, "use_pass_glossy_indirect", PROP_BOOLEAN, PROP_NONE);
5285 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_INDIRECT);
5286 RNA_def_property_ui_text(prop, "Glossy Indirect", "Deliver glossy indirect pass");
5287 if (scene) {
5288 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5289 }
5290 else {
5292 }
5293
5294 prop = RNA_def_property(srna, "use_pass_glossy_color", PROP_BOOLEAN, PROP_NONE);
5295 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_COLOR);
5296 RNA_def_property_ui_text(prop, "Glossy Color", "Deliver glossy color pass");
5297 if (scene) {
5298 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5299 }
5300 else {
5302 }
5303
5304 prop = RNA_def_property(srna, "use_pass_transmission_direct", PROP_BOOLEAN, PROP_NONE);
5305 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_DIRECT);
5306 RNA_def_property_ui_text(prop, "Transmission Direct", "Deliver transmission direct pass");
5307 if (scene) {
5308 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5309 }
5310 else {
5312 }
5313
5314 prop = RNA_def_property(srna, "use_pass_transmission_indirect", PROP_BOOLEAN, PROP_NONE);
5315 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_INDIRECT);
5316 RNA_def_property_ui_text(prop, "Transmission Indirect", "Deliver transmission indirect pass");
5317 if (scene) {
5318 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5319 }
5320 else {
5322 }
5323
5324 prop = RNA_def_property(srna, "use_pass_transmission_color", PROP_BOOLEAN, PROP_NONE);
5325 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_COLOR);
5326 RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass");
5327 if (scene) {
5328 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5329 }
5330 else {
5332 }
5333
5334 prop = RNA_def_property(srna, "use_pass_subsurface_direct", PROP_BOOLEAN, PROP_NONE);
5336 RNA_def_property_ui_text(prop, "Subsurface Direct", "Deliver subsurface direct pass");
5337 if (scene) {
5338 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5339 }
5340 else {
5342 }
5343
5344 prop = RNA_def_property(srna, "use_pass_subsurface_indirect", PROP_BOOLEAN, PROP_NONE);
5346 RNA_def_property_ui_text(prop, "Subsurface Indirect", "Deliver subsurface indirect pass");
5347 if (scene) {
5348 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5349 }
5350 else {
5352 }
5353
5354 prop = RNA_def_property(srna, "use_pass_subsurface_color", PROP_BOOLEAN, PROP_NONE);
5355 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_SUBSURFACE_COLOR);
5356 RNA_def_property_ui_text(prop, "Subsurface Color", "Deliver subsurface color pass");
5357 if (scene) {
5358 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5359 }
5360 else {
5362 }
5363}
5364
5366{
5367 StructRNA *srna;
5368 FunctionRNA *func;
5369 PropertyRNA *parm;
5370
5371 RNA_def_property_srna(cprop, "FreestyleModules");
5372 srna = RNA_def_struct(brna, "FreestyleModules", nullptr);
5373 RNA_def_struct_sdna(srna, "FreestyleSettings");
5375 srna, "Style Modules", "A list of style modules (to be applied from top to bottom)");
5376
5377 func = RNA_def_function(srna, "new", "rna_FreestyleSettings_module_add");
5379 "Add a style module to scene render layer Freestyle settings");
5381 parm = RNA_def_pointer(
5382 func, "module", "FreestyleModuleSettings", "", "Newly created style module");
5383 RNA_def_function_return(func, parm);
5384
5385 func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_module_remove");
5387 func, "Remove a style module from scene render layer Freestyle settings");
5389 parm = RNA_def_pointer(func, "module", "FreestyleModuleSettings", "", "Style module to remove");
5392}
5393
5395{
5396 StructRNA *srna;
5397 PropertyRNA *prop;
5398 FunctionRNA *func;
5399 PropertyRNA *parm;
5400
5401 RNA_def_property_srna(cprop, "Linesets");
5402 srna = RNA_def_struct(brna, "Linesets", nullptr);
5403 RNA_def_struct_sdna(srna, "FreestyleSettings");
5405 srna, "Line Sets", "Line sets for associating lines and style parameters");
5406
5407 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
5408 RNA_def_property_struct_type(prop, "FreestyleLineSet");
5410 prop, "rna_FreestyleSettings_active_lineset_get", nullptr, nullptr, nullptr);
5411 RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed");
5413
5414 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
5416 "rna_FreestyleSettings_active_lineset_index_get",
5417 "rna_FreestyleSettings_active_lineset_index_set",
5418 "rna_FreestyleSettings_active_lineset_index_range");
5419 RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
5421
5422 func = RNA_def_function(srna, "new", "rna_FreestyleSettings_lineset_add");
5423 RNA_def_function_ui_description(func, "Add a line set to scene render layer Freestyle settings");
5425 parm = RNA_def_string(func, "name", "LineSet", 0, "", "New name for the line set (not unique)");
5427 parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Newly created line set");
5428 RNA_def_function_return(func, parm);
5429
5430 func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_lineset_remove");
5432 "Remove a line set from scene render layer Freestyle settings");
5434 parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Line set to remove");
5437}
5438
5440{
5441 StructRNA *srna;
5442 PropertyRNA *prop;
5443
5444 static const EnumPropertyItem edge_type_negation_items[] = {
5445 {0,
5446 "INCLUSIVE",
5447 0,
5448 "Inclusive",
5449 "Select feature edges satisfying the given edge type conditions"},
5451 "EXCLUSIVE",
5452 0,
5453 "Exclusive",
5454 "Select feature edges not satisfying the given edge type conditions"},
5455 {0, nullptr, 0, nullptr, nullptr},
5456 };
5457
5458 static const EnumPropertyItem edge_type_combination_items[] = {
5459 {0,
5460 "OR",
5461 0,
5462 "Logical OR",
5463 "Select feature edges satisfying at least one of edge type conditions"},
5465 "AND",
5466 0,
5467 "Logical AND",
5468 "Select feature edges satisfying all edge type conditions"},
5469 {0, nullptr, 0, nullptr, nullptr},
5470 };
5471
5472 static const EnumPropertyItem collection_negation_items[] = {
5473 {0,
5474 "INCLUSIVE",
5475 0,
5476 "Inclusive",
5477 "Select feature edges belonging to some object in the group"},
5479 "EXCLUSIVE",
5480 0,
5481 "Exclusive",
5482 "Select feature edges not belonging to any object in the group"},
5483 {0, nullptr, 0, nullptr, nullptr},
5484 };
5485
5486 static const EnumPropertyItem face_mark_negation_items[] = {
5487 {0,
5488 "INCLUSIVE",
5489 0,
5490 "Inclusive",
5491 "Select feature edges satisfying the given face mark conditions"},
5493 "EXCLUSIVE",
5494 0,
5495 "Exclusive",
5496 "Select feature edges not satisfying the given face mark conditions"},
5497 {0, nullptr, 0, nullptr, nullptr},
5498 };
5499
5500 static const EnumPropertyItem face_mark_condition_items[] = {
5501 {0, "ONE", 0, "One Face", "Select a feature edge if either of its adjacent faces is marked"},
5503 "BOTH",
5504 0,
5505 "Both Faces",
5506 "Select a feature edge if both of its adjacent faces are marked"},
5507 {0, nullptr, 0, nullptr, nullptr},
5508 };
5509
5510 static const EnumPropertyItem freestyle_ui_mode_items[] = {
5512 "SCRIPT",
5513 0,
5514 "Python Scripting",
5515 "Advanced mode for using style modules written in Python"},
5517 "EDITOR",
5518 0,
5519 "Parameter Editor",
5520 "Basic mode for interactive style parameter editing"},
5521 {0, nullptr, 0, nullptr, nullptr},
5522 };
5523
5524 static const EnumPropertyItem visibility_items[] = {
5525 {FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible feature edges"},
5526 {FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden feature edges"},
5528 "RANGE",
5529 0,
5530 "Quantitative Invisibility",
5531 "Select feature edges within a range of quantitative invisibility (QI) values"},
5532 {0, nullptr, 0, nullptr, nullptr},
5533 };
5534
5535 /* FreestyleLineSet */
5536
5537 srna = RNA_def_struct(brna, "FreestyleLineSet", nullptr);
5539 srna, "Freestyle Line Set", "Line set for associating lines and style parameters");
5540
5541 /* access to line style settings is redirected through functions
5542 * to allow proper id-buttons functionality
5543 */
5544 prop = RNA_def_property(srna, "linestyle", PROP_POINTER, PROP_NONE);
5545 RNA_def_property_struct_type(prop, "FreestyleLineStyle");
5548 "rna_FreestyleLineSet_linestyle_get",
5549 "rna_FreestyleLineSet_linestyle_set",
5550 nullptr,
5551 nullptr);
5552 RNA_def_property_ui_text(prop, "Line Style", "Line style settings");
5553 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5554
5555 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5556 RNA_def_property_string_sdna(prop, nullptr, "name");
5557 RNA_def_property_ui_text(prop, "Line Set Name", "Line set name");
5559 RNA_def_struct_name_property(srna, prop);
5560
5561 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
5564 prop, "Render", "Enable or disable this line set during stroke rendering");
5565 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5566
5567 prop = RNA_def_property(srna, "select_by_visibility", PROP_BOOLEAN, PROP_NONE);
5568 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_VISIBILITY);
5570 prop, "Selection by Visibility", "Select feature edges based on visibility");
5571 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5572
5573 prop = RNA_def_property(srna, "select_by_edge_types", PROP_BOOLEAN, PROP_NONE);
5574 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_EDGE_TYPES);
5576 prop, "Selection by Edge Types", "Select feature edges based on edge types");
5577 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5578
5579 prop = RNA_def_property(srna, "select_by_collection", PROP_BOOLEAN, PROP_NONE);
5580 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_GROUP);
5582 prop, "Selection by Collection", "Select feature edges based on a collection of objects");
5583 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5584
5585 prop = RNA_def_property(srna, "select_by_image_border", PROP_BOOLEAN, PROP_NONE);
5586 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_IMAGE_BORDER);
5588 "Selection by Image Border",
5589 "Select feature edges by image border (less memory consumption)");
5590 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5591
5592 prop = RNA_def_property(srna, "select_by_face_marks", PROP_BOOLEAN, PROP_NONE);
5593 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_FACE_MARK);
5594 RNA_def_property_ui_text(prop, "Selection by Face Marks", "Select feature edges by face marks");
5595 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5596
5597 prop = RNA_def_property(srna, "edge_type_negation", PROP_ENUM, PROP_NONE);
5598 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5599 RNA_def_property_enum_items(prop, edge_type_negation_items);
5601 prop,
5602 "Edge Type Negation",
5603 "Specify either inclusion or exclusion of feature edges selected by edge types");
5604 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5605
5606 prop = RNA_def_property(srna, "edge_type_combination", PROP_ENUM, PROP_NONE);
5607 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5608 RNA_def_property_enum_items(prop, edge_type_combination_items);
5610 prop,
5611 "Edge Type Combination",
5612 "Specify a logical combination of selection conditions on feature edge types");
5613 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5614
5615 prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
5616 RNA_def_property_pointer_sdna(prop, nullptr, "group");
5617 RNA_def_property_struct_type(prop, "Collection");
5620 prop, "Collection", "A collection of objects based on which feature edges are selected");
5621 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5622
5623 prop = RNA_def_property(srna, "collection_negation", PROP_ENUM, PROP_NONE);
5624 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5625 RNA_def_property_enum_items(prop, collection_negation_items);
5627 "Collection Negation",
5628 "Specify either inclusion or exclusion of feature edges belonging to a "
5629 "collection of objects");
5630 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5631
5632 prop = RNA_def_property(srna, "face_mark_negation", PROP_ENUM, PROP_NONE);
5633 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5634 RNA_def_property_enum_items(prop, face_mark_negation_items);
5636 prop,
5637 "Face Mark Negation",
5638 "Specify either inclusion or exclusion of feature edges selected by face marks");
5639 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5640
5641 prop = RNA_def_property(srna, "face_mark_condition", PROP_ENUM, PROP_NONE);
5642 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5643 RNA_def_property_enum_items(prop, face_mark_condition_items);
5645 "Face Mark Condition",
5646 "Specify a feature edge selection condition based on face marks");
5647 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5648
5649 prop = RNA_def_property(srna, "select_silhouette", PROP_BOOLEAN, PROP_NONE);
5650 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_SILHOUETTE);
5652 prop,
5653 "Silhouette",
5654 "Select silhouettes (edges at the boundary of visible and hidden faces)");
5655 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5656
5657 prop = RNA_def_property(srna, "select_border", PROP_BOOLEAN, PROP_NONE);
5658 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_BORDER);
5659 RNA_def_property_ui_text(prop, "Border", "Select border edges (open mesh edges)");
5660 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5661
5662 prop = RNA_def_property(srna, "select_crease", PROP_BOOLEAN, PROP_NONE);
5663 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_CREASE);
5665 "Crease",
5666 "Select crease edges (those between two faces making an angle smaller "
5667 "than the Crease Angle)");
5668 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5669
5670 prop = RNA_def_property(srna, "select_ridge_valley", PROP_BOOLEAN, PROP_NONE);
5671 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_RIDGE_VALLEY);
5673 prop,
5674 "Ridge & Valley",
5675 "Select ridges and valleys (boundary lines between convex and concave areas of surface)");
5676 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5677
5678 prop = RNA_def_property(srna, "select_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
5681 prop, "Suggestive Contour", "Select suggestive contours (almost silhouette/contour edges)");
5682 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5683
5684 prop = RNA_def_property(srna, "select_material_boundary", PROP_BOOLEAN, PROP_NONE);
5686 RNA_def_property_ui_text(prop, "Material Boundary", "Select edges at material boundaries");
5687 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5688
5689 prop = RNA_def_property(srna, "select_contour", PROP_BOOLEAN, PROP_NONE);
5690 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_CONTOUR);
5691 RNA_def_property_ui_text(prop, "Contour", "Select contours (outer silhouettes of each object)");
5692 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5693
5694 prop = RNA_def_property(srna, "select_external_contour", PROP_BOOLEAN, PROP_NONE);
5697 prop,
5698 "External Contour",
5699 "Select external contours (outer silhouettes of occluding and occluded objects)");
5700 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5701
5702 prop = RNA_def_property(srna, "select_edge_mark", PROP_BOOLEAN, PROP_NONE);
5703 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_EDGE_MARK);
5705 prop, "Edge Mark", "Select edge marks (edges annotated by Freestyle edge marks)");
5706 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5707
5708 prop = RNA_def_property(srna, "exclude_silhouette", PROP_BOOLEAN, PROP_NONE);
5709 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_SILHOUETTE);
5710 RNA_def_property_ui_text(prop, "Silhouette", "Exclude silhouette edges");
5711 RNA_def_property_ui_icon(prop, ICON_X, 0);
5712 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5713
5714 prop = RNA_def_property(srna, "exclude_border", PROP_BOOLEAN, PROP_NONE);
5715 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_BORDER);
5716 RNA_def_property_ui_text(prop, "Border", "Exclude border edges");
5717 RNA_def_property_ui_icon(prop, ICON_X, 0);
5718 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5719
5720 prop = RNA_def_property(srna, "exclude_crease", PROP_BOOLEAN, PROP_NONE);
5721 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_CREASE);
5722 RNA_def_property_ui_text(prop, "Crease", "Exclude crease edges");
5723 RNA_def_property_ui_icon(prop, ICON_X, 0);
5724 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5725
5726 prop = RNA_def_property(srna, "exclude_ridge_valley", PROP_BOOLEAN, PROP_NONE);
5727 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_RIDGE_VALLEY);
5728 RNA_def_property_ui_text(prop, "Ridge & Valley", "Exclude ridges and valleys");
5729 RNA_def_property_ui_icon(prop, ICON_X, 0);
5730 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5731
5732 prop = RNA_def_property(srna, "exclude_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
5734 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_SUGGESTIVE_CONTOUR);
5735 RNA_def_property_ui_text(prop, "Suggestive Contour", "Exclude suggestive contours");
5736 RNA_def_property_ui_icon(prop, ICON_X, 0);
5737 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5738
5739 prop = RNA_def_property(srna, "exclude_material_boundary", PROP_BOOLEAN, PROP_NONE);
5741 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_MATERIAL_BOUNDARY);
5742 RNA_def_property_ui_text(prop, "Material Boundary", "Exclude edges at material boundaries");
5743 RNA_def_property_ui_icon(prop, ICON_X, 0);
5744 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5745
5746 prop = RNA_def_property(srna, "exclude_contour", PROP_BOOLEAN, PROP_NONE);
5747 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_CONTOUR);
5748 RNA_def_property_ui_text(prop, "Contour", "Exclude contours");
5749 RNA_def_property_ui_icon(prop, ICON_X, 0);
5750 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5751
5752 prop = RNA_def_property(srna, "exclude_external_contour", PROP_BOOLEAN, PROP_NONE);
5754 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_EXTERNAL_CONTOUR);
5755 RNA_def_property_ui_text(prop, "External Contour", "Exclude external contours");
5756 RNA_def_property_ui_icon(prop, ICON_X, 0);
5757 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5758
5759 prop = RNA_def_property(srna, "exclude_edge_mark", PROP_BOOLEAN, PROP_NONE);
5760 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_EDGE_MARK);
5761 RNA_def_property_ui_text(prop, "Edge Mark", "Exclude edge marks");
5762 RNA_def_property_ui_icon(prop, ICON_X, 0);
5763 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5764
5765 prop = RNA_def_property(srna, "visibility", PROP_ENUM, PROP_NONE);
5766 RNA_def_property_enum_sdna(prop, nullptr, "qi");
5767 RNA_def_property_enum_items(prop, visibility_items);
5769 prop, "Visibility", "Determine how to use visibility for feature edge selection");
5770 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5771
5772 prop = RNA_def_property(srna, "qi_start", PROP_INT, PROP_UNSIGNED);
5773 RNA_def_property_int_sdna(prop, nullptr, "qi_start");
5774 RNA_def_property_range(prop, 0, INT_MAX);
5775 RNA_def_property_ui_text(prop, "Start", "First QI value of the QI range");
5776 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5777
5778 prop = RNA_def_property(srna, "qi_end", PROP_INT, PROP_UNSIGNED);
5779 RNA_def_property_int_sdna(prop, nullptr, "qi_end");
5780 RNA_def_property_range(prop, 0, INT_MAX);
5781 RNA_def_property_ui_text(prop, "End", "Last QI value of the QI range");
5782 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5783
5784 /* FreestyleModuleSettings */
5785
5786 srna = RNA_def_struct(brna, "FreestyleModuleSettings", nullptr);
5787 RNA_def_struct_sdna(srna, "FreestyleModuleConfig");
5789 srna, "Freestyle Module", "Style module configuration for specifying a style module");
5790
5791 prop = RNA_def_property(srna, "script", PROP_POINTER, PROP_NONE);
5792 RNA_def_property_struct_type(prop, "Text");
5794 RNA_def_property_ui_text(prop, "Style Module", "Python script to define a style module");
5795 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5796
5797 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
5798 RNA_def_property_boolean_sdna(prop, nullptr, "is_displayed", 1);
5800 prop, "Use", "Enable or disable this style module during stroke rendering");
5801 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5802
5803 /* FreestyleSettings */
5804
5805 srna = RNA_def_struct(brna, "FreestyleSettings", nullptr);
5806 RNA_def_struct_sdna(srna, "FreestyleConfig");
5807 RNA_def_struct_nested(brna, srna, "ViewLayer");
5809 srna, "Freestyle Settings", "Freestyle settings for a ViewLayer data-block");
5810
5811 prop = RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
5812 RNA_def_property_collection_sdna(prop, nullptr, "modules", nullptr);
5813 RNA_def_property_struct_type(prop, "FreestyleModuleSettings");
5815 prop, "Style Modules", "A list of style modules (to be applied from top to bottom)");
5816 rna_def_freestyle_modules(brna, prop);
5817
5818 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
5819 RNA_def_property_enum_sdna(prop, nullptr, "mode");
5820 RNA_def_property_enum_items(prop, freestyle_ui_mode_items);
5821 RNA_def_property_ui_text(prop, "Control Mode", "Select the Freestyle control mode");
5822 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5823
5824 prop = RNA_def_property(srna, "use_culling", PROP_BOOLEAN, PROP_NONE);
5825 RNA_def_property_boolean_sdna(prop, nullptr, "flags", FREESTYLE_CULLING);
5826 RNA_def_property_ui_text(prop, "Culling", "If enabled, out-of-view edges are ignored");
5827 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5828
5829 prop = RNA_def_property(srna, "use_suggestive_contours", PROP_BOOLEAN, PROP_NONE);
5831 RNA_def_property_ui_text(prop, "Suggestive Contours", "Enable suggestive contours");
5832 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5833
5834 prop = RNA_def_property(srna, "use_ridges_and_valleys", PROP_BOOLEAN, PROP_NONE);
5836 RNA_def_property_ui_text(prop, "Ridges and Valleys", "Enable ridges and valleys");
5837 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5838
5839 prop = RNA_def_property(srna, "use_material_boundaries", PROP_BOOLEAN, PROP_NONE);
5841 RNA_def_property_ui_text(prop, "Material Boundaries", "Enable material boundaries");
5842 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5843
5844 prop = RNA_def_property(srna, "use_smoothness", PROP_BOOLEAN, PROP_NONE);
5847 prop, "Face Smoothness", "Take face smoothness into account in view map calculation");
5848 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5849
5850 prop = RNA_def_property(srna, "use_view_map_cache", PROP_BOOLEAN, PROP_NONE);
5853 prop,
5854 "View Map Cache",
5855 "Keep the computed view map and avoid recalculating it if mesh geometry is unchanged");
5857 prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_view_map_cache_update");
5858
5859 prop = RNA_def_property(srna, "as_render_pass", PROP_BOOLEAN, PROP_NONE);
5862 prop,
5863 "As Render Pass",
5864 "Renders Freestyle output to a separate pass instead of overlaying it on the Combined pass");
5865 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5866
5867 prop = RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
5868 RNA_def_property_float_sdna(prop, nullptr, "sphere_radius");
5870 RNA_def_property_range(prop, 0.0, 1000.0);
5871 RNA_def_property_ui_text(prop, "Sphere Radius", "Sphere radius for computing curvatures");
5872 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5873
5874 prop = RNA_def_property(srna, "kr_derivative_epsilon", PROP_FLOAT, PROP_NONE);
5876 RNA_def_property_float_sdna(prop, nullptr, "dkr_epsilon");
5877 RNA_def_property_range(prop, -1000.0, 1000.0);
5879 prop, "Kr Derivative Epsilon", "Kr derivative epsilon for computing suggestive contours");
5880 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5881
5882 prop = RNA_def_property(srna, "crease_angle", PROP_FLOAT, PROP_ANGLE);
5883 RNA_def_property_float_sdna(prop, nullptr, "crease_angle");
5884 RNA_def_property_range(prop, 0.0, DEG2RAD(180.0));
5885 RNA_def_property_ui_text(prop, "Crease Angle", "Angular threshold for detecting crease edges");
5886 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5887
5888 prop = RNA_def_property(srna, "linesets", PROP_COLLECTION, PROP_NONE);
5889 RNA_def_property_collection_sdna(prop, nullptr, "linesets", nullptr);
5890 RNA_def_property_struct_type(prop, "FreestyleLineSet");
5891 RNA_def_property_ui_text(prop, "Line Sets", "");
5892 rna_def_freestyle_linesets(brna, prop);
5893}
5894
5896{
5897 static const EnumPropertyItem bake_type_items[] = {
5898 //{R_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
5899 {R_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"},
5900 {R_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"},
5902 "VECTOR_DISPLACEMENT",
5903 0,
5904 "Vector Displacement",
5905 "Bake vector displacement"},
5906 {0, nullptr, 0, nullptr, nullptr},
5907 };
5908
5909 static const EnumPropertyItem displacement_space_items[] = {
5910 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the displacement in object space"},
5911 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the displacement in tangent space"},
5912 {0, nullptr, 0, nullptr, nullptr},
5913 };
5914
5915 StructRNA *srna;
5916 PropertyRNA *prop;
5917
5918 srna = RNA_def_struct(brna, "BakeSettings", nullptr);
5919 RNA_def_struct_sdna(srna, "BakeData");
5920 RNA_def_struct_nested(brna, srna, "RenderSettings");
5921 RNA_def_struct_ui_text(srna, "Bake Data", "Bake data for a Scene data-block");
5922 RNA_def_struct_path_func(srna, "rna_BakeSettings_path");
5923
5924 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
5925 RNA_def_property_enum_items(prop, bake_type_items);
5926 RNA_def_property_ui_text(prop, "Bake Type", "Choose shading information to bake into the image");
5928
5929 prop = RNA_def_property(srna, "cage_object", PROP_POINTER, PROP_NONE);
5931 prop,
5932 "Cage Object",
5933 "Object to use as cage "
5934 "instead of calculating the cage from the active object with cage extrusion");
5937
5938 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
5939 RNA_def_property_ui_text(prop, "File Path", "Image filepath to use when saving externally");
5942
5943 prop = RNA_def_property(srna, "width", PROP_INT, PROP_PIXEL);
5944 RNA_def_property_range(prop, 4, 10000);
5945 RNA_def_property_ui_text(prop, "Width", "Horizontal dimension of the baking map");
5947
5948 prop = RNA_def_property(srna, "height", PROP_INT, PROP_PIXEL);
5949 RNA_def_property_range(prop, 4, 10000);
5950 RNA_def_property_ui_text(prop, "Height", "Vertical dimension of the baking map");
5952
5953 prop = RNA_def_property(srna, "margin", PROP_INT, PROP_PIXEL);
5954 RNA_def_property_range(prop, 0, SHRT_MAX);
5955 RNA_def_property_ui_range(prop, 0, 64, 1, 1);
5956 RNA_def_property_ui_text(prop, "Margin", "Extends the baked result as a post process filter");
5958
5959 prop = RNA_def_property(srna, "margin_type", PROP_ENUM, PROP_NONE);
5961 RNA_def_property_ui_text(prop, "Margin Type", "Algorithm to extend the baked result");
5963
5964 prop = RNA_def_property(srna, "max_ray_distance", PROP_FLOAT, PROP_DISTANCE);
5965 RNA_def_property_range(prop, 0.0, FLT_MAX);
5966 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
5968 "Max Ray Distance",
5969 "The maximum ray distance for matching points between the active and "
5970 "selected objects. If zero, there is no limit.");
5972
5973 prop = RNA_def_property(srna, "cage_extrusion", PROP_FLOAT, PROP_DISTANCE);
5974 RNA_def_property_range(prop, 0.0, FLT_MAX);
5975 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
5977 prop,
5978 "Cage Extrusion",
5979 "Inflate the active object by the specified distance for baking. This helps matching to "
5980 "points nearer to the outside of the selected object meshes.");
5982
5983 prop = RNA_def_property(srna, "normal_space", PROP_ENUM, PROP_NONE);
5984 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_space");
5986 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
5988
5989 prop = RNA_def_property(srna, "normal_r", PROP_ENUM, PROP_NONE);
5990 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[0]");
5992 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in red channel");
5994
5995 prop = RNA_def_property(srna, "normal_g", PROP_ENUM, PROP_NONE);
5996 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[1]");
5998 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in green channel");
6000
6001 prop = RNA_def_property(srna, "normal_b", PROP_ENUM, PROP_NONE);
6002 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[2]");
6004 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in blue channel");
6006
6007 prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
6009 RNA_def_property_pointer_sdna(prop, nullptr, "im_format");
6010 RNA_def_property_struct_type(prop, "ImageFormatSettings");
6011 RNA_def_property_ui_text(prop, "Image Format", "");
6012
6013 prop = RNA_def_property(srna, "target", PROP_ENUM, PROP_NONE);
6015 RNA_def_property_ui_text(prop, "Target", "Where to output the baked map");
6017
6018 prop = RNA_def_property(srna, "save_mode", PROP_ENUM, PROP_NONE);
6019 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "save_mode");
6021 RNA_def_property_ui_text(prop, "Save Mode", "Where to save baked image textures");
6023
6024 prop = RNA_def_property(srna, "view_from", PROP_ENUM, PROP_NONE);
6026 RNA_def_property_ui_text(prop, "View From", "Source of reflection ray directions");
6028
6029 /* flags */
6030 prop = RNA_def_property(srna, "use_selected_to_active", PROP_BOOLEAN, PROP_NONE);
6031 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_TO_ACTIVE);
6033 "Selected to Active",
6034 "Bake shading on the surface of selected objects to the active object");
6036
6037 prop = RNA_def_property(srna, "use_clear", PROP_BOOLEAN, PROP_NONE);
6038 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_CLEAR);
6039 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking (internal only)");
6041
6042 prop = RNA_def_property(srna, "use_split_materials", PROP_BOOLEAN, PROP_NONE);
6043 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_SPLIT_MAT);
6045 prop, "Split Materials", "Split external images per material (external only)");
6047
6048 prop = RNA_def_property(srna, "use_automatic_name", PROP_BOOLEAN, PROP_NONE);
6049 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_AUTO_NAME);
6051 prop,
6052 "Automatic Name",
6053 "Automatically name the output file with the pass type (external only)");
6055
6056 prop = RNA_def_property(srna, "use_cage", PROP_BOOLEAN, PROP_NONE);
6057 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_CAGE);
6058 RNA_def_property_ui_text(prop, "Cage", "Cast rays to active object from a cage");
6060
6061 /* custom passes flags */
6062 prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
6063 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_EMIT);
6064 RNA_def_property_ui_text(prop, "Emission", "Add emission contribution");
6065
6066 prop = RNA_def_property(srna, "use_pass_direct", PROP_BOOLEAN, PROP_NONE);
6067 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_DIRECT);
6068 RNA_def_property_ui_text(prop, "Direct", "Add direct lighting contribution");
6070
6071 prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
6072 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_INDIRECT);
6073 RNA_def_property_ui_text(prop, "Indirect", "Add indirect lighting contribution");
6075
6076 prop = RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
6077 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_COLOR);
6078 RNA_def_property_ui_text(prop, "Color", "Color the pass");
6080
6081 prop = RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
6082 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_DIFFUSE);
6083 RNA_def_property_ui_text(prop, "Diffuse", "Add diffuse contribution");
6085
6086 prop = RNA_def_property(srna, "use_pass_glossy", PROP_BOOLEAN, PROP_NONE);
6087 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_GLOSSY);
6088 RNA_def_property_ui_text(prop, "Glossy", "Add glossy contribution");
6090
6091 prop = RNA_def_property(srna, "use_pass_transmission", PROP_BOOLEAN, PROP_NONE);
6092 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_TRANSM);
6093 RNA_def_property_ui_text(prop, "Transmission", "Add transmission contribution");
6095
6096 prop = RNA_def_property(srna, "pass_filter", PROP_ENUM, PROP_NONE);
6097 RNA_def_property_enum_sdna(prop, nullptr, "pass_filter");
6100 RNA_def_property_ui_text(prop, "Pass Filter", "Passes to include in the active baking pass");
6102
6103 prop = RNA_def_property(srna, "use_multires", PROP_BOOLEAN, PROP_NONE);
6104 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_MULTIRES);
6105 RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object");
6107
6108 prop = RNA_def_property(srna, "use_lores_mesh", PROP_BOOLEAN, PROP_NONE);
6109 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_LORES_MESH);
6111 prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh");
6113
6114 prop = RNA_def_property(srna, "displacement_space", PROP_ENUM, PROP_NONE);
6115 RNA_def_property_enum_sdna(prop, nullptr, "displacement_space");
6116 RNA_def_property_enum_items(prop, displacement_space_items);
6117 RNA_def_property_ui_text(prop, "Displacement Space", "Choose displacement space for baking");
6119}
6120
6122{
6123 StructRNA *srna;
6124 FunctionRNA *func;
6125 PropertyRNA *parm;
6126
6127 RNA_def_property_srna(cprop, "ViewLayers");
6128 srna = RNA_def_struct(brna, "ViewLayers", nullptr);
6129 RNA_def_struct_sdna(srna, "Scene");
6130 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
6131
6132 func = RNA_def_function(srna, "new", "rna_ViewLayer_new");
6133 RNA_def_function_ui_description(func, "Add a view layer to scene");
6135 parm = RNA_def_string(
6136 func, "name", "ViewLayer", 0, "", "New name for the view layer (not unique)");
6138 parm = RNA_def_pointer(func, "result", "ViewLayer", "", "Newly created view layer");
6139 RNA_def_function_return(func, parm);
6140
6141 func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove");
6142 RNA_def_function_ui_description(func, "Remove a view layer");
6144 parm = RNA_def_pointer(func, "layer", "ViewLayer", "", "View layer to remove");
6147
6148 func = RNA_def_function(srna, "move", "rna_ViewLayer_move");
6149 RNA_def_function_ui_description(func, "Move a view layer");
6151 parm = RNA_def_int(
6152 func, "from_index", -1, INT_MIN, INT_MAX, "From Index", "Index to move", 0, 10000);
6154 parm = RNA_def_int(func, "to_index", -1, INT_MIN, INT_MAX, "To Index", "Target index", 0, 10000);
6156}
6157
6158/* Render Views - MultiView */
6160{
6161 StructRNA *srna;
6162 PropertyRNA *prop;
6163
6164 srna = RNA_def_struct(brna, "SceneRenderView", nullptr);
6166 srna, "Scene Render View", "Render viewpoint for 3D stereo and multiview rendering");
6167 RNA_def_struct_ui_icon(srna, ICON_RESTRICT_RENDER_OFF);
6168 RNA_def_struct_path_func(srna, "rna_SceneRenderView_path");
6169
6170 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
6171 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_SceneRenderView_name_set");
6172 RNA_def_property_ui_text(prop, "Name", "Render view name");
6173 RNA_def_struct_name_property(srna, prop);
6175
6176 prop = RNA_def_property(srna, "file_suffix", PROP_STRING, PROP_NONE);
6177 RNA_def_property_string_sdna(prop, nullptr, "suffix");
6178 RNA_def_property_ui_text(prop, "File Suffix", "Suffix added to the render images for this view");
6180
6181 prop = RNA_def_property(srna, "camera_suffix", PROP_STRING, PROP_NONE);
6182 RNA_def_property_string_sdna(prop, nullptr, "suffix");
6184 prop,
6185 "Camera Suffix",
6186 "Suffix to identify the cameras to use, and added to the render images for this view");
6188
6189 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
6190 RNA_def_property_boolean_negative_sdna(prop, nullptr, "viewflag", SCE_VIEW_DISABLE);
6192 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render view");
6194 prop, NC_SCENE | ND_RENDER_OPTIONS | NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
6195}
6196
6198{
6199 StructRNA *srna;
6200 PropertyRNA *prop;
6201
6202 FunctionRNA *func;
6203 PropertyRNA *parm;
6204
6205 RNA_def_property_srna(cprop, "RenderViews");
6206 srna = RNA_def_struct(brna, "RenderViews", nullptr);
6207 RNA_def_struct_sdna(srna, "RenderData");
6208 RNA_def_struct_ui_text(srna, "Render Views", "Collection of render views");
6209
6210 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
6211 RNA_def_property_int_sdna(prop, nullptr, "actview");
6213 "rna_RenderSettings_active_view_index_get",
6214 "rna_RenderSettings_active_view_index_set",
6215 "rna_RenderSettings_active_view_index_range");
6216 RNA_def_property_ui_text(prop, "Active View Index", "Active index in render view array");
6218
6219 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
6220 RNA_def_property_struct_type(prop, "SceneRenderView");
6222 "rna_RenderSettings_active_view_get",
6223 "rna_RenderSettings_active_view_set",
6224 nullptr,
6225 nullptr);
6227 RNA_def_property_ui_text(prop, "Active Render View", "Active Render View");
6229
6230 func = RNA_def_function(srna, "new", "rna_RenderView_new");
6231 RNA_def_function_ui_description(func, "Add a render view to scene");
6233 parm = RNA_def_string(func, "name", "RenderView", 0, "", "New name for the marker (not unique)");
6235 parm = RNA_def_pointer(func, "result", "SceneRenderView", "", "Newly created render view");
6236 RNA_def_function_return(func, parm);
6237
6238 func = RNA_def_function(srna, "remove", "rna_RenderView_remove");
6239 RNA_def_function_ui_description(func, "Remove a render view");
6241 parm = RNA_def_pointer(func, "view", "SceneRenderView", "", "Render view to remove");
6244}
6245
6247{
6248 StructRNA *srna;
6249 PropertyRNA *prop;
6250
6251 /* rna_enum_stereo3d_display_items, without (S3D_DISPLAY_PAGEFLIP) */
6252 static const EnumPropertyItem stereo3d_display_items[] = {
6254 "ANAGLYPH",
6255 0,
6256 "Anaglyph",
6257 "Render views for left and right eyes as two differently filtered colors in a single image "
6258 "(anaglyph glasses are required)"},
6260 "INTERLACE",
6261 0,
6262 "Interlace",
6263 "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
6264 "required)"},
6266 "SIDEBYSIDE",
6267 0,
6268 "Side-by-Side",
6269 "Render views for left and right eyes side-by-side"},
6271 "TOPBOTTOM",
6272 0,
6273 "Top-Bottom",
6274 "Render views for left and right eyes one above another"},
6275 {0, nullptr, 0, nullptr, nullptr},
6276 };
6277
6278 srna = RNA_def_struct(brna, "Stereo3dFormat", nullptr);
6279 RNA_def_struct_sdna(srna, "Stereo3dFormat");
6280 RNA_def_struct_ui_text(srna, "Stereo Output", "Settings for stereo output");
6281
6282 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
6283 RNA_def_property_enum_sdna(prop, nullptr, "display_mode");
6284 RNA_def_property_enum_items(prop, stereo3d_display_items);
6285 RNA_def_property_ui_text(prop, "Stereo Mode", "");
6286 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6287
6288 prop = RNA_def_property(srna, "anaglyph_type", PROP_ENUM, PROP_NONE);
6290 RNA_def_property_ui_text(prop, "Anaglyph Type", "");
6291 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6292
6293 prop = RNA_def_property(srna, "interlace_type", PROP_ENUM, PROP_NONE);
6295 RNA_def_property_ui_text(prop, "Interlace Type", "");
6296 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6297
6298 prop = RNA_def_property(srna, "use_interlace_swap", PROP_BOOLEAN, PROP_BOOLEAN);
6299 RNA_def_property_boolean_sdna(prop, nullptr, "flag", S3D_INTERLACE_SWAP);
6300 RNA_def_property_ui_text(prop, "Swap Left/Right", "Swap left and right stereo channels");
6301 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6302
6303 prop = RNA_def_property(srna, "use_sidebyside_crosseyed", PROP_BOOLEAN, PROP_BOOLEAN);
6305 RNA_def_property_ui_text(prop, "Cross-Eyed", "Right eye should see left image and vice versa");
6306 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6307
6308 prop = RNA_def_property(srna, "use_squeezed_frame", PROP_BOOLEAN, PROP_BOOLEAN);
6309 RNA_def_property_boolean_sdna(prop, nullptr, "flag", S3D_SQUEEZED_FRAME);
6310 RNA_def_property_ui_text(prop, "Squeezed Frame", "Combine both views in a squeezed image");
6311 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6312}
6313
6314/* use for render output and image save operator,
6315 * NOTE: there are some cases where the members act differently when this is
6316 * used from a scene, video formats can only be selected for render output
6317 * for example, this is checked by seeing if the ptr->owner_id is a Scene id */
6318
6320{
6321# ifdef WITH_IMAGE_OPENJPEG
6322 static const EnumPropertyItem jp2_codec_items[] = {
6323 {R_IMF_JP2_CODEC_JP2, "JP2", 0, "JP2", ""},
6324 {R_IMF_JP2_CODEC_J2K, "J2K", 0, "J2K", ""},
6325 {0, nullptr, 0, nullptr, nullptr},
6326 };
6327# endif
6328
6329 static const EnumPropertyItem tiff_codec_items[] = {
6330 {R_IMF_TIFF_CODEC_NONE, "NONE", 0, "None", ""},
6331 {R_IMF_TIFF_CODEC_DEFLATE, "DEFLATE", 0, "Deflate", ""},
6332 {R_IMF_TIFF_CODEC_LZW, "LZW", 0, "LZW", ""},
6333 {R_IMF_TIFF_CODEC_PACKBITS, "PACKBITS", 0, "Pack Bits", ""},
6334 {0, nullptr, 0, nullptr, nullptr},
6335 };
6336
6337 static const EnumPropertyItem color_management_items[] = {
6338 {R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE, "FOLLOW_SCENE", 0, "Follow Scene", ""},
6339 {R_IMF_COLOR_MANAGEMENT_OVERRIDE, "OVERRIDE", 0, "Override", ""},
6340 {0, nullptr, 0, nullptr, nullptr},
6341 };
6342
6343 StructRNA *srna;
6344 PropertyRNA *prop;
6345
6347
6348 srna = RNA_def_struct(brna, "ImageFormatSettings", nullptr);
6349 RNA_def_struct_sdna(srna, "ImageFormatData");
6350 RNA_def_struct_nested(brna, srna, "Scene");
6351 RNA_def_struct_path_func(srna, "rna_ImageFormatSettings_path");
6352 RNA_def_struct_ui_text(srna, "Image Format", "Settings for image formats");
6353
6354 prop = RNA_def_property(srna, "media_type", PROP_ENUM, PROP_NONE);
6355 RNA_def_property_enum_sdna(prop, nullptr, "media_type");
6358 nullptr,
6359 "rna_ImageFormatSettings_media_type_set",
6360 "rna_ImageFormatSettings_media_type_itemf");
6361 RNA_def_property_ui_text(prop, "Media Type", "The type of media to save");
6363
6364 prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
6365 RNA_def_property_enum_sdna(prop, nullptr, "imtype");
6368 nullptr,
6369 "rna_ImageFormatSettings_file_format_set",
6370 "rna_ImageFormatSettings_file_format_itemf");
6371 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
6373
6374 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
6375 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "planes");
6377 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_color_mode_itemf");
6379 prop,
6380 "Color Mode",
6381 "Choose BW for saving grayscale images, RGB for saving red, green and blue channels, "
6382 "and RGBA for saving red, green, blue and alpha channels");
6384
6385 prop = RNA_def_property(srna, "color_depth", PROP_ENUM, PROP_NONE);
6386 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "depth");
6388 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_color_depth_itemf");
6389 RNA_def_property_ui_text(prop, "Color Depth", "Bit depth per channel");
6391
6392 /* was 'file_quality' */
6393 prop = RNA_def_property(srna, "quality", PROP_INT, PROP_PERCENTAGE);
6394 RNA_def_property_int_sdna(prop, nullptr, "quality");
6395 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
6397 prop, "Quality", "Quality for image formats that support lossy compression");
6399
6400 /* was shared with file_quality */
6401 prop = RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE);
6402 RNA_def_property_int_sdna(prop, nullptr, "compress");
6403 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
6405 "Compression",
6406 "Amount of time to determine best compression: "
6407 "0 = no compression with fast file output, "
6408 "100 = maximum lossless compression with slow file output");
6410
6411 prop = RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE);
6414 prop, "Preview", "When rendering animations, save JPG preview images in same directory");
6416
6417 /* format specific */
6418
6419# ifdef WITH_IMAGE_OPENEXR
6420 /* OpenEXR */
6421
6422 prop = RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
6423 RNA_def_property_enum_sdna(prop, nullptr, "exr_codec");
6424 RNA_def_property_enum_items(prop, rna_enum_exr_codec_items);
6425 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_exr_codec_itemf");
6426 RNA_def_property_ui_text(prop, "Codec", "Compression codec settings for OpenEXR");
6428
6429 prop = RNA_def_property(srna, "use_exr_interleave", PROP_BOOLEAN, PROP_NONE);
6432 prop,
6433 "Interleave",
6434 "Use legacy interleaved storage of views, layers and passes for compatibility with "
6435 "applications that do not support more efficient multi-part OpenEXR files.");
6437# endif
6438
6439# ifdef WITH_IMAGE_OPENJPEG
6440 /* JPEG 2000 */
6441 prop = RNA_def_property(srna, "use_jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
6442 RNA_def_property_boolean_sdna(prop, nullptr, "jp2_flag", R_IMF_JP2_FLAG_YCC);
6444 prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
6446
6447 prop = RNA_def_property(srna, "use_jpeg2k_cinema_preset", PROP_BOOLEAN, PROP_NONE);
6449 RNA_def_property_ui_text(prop, "Cinema", "Use OpenJPEG Cinema Preset");
6451
6452 prop = RNA_def_property(srna, "use_jpeg2k_cinema_48", PROP_BOOLEAN, PROP_NONE);
6453 RNA_def_property_boolean_sdna(prop, nullptr, "jp2_flag", R_IMF_JP2_FLAG_CINE_48);
6454 RNA_def_property_ui_text(prop, "Cinema (48)", "Use OpenJPEG Cinema Preset (48fps)");
6456
6457 prop = RNA_def_property(srna, "jpeg2k_codec", PROP_ENUM, PROP_NONE);
6458 RNA_def_property_enum_sdna(prop, nullptr, "jp2_codec");
6459 RNA_def_property_enum_items(prop, jp2_codec_items);
6460 RNA_def_property_ui_text(prop, "Codec", "Codec settings for JPEG 2000");
6462# endif
6463
6464 /* TIFF */
6465 prop = RNA_def_property(srna, "tiff_codec", PROP_ENUM, PROP_NONE);
6466 RNA_def_property_enum_sdna(prop, nullptr, "tiff_codec");
6467 RNA_def_property_enum_items(prop, tiff_codec_items);
6468 RNA_def_property_ui_text(prop, "Compression", "Compression mode for TIFF");
6470
6471 /* Cineon and DPX */
6472
6473 prop = RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
6474 RNA_def_property_boolean_sdna(prop, nullptr, "cineon_flag", R_IMF_CINEON_FLAG_LOG);
6475 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
6477
6478 prop = RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
6479 RNA_def_property_int_sdna(prop, nullptr, "cineon_black");
6480 RNA_def_property_range(prop, 0, 1024);
6481 RNA_def_property_ui_text(prop, "Black", "Log conversion reference blackpoint");
6483
6484 prop = RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
6485 RNA_def_property_int_sdna(prop, nullptr, "cineon_white");
6486 RNA_def_property_range(prop, 0, 1024);
6487 RNA_def_property_ui_text(prop, "White", "Log conversion reference whitepoint");
6489
6490 prop = RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
6491 RNA_def_property_float_sdna(prop, nullptr, "cineon_gamma");
6492 RNA_def_property_range(prop, 0.0f, 10.0f);
6493 RNA_def_property_ui_text(prop, "Gamma", "Log conversion gamma");
6495
6496 /* multiview */
6497 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
6498 RNA_def_property_enum_sdna(prop, nullptr, "views_format");
6501 prop, nullptr, nullptr, "rna_ImageFormatSettings_views_format_itemf");
6502 RNA_def_property_ui_text(prop, "Views Format", "Format of multiview media");
6504
6505 prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
6506 RNA_def_property_pointer_sdna(prop, nullptr, "stereo3d_format");
6508 RNA_def_property_struct_type(prop, "Stereo3dFormat");
6509 RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3D");
6510
6511 /* color management */
6512 prop = RNA_def_property(srna, "color_management", PROP_ENUM, PROP_NONE);
6513 RNA_def_property_enum_items(prop, color_management_items);
6515 prop, "Color Management", "Which color management settings to use for file saving");
6517 prop, nullptr, "rna_ImageFormatSettings_color_management_set", nullptr);
6519
6520 prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
6521 RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
6523 prop, "View Settings", "Color management settings applied on image before saving");
6524
6525 prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
6526 RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
6528 prop, "Display Settings", "Settings of device saved image would be displayed on");
6529
6530 prop = RNA_def_property(srna, "linear_colorspace_settings", PROP_POINTER, PROP_NONE);
6531 RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
6532 RNA_def_property_ui_text(prop, "Color Space Settings", "Output color space settings");
6533
6534 prop = RNA_def_property(srna, "has_linear_colorspace", PROP_BOOLEAN, PROP_NONE);
6536 prop, "rna_ImageFormatSettings_has_linear_colorspace_get", nullptr);
6539 prop, "Has Linear Color Space", "File format expects linear color space");
6540}
6541
6543{
6544 StructRNA *srna;
6545 PropertyRNA *prop;
6546
6547# ifdef WITH_FFMPEG
6548 /* Container types */
6549 static const EnumPropertyItem ffmpeg_format_items[] = {
6550 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
6551 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
6552 {FFMPEG_WEBM, "WEBM", 0, "WebM", ""},
6553 /* Legacy containers. */
6555 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
6556 {FFMPEG_DV, "DV", 0, "DV", ""},
6557 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
6558 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
6559 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
6560 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
6561 {FFMPEG_MOV, "QUICKTIME", 0, "QuickTime", ""},
6562 {0, nullptr, 0, nullptr, nullptr},
6563 };
6564
6565 static const EnumPropertyItem ffmpeg_codec_items[] = {
6567 "NONE",
6568 0,
6569 "No Video",
6570 "Disables video output, for audio-only renders"},
6571 {FFMPEG_CODEC_ID_AV1, "AV1", 0, "AV1", ""},
6572 {FFMPEG_CODEC_ID_H264, "H264", 0, "H.264", ""},
6573 {FFMPEG_CODEC_ID_H265, "H265", 0, "H.265 / HEVC", ""},
6574 {FFMPEG_CODEC_ID_VP9, "WEBM", 0, "WebM / VP9", ""},
6575 /* Legacy / rare codecs. */
6577 {FFMPEG_CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""},
6578 {FFMPEG_CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
6579 {FFMPEG_CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
6580 {FFMPEG_CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
6581 {FFMPEG_CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
6582 {FFMPEG_CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
6583 {FFMPEG_CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
6584 {FFMPEG_CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4 (divx)", ""},
6585 {FFMPEG_CODEC_ID_PNG, "PNG", 0, "PNG", ""},
6586 {FFMPEG_CODEC_ID_PRORES, "PRORES", 0, "ProRes", ""},
6587 {FFMPEG_CODEC_ID_QTRLE, "QTRLE", 0, "QuickTime Animation", ""},
6588 {FFMPEG_CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
6589 {0, nullptr, 0, nullptr, nullptr},
6590 };
6591
6592 /* Recommendations come from the FFmpeg wiki, https://trac.ffmpeg.org/wiki/Encode/VP9.
6593 * The label for BEST has been changed to "Slowest" so that it fits the "Encoding Speed"
6594 * property label in the UI. */
6595 static const EnumPropertyItem ffmpeg_preset_items[] = {
6597 "BEST",
6598 0,
6599 "Slowest",
6600 "Recommended if you have lots of time and want the best compression efficiency"},
6601 {FFM_PRESET_GOOD, "GOOD", 0, "Good", "The default and recommended for most applications"},
6602 {FFM_PRESET_REALTIME, "REALTIME", 0, "Realtime", "Recommended for fast encoding"},
6603 {0, nullptr, 0, nullptr, nullptr},
6604 };
6605
6606 static const EnumPropertyItem ffmpeg_prores_profiles_items[] = {
6607 {FFM_PRORES_PROFILE_422_PROXY, "422_PROXY", 0, "ProRes 422 Proxy", ""},
6608 {FFM_PRORES_PROFILE_422_LT, "422_LT", 0, "ProRes 422 LT", ""},
6609 {FFM_PRORES_PROFILE_422_STD, "422_STD", 0, "ProRes 422", ""},
6610 {FFM_PRORES_PROFILE_422_HQ, "422_HQ", 0, "ProRes 422 HQ", ""},
6611 {FFM_PRORES_PROFILE_4444, "4444", 0, "ProRes 4444", ""},
6612 {FFM_PRORES_PROFILE_4444_XQ, "4444_XQ", 0, "ProRes 4444 XQ", ""},
6613 {0, nullptr, 0, nullptr, nullptr},
6614 };
6615
6616 static const EnumPropertyItem ffmpeg_crf_items[] = {
6617 {FFM_CRF_NONE,
6618 "NONE",
6619 0,
6620 "Constant Bitrate",
6621 "Configure constant bit rate, rather than constant output quality"},
6622 {FFM_CRF_LOSSLESS, "LOSSLESS", 0, "Lossless", ""},
6623 {FFM_CRF_PERC_LOSSLESS, "PERC_LOSSLESS", 0, "Perceptually Lossless", ""},
6624 {FFM_CRF_HIGH, "HIGH", 0, "High Quality", ""},
6625 {FFM_CRF_MEDIUM, "MEDIUM", 0, "Medium Quality", ""},
6626 {FFM_CRF_LOW, "LOW", 0, "Low Quality", ""},
6627 {FFM_CRF_VERYLOW, "VERYLOW", 0, "Very Low Quality", ""},
6628 {FFM_CRF_LOWEST, "LOWEST", 0, "Lowest Quality", ""},
6629 {0, nullptr, 0, nullptr, nullptr},
6630 };
6631
6632 static const EnumPropertyItem ffmpeg_audio_codec_items[] = {
6634 "NONE",
6635 0,
6636 "No Audio",
6637 "Disables audio output, for video-only renders"},
6638 {FFMPEG_CODEC_ID_AAC, "AAC", 0, "AAC", ""},
6639 {FFMPEG_CODEC_ID_AC3, "AC3", 0, "AC3", ""},
6640 {FFMPEG_CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
6641 {FFMPEG_CODEC_ID_MP2, "MP2", 0, "MP2", ""},
6642 {FFMPEG_CODEC_ID_MP3, "MP3", 0, "MP3", ""},
6643 {FFMPEG_CODEC_ID_OPUS, "OPUS", 0, "Opus", ""},
6644 {FFMPEG_CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
6645 {FFMPEG_CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
6646 {0, nullptr, 0, nullptr, nullptr},
6647 };
6648# endif
6649
6650 static const EnumPropertyItem audio_channel_items[] = {
6651 {FFM_CHANNELS_MONO, "MONO", 0, "Mono", "Set audio channels to mono"},
6652 {FFM_CHANNELS_STEREO, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
6653 {FFM_CHANNELS_SURROUND4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
6655 "SURROUND51",
6656 0,
6657 "5.1 Surround",
6658 "Set audio channels to 5.1 surround sound"},
6660 "SURROUND71",
6661 0,
6662 "7.1 Surround",
6663 "Set audio channels to 7.1 surround sound"},
6664 {0, nullptr, 0, nullptr, nullptr},
6665 };
6666
6667 srna = RNA_def_struct(brna, "FFmpegSettings", nullptr);
6668 RNA_def_struct_sdna(srna, "FFMpegCodecData");
6669 RNA_def_struct_path_func(srna, "rna_FFmpegSettings_path");
6670 RNA_def_struct_ui_text(srna, "FFmpeg Settings", "FFmpeg related settings for the scene");
6671
6672# ifdef WITH_FFMPEG
6673 prop = RNA_def_property(srna, "format", PROP_ENUM, PROP_NONE);
6674 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "type");
6676 RNA_def_property_enum_items(prop, ffmpeg_format_items);
6678 RNA_def_property_ui_text(prop, "Container", "Output file container");
6679
6680 prop = RNA_def_property(srna, "codec", PROP_ENUM, PROP_NONE);
6681 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "codec");
6683 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
6685 RNA_def_property_ui_text(prop, "Video Codec", "FFmpeg codec to use for video output");
6686 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_FFmpegSettings_codec_update");
6687
6688 prop = RNA_def_property(srna, "video_bitrate", PROP_INT, PROP_NONE);
6689 RNA_def_property_int_sdna(prop, nullptr, "video_bitrate");
6691 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kbit/s)");
6693
6694 prop = RNA_def_property(srna, "minrate", PROP_INT, PROP_NONE);
6695 RNA_def_property_int_sdna(prop, nullptr, "rc_min_rate");
6697 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kbit/s)");
6699
6700 prop = RNA_def_property(srna, "maxrate", PROP_INT, PROP_NONE);
6701 RNA_def_property_int_sdna(prop, nullptr, "rc_max_rate");
6703 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kbit/s)");
6705
6706 prop = RNA_def_property(srna, "muxrate", PROP_INT, PROP_NONE);
6707 RNA_def_property_int_sdna(prop, nullptr, "mux_rate");
6709 RNA_def_property_range(prop, 0, 100000000);
6710 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/second)");
6712
6713 prop = RNA_def_property(srna, "gopsize", PROP_INT, PROP_NONE);
6714 RNA_def_property_int_sdna(prop, nullptr, "gop_size");
6716 RNA_def_property_range(prop, 0, 500);
6719 "Keyframe Interval",
6720 "Distance between key frames, also known as GOP size; "
6721 "influences file size and seekability");
6723
6724 prop = RNA_def_property(srna, "max_b_frames", PROP_INT, PROP_NONE);
6725 RNA_def_property_int_sdna(prop, nullptr, "max_b_frames");
6727 RNA_def_property_range(prop, 0, 16);
6729 prop,
6730 "Max B-Frames",
6731 "Maximum number of B-frames between non-B-frames; influences file size and seekability");
6733
6734 prop = RNA_def_property(srna, "use_max_b_frames", PROP_BOOLEAN, PROP_NONE);
6737 RNA_def_property_ui_text(prop, "Use Max B-Frames", "Set a maximum number of B-frames");
6739
6740 prop = RNA_def_property(srna, "buffersize", PROP_INT, PROP_NONE);
6741 RNA_def_property_int_sdna(prop, nullptr, "rc_buffer_size");
6743 RNA_def_property_range(prop, 0, 2000);
6744 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
6746
6747 prop = RNA_def_property(srna, "packetsize", PROP_INT, PROP_NONE);
6748 RNA_def_property_int_sdna(prop, nullptr, "mux_packet_size");
6750 RNA_def_property_range(prop, 0, 16384);
6751 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
6753
6754 prop = RNA_def_property(srna, "constant_rate_factor", PROP_ENUM, PROP_NONE);
6755 RNA_def_property_enum_sdna(prop, nullptr, "constant_rate_factor");
6757 RNA_def_property_enum_items(prop, ffmpeg_crf_items);
6760 prop,
6761 "Output Quality",
6762 "Constant Rate Factor (CRF); tradeoff between video quality and file size");
6764
6765 prop = RNA_def_property(srna, "ffmpeg_preset", PROP_ENUM, PROP_NONE);
6766 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "ffmpeg_preset");
6768 RNA_def_property_enum_items(prop, ffmpeg_preset_items);
6771 prop, "Encoding Speed", "Tradeoff between encoding speed and compression ratio");
6773
6774 prop = RNA_def_property(srna, "ffmpeg_prores_profile", PROP_ENUM, PROP_NONE);
6775 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "ffmpeg_prores_profile");
6777 RNA_def_property_enum_items(prop, ffmpeg_prores_profiles_items);
6779 RNA_def_property_ui_text(prop, "Profile", "ProRes Profile");
6781
6782 prop = RNA_def_property(srna, "use_autosplit", PROP_BOOLEAN, PROP_NONE);
6785 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
6787
6788 prop = RNA_def_property(srna, "use_lossless_output", PROP_BOOLEAN, PROP_NONE);
6791 RNA_def_property_boolean_funcs(prop, nullptr, "rna_FFmpegSettings_lossless_output_set");
6792 RNA_def_property_ui_text(prop, "Lossless Output", "Use lossless output for video streams");
6794
6795 /* FFMPEG Audio. */
6796 prop = RNA_def_property(srna, "audio_codec", PROP_ENUM, PROP_NONE);
6797 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "audio_codec");
6799 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
6800 RNA_def_property_ui_text(prop, "Audio Codec", "FFmpeg audio codec to use");
6802
6803 prop = RNA_def_property(srna, "audio_bitrate", PROP_INT, PROP_NONE);
6804 RNA_def_property_int_sdna(prop, nullptr, "audio_bitrate");
6806 RNA_def_property_range(prop, 32, 384);
6807 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)");
6809
6810 prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
6811 RNA_def_property_float_sdna(prop, nullptr, "audio_volume");
6813 RNA_def_property_range(prop, 0.0f, 1.0f);
6814 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
6817# endif
6818
6819 /* the following two "ffmpeg" settings are general audio settings */
6820 prop = RNA_def_property(srna, "audio_mixrate", PROP_INT, PROP_NONE);
6821 RNA_def_property_int_sdna(prop, nullptr, "audio_mixrate");
6823 RNA_def_property_range(prop, 8000, 192000);
6824 RNA_def_property_ui_text(prop, "Sample Rate", "Audio sample rate (samples/s)");
6826
6827 prop = RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
6828 RNA_def_property_enum_sdna(prop, nullptr, "audio_channels");
6830 RNA_def_property_enum_items(prop, audio_channel_items);
6831 RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
6832}
6833
6835{
6836 StructRNA *srna;
6837 PropertyRNA *prop;
6838
6839 static const EnumPropertyItem pixel_size_items[] = {
6840 {0, "AUTO", 0, "Automatic", "Automatic pixel size, depends on the user interface scale"},
6841 {1, "1", 0, "1" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at full resolution"},
6842 {2, "2", 0, "2" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 50% resolution"},
6843 {4, "4", 0, "4" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 25% resolution"},
6844 {8, "8", 0, "8" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 12.5% resolution"},
6845 {0, nullptr, 0, nullptr, nullptr},
6846 };
6847
6848 static const EnumPropertyItem threads_mode_items[] = {
6849 {0,
6850 "AUTO",
6851 0,
6852 "Auto-Detect",
6853 "Automatically determine the number of threads, based on CPUs"},
6854 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
6855 {0, nullptr, 0, nullptr, nullptr},
6856 };
6857
6858 static const EnumPropertyItem engine_items[] = {
6859 {0, "BLENDER_EEVEE", 0, "EEVEE", ""},
6860 {0, nullptr, 0, nullptr, nullptr},
6861 };
6862
6863 static const EnumPropertyItem freestyle_thickness_items[] = {
6865 "ABSOLUTE",
6866 0,
6867 "Absolute",
6868 "Specify unit line thickness in pixels"},
6870 "RELATIVE",
6871 0,
6872 "Relative",
6873 "Unit line thickness is scaled by the proportion of the present vertical image "
6874 "resolution to 480 pixels"},
6875 {0, nullptr, 0, nullptr, nullptr},
6876 };
6877
6878 static const EnumPropertyItem views_format_items[] = {
6880 "STEREO_3D",
6881 0,
6882 "Stereo 3D",
6883 "Single stereo camera system, adjust the stereo settings in the camera panel"},
6885 "MULTIVIEW",
6886 0,
6887 "Multi-View",
6888 "Multi camera system, adjust the cameras individually"},
6889 {0, nullptr, 0, nullptr, nullptr},
6890 };
6891
6892 static const EnumPropertyItem motion_blur_position_items[] = {
6893 {SCE_MB_START, "START", 0, "Start on Frame", "The shutter opens at the current frame"},
6895 "CENTER",
6896 0,
6897 "Center on Frame",
6898 "The shutter is open during the current frame"},
6899 {SCE_MB_END, "END", 0, "End on Frame", "The shutter closes at the current frame"},
6900 {0, nullptr, 0, nullptr, nullptr},
6901 };
6902
6903 static const EnumPropertyItem hair_shape_type_items[] = {
6904 {SCE_HAIR_SHAPE_STRAND, "STRAND", 0, "Strand", ""},
6905 {SCE_HAIR_SHAPE_STRIP, "STRIP", 0, "Strip", ""},
6906 {SCE_HAIR_SHAPE_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
6907 {0, nullptr, 0, nullptr, nullptr},
6908 };
6909
6910 static const EnumPropertyItem meta_input_items[] = {
6911 {0, "SCENE", 0, "Scene", "Use metadata from the current scene"},
6913 "STRIPS",
6914 0,
6915 "Sequencer Strips",
6916 "Use metadata from the strips in the sequencer"},
6917 {0, nullptr, 0, nullptr, nullptr},
6918 };
6919
6920 static const EnumPropertyItem compositor_device_items[] = {
6921 {SCE_COMPOSITOR_DEVICE_CPU, "CPU", 0, "CPU", ""},
6922 {SCE_COMPOSITOR_DEVICE_GPU, "GPU", 0, "GPU", ""},
6923 {0, nullptr, 0, nullptr, nullptr},
6924 };
6925
6926 static const EnumPropertyItem compositor_precision_items[] = {
6928 "AUTO",
6929 0,
6930 "Auto",
6931 "Full precision for final renders, half precision otherwise"},
6932 {SCE_COMPOSITOR_PRECISION_FULL, "FULL", 0, "Full", "Full precision"},
6933 {0, nullptr, 0, nullptr, nullptr},
6934 };
6935
6936 static const EnumPropertyItem compositor_denoise_device_items[] = {
6938 "AUTO",
6939 0,
6940 "Auto",
6941 "Use the same device used by the compositor to process the denoise node"},
6943 "CPU",
6944 0,
6945 "CPU",
6946 "Use the CPU to process the denoise node"},
6948 "GPU",
6949 0,
6950 "GPU",
6951 "Use the GPU to process the denoise node if available, otherwise fallback to CPU"},
6952 {0, nullptr, 0, nullptr, nullptr},
6953 };
6954
6955 static const EnumPropertyItem compositor_denoise_quality_items[] = {
6956 {SCE_COMPOSITOR_DENOISE_HIGH, "HIGH", 0, "High", "High quality"},
6958 "BALANCED",
6959 0,
6960 "Balanced",
6961 "Balanced between performance and quality"},
6962 {SCE_COMPOSITOR_DENOISE_FAST, "FAST", 0, "Fast", "High performance"},
6963 {0, nullptr, 0, nullptr, nullptr},
6964 };
6965
6967
6968 srna = RNA_def_struct(brna, "RenderSettings", nullptr);
6969 RNA_def_struct_sdna(srna, "RenderData");
6970 RNA_def_struct_nested(brna, srna, "Scene");
6971 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
6972 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene data-block");
6973
6974 /* Render Data */
6975 prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
6977 RNA_def_property_pointer_sdna(prop, nullptr, "im_format");
6978 RNA_def_property_struct_type(prop, "ImageFormatSettings");
6979 RNA_def_property_ui_text(prop, "Image Format", "");
6980
6981 prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL);
6982 RNA_def_property_int_sdna(prop, nullptr, "xsch");
6985 RNA_def_property_range(prop, 4, 65536);
6987 prop, "Resolution X", "Number of horizontal pixels in the rendered image");
6988 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6989
6990 prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL);
6991 RNA_def_property_int_sdna(prop, nullptr, "ysch");
6994 RNA_def_property_range(prop, 4, 65536);
6996 prop, "Resolution Y", "Number of vertical pixels in the rendered image");
6997 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6998
6999 prop = RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
7000 RNA_def_property_int_sdna(prop, nullptr, "size");
7002 RNA_def_property_range(prop, 1, SHRT_MAX);
7003 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
7004 RNA_def_property_ui_text(prop, "Resolution Scale", "Percentage scale for render resolution");
7005 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneSequencer_update");
7006
7007 prop = RNA_def_property(srna, "preview_pixel_size", PROP_ENUM, PROP_NONE);
7008 RNA_def_property_enum_sdna(prop, nullptr, "preview_pixel_size");
7009 RNA_def_property_enum_items(prop, pixel_size_items);
7010 RNA_def_property_ui_text(prop, "Pixel Size", "Pixel size for viewport rendering");
7012
7013 prop = RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
7014 RNA_def_property_float_sdna(prop, nullptr, "xasp");
7017 RNA_def_property_range(prop, 1.0f, 200.0f);
7019 "Pixel Aspect X",
7020 "Horizontal aspect ratio - for anamorphic or non-square pixel output");
7021 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7022
7023 prop = RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
7024 RNA_def_property_float_sdna(prop, nullptr, "yasp");
7027 RNA_def_property_range(prop, 1.0f, 200.0f);
7029 prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
7030 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7031
7032 /* Pixels per meters (also DPI). */
7033 prop = RNA_def_property(srna, "ppm_factor", PROP_FLOAT, PROP_NONE);
7034 RNA_def_property_float_sdna(prop, nullptr, "ppm_factor");
7036 RNA_def_property_range(prop, 1e-5f, 1e6f);
7037 RNA_def_property_ui_range(prop, 0.0001f, 10000.0f, 2, 2);
7039 "PPM Factor",
7040 "The pixel density meta-data written to supported image formats. "
7041 "This value is multiplied by the PPM-base which defines the unit "
7042 "(typically inches or meters)");
7043
7044 prop = RNA_def_property(srna, "ppm_base", PROP_FLOAT, PROP_NONE);
7045 RNA_def_property_float_sdna(prop, nullptr, "ppm_base");
7047 RNA_def_property_range(prop, 1e-5f, 1e6f);
7048 /* Important to show at least 3 decimal points because multiple presets set this to 1.001. */
7049 RNA_def_property_ui_range(prop, 0.0001f, 10000.0f, 2, 4);
7050 RNA_def_property_ui_text(prop, "PPM Base", "The base unit for pixels per meter.");
7051
7052 prop = RNA_def_property(srna, "ffmpeg", PROP_POINTER, PROP_NONE);
7053 RNA_def_property_struct_type(prop, "FFmpegSettings");
7054 RNA_def_property_pointer_sdna(prop, nullptr, "ffcodecdata");
7056 RNA_def_property_ui_text(prop, "FFmpeg Settings", "FFmpeg related settings for the scene");
7057
7058 prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
7059 RNA_def_property_int_sdna(prop, nullptr, "frs_sec");
7061 RNA_def_property_range(prop, 1, SHRT_MAX);
7062 RNA_def_property_ui_range(prop, 1, 240, 1, -1);
7063 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
7064 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
7065
7066 prop = RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
7067 RNA_def_property_float_sdna(prop, nullptr, "frs_sec_base");
7069 RNA_def_property_range(prop, 1e-5f, 1e6f);
7070 /* Important to show at least 3 decimal points because multiple presets set this to 1.001. */
7071 RNA_def_property_ui_range(prop, 0.1f, 120.0f, 2, 3);
7072 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
7073 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
7074
7075 /* frame mapping */
7076 prop = RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
7077 RNA_def_property_int_sdna(prop, nullptr, "framapto");
7079 RNA_def_property_range(prop, 1, 900);
7080 RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames");
7081 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
7082
7083 prop = RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
7084 RNA_def_property_int_sdna(prop, nullptr, "images");
7086 RNA_def_property_range(prop, 1, 900);
7087 RNA_def_property_ui_text(prop, "Frame Map New", "How many frames the Map Old will last");
7088 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
7089
7090 prop = RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
7091 RNA_def_property_float_sdna(prop, nullptr, "dither_intensity");
7092 RNA_def_property_range(prop, 0.0, FLT_MAX);
7093 RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 2);
7095 prop,
7096 "Dither Intensity",
7097 "Amount of dithering noise added to the rendered image to break up banding");
7099
7100 prop = RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_PIXEL);
7101 RNA_def_property_float_sdna(prop, nullptr, "gauss");
7102 RNA_def_property_range(prop, 0.0f, 500.0f);
7103 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 1, 2);
7105 prop, "Filter Size", "Width over which the reconstruction filter combines samples");
7107
7108 prop = RNA_def_property(srna, "film_transparent", PROP_BOOLEAN, PROP_NONE);
7109 RNA_def_property_boolean_sdna(prop, nullptr, "alphamode", R_ALPHAPREMUL);
7111 prop,
7112 "Transparent",
7113 "World background is transparent, for compositing the render over another background");
7114 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7115
7116 prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
7118 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_EDGE_FRS);
7119 RNA_def_property_ui_text(prop, "Use Freestyle", "Draw stylized strokes using Freestyle");
7120 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_freestyle_update");
7121
7122 /* threads */
7123 prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
7124 RNA_def_property_int_sdna(prop, nullptr, "threads");
7126 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", nullptr, nullptr);
7128 "Threads",
7129 "Maximum number of CPU cores to use simultaneously while rendering "
7130 "(for multi-core/CPU systems)");
7132
7133 prop = RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
7134 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "mode");
7135 RNA_def_property_enum_items(prop, threads_mode_items);
7136 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_threads_mode_get", nullptr, nullptr);
7137 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
7139
7140 /* motion blur */
7141 prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
7142 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_MBLUR);
7143 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
7145 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7146
7147 prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR);
7148 RNA_def_property_range(prop, 0.0f, FLT_MAX);
7149 RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 2);
7150 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
7151 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7152
7153 prop = RNA_def_property(srna, "motion_blur_position", PROP_ENUM, PROP_NONE);
7154 RNA_def_property_enum_items(prop, motion_blur_position_items);
7156 "Motion Blur Position",
7157 "Offset for the shutter's time interval, "
7158 "allows to change the motion blur trails");
7161
7162 prop = RNA_def_property(srna, "motion_blur_shutter_curve", PROP_POINTER, PROP_NONE);
7163 RNA_def_property_pointer_sdna(prop, nullptr, "mblur_shutter_curve");
7164 RNA_def_property_struct_type(prop, "CurveMapping");
7166 prop, "Shutter Curve", "Curve defining the shutter's openness over time");
7167
7168 /* Hairs */
7169 prop = RNA_def_property(srna, "hair_type", PROP_ENUM, PROP_NONE);
7170 RNA_def_property_enum_items(prop, hair_shape_type_items);
7171 RNA_def_property_ui_text(prop, "Curves Shape Type", "Curves shape type");
7173 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7174
7175 prop = RNA_def_property(srna, "hair_subdiv", PROP_INT, PROP_NONE);
7176 RNA_def_property_range(prop, 0, 3);
7178 prop, "Additional Subdivision", "Additional subdivision along the curves");
7179 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7180
7181 /* Performance */
7182 prop = RNA_def_property(srna, "use_high_quality_normals", PROP_BOOLEAN, PROP_NONE);
7183 RNA_def_property_boolean_sdna(prop, nullptr, "perf_flag", SCE_PERF_HQ_NORMALS);
7185 "High Quality Normals",
7186 "Use high quality tangent space at the cost of lower performance");
7187 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_mesh_quality_update");
7188
7189 /* border */
7190 prop = RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
7191 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_BORDER);
7194 prop, "Render Region", "Render a user-defined render region, within the frame size");
7196
7197 prop = RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
7198 RNA_def_property_float_sdna(prop, nullptr, "border.xmin");
7199 RNA_def_property_range(prop, 0.0f, 1.0f);
7201 RNA_def_property_ui_text(prop, "Region Minimum X", "Minimum X value for the render region");
7203
7204 prop = RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
7205 RNA_def_property_float_sdna(prop, nullptr, "border.ymin");
7206 RNA_def_property_range(prop, 0.0f, 1.0f);
7208 RNA_def_property_ui_text(prop, "Region Minimum Y", "Minimum Y value for the render region");
7210
7211 prop = RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
7212 RNA_def_property_float_sdna(prop, nullptr, "border.xmax");
7213 RNA_def_property_range(prop, 0.0f, 1.0f);
7215 RNA_def_property_ui_text(prop, "Region Maximum X", "Maximum X value for the render region");
7217
7218 prop = RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
7219 RNA_def_property_float_sdna(prop, nullptr, "border.ymax");
7220 RNA_def_property_range(prop, 0.0f, 1.0f);
7222 RNA_def_property_ui_text(prop, "Region Maximum Y", "Maximum Y value for the render region");
7224
7225 prop = RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
7226 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_CROP);
7229 prop, "Crop to Render Region", "Crop the rendered frame to the defined render region size");
7231
7232 prop = RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
7233 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_TOUCH);
7236 prop,
7237 "Placeholders",
7238 "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
7240
7241 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
7243 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
7245
7246 prop = RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
7247 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_DOCOMP);
7250 "Compositing",
7251 "Process the render result through the compositing pipeline, "
7252 "if a compositing node group is assigned to the scene");
7254
7255 prop = RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
7256 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_DOSEQ);
7259 "Sequencer",
7260 "Process the render (and composited) result through the video sequence "
7261 "editor pipeline, if sequencer strips exist");
7263
7264 prop = RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
7265 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_EXTENSION);
7268 prop,
7269 "File Extensions",
7270 "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
7272
7273# if 0 /* moved */
7274 prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
7275 RNA_def_property_enum_sdna(prop, nullptr, "imtype");
7277 RNA_def_property_enum_funcs(prop, nullptr, "rna_RenderSettings_file_format_set", nullptr);
7278 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
7280# endif
7281
7282 prop = RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
7284 prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", nullptr);
7285 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
7287
7288 prop = RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
7289 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_format_get", nullptr);
7291 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
7292
7293 prop = RNA_def_property(srna, "use_lock_interface", PROP_BOOLEAN, PROP_NONE);
7294 RNA_def_property_boolean_sdna(prop, nullptr, "use_lock_interface", 1);
7296 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
7298 prop,
7299 "Lock Interface",
7300 "Lock interface during rendering in favor of giving more memory to the renderer");
7302
7303 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
7304 RNA_def_property_string_sdna(prop, nullptr, "pic");
7309 "Output Path",
7310 "Directory/name to save animations, # characters define the position "
7311 "and padding of frame numbers");
7313
7314 /* Render result EXR cache. */
7315 prop = RNA_def_property(srna, "use_render_cache", PROP_BOOLEAN, PROP_NONE);
7316 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_EXR_CACHE_FILE);
7319 "Cache Result",
7320 "Save render cache to EXR files (useful for heavy compositing, "
7321 "Note: affects indirectly rendered scenes)");
7323
7324 /* stamp */
7325
7326 prop = RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
7327 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_TIME);
7329 prop, "Stamp Time", "Include the rendered frame timecode as HH:MM:SS.FF in image metadata");
7331
7332 prop = RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
7333 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_DATE);
7334 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image/video metadata");
7336
7337 prop = RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
7338 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FRAME);
7339 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
7341
7342 prop = RNA_def_property(srna, "use_stamp_frame_range", PROP_BOOLEAN, PROP_NONE);
7343 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FRAME_RANGE);
7345 prop, "Stamp Frame", "Include the rendered frame range in image/video metadata");
7347
7348 prop = RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
7349 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_CAMERA);
7351 prop, "Stamp Camera", "Include the name of the active camera in image metadata");
7353
7354 prop = RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
7355 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_CAMERALENS);
7357 prop, "Stamp Lens", "Include the active camera's lens in image metadata");
7359
7360 prop = RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
7361 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_SCENE);
7363 prop, "Stamp Scene", "Include the name of the active scene in image/video metadata");
7365
7366 prop = RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
7367 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_NOTE);
7368 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image/video metadata");
7370
7371 prop = RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
7372 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_MARKER);
7374 prop, "Stamp Marker", "Include the name of the last marker in image metadata");
7376
7377 prop = RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
7378 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FILENAME);
7380 prop, "Stamp Filename", "Include the .blend filename in image/video metadata");
7382
7383 prop = RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
7384 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_SEQSTRIP);
7386 "Stamp Sequence Strip",
7387 "Include the name of the foreground sequence strip in image metadata");
7389
7390 prop = RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
7391 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_RENDERTIME);
7392 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in image metadata");
7394
7395 prop = RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
7396 RNA_def_property_string_sdna(prop, nullptr, "stamp_udata");
7397 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
7399
7400 prop = RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
7401 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_DRAW);
7403 prop, "Stamp Output", "Render the stamp info text in the rendered image");
7405
7406 prop = RNA_def_property(srna, "use_stamp_labels", PROP_BOOLEAN, PROP_NONE);
7409 prop, "Stamp Labels", "Display stamp labels (\"Camera\" in front of camera name, etc.)");
7411
7412 prop = RNA_def_property(srna, "metadata_input", PROP_ENUM, PROP_NONE); /* as an enum */
7413 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "stamp");
7414 RNA_def_property_enum_items(prop, meta_input_items);
7415 RNA_def_property_ui_text(prop, "Metadata Input", "Where to take the metadata from");
7417
7418 prop = RNA_def_property(srna, "use_stamp_memory", PROP_BOOLEAN, PROP_NONE);
7419 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_MEMORY);
7421 prop, "Stamp Peak Memory", "Include the peak memory usage in image metadata");
7423
7424 prop = RNA_def_property(srna, "use_stamp_hostname", PROP_BOOLEAN, PROP_NONE);
7425 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_HOSTNAME);
7427 prop, "Stamp Hostname", "Include the hostname of the machine that rendered the frame");
7429
7430 prop = RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_PIXEL);
7431 RNA_def_property_int_sdna(prop, nullptr, "stamp_font_id");
7432 RNA_def_property_range(prop, 8, 64);
7433 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
7435
7436 prop = RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR_GAMMA);
7437 RNA_def_property_float_sdna(prop, nullptr, "fg_stamp");
7438 RNA_def_property_array(prop, 4);
7439 RNA_def_property_range(prop, 0.0, 1.0);
7440 RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text");
7442
7443 prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR_GAMMA);
7444 RNA_def_property_float_sdna(prop, nullptr, "bg_stamp");
7445 RNA_def_property_array(prop, 4);
7446 RNA_def_property_range(prop, 0.0, 1.0);
7447 RNA_def_property_ui_text(prop, "Background", "Color to use behind stamp text");
7449
7450 /* sequencer draw options */
7451
7452 prop = RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
7453 RNA_def_property_enum_sdna(prop, nullptr, "seq_prev_type");
7456 prop, "Sequencer Preview Shading", "Display method used in the sequencer view");
7457 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
7458
7459 prop = RNA_def_property(srna, "use_sequencer_override_scene_strip", PROP_BOOLEAN, PROP_NONE);
7462 "Override Scene Settings",
7463 "Use workbench render settings from the sequencer scene, instead of "
7464 "each individual scene used in the strip");
7465 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
7466
7467 prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
7468 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_SINGLE_LAYER);
7470 "Render Single Layer",
7471 "Only render the active layer. Only affects rendering from the "
7472 "interface, ignored for rendering from command line.");
7475
7476 /* views (stereoscopy et al) */
7477 prop = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE);
7478 RNA_def_property_struct_type(prop, "SceneRenderView");
7479 RNA_def_property_ui_text(prop, "Render Views", "");
7480 rna_def_render_views(brna, prop);
7481
7482 prop = RNA_def_property(srna, "stereo_views", PROP_COLLECTION, PROP_NONE);
7483 RNA_def_property_collection_sdna(prop, nullptr, "views", nullptr);
7485 "rna_RenderSettings_stereoViews_begin",
7486 "rna_iterator_listbase_next",
7487 "rna_iterator_listbase_end",
7488 "rna_iterator_listbase_get",
7489 nullptr,
7490 nullptr,
7491 nullptr,
7492 nullptr);
7493 RNA_def_property_struct_type(prop, "SceneRenderView");
7494 RNA_def_property_ui_text(prop, "Render Views", "");
7495
7496 prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
7497 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_MULTIVIEW);
7498 RNA_def_property_ui_text(prop, "Multiple Views", "Use multiple views in the scene");
7499 RNA_def_property_update(prop, NC_WINDOW, nullptr);
7500
7501 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
7502 RNA_def_property_enum_items(prop, views_format_items);
7504 RNA_def_property_ui_text(prop, "Setup Stereo Mode", "");
7505 RNA_def_property_enum_funcs(prop, nullptr, "rna_RenderSettings_views_format_set", nullptr);
7506 RNA_def_property_update(prop, NC_WINDOW, nullptr);
7507
7508 /* engine */
7509 prop = RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
7510 RNA_def_property_enum_items(prop, engine_items);
7512 "rna_RenderSettings_engine_get",
7513 "rna_RenderSettings_engine_set",
7514 "rna_RenderSettings_engine_itemf");
7516 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
7517 RNA_def_property_update(prop, NC_WINDOW, "rna_RenderSettings_engine_update");
7518
7519 prop = RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
7520 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", nullptr);
7523 prop, "Multiple Engines", "More than one rendering engine is available");
7524
7525 prop = RNA_def_property(srna, "use_spherical_stereo", PROP_BOOLEAN, PROP_NONE);
7526 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_spherical_stereo_get", nullptr);
7529 prop, "Use Spherical Stereo", "Active render engine supports spherical stereo rendering");
7530
7531 /* simplify */
7532 prop = RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
7533 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_SIMPLIFY);
7535 prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
7537 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
7538
7539 prop = RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
7540 RNA_def_property_int_sdna(prop, nullptr, "simplify_subsurf");
7541 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
7542 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
7543 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7544
7545 prop = RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
7546 RNA_def_property_float_sdna(prop, nullptr, "simplify_particles");
7547 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
7548 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7549
7550 prop = RNA_def_property(srna, "simplify_subdivision_render", PROP_INT, PROP_UNSIGNED);
7551 RNA_def_property_int_sdna(prop, nullptr, "simplify_subsurf_render");
7552 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
7554 prop, "Simplify Subdivision", "Global maximum subdivision level during rendering");
7555 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7556
7557 prop = RNA_def_property(srna, "simplify_child_particles_render", PROP_FLOAT, PROP_FACTOR);
7558 RNA_def_property_float_sdna(prop, nullptr, "simplify_particles_render");
7560 prop, "Simplify Child Particles", "Global child particles percentage during rendering");
7561 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7562
7563 prop = RNA_def_property(srna, "simplify_volumes", PROP_FLOAT, PROP_FACTOR);
7564 RNA_def_property_range(prop, 0.0, 1.0f);
7566 prop, "Simplify Volumes", "Resolution percentage of volume objects in viewport");
7568 RNA_def_property_update(prop, 0, "rna_Scene_simplify_volume_update");
7569
7570 prop = RNA_def_property(srna, "use_simplify_normals", PROP_BOOLEAN, PROP_NONE);
7571 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_SIMPLIFY_NORMALS);
7573 "Mesh Normals",
7574 "Skip computing custom normals and face corner normals for displaying "
7575 "meshes in the viewport");
7576 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_normals_update");
7577
7578 /* Grease Pencil - Simplify Options */
7579 prop = RNA_def_property(srna, "simplify_gpencil", PROP_BOOLEAN, PROP_NONE);
7580 RNA_def_property_boolean_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_ENABLE);
7581 RNA_def_property_ui_text(prop, "Simplify", "Simplify Grease Pencil drawing");
7582 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7583
7584 prop = RNA_def_property(srna, "simplify_gpencil_onplay", PROP_BOOLEAN, PROP_NONE);
7585 RNA_def_property_boolean_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_ON_PLAY);
7587 prop, "Playback Only", "Simplify Grease Pencil only during animation playback");
7588 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7589
7590 prop = RNA_def_property(srna, "simplify_gpencil_antialiasing", PROP_BOOLEAN, PROP_NONE);
7591 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_AA);
7592 RNA_def_property_ui_text(prop, "Antialiasing", "Use Antialiasing to smooth stroke edges");
7593 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7594
7595 prop = RNA_def_property(srna, "simplify_gpencil_view_fill", PROP_BOOLEAN, PROP_NONE);
7596 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_FILL);
7597 RNA_def_property_ui_text(prop, "Fill", "Display fill strokes in the viewport");
7598 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7599
7600 prop = RNA_def_property(srna, "simplify_gpencil_modifier", PROP_BOOLEAN, PROP_NONE);
7602 prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_MODIFIER);
7603 RNA_def_property_ui_text(prop, "Modifiers", "Display modifiers");
7604 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7605
7606 prop = RNA_def_property(srna, "simplify_gpencil_shader_fx", PROP_BOOLEAN, PROP_NONE);
7607 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_FX);
7608 RNA_def_property_ui_text(prop, "Shader Effects", "Display Shader Effects");
7609 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7610
7611 prop = RNA_def_property(srna, "simplify_gpencil_tint", PROP_BOOLEAN, PROP_NONE);
7612 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_TINT);
7613 RNA_def_property_ui_text(prop, "Layers Tinting", "Display layer tint");
7614 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7615
7616 /* persistent data */
7617 prop = RNA_def_property(srna, "use_persistent_data", PROP_BOOLEAN, PROP_NONE);
7618 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_PERSISTENT_DATA);
7620 "Persistent Data",
7621 "Keep render data around for faster re-renders and animation renders, "
7622 "at the cost of increased memory usage");
7623 RNA_def_property_update(prop, 0, "rna_Scene_use_persistent_data_update");
7624
7625 /* Freestyle line thickness options */
7626 prop = RNA_def_property(srna, "line_thickness_mode", PROP_ENUM, PROP_NONE);
7627 RNA_def_property_enum_sdna(prop, nullptr, "line_thickness_mode");
7628 RNA_def_property_enum_items(prop, freestyle_thickness_items);
7630 prop, "Line Thickness Mode", "Line thickness mode for Freestyle line drawing");
7631 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
7632
7633 prop = RNA_def_property(srna, "line_thickness", PROP_FLOAT, PROP_PIXEL);
7634 RNA_def_property_float_sdna(prop, nullptr, "unit_line_thickness");
7635 RNA_def_property_range(prop, 0.0f, 10000.0f);
7636 RNA_def_property_ui_text(prop, "Line Thickness", "Line thickness in pixels");
7637 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
7638
7639 /* Bake Settings */
7640 prop = RNA_def_property(srna, "bake", PROP_POINTER, PROP_NONE);
7642 RNA_def_property_pointer_sdna(prop, nullptr, "bake");
7643 RNA_def_property_struct_type(prop, "BakeSettings");
7644 RNA_def_property_ui_text(prop, "Bake Data", "");
7645
7646 /* Compositor. */
7647
7648 prop = RNA_def_property(srna, "compositor_device", PROP_ENUM, PROP_NONE);
7649 RNA_def_property_enum_items(prop, compositor_device_items);
7650 RNA_def_property_ui_text(prop, "Compositor Device", "Set how compositing is executed");
7651 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7652
7653 prop = RNA_def_property(srna, "compositor_precision", PROP_ENUM, PROP_NONE);
7654 RNA_def_property_enum_sdna(prop, nullptr, "compositor_precision");
7655 RNA_def_property_enum_items(prop, compositor_precision_items);
7657 prop, "Compositor Precision", "The precision of compositor intermediate result");
7658 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7659
7660 prop = RNA_def_property(srna, "compositor_denoise_device", PROP_ENUM, PROP_NONE);
7661 RNA_def_property_enum_sdna(prop, nullptr, "compositor_denoise_device");
7662 RNA_def_property_enum_items(prop, compositor_denoise_device_items);
7665 "Compositor Denoise Node Device",
7666 "The device to use to process the denoise nodes in the compositor");
7667 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7668
7669 prop = RNA_def_property(srna, "compositor_denoise_preview_quality", PROP_ENUM, PROP_NONE);
7670 RNA_def_property_enum_sdna(prop, nullptr, "compositor_denoise_preview_quality");
7671 RNA_def_property_enum_items(prop, compositor_denoise_quality_items);
7674 "Compositor Preview Denoise Quality",
7675 "The quality used by denoise nodes during viewport and interactive "
7676 "compositing if the nodes' quality option is set to Follow Scene");
7677 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7678
7679 prop = RNA_def_property(srna, "compositor_denoise_final_quality", PROP_ENUM, PROP_NONE);
7680 RNA_def_property_enum_sdna(prop, nullptr, "compositor_denoise_final_quality");
7681 RNA_def_property_enum_items(prop, compositor_denoise_quality_items);
7684 "Compositor Final Denoise Quality",
7685 "The quality used by denoise nodes during the compositing of final "
7686 "renders if the nodes' quality option is set to Follow Scene");
7687 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7688
7689 /* Nestled Data. */
7690 /* *** Non-Animated *** */
7692 rna_def_bake_data(brna);
7694
7695 /* *** Animated *** */
7696
7697 /* Scene API */
7699}
7700
7701/* scene.objects */
7703{
7704 StructRNA *srna;
7705
7706 RNA_def_property_srna(cprop, "SceneObjects");
7707 srna = RNA_def_struct(brna, "SceneObjects", nullptr);
7708 RNA_def_struct_sdna(srna, "Scene");
7709 RNA_def_struct_ui_text(srna, "Scene Objects", "All of the scene objects");
7710}
7711
7712/* scene.timeline_markers */
7714{
7715 StructRNA *srna;
7716
7717 FunctionRNA *func;
7718 PropertyRNA *parm;
7719
7720 RNA_def_property_srna(cprop, "TimelineMarkers");
7721 srna = RNA_def_struct(brna, "TimelineMarkers", nullptr);
7722 RNA_def_struct_sdna(srna, "Scene");
7723 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
7724
7725 func = RNA_def_function(srna, "new", "rna_TimeLine_add");
7726 RNA_def_function_ui_description(func, "Add a timeline marker");
7727 parm = RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
7729 parm = RNA_def_int(func,
7730 "frame",
7731 1,
7732 -MAXFRAME,
7733 MAXFRAME,
7734 "",
7735 "The frame for the new marker",
7736 -MAXFRAME,
7737 MAXFRAME);
7738 parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
7739 RNA_def_function_return(func, parm);
7740
7741 func = RNA_def_function(srna, "remove", "rna_TimeLine_remove");
7742 RNA_def_function_ui_description(func, "Remove a timeline marker");
7744 parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
7747
7748 func = RNA_def_function(srna, "clear", "rna_TimeLine_clear");
7749 RNA_def_function_ui_description(func, "Remove all timeline markers");
7750}
7751
7752/* scene.keying_sets */
7754{
7755 StructRNA *srna;
7756 PropertyRNA *prop;
7757
7758 FunctionRNA *func;
7759 PropertyRNA *parm;
7760
7761 RNA_def_property_srna(cprop, "KeyingSets");
7762 srna = RNA_def_struct(brna, "KeyingSets", nullptr);
7763 RNA_def_struct_sdna(srna, "Scene");
7764 RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
7765
7766 /* Add Keying Set */
7767 func = RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
7768 RNA_def_function_ui_description(func, "Add a new Keying Set to Scene");
7770 /* name */
7772 func, "idname", "KeyingSet", MAX_NAME, "IDName", "Internal identifier of Keying Set");
7773 RNA_def_string(func, "name", "KeyingSet", MAX_NAME, "Name", "User visible name of Keying Set");
7774 /* returns the new KeyingSet */
7775 parm = RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set");
7776 RNA_def_function_return(func, parm);
7777
7778 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
7779 RNA_def_property_struct_type(prop, "KeyingSet");
7782 "rna_Scene_active_keying_set_get",
7783 "rna_Scene_active_keying_set_set",
7784 nullptr,
7785 nullptr);
7787 prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
7789
7790 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
7791 RNA_def_property_int_sdna(prop, nullptr, "active_keyingset");
7793 "rna_Scene_active_keying_set_index_get",
7794 "rna_Scene_active_keying_set_index_set",
7795 nullptr);
7797 prop,
7798 "Active Keying Set Index",
7799 "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
7801}
7802
7804{
7805 StructRNA *srna;
7806 PropertyRNA *prop;
7807
7808 RNA_def_property_srna(cprop, "KeyingSetsAll");
7809 srna = RNA_def_struct(brna, "KeyingSetsAll", nullptr);
7810 RNA_def_struct_sdna(srna, "Scene");
7811 RNA_def_struct_path_func(srna, "rna_Scene_KeyingsSetsAll_path");
7812 RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
7813
7814 /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
7815
7816 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
7817 RNA_def_property_struct_type(prop, "KeyingSet");
7820 "rna_Scene_active_keying_set_get",
7821 "rna_Scene_active_keying_set_set",
7822 nullptr,
7823 nullptr);
7825 prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
7827
7828 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
7829 RNA_def_property_int_sdna(prop, nullptr, "active_keyingset");
7831 "rna_Scene_active_keying_set_index_get",
7832 "rna_Scene_active_keying_set_index_set",
7833 nullptr);
7835 prop,
7836 "Active Keying Set Index",
7837 "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
7839}
7840
7841/* Runtime property, used to remember uv indices, used only in UV stitch for now.
7842 */
7844{
7845 StructRNA *srna;
7846 PropertyRNA *prop;
7847
7848 srna = RNA_def_struct(brna, "SelectedUvElement", "PropertyGroup");
7849 RNA_def_struct_ui_text(srna, "Selected UV Element", "");
7850
7851 /* store the index to the UV element selected */
7852 prop = RNA_def_property(srna, "element_index", PROP_INT, PROP_UNSIGNED);
7854 RNA_def_property_ui_text(prop, "Element Index", "");
7855
7856 prop = RNA_def_property(srna, "face_index", PROP_INT, PROP_UNSIGNED);
7858 RNA_def_property_ui_text(prop, "Face Index", "");
7859}
7860
7862{
7863 StructRNA *srna;
7864 PropertyRNA *prop;
7865
7866 srna = RNA_def_struct(brna, "DisplaySafeAreas", nullptr);
7867 RNA_def_struct_ui_text(srna, "Safe Areas", "Safe areas used in 3D view and the sequencer");
7868 RNA_def_struct_sdna(srna, "DisplaySafeAreas");
7869
7870 /* SAFE AREAS */
7871 prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_XYZ);
7872 RNA_def_property_float_sdna(prop, nullptr, "title");
7873 RNA_def_property_array(prop, 2);
7874 RNA_def_property_range(prop, 0.0f, 1.0f);
7875 RNA_def_property_ui_text(prop, "Title Safe Margins", "Safe area for text and graphics");
7877
7878 prop = RNA_def_property(srna, "action", PROP_FLOAT, PROP_XYZ);
7879 RNA_def_property_float_sdna(prop, nullptr, "action");
7880 RNA_def_property_array(prop, 2);
7881 RNA_def_property_range(prop, 0.0f, 1.0f);
7882 RNA_def_property_ui_text(prop, "Action Safe Margins", "Safe area for general elements");
7884
7885 prop = RNA_def_property(srna, "title_center", PROP_FLOAT, PROP_XYZ);
7886 RNA_def_property_float_sdna(prop, nullptr, "title_center");
7887 RNA_def_property_array(prop, 2);
7888 RNA_def_property_range(prop, 0.0f, 1.0f);
7890 "Center Title Safe Margins",
7891 "Safe area for text and graphics in a different aspect ratio");
7893
7894 prop = RNA_def_property(srna, "action_center", PROP_FLOAT, PROP_XYZ);
7895 RNA_def_property_float_sdna(prop, nullptr, "action_center");
7896 RNA_def_property_array(prop, 2);
7897 RNA_def_property_range(prop, 0.0f, 1.0f);
7899 "Center Action Safe Margins",
7900 "Safe area for general elements in a different aspect ratio");
7902}
7903
7905{
7906 StructRNA *srna;
7907 PropertyRNA *prop;
7908
7909 srna = RNA_def_struct(brna, "SceneDisplay", nullptr);
7910 RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
7911 RNA_def_struct_sdna(srna, "SceneDisplay");
7912
7913 prop = RNA_def_property(srna, "light_direction", PROP_FLOAT, PROP_DIRECTION);
7914 RNA_def_property_float_sdna(prop, nullptr, "light_direction");
7916 RNA_def_property_array(prop, 3);
7918 prop, "Light Direction", "Direction of the light for shadows and highlights");
7919 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7920
7921 prop = RNA_def_property(srna, "shadow_shift", PROP_FLOAT, PROP_ANGLE);
7922 RNA_def_property_ui_text(prop, "Shadow Shift", "Shadow termination angle");
7923 RNA_def_property_range(prop, 0.0f, 1.0f);
7924 RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 2);
7926 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7927
7928 prop = RNA_def_property(srna, "shadow_focus", PROP_FLOAT, PROP_FACTOR);
7930 RNA_def_property_ui_text(prop, "Shadow Focus", "Shadow factor hardness");
7931 RNA_def_property_range(prop, 0.0f, 1.0f);
7932 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
7934 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7935
7936 prop = RNA_def_property(srna, "matcap_ssao_distance", PROP_FLOAT, PROP_DISTANCE);
7938 prop, "Distance", "Distance of object that contribute to the cavity/edge effect");
7939 RNA_def_property_range(prop, 0.0f, 100000.0f);
7940 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
7941
7942 prop = RNA_def_property(srna, "matcap_ssao_attenuation", PROP_FLOAT, PROP_NONE);
7943 RNA_def_property_ui_text(prop, "Attenuation", "Attenuation constant");
7944 RNA_def_property_range(prop, 0.0f, 100000.0f);
7945 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
7946
7947 prop = RNA_def_property(srna, "matcap_ssao_samples", PROP_INT, PROP_NONE);
7948 RNA_def_property_ui_text(prop, "Samples", "Number of samples");
7949 RNA_def_property_range(prop, 1, 500);
7950
7951 prop = RNA_def_property(srna, "render_aa", PROP_ENUM, PROP_NONE);
7954 prop, "Render Anti-Aliasing", "Method of anti-aliasing when rendering final image");
7956
7957 prop = RNA_def_property(srna, "viewport_aa", PROP_ENUM, PROP_NONE);
7960 prop, "Viewport Anti-Aliasing", "Method of anti-aliasing when rendering 3d viewport");
7962
7963 /* OpenGL render engine settings. */
7964 prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
7965 RNA_def_property_ui_text(prop, "Shading Settings", "Shading settings for OpenGL render engine");
7966}
7967
7969{
7970 StructRNA *srna;
7971 PropertyRNA *prop;
7972
7973 srna = RNA_def_struct(brna, "RaytraceEEVEE", nullptr);
7974 RNA_def_struct_path_func(srna, "rna_RaytraceEEVEE_path");
7976 srna, "EEVEE Raytrace Options", "Quality options for the raytracing pipeline");
7977
7978 prop = RNA_def_property(srna, "resolution_scale", PROP_ENUM, PROP_NONE);
7981 "Resolution",
7982 "Determines the number of rays per pixel. "
7983 "Higher resolution uses more memory.");
7986
7987 prop = RNA_def_property(srna, "use_denoise", PROP_BOOLEAN, PROP_NONE);
7990 prop, "Denoise", "Enable noise reduction techniques for raytraced effects");
7993
7994 prop = RNA_def_property(srna, "denoise_spatial", PROP_BOOLEAN, PROP_NONE);
7995 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_SPATIAL);
7996 RNA_def_property_ui_text(prop, "Spatial Reuse", "Reuse neighbor pixels' rays");
7999
8000 prop = RNA_def_property(srna, "denoise_temporal", PROP_BOOLEAN, PROP_NONE);
8001 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_TEMPORAL);
8003 prop, "Temporal Accumulation", "Accumulate samples by reprojecting last tracing results");
8006
8007 prop = RNA_def_property(srna, "denoise_bilateral", PROP_BOOLEAN, PROP_NONE);
8008 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_BILATERAL);
8010 prop, "Bilateral Filter", "Blur the resolved radiance using a bilateral filter");
8013
8014 prop = RNA_def_property(srna, "screen_trace_thickness", PROP_FLOAT, PROP_DISTANCE);
8016 prop,
8017 "Screen-Trace Thickness",
8018 "Surface thickness used to detect intersection when using screen-tracing");
8019 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8020 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3);
8023
8024 prop = RNA_def_property(srna, "trace_max_roughness", PROP_FLOAT, PROP_FACTOR);
8026 "Raytrace Max Roughness",
8027 "Maximum roughness to use the tracing pipeline for. Higher "
8028 "roughness surfaces will use fast GI approximation. A value of 1 will "
8029 "disable fast GI approximation.");
8030 RNA_def_property_range(prop, 0.0f, 1.0f);
8033
8034 prop = RNA_def_property(srna, "screen_trace_quality", PROP_FLOAT, PROP_FACTOR);
8036 prop, "Screen-Trace Precision", "Precision of the screen space ray-tracing");
8037 RNA_def_property_range(prop, 0.0f, 1.0f);
8040}
8041
8043{
8044 StructRNA *srna;
8045 PropertyRNA *prop;
8046
8047 static const EnumPropertyItem eevee_shadow_size_items[] = {
8048 {128, "128", 0, "128 px", ""},
8049 {256, "256", 0, "256 px", ""},
8050 {512, "512", 0, "512 px", ""},
8051 {1024, "1024", 0, "1024 px", ""},
8052 {2048, "2048", 0, "2048 px", ""},
8053 {4096, "4096", 0, "4096 px", ""},
8054 {0, nullptr, 0, nullptr, nullptr},
8055 };
8056
8057 static const EnumPropertyItem eevee_pool_size_items[] = {
8058 {16, "16", 0, "16 MB", ""},
8059 {32, "32", 0, "32 MB", ""},
8060 {64, "64", 0, "64 MB", ""},
8061 {128, "128", 0, "128 MB", ""},
8062 {256, "256", 0, "256 MB", ""},
8063 {512, "512", 0, "512 MB", ""},
8064 {1024, "1024", 0, "1 GB", ""},
8065 {0, nullptr, 0, nullptr, nullptr},
8066 };
8067
8068 static const EnumPropertyItem eevee_gi_visibility_size_items[] = {
8069 {8, "8", 0, "8 px", ""},
8070 {16, "16", 0, "16 px", ""},
8071 {32, "32", 0, "32 px", ""},
8072 {64, "64", 0, "64 px", ""},
8073 {0, nullptr, 0, nullptr, nullptr},
8074 };
8075
8076 static const EnumPropertyItem ray_tracing_method_items[] = {
8078 "PROBE",
8079 0,
8080 "Light Probe",
8081 "Use light probes to find scene intersection"},
8083 "SCREEN",
8084 0,
8085 "Screen-Trace",
8086 "Raytrace against the depth buffer. Fallback to light probes for invalid rays."},
8087 {0, nullptr, 0, nullptr, nullptr},
8088 };
8089
8090 static const EnumPropertyItem fast_gi_method_items[] = {
8092 "AMBIENT_OCCLUSION_ONLY",
8093 0,
8094 "Ambient Occlusion",
8095 "Use ambient occlusion instead of full global illumination"},
8096 {FAST_GI_FULL,
8097 "GLOBAL_ILLUMINATION",
8098 0,
8099 "Global Illumination",
8100 "Compute global illumination taking into account light bouncing off surrounding objects"},
8101 {0, nullptr, 0, nullptr, nullptr},
8102 };
8103
8104 srna = RNA_def_struct(brna, "SceneEEVEE", nullptr);
8105 RNA_def_struct_path_func(srna, "rna_SceneEEVEE_path");
8106 RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
8107
8108 /* Indirect Lighting */
8109 prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE);
8111 "Diffuse Bounces",
8112 "Number of times the light is reinjected inside light grids, "
8113 "0 disable indirect diffuse light");
8114 RNA_def_property_range(prop, 0, INT_MAX);
8116
8117 prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
8118 RNA_def_property_enum_items(prop, eevee_shadow_size_items);
8119 RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
8121 RNA_def_property_update(prop, 0, "rna_SceneEEVEE_gi_cubemap_resolution_update");
8122
8123 prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE);
8124 RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items);
8126 "Irradiance Visibility Size",
8127 "Size of the shadow map applied to each irradiance sample");
8129
8130 prop = RNA_def_property(srna, "gi_glossy_clamp", PROP_FLOAT, PROP_NONE);
8132 "Clamp Glossy",
8133 "Clamp pixel intensity to reduce noise inside glossy reflections "
8134 "from reflection cubemaps (0 to disable)");
8135 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8137
8138 prop = RNA_def_property(srna, "gi_irradiance_pool_size", PROP_ENUM, PROP_NONE);
8139 RNA_def_property_enum_items(prop, eevee_pool_size_items);
8141 "Irradiance Pool Size",
8142 "Size of the irradiance pool, "
8143 "a bigger pool size allows for more irradiance grid in the scene "
8144 "but might not fit into GPU memory and decrease performance");
8147
8148 /* Temporal Anti-Aliasing (super sampling) */
8149 prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
8150 RNA_def_property_ui_text(prop, "Viewport Samples", "Number of samples, unlimited if 0");
8151 RNA_def_property_range(prop, 0, INT_MAX);
8155
8156 prop = RNA_def_property(srna, "taa_render_samples", PROP_INT, PROP_NONE);
8157 RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixel for rendering");
8158 RNA_def_property_range(prop, 1, INT_MAX);
8162
8163 prop = RNA_def_property(srna, "use_taa_reprojection", PROP_BOOLEAN, PROP_NONE);
8166 "Viewport Denoising",
8167 "Denoise image using temporal reprojection "
8168 "(can leave some ghosting)");
8172
8173 prop = RNA_def_property(srna, "ray_tracing_method", PROP_ENUM, PROP_NONE);
8174 RNA_def_property_enum_items(prop, ray_tracing_method_items);
8176 prop, "Tracing Method", "Select the tracing method used to find scene-ray intersections");
8178
8179 prop = RNA_def_property(srna, "use_shadow_jitter_viewport", PROP_BOOLEAN, PROP_NONE);
8182 "Jittered Shadows (Viewport)",
8183 "Enable jittered shadows on the viewport. (Jittered shadows are always "
8184 "enabled for final renders).");
8186
8187 /* Clamping */
8188 prop = RNA_def_property(srna, "clamp_surface_direct", PROP_FLOAT, PROP_NONE);
8190 "Clamp Surface Direct",
8191 "If non-zero, the maximum value for lights contribution on a surface. "
8192 "Higher values will be scaled down to avoid too "
8193 "much noise and slow convergence at the cost of accuracy. "
8194 "Used by light objects.");
8195 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8198
8199 prop = RNA_def_property(srna, "clamp_surface_indirect", PROP_FLOAT, PROP_NONE);
8201 "Clamp Surface Indirect",
8202 "If non-zero, the maximum value for indirect lighting on surface. "
8203 "Higher values will be scaled down to avoid too "
8204 "much noise and slow convergence at the cost of accuracy. "
8205 "Used by ray-tracing and light-probes.");
8206 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8209 prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneEEVEE_clamp_surface_indirect_update");
8210
8211 prop = RNA_def_property(srna, "clamp_volume_direct", PROP_FLOAT, PROP_NONE);
8213 "Clamp Volume Direct",
8214 "If non-zero, the maximum value for lights contribution in volumes. "
8215 "Higher values will be scaled down to avoid too "
8216 "much noise and slow convergence at the cost of accuracy. "
8217 "Used by light objects.");
8218 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8221
8222 prop = RNA_def_property(srna, "clamp_volume_indirect", PROP_FLOAT, PROP_NONE);
8224 "Clamp Volume Indirect",
8225 "If non-zero, the maximum value for indirect lighting in volumes. "
8226 "Higher values will be scaled down to avoid too "
8227 "much noise and slow convergence at the cost of accuracy. "
8228 "Used by light-probes.");
8229 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8232
8233 /* Volumetrics */
8234 prop = RNA_def_property(srna, "volumetric_start", PROP_FLOAT, PROP_DISTANCE);
8235 RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect");
8236 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8237 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
8240
8241 prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE);
8242 RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect");
8243 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8244 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
8247
8248 prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE);
8251 "Resolution",
8252 "Control the quality of the volumetric effects. "
8253 "Higher resolution uses more memory.");
8256
8257 prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE);
8259 "Steps",
8260 "Number of steps to compute volumetric effects. "
8261 "Higher step count increase VRAM usage and quality.");
8262 RNA_def_property_range(prop, 1, 256);
8265
8266 prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR);
8268 prop, "Exponential Sampling", "Distribute more samples closer to the camera");
8271
8272 prop = RNA_def_property(srna, "volumetric_ray_depth", PROP_INT, PROP_NONE);
8274 "Volume Max Ray Depth",
8275 "Maximum surface intersection count used by the accurate volume "
8276 "intersection method. Will create artifact if it is exceeded. "
8277 "Higher count increases VRAM usage.");
8278 RNA_def_property_range(prop, 1, 16);
8281
8282 prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE);
8283 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8284 RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise");
8287
8288 prop = RNA_def_property(srna, "use_volumetric_shadows", PROP_BOOLEAN, PROP_NONE);
8291 prop,
8292 "Volumetric Shadows",
8293 "Cast shadows from volumetric materials onto volumetric materials (Very expensive)");
8296
8297 prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE);
8298 RNA_def_property_range(prop, 1, 128);
8300 prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing");
8303
8304 prop = RNA_def_property(srna, "use_volume_custom_range", PROP_BOOLEAN, PROP_NONE);
8307 "Volume Custom Range",
8308 "Enable custom start and end clip distances for volume computation");
8310
8311 /* Fast GI approximation */
8312
8313 prop = RNA_def_property(srna, "use_fast_gi", PROP_BOOLEAN, PROP_NONE);
8316 "Fast GI Approximation",
8317 "Use faster global illumination technique for high roughness surfaces");
8320
8321 prop = RNA_def_property(srna, "fast_gi_thickness_near", PROP_FLOAT, PROP_DISTANCE);
8323 prop,
8324 "Near Thickness",
8325 "Geometric thickness of the surfaces when computing fast GI and ambient occlusion. "
8326 "Reduces light leaking and missing contact occlusion.");
8327 RNA_def_property_range(prop, 0.0f, 100000.0f);
8328 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1.0f, 3);
8331
8332 prop = RNA_def_property(srna, "fast_gi_thickness_far", PROP_FLOAT, PROP_ANGLE);
8334 prop,
8335 "Far Thickness",
8336 "Angular thickness of the surfaces when computing fast GI and ambient occlusion. "
8337 "Reduces energy loss and missing occlusion of far geometry.");
8338 RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f));
8339 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 10.0f, 3);
8342
8343 prop = RNA_def_property(srna, "fast_gi_quality", PROP_FLOAT, PROP_FACTOR);
8344 RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the fast GI ray marching");
8345 RNA_def_property_range(prop, 0.0f, 1.0f);
8348
8349 prop = RNA_def_property(srna, "fast_gi_step_count", PROP_INT, PROP_UNSIGNED);
8350 RNA_def_property_range(prop, 1, 64);
8351 RNA_def_property_ui_text(prop, "Step Count", "Amount of screen sample per GI ray");
8354
8355 prop = RNA_def_property(srna, "fast_gi_ray_count", PROP_INT, PROP_UNSIGNED);
8356 RNA_def_property_range(prop, 1, 16);
8357 RNA_def_property_ui_text(prop, "Ray Count", "Amount of GI ray to trace for each pixel");
8360
8361 prop = RNA_def_property(srna, "fast_gi_method", PROP_ENUM, PROP_NONE);
8362 RNA_def_property_enum_items(prop, fast_gi_method_items);
8363 RNA_def_property_ui_text(prop, "Method", "Fast GI approximation method");
8365
8366 prop = RNA_def_property(srna, "fast_gi_distance", PROP_FLOAT, PROP_DISTANCE);
8367 RNA_def_property_range(prop, 0.0f, 100000.0f);
8368 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
8370 "Distance",
8371 "If non-zero, the maximum distance at which other surfaces will "
8372 "contribute to the fast GI approximation");
8374
8375 prop = RNA_def_property(srna, "fast_gi_bias", PROP_FLOAT, PROP_FACTOR);
8377 prop, "Bias", "Bias the shading normal to reduce self intersection artifacts");
8378 RNA_def_property_range(prop, 0.0f, 1.0f);
8379 RNA_def_property_ui_range(prop, 0.0f, 0.5f, 1.0f, 2);
8382
8383 prop = RNA_def_property(srna, "fast_gi_resolution", PROP_ENUM, PROP_NONE);
8386 "Resolution",
8387 "Control the quality of the fast GI lighting. "
8388 "Higher resolution uses more memory.");
8391
8392 /* Depth of Field */
8393
8394 prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_PIXEL);
8396 prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)");
8397 RNA_def_property_range(prop, 0.0f, 2000.0f);
8398 RNA_def_property_ui_range(prop, 0.0f, 200.0f, 100.0f, 1);
8400
8401 prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR);
8403 prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field");
8404 RNA_def_property_range(prop, 0.0f, 100000.0f);
8405 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 2);
8408
8409 prop = RNA_def_property(srna, "bokeh_neighbor_max", PROP_FLOAT, PROP_FACTOR);
8411 "Neighbor Rejection",
8412 "Maximum brightness to consider when rejecting bokeh sprites "
8413 "based on neighborhood (lower is faster)");
8414 RNA_def_property_range(prop, 0.0f, 100000.0f);
8415 RNA_def_property_ui_range(prop, 0.0f, 40.0f, 10, 2);
8418
8419 prop = RNA_def_property(srna, "use_bokeh_jittered", PROP_BOOLEAN, PROP_NONE);
8422 "Jitter Camera",
8423 "Jitter camera position to create accurate blurring "
8424 "using render samples (only for final render)");
8427
8428 prop = RNA_def_property(srna, "bokeh_overblur", PROP_FLOAT, PROP_PERCENTAGE);
8430 "Over-blur",
8431 "Apply blur to each jittered sample to reduce "
8432 "under-sampling artifacts");
8433 RNA_def_property_range(prop, 0, 100);
8434 RNA_def_property_ui_range(prop, 0.0f, 20.0f, 1, 1);
8436
8437 /* Motion blur */
8438 prop = RNA_def_property(srna, "motion_blur_depth_scale", PROP_FLOAT, PROP_NONE);
8440 "Bleeding Bias",
8441 "Lower values will reduce background"
8442 " bleeding onto foreground elements");
8443 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8444 RNA_def_property_ui_range(prop, 0.01f, 1000.0f, 1, 2);
8447
8448 prop = RNA_def_property(srna, "motion_blur_max", PROP_INT, PROP_PIXEL);
8449 RNA_def_property_ui_text(prop, "Max Blur", "Maximum blur distance a pixel can spread over");
8450 RNA_def_property_range(prop, 0, 2048);
8451 RNA_def_property_ui_range(prop, 0, 512, 1, -1);
8454
8455 prop = RNA_def_property(srna, "motion_blur_steps", PROP_INT, PROP_NONE);
8457 "Motion steps",
8458 "Controls accuracy of motion blur, "
8459 "more steps means longer render time");
8460 RNA_def_property_range(prop, 1, INT_MAX);
8461 RNA_def_property_ui_range(prop, 1, 64, 1, -1);
8464
8465 /* Shadows */
8466 prop = RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
8468 RNA_def_property_ui_text(prop, "Shadows", "Enable shadow casting from lights");
8471
8472 prop = RNA_def_property(srna, "shadow_pool_size", PROP_ENUM, PROP_NONE);
8473 RNA_def_property_enum_items(prop, eevee_pool_size_items);
8475 "Shadow Pool Size",
8476 "Size of the shadow pool, "
8477 "a bigger pool size allows for more shadows in the scene "
8478 "but might not fit into GPU memory");
8481
8482 prop = RNA_def_property(srna, "shadow_ray_count", PROP_INT, PROP_UNSIGNED);
8483 RNA_def_property_range(prop, 1, 4);
8485 prop, "Shadow Ray Count", "Amount of shadow ray to trace for each light");
8488
8489 prop = RNA_def_property(srna, "shadow_step_count", PROP_INT, PROP_UNSIGNED);
8490 RNA_def_property_range(prop, 1, 16);
8492 prop, "Shadow Step Count", "Amount of shadow map sample per shadow ray");
8495
8496 prop = RNA_def_property(srna, "light_threshold", PROP_FLOAT, PROP_UNSIGNED);
8498 "Light Threshold",
8499 "Minimum light intensity for a light to contribute to the lighting");
8500 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8501 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
8504
8505 /* Overscan */
8506 prop = RNA_def_property(srna, "use_overscan", PROP_BOOLEAN, PROP_NONE);
8507 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_EEVEE_OVERSCAN);
8509 "Overscan",
8510 "Internally render past the image border to avoid "
8511 "screen-space effects disappearing");
8513
8514 prop = RNA_def_property(srna, "overscan_size", PROP_FLOAT, PROP_PERCENTAGE);
8515 RNA_def_property_float_sdna(prop, nullptr, "overscan");
8517 "Overscan Size",
8518 "Percentage of render size to add as overscan to the "
8519 "internal render buffers");
8520 RNA_def_property_range(prop, 0.0f, 50.0f);
8521 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 2);
8523
8524 prop = RNA_def_property(srna, "ray_tracing_options", PROP_POINTER, PROP_NONE);
8525 RNA_def_property_struct_type(prop, "RaytraceEEVEE");
8527 prop, "Reflection Trace Options", "EEVEE settings for tracing reflections");
8528
8529 prop = RNA_def_property(srna, "use_raytracing", PROP_BOOLEAN, PROP_NONE);
8530 /* Reuse the same property as legacy EEVEE for compatibility. */
8532 RNA_def_property_ui_text(prop, "Use Ray-Tracing", "Enable the ray-tracing module");
8535
8536 prop = RNA_def_property(srna, "shadow_resolution_scale", PROP_FLOAT, PROP_FACTOR);
8537 RNA_def_property_range(prop, 0.0f, 1.0f);
8539 prop, "Shadows Resolution Scale", "Resolution percentage of shadow maps");
8541 RNA_def_property_update(prop, 0, "rna_SceneEEVEE_shadow_resolution_update");
8542}
8543
8545{
8546 StructRNA *srna;
8547 PropertyRNA *prop;
8548
8549 srna = RNA_def_struct(brna, "SceneGpencil", nullptr);
8550 RNA_def_struct_path_func(srna, "rna_SceneGpencil_path");
8551 RNA_def_struct_ui_text(srna, "Grease Pencil Render", "Render settings");
8552
8553 prop = RNA_def_property(srna, "antialias_threshold", PROP_FLOAT, PROP_NONE);
8554 RNA_def_property_float_sdna(prop, nullptr, "smaa_threshold");
8555 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8556 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
8558 "SMAA Threshold Viewport",
8559 "Threshold for edge detection algorithm (higher values might over-blur "
8560 "some part of the image)");
8562
8563 prop = RNA_def_property(srna, "antialias_threshold_render", PROP_FLOAT, PROP_NONE);
8564 RNA_def_property_float_sdna(prop, nullptr, "smaa_threshold_render");
8565 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8566 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
8568 "SMAA Threshold Render",
8569 "Threshold for edge detection algorithm (higher values might over-blur "
8570 "some part of the image). Only applies to final render");
8572
8573 prop = RNA_def_property(srna, "aa_samples", PROP_INT, PROP_NONE);
8575 prop,
8576 "Anti-Aliasing Samples",
8577 "Number of supersampling anti-aliasing samples per pixel for final render");
8578 RNA_def_property_range(prop, 1, INT_MAX);
8579 RNA_def_property_ui_range(prop, 1, 256, 1, 3);
8583
8584 prop = RNA_def_property(srna, "motion_blur_steps", PROP_INT, PROP_NONE);
8586 "Motion Blur Steps",
8587 "Controls accuracy of motion blur, more steps result in longer render "
8588 "time. Only used when Motion Blur is enabled. Set to 0 to disable "
8589 "motion blur for Grease Pencil");
8590 RNA_def_property_range(prop, 0, INT_MAX);
8591 RNA_def_property_ui_range(prop, 0, 64, 1, -1);
8595
8598}
8599
8601{
8602 StructRNA *srna;
8603 PropertyRNA *prop;
8604
8605 static const EnumPropertyItem hydra_export_method_items[] = {
8607 "HYDRA",
8608 0,
8609 "Hydra",
8610 "Fast interactive editing through native Hydra integration"},
8612 "USD",
8613 0,
8614 "USD",
8615 "Export scene through USD file, for accurate comparison with USD file export"},
8616 {0, nullptr, 0, nullptr, nullptr},
8617 };
8618
8619 srna = RNA_def_struct(brna, "SceneHydra", nullptr);
8620 RNA_def_struct_path_func(srna, "rna_SceneHydra_path");
8621 RNA_def_struct_ui_text(srna, "Scene Hydra", "Scene Hydra render engine settings");
8622
8623 prop = RNA_def_property(srna, "export_method", PROP_ENUM, PROP_NONE);
8624 RNA_def_property_enum_items(prop, hydra_export_method_items);
8626 prop, "Export Method", "How to export the Blender scene to the Hydra render engine");
8628}
8629
8631{
8632 StructRNA *srna;
8633 PropertyRNA *prop;
8634
8635 FunctionRNA *func;
8636 PropertyRNA *parm;
8637
8638 static const EnumPropertyItem audio_distance_model_items[] = {
8639 {0, "NONE", 0, "None", "No distance attenuation"},
8640 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
8641 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
8642 {3, "LINEAR", 0, "Linear", "Linear distance model"},
8643 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
8644 {5, "EXPONENT", 0, "Exponential", "Exponential distance model"},
8645 {6,
8646 "EXPONENT_CLAMPED",
8647 0,
8648 "Exponential Clamped",
8649 "Exponential distance model with clamping"},
8650 {0, nullptr, 0, nullptr, nullptr},
8651 };
8652
8653 static const EnumPropertyItem sync_mode_items[] = {
8654 {0, "NONE", 0, "Play Every Frame", "Do not sync, play every frame"},
8655 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
8656 {AUDIO_SYNC, "AUDIO_SYNC", 0, "Sync to Audio", "Sync to audio playback, dropping frames"},
8657 {0, nullptr, 0, nullptr, nullptr},
8658 };
8659
8660 static const EnumPropertyItem time_jump_unit_items[] = {
8661 {SCE_TIME_JUMP_FRAME, "FRAME", 0, "Frame", "Jump by frames"},
8662 {SCE_TIME_JUMP_SECOND, "SECOND", 0, "Second", "Jump by seconds"},
8663 {0, nullptr, 0, nullptr, nullptr},
8664 };
8665
8666 /* Struct definition */
8667 srna = RNA_def_struct(brna, "Scene", "ID");
8669 "Scene",
8670 "Scene data-block, consisting in objects and "
8671 "defining time and render related settings");
8672 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
8674
8675 /* Global Settings */
8676 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
8679 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Camera_object_poll");
8680 RNA_def_property_ui_text(prop, "Camera", "Active camera, used for rendering the scene");
8681 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_camera_update");
8682
8683 prop = RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
8684 RNA_def_property_pointer_sdna(prop, nullptr, "set");
8685 RNA_def_property_struct_type(prop, "Scene");
8688 RNA_def_property_pointer_funcs(prop, nullptr, "rna_Scene_set_set", nullptr, nullptr);
8689 RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
8690 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
8691
8692 prop = RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
8695 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
8697 RNA_def_property_update(prop, NC_SCENE | ND_WORLD, "rna_Scene_world_update");
8698
8699 prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
8700 RNA_def_property_struct_type(prop, "Object");
8701 RNA_def_property_ui_text(prop, "Objects", "");
8703 "rna_Scene_objects_begin",
8704 "rna_Scene_objects_next",
8705 "rna_Scene_objects_end",
8706 "rna_Scene_objects_get",
8707 nullptr,
8708 nullptr,
8709 nullptr,
8710 nullptr);
8711 rna_def_scene_objects(brna, prop);
8712
8713 /* Frame Range Stuff */
8714 prop = RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
8716 RNA_def_property_int_sdna(prop, nullptr, "r.cfra");
8718 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_frame_current_set", nullptr);
8720 prop,
8721 "Current Frame",
8722 "Current frame, to update animation data from Python frame_set() instead");
8724 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update_context");
8725
8726 prop = RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME);
8727 RNA_def_property_float_sdna(prop, nullptr, "r.subframe");
8728 RNA_def_property_ui_text(prop, "Current Subframe", "");
8730 RNA_def_property_range(prop, 0.0f, 1.0f);
8731 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2);
8732 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
8733
8734 prop = RNA_def_property(srna, "frame_float", PROP_FLOAT, PROP_TIME);
8735 RNA_def_property_ui_text(prop, "Current Subframe", "");
8740 prop, "rna_Scene_frame_float_get", "rna_Scene_frame_float_set", nullptr);
8741 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
8742
8743 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
8745 RNA_def_property_int_sdna(prop, nullptr, "r.sfra");
8746 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_start_frame_set", nullptr);
8748 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
8750
8751 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
8753 RNA_def_property_int_sdna(prop, nullptr, "r.efra");
8754 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_end_frame_set", nullptr);
8756 RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
8758
8759 prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
8761 RNA_def_property_int_sdna(prop, nullptr, "r.frame_step");
8763 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
8765 prop,
8766 "Frame Step",
8767 "Number of frames to skip forward while rendering/playing back each frame");
8768 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8769
8770 prop = RNA_def_property(srna, "time_jump_unit", PROP_ENUM, PROP_NONE);
8771 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "r.time_jump_unit");
8773 RNA_def_property_enum_items(prop, time_jump_unit_items);
8775 prop, "Time Jump Unit", "Which unit to use for time jumps in the timeline");
8778
8779 prop = RNA_def_property(srna, "time_jump_delta", PROP_FLOAT, PROP_TIME);
8781 RNA_def_property_float_sdna(prop, nullptr, "r.time_jump_delta");
8782 RNA_def_property_range(prop, 0.1f, FLT_MAX);
8784 prop, "Time Jump Delta", "Number of frames or seconds to jump forward or backward");
8786
8787 prop = RNA_def_property(srna, "frame_current_final", PROP_FLOAT, PROP_TIME);
8790 RNA_def_property_float_funcs(prop, "rna_Scene_frame_current_final_get", nullptr, nullptr);
8792 prop, "Current Frame Final", "Current frame with subframe and time remapping applied");
8793
8794 prop = RNA_def_property(srna, "lock_frame_selection_to_range", PROP_BOOLEAN, PROP_NONE);
8798 "Lock Frame Selection",
8799 "Don't allow frame to be selected with mouse outside of frame range");
8800 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8801
8802 /* Preview Range (frame-range for UI playback) */
8803 prop = RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
8805 RNA_def_property_boolean_sdna(prop, nullptr, "r.flag", SCER_PRV_RANGE);
8806 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Scene_use_preview_range_set");
8808 prop,
8809 "Use Preview Range",
8810 "Use an alternative start/end frame range for animation playback and view renders");
8811 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8812 RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
8813
8814 prop = RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
8816 RNA_def_property_int_sdna(prop, nullptr, "r.psfra");
8817 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_preview_range_start_frame_set", nullptr);
8819 prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
8820 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8821
8822 prop = RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
8824 RNA_def_property_int_sdna(prop, nullptr, "r.pefra");
8825 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_preview_range_end_frame_set", nullptr);
8827 prop, "Preview Range End Frame", "Alternative end frame for UI playback");
8828 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8829
8830 /* Sub-frame for motion-blur debug. */
8831 prop = RNA_def_property(srna, "show_subframe", PROP_BOOLEAN, PROP_NONE);
8833 RNA_def_property_boolean_sdna(prop, nullptr, "r.flag", SCER_SHOW_SUBFRAME);
8835 prop,
8836 "Show Subframe",
8837 "Display and allow setting fractional frame values for the current frame");
8838 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_show_subframe_update");
8839
8840 /* Timeline / Time Navigation settings */
8841 prop = RNA_def_property(srna, "show_keys_from_selected_only", PROP_BOOLEAN, PROP_NONE);
8844 prop, "Only Show Selected", "Only include channels relating to selected objects and data");
8845 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8846
8847 /* Stamp */
8848 prop = RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
8849 RNA_def_property_string_sdna(prop, nullptr, "r.stamp_udata");
8850 RNA_def_property_ui_text(prop, "Stamp Note", "User defined note for the render stamping");
8852
8853 /* Animation Data (for Scene) */
8855
8856 /* Readonly Properties */
8857 prop = RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
8858 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_NLA_EDIT_ON);
8860 PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
8862 prop,
8863 "NLA Tweak Mode",
8864 "Whether there is any action referenced by NLA being edited (strictly read-only)");
8866
8867 /* Frame dropping flag for playback and sync enum */
8868# if 0 /* XXX: Is this actually needed? */
8869 prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
8870 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_FRAME_DROP);
8872 prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
8873 RNA_def_property_update(prop, NC_SCENE, nullptr);
8874# endif
8875
8876 prop = RNA_def_property(srna, "use_custom_simulation_range", PROP_BOOLEAN, PROP_NONE);
8879 "Custom Simulation Range",
8880 "Use a simulation range that is different from the scene range for "
8881 "simulation nodes that don't override the frame range themselves");
8883 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
8884
8885 prop = RNA_def_property(srna, "simulation_frame_start", PROP_INT, PROP_NONE);
8886 RNA_def_property_ui_text(prop, "Simulation Frame Start", "Frame at which simulations start");
8888 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
8889
8890 prop = RNA_def_property(srna, "simulation_frame_end", PROP_INT, PROP_NONE);
8891 RNA_def_property_ui_text(prop, "Simulation Frame End", "Frame at which simulations end");
8893 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
8894
8895 prop = RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
8896 RNA_def_property_enum_funcs(prop, "rna_Scene_sync_mode_get", "rna_Scene_sync_mode_set", nullptr);
8897 RNA_def_property_enum_items(prop, sync_mode_items);
8899 RNA_def_property_ui_text(prop, "Sync Mode", "How to sync playback");
8900 RNA_def_property_update(prop, NC_SCENE, nullptr);
8901
8902 /* Nodes (Compositing) */
8903 prop = RNA_def_property(srna, "compositing_node_group", PROP_POINTER, PROP_NONE);
8904 RNA_def_property_pointer_sdna(prop, nullptr, "compositing_node_group");
8905 RNA_def_property_struct_type(prop, "NodeTree");
8908 RNA_def_property_ui_text(prop, "Node Tree", "Compositor Nodes");
8909 RNA_def_property_update(prop, 0, "rna_Scene_compositor_update");
8911 nullptr,
8912 "rna_Scene_compositing_node_group_set",
8913 nullptr,
8914 "rna_Scene_compositing_node_group_poll");
8915
8916 /* Todo(#140111): Remove in 6.0. */
8917 prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
8918 RNA_def_property_boolean_sdna(prop, nullptr, "use_nodes", 1);
8920 RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node group.");
8921 RNA_def_property_boolean_funcs(prop, "rna_Scene_use_nodes_get", "rna_Scene_use_nodes_set");
8923 prop,
8924 "Unused but kept for compatibility reasons. Setting the property "
8925 "has no effect, and getting it always returns True. Use #scene.render.use_compositing to "
8926 "turn compositing to enable or disable compositing.",
8927 500,
8928 600);
8929
8930 /* Sequencer */
8931 prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
8932 RNA_def_property_pointer_sdna(prop, nullptr, "ed");
8933 RNA_def_property_struct_type(prop, "SequenceEditor");
8934 RNA_def_property_ui_text(prop, "Sequence Editor", "");
8935
8936 /* Keying Sets */
8937 prop = RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
8938 RNA_def_property_collection_sdna(prop, nullptr, "keyingsets", nullptr);
8939 RNA_def_property_struct_type(prop, "KeyingSet");
8940 RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
8942 rna_def_scene_keying_sets(brna, prop);
8943
8944 prop = RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
8946 "rna_Scene_all_keyingsets_begin",
8947 "rna_Scene_all_keyingsets_next",
8948 "rna_iterator_listbase_end",
8949 "rna_iterator_listbase_get",
8950 nullptr,
8951 nullptr,
8952 nullptr,
8953 nullptr);
8954 RNA_def_property_struct_type(prop, "KeyingSet");
8956 prop,
8957 "All Keying Sets",
8958 "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
8961
8962 /* Rigid Body Simulation */
8963 prop = RNA_def_property(srna, "rigidbody_world", PROP_POINTER, PROP_NONE);
8964 RNA_def_property_pointer_sdna(prop, nullptr, "rigidbody_world");
8965 RNA_def_property_struct_type(prop, "RigidBodyWorld");
8966 RNA_def_property_ui_text(prop, "Rigid Body World", "");
8967 RNA_def_property_update(prop, NC_SCENE, "rna_Physics_relations_update");
8968
8969 /* Tool Settings */
8970 prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
8973 RNA_def_property_pointer_sdna(prop, nullptr, "toolsettings");
8974 RNA_def_property_struct_type(prop, "ToolSettings");
8975 RNA_def_property_ui_text(prop, "Tool Settings", "");
8976
8977 /* Unit Settings */
8978 prop = RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
8980 RNA_def_property_pointer_sdna(prop, nullptr, "unit");
8981 RNA_def_property_struct_type(prop, "UnitSettings");
8982 RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
8983
8984 /* Physics Settings */
8985 prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
8986 RNA_def_property_float_sdna(prop, nullptr, "physics_settings.gravity");
8987 RNA_def_property_array(prop, 3);
8988 RNA_def_property_ui_range(prop, -200.0f, 200.0f, 1, 2);
8989 RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
8990 RNA_def_property_update(prop, 0, "rna_Physics_update");
8991
8992 prop = RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
8993 RNA_def_property_boolean_sdna(prop, nullptr, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
8994 RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics");
8995 RNA_def_property_update(prop, 0, "rna_Physics_update");
8996
8997 /* Render Data */
8998 prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
9000 RNA_def_property_pointer_sdna(prop, nullptr, "r");
9001 RNA_def_property_struct_type(prop, "RenderSettings");
9002 RNA_def_property_ui_text(prop, "Render Data", "");
9003
9004 /* Safe Areas */
9005 prop = RNA_def_property(srna, "safe_areas", PROP_POINTER, PROP_NONE);
9006 RNA_def_property_pointer_sdna(prop, nullptr, "safe_areas");
9008 RNA_def_property_struct_type(prop, "DisplaySafeAreas");
9009 RNA_def_property_ui_text(prop, "Safe Areas", "");
9010
9011 /* Markers */
9012 prop = RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
9013 RNA_def_property_collection_sdna(prop, nullptr, "markers", nullptr);
9014 RNA_def_property_struct_type(prop, "TimelineMarker");
9016 prop, "Timeline Markers", "Markers used in all timelines for the current scene");
9017 rna_def_timeline_markers(brna, prop);
9018
9019 /* Transform Orientations */
9020 prop = RNA_def_property(srna, "transform_orientation_slots", PROP_COLLECTION, PROP_NONE);
9022 "rna_Scene_transform_orientation_slots_begin",
9023 "rna_iterator_array_next",
9024 "rna_iterator_array_end",
9025 "rna_iterator_array_get",
9026 "rna_Scene_transform_orientation_slots_length",
9027 nullptr,
9028 nullptr,
9029 nullptr);
9030 RNA_def_property_struct_type(prop, "TransformOrientationSlot");
9031 RNA_def_property_ui_text(prop, "Transform Orientation Slots", "");
9032
9033 /* 3D View Cursor */
9034 prop = RNA_def_property(srna, "cursor", PROP_POINTER, PROP_NONE);
9036 RNA_def_property_pointer_sdna(prop, nullptr, "cursor");
9037 RNA_def_property_struct_type(prop, "View3DCursor");
9038 RNA_def_property_ui_text(prop, "3D Cursor", "");
9039
9040 /* Audio Settings */
9041 prop = RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE);
9042 RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set");
9044 prop, "Play Audio", "Play back of audio from Sequence Editor, otherwise mute audio");
9045 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_use_audio_update");
9046
9047# if 0 /* XXX: Is this actually needed? */
9048 prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
9049 RNA_def_property_boolean_sdna(prop, nullptr, "audio.flag", AUDIO_SYNC);
9051 prop,
9052 "Audio Sync",
9053 "Play back and sync with audio clock, dropping frames if frame display is too slow");
9054 RNA_def_property_update(prop, NC_SCENE, nullptr);
9055# endif
9056
9057 prop = RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
9058 RNA_def_property_boolean_sdna(prop, nullptr, "audio.flag", AUDIO_SCRUB);
9060 prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing");
9061 RNA_def_property_update(prop, NC_SCENE, nullptr);
9062
9063 prop = RNA_def_property(srna, "audio_doppler_speed", PROP_FLOAT, PROP_NONE);
9064 RNA_def_property_float_sdna(prop, nullptr, "audio.speed_of_sound");
9066 RNA_def_property_range(prop, 0.01f, FLT_MAX);
9068 prop, "Speed of Sound", "Speed of sound for Doppler effect calculation");
9069 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
9070
9071 prop = RNA_def_property(srna, "audio_doppler_factor", PROP_FLOAT, PROP_NONE);
9072 RNA_def_property_float_sdna(prop, nullptr, "audio.doppler_factor");
9074 RNA_def_property_range(prop, 0.0, FLT_MAX);
9075 RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for Doppler effect calculation");
9076 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
9077
9078 prop = RNA_def_property(srna, "audio_distance_model", PROP_ENUM, PROP_NONE);
9079 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "audio.distance_model");
9081 RNA_def_property_enum_items(prop, audio_distance_model_items);
9083 prop, "Distance Model", "Distance model for distance attenuation calculation");
9084 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
9085
9086 prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
9087 RNA_def_property_float_sdna(prop, nullptr, "audio.volume");
9088 RNA_def_property_range(prop, 0.0f, 100.0f);
9089 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
9091 RNA_def_property_update(prop, NC_SCENE, nullptr);
9092 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_volume_update");
9093
9094 func = RNA_def_function(srna, "update_render_engine", "rna_Scene_update_render_engine");
9096 RNA_def_function_ui_description(func, "Trigger a render engine update");
9097
9098 /* Statistics */
9099 func = RNA_def_function(srna, "statistics", "rna_Scene_statistics_string_get");
9101 parm = RNA_def_pointer(func, "view_layer", "ViewLayer", "View Layer", "");
9103 parm = RNA_def_string(func, "statistics", nullptr, 0, "Statistics", "");
9104 RNA_def_function_return(func, parm);
9105
9106 /* Grease Pencil */
9107 prop = RNA_def_property(srna, "annotation", PROP_POINTER, PROP_NONE);
9108 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
9109 RNA_def_property_struct_type(prop, "Annotation");
9111 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
9114 RNA_def_property_ui_text(prop, "Annotations", "Data-block used for annotations in the 3D view");
9116
9117 /* active MovieClip */
9118 prop = RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE);
9119 RNA_def_property_pointer_sdna(prop, nullptr, "clip");
9121 RNA_def_property_struct_type(prop, "MovieClip");
9123 "Active Movie Clip",
9124 "Active Movie Clip that can be used by motion tracking constraints "
9125 "or as a camera's background image");
9127
9128 /* color management */
9129 prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
9130 RNA_def_property_pointer_sdna(prop, nullptr, "view_settings");
9131 RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
9133 prop, "View Settings", "Color management settings applied on image before saving");
9134
9135 prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
9136 RNA_def_property_pointer_sdna(prop, nullptr, "display_settings");
9137 RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
9139 prop, "Display Settings", "Settings of device saved image would be displayed on");
9140
9141 prop = RNA_def_property(srna, "sequencer_colorspace_settings", PROP_POINTER, PROP_NONE);
9142 RNA_def_property_pointer_sdna(prop, nullptr, "sequencer_colorspace_settings");
9143 RNA_def_property_struct_type(prop, "ColorManagedSequencerColorspaceSettings");
9145 prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
9146
9147 /* Layer and Collections */
9148 prop = RNA_def_property(srna, "view_layers", PROP_COLLECTION, PROP_NONE);
9149 RNA_def_property_collection_sdna(prop, nullptr, "view_layers", nullptr);
9150 RNA_def_property_struct_type(prop, "ViewLayer");
9151 RNA_def_property_ui_text(prop, "View Layers", "");
9152 rna_def_view_layers(brna, prop);
9153
9154 prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
9156 RNA_def_property_pointer_sdna(prop, nullptr, "master_collection");
9157 RNA_def_property_struct_type(prop, "Collection");
9161 "Collection",
9162 "Scene root collection that owns all the objects and other collections "
9163 "instantiated in the scene");
9164
9165 /* Scene Display */
9166 prop = RNA_def_property(srna, "display", PROP_POINTER, PROP_NONE);
9167 RNA_def_property_pointer_sdna(prop, nullptr, "display");
9168 RNA_def_property_struct_type(prop, "SceneDisplay");
9169 RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3D viewport");
9170
9171 /* EEVEE */
9172 prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
9173 RNA_def_property_struct_type(prop, "SceneEEVEE");
9174 RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene");
9175
9176 /* Grease Pencil */
9177 prop = RNA_def_property(srna, "grease_pencil_settings", PROP_POINTER, PROP_NONE);
9178 RNA_def_property_struct_type(prop, "SceneGpencil");
9179 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil settings for the scene");
9180
9181 /* Hydra */
9182 prop = RNA_def_property(srna, "hydra", PROP_POINTER, PROP_NONE);
9183 RNA_def_property_struct_type(prop, "SceneHydra");
9184 RNA_def_property_ui_text(prop, "Hydra", "Hydra settings for the scene");
9185
9186 /* Nestled Data. */
9187 /* *** Non-Animated *** */
9193 rna_def_statvis(brna);
9203 rna_def_scene_eevee(brna);
9204 rna_def_scene_hydra(brna);
9210 /* *** Animated *** */
9213
9214 /* Scene API */
9215 RNA_api_scene(srna);
9216}
9217
9218#endif
Functionality to interact with keying sets.
struct KeyingSet * BKE_keyingset_add(struct ListBase *list, const char idname[], const char name[], short flag, short keyingflag)
Definition anim_sys.cc:134
void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_SCENE_OBJECT_END
void BKE_scene_objects_iterator_end(BLI_Iterator *iter)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance)
void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
void BKE_scene_objects_iterator_next(BLI_Iterator *iter)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
Definition editmesh.cc:61
struct FreestyleModuleConfig * BKE_freestyle_module_add(struct FreestyleConfig *config)
Definition freestyle.cc:116
struct FreestyleLineSet * BKE_freestyle_lineset_add(struct Main *bmain, struct FreestyleConfig *config, const char *name)
Definition freestyle.cc:163
struct FreestyleSettings FreestyleSettings
short BKE_freestyle_lineset_get_active_index(struct FreestyleConfig *config)
Definition freestyle.cc:222
bool BKE_freestyle_lineset_delete(struct FreestyleConfig *config, struct FreestyleLineSet *lineset)
Definition freestyle.cc:195
struct FreestyleLineSet * BKE_freestyle_lineset_get_active(struct FreestyleConfig *config)
Definition freestyle.cc:212
void BKE_freestyle_lineset_set_active_index(struct FreestyleConfig *config, short index)
Definition freestyle.cc:237
bool BKE_freestyle_module_delete(struct FreestyleConfig *config, struct FreestyleModuleConfig *module_conf)
Definition freestyle.cc:131
#define G_MAIN
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
#define IMA_SIGNAL_FREE
Definition BKE_image.hh:169
bool BKE_image_is_stereo(const Image *ima)
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
#define IMA_CHAN_FLAG_RGB
char BKE_imtype_valid_channels(char imtype)
int BKE_image_path_ext_from_imformat(const ImageFormatData *im_format, const char *r_ext[BKE_IMAGE_PATH_EXT_MAX])
void BKE_image_format_set(ImageFormatData *imf, ID *owner_id, const char imtype)
char BKE_imtype_first_valid_depth(const char valid_depths)
#define IMA_CHAN_FLAG_RGBA
#define IMA_CHAN_FLAG_BW
#define BKE_IMAGE_PATH_EXT_MAX
void BKE_image_format_media_type_set(ImageFormatData *format, ID *owner_id, const MediaType media_type)
void BKE_image_format_color_management_copy_from_scene(ImageFormatData *imf, const Scene *scene)
bool BKE_imtype_is_movie(char imtype)
bool BKE_imtype_requires_linear_float(char imtype)
char BKE_imtype_valid_depths_with_video(char imtype, const ID *owner_id)
void BKE_view_layer_rename_lightgroup(Scene *scene, ViewLayer *view_layer, ViewLayerLightgroup *lightgroup, const char *name)
ViewLayer * BKE_view_layer_find_with_aov(Scene *scene, ViewLayerAOV *aov)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
@ VIEWLAYER_ADD_NEW
Definition BKE_layer.hh:34
void BKE_view_layer_verify_aov(RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
ViewLayer * BKE_view_layer_find_with_lightgroup(Scene *scene, ViewLayerLightgroup *lightgroup)
ViewLayer * BKE_view_layer_add(Scene *scene, const char *name, ViewLayer *view_layer_source, int type)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
void BKE_view_layer_rename(Main *bmain, Scene *scene, ViewLayer *view_layer, const char *newname)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
void id_lib_extern(ID *id)
Definition lib_id.cc:290
void id_us_plus(ID *id)
Definition lib_id.cc:358
ID * BKE_id_owner_get(ID *id, const bool debug_relationship_assert=true)
Definition lib_id.cc:2511
void id_us_min(ID *id)
Definition lib_id.cc:366
void BKE_main_id_tag_listbase(ListBase *lb, int tag, bool value)
Definition lib_id.cc:1201
bool BKE_id_is_in_global_main(ID *id)
Definition lib_id.cc:2500
void BKE_main_ensure_invariants(Main &bmain, std::optional< blender::Span< ID * > > modified_ids=std::nullopt)
Mesh * BKE_mesh_from_object(Object *ob)
#define CMP_NODE_OUTPUT_FILE
int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode)
#define PTCACHE_RESET_DEPSGRAPH
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ RPT_ERROR
Definition BKE_report.hh:39
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:153
bool BKE_scene_has_view_layer(const Scene *scene, const ViewLayer *layer)
Definition scene.cc:2206
int BKE_render_num_threads(const RenderData *r)
Definition scene.cc:2888
#define SETLOOPER_SET_ONLY(_sce_basis, _sce_iter, _base)
Definition BKE_scene.hh:52
TransformOrientation * BKE_scene_transform_orientation_find(const Scene *scene, int index)
Definition scene.cc:3525
int BKE_scene_orientation_slot_get_index(const TransformOrientationSlot *orient_slot)
Definition scene.cc:2432
bool BKE_scene_use_spherical_stereo(Scene *scene)
Definition scene.cc:2818
void BKE_scene_orientation_slot_set_index(TransformOrientationSlot *orient_slot, int orientation)
Definition scene.cc:2425
bool BKE_scene_remove_render_view(Scene *scene, SceneRenderView *srv)
Definition scene.cc:2731
SceneRenderView * BKE_scene_add_render_view(Scene *sce, const char *name)
Definition scene.cc:2712
float BKE_scene_frame_to_ctime(const Scene *scene, int frame)
Definition scene.cc:2375
int BKE_unit_base_of_type_get(int system, int type)
Definition unit.cc:2537
@ B_UNIT_LENGTH
Definition BKE_unit.hh:137
@ B_UNIT_TEMPERATURE
Definition BKE_unit.hh:148
@ B_UNIT_MASS
Definition BKE_unit.hh:140
@ B_UNIT_TIME
Definition BKE_unit.hh:142
const char * BKE_unit_identifier_get(const void *usys_pt, int index)
Definition unit.cc:2554
bool BKE_unit_is_suppressed(const void *usys_pt, int index)
Definition unit.cc:2572
void BKE_unit_system_get(int system, int type, const void **r_usys_pt, int *r_len)
Definition unit.cc:2519
const char * BKE_unit_display_name_get(const void *usys_pt, int index)
Definition unit.cc:2548
#define BLI_assert_unreachable()
Definition BLI_assert.h:93
#define BLI_assert(a)
Definition BLI_assert.h:46
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:586
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:534
#define LISTBASE_FOREACH(type, var, list)
bool BLI_listbase_move_index(ListBase *listbase, int from, int to) ATTR_NONNULL()
Definition listbase.cc:467
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:497
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
bool BLI_remlink_safe(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:154
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:524
MINLINE int max_ii(int a, int b)
#define DEG2RAD(_deg)
#define DEG2RADF(_deg)
#define M_PI
void normalize_m4_m4(float rmat[4][4], const float mat[4][4]) ATTR_NONNULL()
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define STR_ELEM(...)
Definition BLI_string.h:661
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
int BLI_system_num_threads_override_get(void)
Definition threads.cc:294
#define BLENDER_MAX_THREADS
Definition BLI_threads.h:16
#define CLAMP(a, b, c)
#define ARRAY_SIZE(arr)
#define ELEM(...)
#define STREQ(a, b)
#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)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ ID_TAG_DOIT
Definition DNA_ID.h:1036
@ ID_RECALC_AUDIO_FPS
Definition DNA_ID.h:1127
@ ID_RECALC_AUDIO_LISTENER
Definition DNA_ID.h:1130
@ ID_RECALC_TRANSFORM
Definition DNA_ID.h:1054
@ ID_RECALC_SHADING
Definition DNA_ID.h:1094
@ ID_RECALC_FRAME_CHANGE
Definition DNA_ID.h:1125
@ ID_RECALC_SELECT
Definition DNA_ID.h:1101
@ ID_RECALC_PSYS_CHILD
Definition DNA_ID.h:1085
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1118
@ ID_RECALC_AUDIO_MUTE
Definition DNA_ID.h:1129
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1122
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ ID_RECALC_AUDIO_VOLUME
Definition DNA_ID.h:1128
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1104
@ ID_IM
@ ID_NT
@ ID_SCE
@ KEYINGSET_ABSOLUTE
@ CU_BEZIER
@ CU_POLY
#define MAX_NAME
Definition DNA_defs.h:50
@ FREESTYLE_QI_VISIBLE
@ FREESTYLE_QI_RANGE
@ FREESTYLE_QI_HIDDEN
@ FREESTYLE_CULLING
@ FREESTYLE_FACE_SMOOTHNESS_FLAG
@ FREESTYLE_MATERIAL_BOUNDARIES_FLAG
@ FREESTYLE_RIDGES_AND_VALLEYS_FLAG
@ FREESTYLE_VIEW_MAP_CACHE
@ FREESTYLE_SUGGESTIVE_CONTOURS_FLAG
@ FREESTYLE_AS_RENDER_PASS
@ FREESTYLE_CONTROL_EDITOR_MODE
@ FREESTYLE_CONTROL_SCRIPT_MODE
@ FREESTYLE_FE_EDGE_MARK
@ FREESTYLE_FE_BORDER
@ FREESTYLE_FE_SILHOUETTE
@ FREESTYLE_FE_RIDGE_VALLEY
@ FREESTYLE_FE_CREASE
@ FREESTYLE_FE_EXTERNAL_CONTOUR
@ FREESTYLE_FE_CONTOUR
@ FREESTYLE_FE_SUGGESTIVE_CONTOUR
@ FREESTYLE_FE_MATERIAL_BOUNDARY
@ FREESTYLE_LINESET_FE_AND
@ FREESTYLE_LINESET_ENABLED
@ FREESTYLE_LINESET_FM_NOT
@ FREESTYLE_LINESET_FE_NOT
@ FREESTYLE_LINESET_FM_BOTH
@ FREESTYLE_LINESET_GR_NOT
@ FREESTYLE_SEL_VISIBILITY
@ FREESTYLE_SEL_EDGE_TYPES
@ FREESTYLE_SEL_IMAGE_BORDER
@ FREESTYLE_SEL_FACE_MARK
@ FREESTYLE_SEL_GROUP
@ VIEW_LAYER_CRYPTOMATTE_MATERIAL
@ VIEW_LAYER_CRYPTOMATTE_ASSET
@ VIEW_LAYER_CRYPTOMATTE_ACCURATE
@ VIEW_LAYER_CRYPTOMATTE_OBJECT
@ EEVEE_RENDER_PASS_VOLUME_LIGHT
@ EEVEE_RENDER_PASS_TRANSPARENT
@ AOV_TYPE_COLOR
@ AOV_TYPE_VALUE
@ AOV_CONFLICT
@ eModifierType_ParticleSystem
@ eModifierType_Subsurf
@ eModifierType_Nodes
@ eModifierType_Multires
@ NTREE_COMPOSIT
Object is a sort of wrapper for general info.
#define OB_TYPE_IS_GEOMETRY(_type)
@ OB_MBALL
@ OB_CAMERA
@ OB_GREASE_PENCIL
@ OB_LAMP
@ OB_MESH
@ OB_VOLUME
@ OB_CURVES_LEGACY
@ OB_LIGHTPROBE
@ WT_VGROUP_ALL
@ WT_VGROUP_BONE_DEFORM_OFF
@ WT_VGROUP_BONE_DEFORM
@ UV_SELECT_VERT
@ UV_SELECT_FACE
@ UV_SELECT_EDGE
@ R_IMF_EXR_CODEC_NONE
@ R_IMF_EXR_CODEC_B44
@ R_IMF_EXR_CODEC_PXR24
@ R_IMF_EXR_CODEC_PIZ
@ R_IMF_EXR_CODEC_MAX
@ R_IMF_EXR_CODEC_DWAB
@ R_IMF_EXR_CODEC_DWAA
@ R_IMF_EXR_CODEC_RLE
@ R_IMF_EXR_CODEC_B44A
@ R_IMF_EXR_CODEC_ZIP
@ R_IMF_EXR_CODEC_ZIPS
@ SCE_COMPOSITOR_DENOISE_FAST
@ SCE_COMPOSITOR_DENOISE_BALANCED
@ SCE_COMPOSITOR_DENOISE_HIGH
@ R_STAMP_MEMORY
@ R_STAMP_SEQSTRIP
@ R_STAMP_RENDERTIME
@ R_STAMP_HIDE_LABELS
@ R_STAMP_MARKER
@ R_STAMP_CAMERA
@ R_STAMP_FRAME_RANGE
@ R_STAMP_SCENE
@ R_STAMP_CAMERALENS
@ R_STAMP_NOTE
@ R_STAMP_FRAME
@ R_STAMP_TIME
@ R_STAMP_FILENAME
@ R_STAMP_DRAW
@ R_STAMP_HOSTNAME
@ R_STAMP_DATE
@ R_STAMP_STRIPMETA
#define STEREO_LEFT_NAME
#define MINFRAME
@ UV_SCULPT_ALL_ISLANDS
@ UV_SCULPT_LOCK_BORDERS
MediaType
@ MEDIA_TYPE_MULTI_LAYER_IMAGE
@ MEDIA_TYPE_VIDEO
@ MEDIA_TYPE_IMAGE
@ SCE_ORIENT_DEFAULT
@ SCE_COMPOSITOR_PRECISION_FULL
@ SCE_COMPOSITOR_PRECISION_AUTO
@ R_SEQ_OVERRIDE_SCENE_SETTINGS
@ FFMPEG_CODEC_ID_VP9
@ FFMPEG_CODEC_ID_THEORA
@ FFMPEG_CODEC_ID_FLV1
@ FFMPEG_CODEC_ID_FFV1
@ FFMPEG_CODEC_ID_PRORES
@ FFMPEG_CODEC_ID_H264
@ FFMPEG_CODEC_ID_MPEG1VIDEO
@ FFMPEG_CODEC_ID_QTRLE
@ FFMPEG_CODEC_ID_PCM_S16LE
@ FFMPEG_CODEC_ID_MP3
@ FFMPEG_CODEC_ID_HUFFYUV
@ FFMPEG_CODEC_ID_AV1
@ FFMPEG_CODEC_ID_PNG
@ FFMPEG_CODEC_ID_DNXHD
@ FFMPEG_CODEC_ID_MP2
@ FFMPEG_CODEC_ID_AAC
@ FFMPEG_CODEC_ID_OPUS
@ FFMPEG_CODEC_ID_DVVIDEO
@ FFMPEG_CODEC_ID_MPEG4
@ FFMPEG_CODEC_ID_FLAC
@ FFMPEG_CODEC_ID_MPEG2VIDEO
@ FFMPEG_CODEC_ID_VORBIS
@ FFMPEG_CODEC_ID_H265
@ FFMPEG_CODEC_ID_NONE
@ FFMPEG_CODEC_ID_AC3
@ RAYTRACE_EEVEE_METHOD_SCREEN
@ RAYTRACE_EEVEE_METHOD_PROBE
@ PROP_EDIT_PROJECTED
@ PROP_EDIT_USE
@ PROP_EDIT_CONNECTED
@ SCE_LAY_SOLID
@ SCE_LAY_STRAND
@ SCE_LAY_SKY
@ SCE_LAY_AO
@ SCE_LAY_MOTION_BLUR
@ SCE_LAY_VOLUMES
@ SCE_LAY_GREASE_PENCIL
@ R_IMF_JP2_FLAG_CINE_48
@ R_IMF_JP2_FLAG_CINE_PRESET
@ R_IMF_JP2_FLAG_YCC
@ UVCALC_TRANSFORM_CORRECT
@ UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED
@ SCE_PERF_HQ_NORMALS
@ SCE_MB_START
@ SCE_MB_END
@ SCE_MB_CENTER
#define MINAFRAME
@ R_TOUCH
@ R_PERSISTENT_DATA
@ R_CROP
@ R_SIMPLIFY
@ R_FIXED_THREADS
@ R_SIMPLIFY_NORMALS
@ R_MBLUR
@ R_NO_OVERWRITE
@ R_EDGE_FRS
@ R_BORDER
@ SEQ_SNAP_IGNORE_SOUND
@ SEQ_SNAP_IGNORE_MUTED
@ SEQ_SNAP_CURRENT_FRAME_TO_STRIPS
#define SCE_SNAP_TO_GEOM
@ R_LINE_THICKNESS_ABSOLUTE
@ R_LINE_THICKNESS_RELATIVE
@ FFM_PRESET_GOOD
@ FFM_PRESET_REALTIME
@ FFM_PRESET_BEST
@ GP_SELECTMODE_POINT
@ GP_SELECTMODE_SEGMENT
@ GP_SELECTMODE_STROKE
@ UV_STICKY_VERT
@ UV_STICKY_LOCATION
@ UV_STICKY_DISABLE
@ PROP_SMOOTH
@ PROP_ROOT
@ PROP_SHARP
@ PROP_RANDOM
@ PROP_LIN
@ PROP_CONST
@ PROP_INVSQUARE
@ PROP_SPHERE
@ R_BAKE_NORMALS
@ R_BAKE_DISPLACEMENT
@ R_BAKE_VECTOR_DISPLACEMENT
@ OB_DRAW_GROUPUSER_ACTIVE
@ OB_DRAW_GROUPUSER_NONE
@ OB_DRAW_GROUPUSER_ALL
@ SCE_HAIR_SHAPE_CYLINDER
@ SCE_HAIR_SHAPE_STRAND
@ SCE_HAIR_SHAPE_STRIP
@ R_BAKE_TARGET_VERTEX_COLORS
@ R_BAKE_TARGET_IMAGE_TEXTURES
@ S3D_ANAGLYPH_REDCYAN
@ S3D_ANAGLYPH_YELLOWBLUE
@ S3D_ANAGLYPH_GREENMAGENTA
@ R_BAKE_POSY
@ R_BAKE_NEGX
@ R_BAKE_POSZ
@ R_BAKE_NEGY
@ R_BAKE_POSX
@ R_BAKE_NEGZ
@ R_BAKE_SPACE_TANGENT
@ R_BAKE_SPACE_OBJECT
@ CURVE_PAINT_PROJECT_CURSOR
@ CURVE_PAINT_PROJECT_SURFACE
@ R_BAKE_ADJACENT_FACES
@ R_BAKE_EXTEND
@ AUDIO_MUTE
@ AUDIO_SCRUB
@ AUDIO_SYNC
@ SEQ_OVERLAP_EXPAND
@ SEQ_OVERLAP_SHUFFLE
@ SEQ_OVERLAP_OVERWRITE
@ R_IMF_PLANES_RGB
@ R_IMF_PLANES_RGBA
@ R_IMF_PLANES_BW
@ SCE_HYDRA_EXPORT_HYDRA
@ SCE_HYDRA_EXPORT_USD
@ SCE_DISPLAY_AA_OFF
@ SCE_DISPLAY_AA_SAMPLES_32
@ SCE_DISPLAY_AA_SAMPLES_8
@ SCE_DISPLAY_AA_SAMPLES_11
@ SCE_DISPLAY_AA_SAMPLES_5
@ SCE_DISPLAY_AA_SAMPLES_16
@ SCE_DISPLAY_AA_FXAA
@ S3D_SQUEEZED_FRAME
@ S3D_INTERLACE_SWAP
@ S3D_SIDEBYSIDE_CROSSEYED
@ SCE_COMPOSITOR_DENOISE_DEVICE_GPU
@ SCE_COMPOSITOR_DENOISE_DEVICE_AUTO
@ SCE_COMPOSITOR_DENOISE_DEVICE_CPU
@ S3D_DISPLAY_ANAGLYPH
@ S3D_DISPLAY_INTERLACE
@ S3D_DISPLAY_TOPBOTTOM
@ S3D_DISPLAY_SIDEBYSIDE
@ S3D_DISPLAY_PAGEFLIP
@ R_IMF_TIFF_CODEC_PACKBITS
@ R_IMF_TIFF_CODEC_DEFLATE
@ R_IMF_TIFF_CODEC_NONE
@ R_IMF_TIFF_CODEC_LZW
@ FFM_CRF_LOW
@ FFM_CRF_MEDIUM
@ FFM_CRF_VERYLOW
@ FFM_CRF_LOSSLESS
@ FFM_CRF_PERC_LOSSLESS
@ FFM_CRF_NONE
@ FFM_CRF_LOWEST
@ FFM_CRF_HIGH
@ RAYTRACE_EEVEE_USE_DENOISE
@ R_IMF_CHAN_DEPTH_8
@ R_IMF_CHAN_DEPTH_16
@ R_IMF_CHAN_DEPTH_12
@ R_IMF_CHAN_DEPTH_10
@ R_IMF_CHAN_DEPTH_32
@ R_BAKE_VIEW_FROM_ABOVE_SURFACE
@ R_BAKE_VIEW_FROM_ACTIVE_CAMERA
@ GP_SCULPT_MASK_SELECTMODE_POINT
@ GP_SCULPT_MASK_SELECTMODE_STROKE
@ GP_SCULPT_MASK_SELECTMODE_SEGMENT
@ SCE_WORKSPACE_TOOL_DEFAULT
@ SCE_WORKSPACE_TOOL_FALLBACK
@ FFMPEG_LOSSLESS_OUTPUT
@ FFMPEG_AUTOSPLIT_OUTPUT
@ FFMPEG_USE_MAX_B_FRAMES
@ GP_VERTEX_MASK_SELECTMODE_SEGMENT
@ GP_VERTEX_MASK_SELECTMODE_STROKE
@ GP_VERTEX_MASK_SELECTMODE_POINT
#define SCE_SNAP_TO_VERTEX
@ R_IMF_JP2_CODEC_JP2
@ R_IMF_JP2_CODEC_J2K
@ R_BAKE_SPLIT_MAT
@ R_BAKE_LORES_MESH
@ R_BAKE_AUTO_NAME
@ R_BAKE_TO_ACTIVE
@ R_BAKE_CAGE
@ R_BAKE_CLEAR
@ R_BAKE_MULTIRES
@ S3D_INTERLACE_ROW
@ S3D_INTERLACE_COLUMN
@ S3D_INTERLACE_CHECKERBOARD
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE
@ CURVE_PAINT_SURFACE_PLANE_VIEW
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW
@ GP_PROJECT_VIEWSPACE
@ GP_PROJECT_DEPTH_VIEW
@ GP_PROJECT_CURSOR
@ GP_PROJECT_DEPTH_STROKE_ENDPOINTS
@ GP_PROJECT_DEPTH_STROKE
@ GP_PROJECT_DEPTH_STROKE_FIRST
@ GP_PROJECT_DEPTH_ONLY_SELECTED
@ SCE_SNAP_PEEL_OBJECT
@ SCE_SNAP_TO_INCLUDE_EDITED
@ SCE_SNAP_NOT_TO_ACTIVE
@ SCE_SNAP
@ SCE_SNAP_TO_INCLUDE_NONEDITED
@ SCE_SNAP_ROTATE
@ SCE_SNAP_ABS_GRID
@ SCE_SNAP_BACKFACE_CULLING
@ SCE_SNAP_KEEP_ON_SAME_OBJECT
@ SCE_SNAP_TO_ONLY_SELECTABLE
@ SCE_SNAP_ABS_TIME_STEP
@ PHYS_GLOBAL_GRAVITY
@ SCE_XFORM_SKIP_CHILDREN
@ SCE_XFORM_AXIS_ALIGN
@ SCE_XFORM_DATA_ORIGIN
@ SIMPLIFY_GPENCIL_FILL
@ SIMPLIFY_GPENCIL_ON_PLAY
@ SIMPLIFY_GPENCIL_AA
@ SIMPLIFY_GPENCIL_MODIFIER
@ SIMPLIFY_GPENCIL_TINT
@ SIMPLIFY_GPENCIL_ENABLE
@ SIMPLIFY_GPENCIL_FX
@ UV_FLAG_SELECT_ISLAND
@ UV_FLAG_CUSTOM_REGION
@ UV_FLAG_SHOW_SAME_IMAGE
@ UV_FLAG_SELECT_SYNC
@ FAST_GI_FULL
@ FAST_GI_AO_ONLY
@ SCER_SHOW_SUBFRAME
@ SCER_PRV_RANGE
@ SCER_LOCK_FRAME_SELECTION
@ FFM_PRORES_PROFILE_422_PROXY
@ FFM_PRORES_PROFILE_4444_XQ
@ FFM_PRORES_PROFILE_422_HQ
@ FFM_PRORES_PROFILE_4444
@ FFM_PRORES_PROFILE_422_LT
@ FFM_PRORES_PROFILE_422_STD
@ SCE_SELECT_FACE
@ SCE_SELECT_VERTEX
@ SCE_SELECT_EDGE
#define STEREO_RIGHT_NAME
@ GP_TOOL_FLAG_RETAIN_LAST
@ GP_TOOL_FLAG_THUMBNAIL_LIST
@ GP_TOOL_FLAG_PAINT_ONBACK
@ GP_TOOL_FLAG_AUTOMERGE_STROKE
@ GP_TOOL_FLAG_CREATE_WEIGHTS
@ GP_USE_MULTI_FRAME_EDITING
@ SCE_SNAP_TRANSFORM_MODE_SCALE
@ SCE_SNAP_TRANSFORM_MODE_ROTATE
@ SCE_SNAP_TRANSFORM_MODE_TRANSLATE
@ CURVE_PAINT_FIT_METHOD_REFIT
@ CURVE_PAINT_FIT_METHOD_SPLIT
@ SCE_CUSTOM_SIMULATION_RANGE
@ SCE_FRAME_DROP
@ SCE_KEYS_NO_SELONLY
@ SCE_NLA_EDIT_ON
@ FFM_CHANNELS_SURROUND4
@ FFM_CHANNELS_STEREO
@ FFM_CHANNELS_SURROUND51
@ FFM_CHANNELS_SURROUND71
@ FFM_CHANNELS_MONO
@ R_ALPHAPREMUL
@ CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS
@ CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS
@ CURVE_PAINT_FLAG_CORNERS_DETECT
@ CURVE_PAINT_FLAG_PRESSURE_RADIUS
@ CURVE_PAINT_FLAG_DEPTH_ONLY_SELECTED
@ SCE_OBJECT_MODE_LOCK
@ SCE_VIEW_DISABLE
#define USER_UNIT_ADAPTIVE
@ SCE_VIEWS_FORMAT_STEREO_3D
@ SCE_VIEWS_FORMAT_MULTIVIEW
@ SCE_EEVEE_FAST_GI_ENABLED
@ SCE_EEVEE_SHADOW_ENABLED
@ SCE_EEVEE_VOLUME_CUSTOM_RANGE
@ SCE_EEVEE_VOLUMETRIC_SHADOWS
@ SCE_EEVEE_SHADOW_JITTERED_VIEWPORT
@ SCE_EEVEE_SSR_ENABLED
@ SCE_EEVEE_TAA_REPROJECTION
@ SCE_EEVEE_OVERSCAN
@ SCE_EEVEE_DOF_JITTER
@ USER_UNIT_ROT_RADIANS
@ USER_UNIT_OPT_SPLIT
@ SCE_COMPOSITOR_DEVICE_GPU
@ SCE_COMPOSITOR_DEVICE_CPU
@ SEQ_SNAP_TO_MARKERS
@ SEQ_SNAP_TO_FRAME_RANGE
@ SEQ_SNAP_TO_PREVIEW_CENTER
@ SEQ_SNAP_TO_STRIPS_PREVIEW
@ SEQ_SNAP_TO_PREVIEW_BORDERS
@ SEQ_SNAP_TO_STRIP_HOLD
@ SEQ_SNAP_TO_RETIMING
@ SEQ_SNAP_TO_CURRENT_FRAME
@ SCE_SNAP_SOURCE_MEDIAN
@ SCE_SNAP_SOURCE_CLOSEST
@ SCE_SNAP_SOURCE_ACTIVE
@ SCE_SNAP_SOURCE_CENTER
@ R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE
@ R_IMF_COLOR_MANAGEMENT_OVERRIDE
@ USER_UNIT_IMPERIAL
@ USER_UNIT_METRIC
@ USER_UNIT_NONE
@ R_IMF_CINEON_FLAG_LOG
@ R_BAKE_SAVE_EXTERNAL
@ R_BAKE_SAVE_INTERNAL
@ SCE_TIME_JUMP_FRAME
@ SCE_TIME_JUMP_SECOND
@ AUTO_MERGE
@ AUTO_MERGE_AND_SPLIT
@ R_IMF_EXR_FLAG_MULTIPART
@ R_IMF_IMTYPE_RADHDR
@ R_IMF_IMTYPE_OPENEXR
@ R_IMF_IMTYPE_MULTILAYER
@ R_BAKE_PASS_FILTER_DIFFUSE
@ R_BAKE_PASS_FILTER_NONE
@ R_BAKE_PASS_FILTER_COLOR
@ R_BAKE_PASS_FILTER_INDIRECT
@ R_BAKE_PASS_FILTER_DIRECT
@ R_BAKE_PASS_FILTER_GLOSSY
@ R_BAKE_PASS_FILTER_EMIT
@ R_BAKE_PASS_FILTER_TRANSM
@ SCE_STATVIS_DISTORT
@ SCE_STATVIS_SHARP
@ SCE_STATVIS_INTERSECT
@ SCE_STATVIS_THICKNESS
@ SCE_STATVIS_OVERHANG
@ SCE_PASS_NORMAL
@ SCE_PASS_GLOSSY_DIRECT
@ SCE_PASS_AO
@ SCE_PASS_DIFFUSE_COLOR
@ SCE_PASS_POSITION
@ SCE_PASS_UV
@ SCE_PASS_SUBSURFACE_INDIRECT
@ SCE_PASS_TRANSM_DIRECT
@ SCE_PASS_SUBSURFACE_COLOR
@ SCE_PASS_GLOSSY_COLOR
@ SCE_PASS_DIFFUSE_DIRECT
@ SCE_PASS_GLOSSY_INDIRECT
@ SCE_PASS_INDEXMA
@ SCE_PASS_INDEXOB
@ SCE_PASS_TRANSM_INDIRECT
@ SCE_PASS_COMBINED
@ SCE_PASS_VECTOR
@ SCE_PASS_DIFFUSE_INDIRECT
@ SCE_PASS_SUBSURFACE_DIRECT
@ SCE_PASS_SHADOW
@ SCE_PASS_TRANSM_COLOR
@ SCE_PASS_MIST
@ SCE_PASS_EMIT
@ SCE_PASS_DEPTH
@ SCE_PASS_ENVIRONMENT
@ R_MULTIVIEW
@ R_SINGLE_LAYER
@ R_DOSEQ
@ R_EXR_CACHE_FILE
@ R_DOCOMP
@ R_EXTENSION
@ RAYTRACE_EEVEE_DENOISE_BILATERAL
@ RAYTRACE_EEVEE_DENOISE_SPATIAL
@ RAYTRACE_EEVEE_DENOISE_TEMPORAL
@ SCE_SNAP_INDIVIDUAL_NEAREST
@ SCE_SNAP_TO_KEYS
@ SCE_SNAP_TO_MARKERS
@ SCE_SNAP_INDIVIDUAL_PROJECT
@ SCE_SNAP_TO_INCREMENT
@ SCE_SNAP_TO_GRID
@ SCE_SNAP_TO_FRAME
@ SCE_SNAP_TO_SECOND
@ SCE_SNAP_TO_NONE
@ SCE_SNAP_TO_STRIPS
@ R_IMF_FLAG_PREVIEW_JPG
#define MAXFRAME
#define FRAMENUMBER_MIN_CLAMP(cfra)
@ AUTOKEY_FLAG_LAYERED_RECORD
@ KEYING_FLAG_CYCLEAWARE
@ AUTOKEY_FLAG_ONLYKEYINGSET
@ FIX_TO_CAM_FLAG_USE_SCALE
@ FIX_TO_CAM_FLAG_USE_LOC
@ FIX_TO_CAM_FLAG_USE_ROT
@ AUTOKEY_MODE_NORMAL
@ AUTOKEY_MODE_EDITKEYS
@ AUTOKEY_ON
@ V3D_PLACE_ORIENT_DEFAULT
@ V3D_PLACE_ORIENT_SURFACE
@ V3D_AROUND_ACTIVE
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CURSOR
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_ORIENT_NORMAL
@ V3D_ORIENT_CUSTOM
@ V3D_ORIENT_GLOBAL
@ V3D_ORIENT_PARENT
@ V3D_ORIENT_LOCAL
@ V3D_ORIENT_VIEW
@ V3D_ORIENT_CURSOR
@ V3D_ORIENT_GIMBAL
@ V3D_PLACE_DEPTH_CURSOR_VIEW
@ V3D_PLACE_DEPTH_CURSOR_PLANE
@ V3D_PLACE_DEPTH_SURFACE
const char * ED_info_statistics_string(Main *bmain, Scene *scene, ViewLayer *view_layer)
void EDBM_selectmode_set(BMEditMesh *em, short selectmode)
void ED_render_engine_changed(Main *bmain, bool update_scene_data)
bool ED_scene_view_layer_delete(Main *bmain, Scene *scene, ViewLayer *layer, ReportList *reports) ATTR_NONNULL(1
void ED_uvedit_selectmode_clean_multi(bContext *C)
void ED_uvedit_sticky_selectmode_update(bContext *C)
void ED_uvedit_select_sync_multi(bContext *C)
void FRS_free_view_map_cache(void)
Read Guarded memory(de)allocation.
@ FFMPEG_FLV
Definition MOV_enums.hh:20
@ FFMPEG_MPEG1
Definition MOV_enums.hh:12
@ FFMPEG_DV
Definition MOV_enums.hh:17
@ FFMPEG_MPEG2
Definition MOV_enums.hh:13
@ FFMPEG_MKV
Definition MOV_enums.hh:21
@ FFMPEG_MOV
Definition MOV_enums.hh:16
@ FFMPEG_MPEG4
Definition MOV_enums.hh:14
@ FFMPEG_WEBM
Definition MOV_enums.hh:24
@ FFMPEG_AVI
Definition MOV_enums.hh:15
@ FFMPEG_OGG
Definition MOV_enums.hh:22
const EnumPropertyItem * rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
ParameterFlag
Definition RNA_types.hh:544
@ PARM_RNAPTR
Definition RNA_types.hh:547
@ PARM_REQUIRED
Definition RNA_types.hh:545
@ FUNC_USE_REPORTS
Definition RNA_types.hh:914
@ FUNC_NO_SELF
Definition RNA_types.hh:907
@ FUNC_USE_MAIN
Definition RNA_types.hh:912
@ FUNC_USE_SELF_ID
Definition RNA_types.hh:889
@ STRUCT_ID_REFCOUNT
Definition RNA_types.hh:959
@ STRUCT_UNDO
Definition RNA_types.hh:961
@ PROP_FLOAT
Definition RNA_types.hh:164
@ PROP_BOOLEAN
Definition RNA_types.hh:162
@ PROP_ENUM
Definition RNA_types.hh:166
@ PROP_INT
Definition RNA_types.hh:163
@ PROP_STRING
Definition RNA_types.hh:165
@ PROP_POINTER
Definition RNA_types.hh:167
@ PROP_COLLECTION
Definition RNA_types.hh:168
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:676
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:224
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:503
@ PROPOVERRIDE_NO_COMPARISON
Definition RNA_types.hh:511
@ PROP_VARIABLES_RENDER_OUTPUT
Definition RNA_types.hh:492
PropertyFlag
Definition RNA_types.hh:300
@ PROP_THICK_WRAP
Definition RNA_types.hh:423
@ PROP_PATH_OUTPUT
Definition RNA_types.hh:451
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:407
@ PROP_ANIMATABLE
Definition RNA_types.hh:319
@ PROP_PROPORTIONAL
Definition RNA_types.hh:349
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:456
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:384
@ PROP_EDITABLE
Definition RNA_types.hh:306
@ PROP_ENUM_FLAG
Definition RNA_types.hh:404
@ PROP_NEVER_NULL
Definition RNA_types.hh:377
@ PROP_PATH_SUPPORTS_TEMPLATES
Definition RNA_types.hh:470
@ PROP_PTR_NO_OWNERSHIP
Definition RNA_types.hh:395
@ PROP_DEG_SYNC_ONLY
Definition RNA_types.hh:445
@ PROP_SKIP_SAVE
Definition RNA_types.hh:344
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:370
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:364
@ PROP_IDPROPERTY
Definition RNA_types.hh:426
@ PROP_TIME
Definition RNA_types.hh:253
@ PROP_MATRIX
Definition RNA_types.hh:265
@ PROP_DIRECTION
Definition RNA_types.hh:262
@ PROP_XYZ
Definition RNA_types.hh:269
@ PROP_DISTANCE
Definition RNA_types.hh:256
@ PROP_ACCELERATION
Definition RNA_types.hh:264
@ PROP_PIXEL
Definition RNA_types.hh:248
@ PROP_ANGLE
Definition RNA_types.hh:252
@ PROP_AXISANGLE
Definition RNA_types.hh:268
@ PROP_EULER
Definition RNA_types.hh:266
@ PROP_NONE
Definition RNA_types.hh:233
@ PROP_PERCENTAGE
Definition RNA_types.hh:250
@ PROP_FACTOR
Definition RNA_types.hh:251
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:272
@ PROP_XYZ_LENGTH
Definition RNA_types.hh:270
@ PROP_UNSIGNED
Definition RNA_types.hh:249
@ PROP_QUATERNION
Definition RNA_types.hh:267
@ PROP_FILEPATH
Definition RNA_types.hh:236
#define C
Definition RandGen.cpp:29
#define ND_SEQUENCER
Definition WM_types.hh:437
#define NC_WORLD
Definition WM_types.hh:387
#define ND_WORLD
Definition WM_types.hh:452
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:535
#define NC_WINDOW
Definition WM_types.hh:375
#define NC_NODE
Definition WM_types.hh:394
#define NC_GEOM
Definition WM_types.hh:393
#define ND_DRAW
Definition WM_types.hh:461
#define ND_DATA
Definition WM_types.hh:509
#define ND_RENDER_OPTIONS
Definition WM_types.hh:435
#define NC_ANIMATION
Definition WM_types.hh:388
#define ND_DISPLAY
Definition WM_types.hh:491
#define ND_KEYINGSET
Definition WM_types.hh:448
#define NC_SCENE
Definition WM_types.hh:378
#define ND_NODES
Definition WM_types.hh:436
#define ND_TOOLSETTINGS
Definition WM_types.hh:449
#define ND_SPACE_IMAGE
Definition WM_types.hh:522
#define NA_EDITED
Definition WM_types.hh:584
#define ND_SPACE_GRAPH
Definition WM_types.hh:532
#define ND_FRAME_RANGE
Definition WM_types.hh:451
#define NC_IMAGE
Definition WM_types.hh:384
#define ND_MARKERS
Definition WM_types.hh:433
#define ND_FRAME
Definition WM_types.hh:434
#define NC_GPENCIL
Definition WM_types.hh:399
#define ND_TRANSFORM
Definition WM_types.hh:456
#define ND_LAYER
Definition WM_types.hh:450
#define ND_KEYFRAME_AUTO
Definition WM_types.hh:501
#define ND_SPACE_VIEW3D
Definition WM_types.hh:528
#define NC_OBJECT
Definition WM_types.hh:379
#define NC_SPACE
Definition WM_types.hh:392
#define ND_DRAW_RENDER_VIEWPORT
Definition WM_types.hh:470
ListBase builtin_keyingsets
volatile int lock
BMesh const char void * data
BPy_StructRNA * depsgraph
nullptr float
#define SELECT
#define offsetof(t, d)
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *keyingset)
#define GS(x)
RenderEngineType * RE_engines_find(const char *idname)
RenderEngine * RE_engine_create(RenderEngineType *type)
void RE_engine_free(RenderEngine *engine)
ListBase R_engines
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
format
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
bool MOV_codec_supports_alpha(IMB_Ffmpeg_Codec_ID codec_id, int ffmpeg_profile)
bool MOV_codec_supports_crf(IMB_Ffmpeg_Codec_ID codec_id)
KeyingSet * scene_get_active_keyingset(const Scene *scene)
void scene_simulation_states_reset(Scene &scene)
bool ensure_selection_domain(ToolSettings *ts, Object *object)
void sync_active_scene_and_time_with_scene_strip(bContext &C)
void sound_update_length(Main *bmain, Scene *scene)
void cache_cleanup(Scene *scene)
MatBase< float, 4, 4 > float4x4
void ntreeCompositUpdateRLayers(bNodeTree *ntree)
static struct PyModuleDef module
Definition python.cpp:796
const char * name
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
void rna_def_animdata_common(StructRNA *srna)
static const EnumPropertyItem curve_type_items[]
Definition rna_curve.cc:122
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_define_animate_sdna(bool animate)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_deprecated(PropertyRNA *prop, const char *note, const short version, const short removal_version)
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_struct_ui_text(StructRNA *srna, const char *name, const char *description)
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_default(PropertyRNA *prop, bool value)
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_property_int_default(PropertyRNA *prop, int value)
void RNA_def_property_path_template_type(PropertyRNA *prop, PropertyPathTemplateType path_template_type)
const float rna_default_axis_angle[4]
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
const int rna_matrix_dimsize_4x4[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
const int rna_matrix_dimsize_3x3[]
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
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)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const EnumPropertyItem rna_enum_beztriple_keyframe_type_items[]
Definition rna_fcurve.cc:77
void rna_Scene_use_view_map_cache_update(Main *bmain, Scene *scene, PointerRNA *ptr)
void rna_FreestyleSettings_module_remove(ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *module_ptr)
PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr)
int rna_FreestyleSettings_active_lineset_index_get(PointerRNA *ptr)
int rna_ViewLayer_active_aov_index_get(PointerRNA *ptr)
void rna_Scene_render_update(Main *bmain, Scene *scene, PointerRNA *ptr)
size_t rna_ViewLayer_path_buffer_get(const ViewLayer *view_layer, char *r_rna_path, const size_t rna_path_buffer_size)
void RNA_api_scene(StructRNA *srna)
void rna_Scene_freestyle_update(Main *bmain, Scene *scene, PointerRNA *ptr)
FreestyleLineSet * rna_FreestyleSettings_lineset_add(ID *id, FreestyleSettings *config, Main *bmain, const char *name)
void rna_ViewLayer_active_aov_index_set(PointerRNA *ptr, int value)
void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value, ReportList *reports)
void rna_FreestyleSettings_lineset_remove(ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *lineset_ptr)
void rna_ViewLayer_active_aov_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
void rna_FreestyleSettings_active_lineset_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
void RNA_api_scene_render(StructRNA *srna)
void rna_ViewLayer_override_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
FreestyleModuleConfig * rna_FreestyleSettings_module_add(ID *id, FreestyleSettings *config)
PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr)
void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value)
std::optional< std::string > rna_ColorManagedDisplaySettings_path(const PointerRNA *ptr)
std::optional< std::string > rna_ColorManagedInputColorspaceSettings_path(const PointerRNA *ptr)
int rna_ViewLayer_active_lightgroup_index_get(PointerRNA *ptr)
void rna_ViewLayer_active_lightgroup_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
std::optional< std::string > rna_ColorManagedViewSettings_path(const PointerRNA *ptr)
void rna_FreestyleSettings_active_lineset_index_set(PointerRNA *ptr, int value)
void rna_ViewLayer_active_lightgroup_index_set(PointerRNA *ptr, int value)
void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
const EnumPropertyItem rna_enum_axis_xyz_items[]
const EnumPropertyItem rna_enum_object_rotation_mode_items[]
const EnumPropertyItem rna_enum_object_axis_items[]
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:32
const EnumPropertyItem rna_enum_mesh_select_mode_uv_items[]
Definition rna_scene.cc:131
static void rna_def_raytrace_eevee(BlenderRNA *brna)
static void rna_def_view3d_cursor(BlenderRNA *brna)
static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
#define IMAGE_TYPE_ITEMS_IMAGE
Definition rna_scene.cc:352
void rna_def_freestyle_settings(BlenderRNA *brna)
#define MEDIA_TYPE_ENUM_VIDEO
Definition rna_scene.cc:261
const EnumPropertyItem rna_enum_image_color_depth_items[]
Definition rna_scene.cc:413
static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_display_safe_areas(BlenderRNA *brna)
const EnumPropertyItem rna_enum_proportional_falloff_curve_only_items[]
Definition rna_scene.cc:112
static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_scene_gpencil(BlenderRNA *brna)
static const EnumPropertyItem plane_depth_items[]
Definition rna_scene.cc:646
static const EnumPropertyItem eevee_resolution_scale_items[]
Definition rna_scene.cc:697
static const EnumPropertyItem plane_orientation_items[]
Definition rna_scene.cc:666
const EnumPropertyItem rna_enum_views_format_multilayer_items[]
Definition rna_scene.cc:503
const EnumPropertyItem rna_enum_image_type_all_items[]
Definition rna_scene.cc:386
const EnumPropertyItem rna_enum_mesh_select_mode_items[]
Definition rna_scene.cc:124
static void rna_def_curve_paint_settings(BlenderRNA *brna)
const EnumPropertyItem rna_enum_snap_playhead_element_items[]
Definition rna_scene.cc:195
#define IMAGE_TYPE_ITEMS_VIDEO
Definition rna_scene.cc:364
static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_scene_display(BlenderRNA *brna)
static void rna_def_tool_settings(BlenderRNA *brna)
void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool scene)
static void rna_def_freestyle_linesets(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_stereo3d_display_items[]
Definition rna_scene.cc:515
const EnumPropertyItem rna_enum_normal_swizzle_items[]
Definition rna_scene.cc:430
#define MEDIA_TYPE_ENUM_MULTI_LAYER_IMAGE
Definition rna_scene.cc:259
#define IMAGE_TYPE_ITEMS_MULTI_LAYER_IMAGE
Definition rna_scene.cc:362
static const EnumPropertyItem rna_enum_scene_display_aa_methods[]
Definition rna_scene.cc:204
static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_scene_eevee(BlenderRNA *brna)
static void rna_def_view_layer_lightgroups(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem snap_uv_element_items[]
Definition rna_scene.cc:184
#define R_IMF_VIEWS_ENUM_MV
Definition rna_scene.cc:496
static void rna_def_selected_uv_element(BlenderRNA *brna)
static void rna_def_transform_orientation_slot(BlenderRNA *brna)
const EnumPropertyItem rna_enum_grease_pencil_selectmode_items[]
Definition rna_scene.cc:686
const EnumPropertyItem rna_enum_proportional_falloff_items[]
Definition rna_scene.cc:95
#define MEDIA_TYPE_ENUM_IMAGE
Definition rna_scene.cc:258
void RNA_def_scene(BlenderRNA *brna)
const EnumPropertyItem rna_enum_snap_animation_element_items[]
Definition rna_scene.cc:176
static void rna_def_gpencil_interpolate(BlenderRNA *brna)
static void rna_def_scene_hydra(BlenderRNA *brna)
static void rna_def_bake_data(BlenderRNA *brna)
static void rna_def_sequencer_tool_settings(BlenderRNA *brna)
#define R_IMF_VIEWS_ENUM_IND
Definition rna_scene.cc:488
static const EnumPropertyItem rna_enum_snap_element_base_items[]
Definition rna_scene.cc:165
static void rna_def_view_layer_lightgroup(BlenderRNA *brna)
static void rna_def_transform_orientation(BlenderRNA *brna)
static void rna_def_scene_image_format_data(BlenderRNA *brna)
const EnumPropertyItem rna_enum_bake_pass_filter_type_items[]
Definition rna_scene.cc:561
static void rna_def_statvis(BlenderRNA *brna)
const EnumPropertyItem rna_enum_snap_source_items[]
Definition rna_scene.cc:87
const EnumPropertyItem rna_enum_snap_element_items[]
Definition rna_scene.cc:150
const EnumPropertyItem rna_enum_bake_save_mode_items[]
Definition rna_scene.cc:464
static void rna_def_scene_render_view(BlenderRNA *brna)
static void rna_def_view_layer_aovs(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem snap_to_items[]
Definition rna_scene.cc:680
static const EnumPropertyItem rna_enum_view_layer_aov_type_items[]
Definition rna_scene.cc:573
static const EnumPropertyItem rna_enum_media_type_all_items[]
Definition rna_scene.cc:263
static const EnumPropertyItem rna_enum_bake_view_from_items[]
Definition rna_scene.cc:474
const EnumPropertyItem rna_enum_bake_margin_type_items[]
Definition rna_scene.cc:440
static void rna_def_view_layer_eevee(BlenderRNA *brna)
const EnumPropertyItem rna_enum_bake_target_items[]
Definition rna_scene.cc:450
static void rna_def_freestyle_modules(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_curve_fit_method_items[]
Definition rna_scene.cc:244
const EnumPropertyItem rna_enum_views_format_items[]
Definition rna_scene.cc:499
const EnumPropertyItem rna_enum_transform_pivot_full_items[]
Definition rna_scene.cc:579
static void rna_def_render_views(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_normal_space_items[]
Definition rna_scene.cc:424
const EnumPropertyItem rna_enum_views_format_multiview_items[]
Definition rna_scene.cc:507
const EnumPropertyItem rna_enum_transform_orientation_items[]
Definition rna_scene.cc:605
const EnumPropertyItem rna_enum_stereo3d_anaglyph_type_items[]
Definition rna_scene.cc:547
const EnumPropertyItem rna_enum_stereo3d_interlace_type_items[]
Definition rna_scene.cc:554
#define R_IMF_VIEWS_ENUM_S3D
Definition rna_scene.cc:494
#define RNA_SNAP_ELEMENTS_BASE
Definition rna_scene.cc:139
static const EnumPropertyItem * rna_enum_snap_element_individual_items
Definition rna_scene.cc:172
static void rna_def_view_layer_aov(BlenderRNA *brna)
static void rna_def_unit_settings(BlenderRNA *brna)
static void rna_def_image_format_stereo3d_format(BlenderRNA *brna)
const EnumPropertyItem rna_enum_image_color_mode_items[]
Definition rna_scene.cc:392
static void rna_def_scene_render_data(BlenderRNA *brna)
static void rna_def_view_layers(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_strip_scale_method_items[]
const EnumPropertyItem rna_enum_shading_type_items[]
Definition rna_space.cc:427
#define min(a, b)
Definition sort.cc:36
void RE_FreePersistentData(const Scene *scene)
#define FLT_MAX
Definition stdcycles.h:14
struct ImageFormatData im_format
struct Object * object
union CollectionPropertyIterator::@220100362304005352221007113371015217044252346141 internal
ListBaseIterator listbase
Definition RNA_types.hh:606
const char * identifier
Definition RNA_types.hh:657
const char * name
Definition RNA_types.hh:661
const char * description
Definition RNA_types.hh:663
Definition DNA_ID.h:414
int tag
Definition DNA_ID.h:442
char name[258]
Definition DNA_ID.h:432
ColorManagedColorspaceSettings linear_colorspace_settings
ColorManagedDisplaySettings display_settings
ColorManagedViewSettings view_settings
void * first
ListBase grease_pencils
Definition BKE_main.hh:310
ListBase wm
Definition BKE_main.hh:307
ListBase objects
Definition BKE_main.hh:280
MeshRuntimeHandle * runtime
struct ModifierData * next
NodeCompositorFileOutputItem * items
ListBase particlesystem
struct Collection * instance_collection
ObjectRuntimeHandle * runtime
ListBase modifiers
struct ParticleSystem * next
void invalidate()
Definition RNA_types.hh:110
void * data
Definition RNA_types.hh:53
struct BakeData bake
char engine[32]
struct ImageFormatData im_format
struct FFMpegCodecData ffcodecdata
char name[64]
Definition RE_engine.h:74
struct RenderEngineType * next
Definition RE_engine.h:70
char idname[64]
Definition RE_engine.h:73
void(* update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition RE_engine.h:110
int active_keyingset
ListBase keyingsets
struct bNodeTree * compositing_node_group
struct RenderData r
ListBase view_layers
TransformOrientationSlot orientation_slots[4]
struct UnitSettings unit
struct Object * camera
ListBase markers
ListBase transform_spaces
struct World * world
struct Scene * set
struct AudioData audio
unsigned int flag
char gpencil_selectmode_vertex
char gpencil_selectmode_sculpt
float rotation_axis[3]
float rotation_quaternion[4]
float rotation_euler[3]
ListBase lightgroups
ViewLayerLightgroup * active_lightgroup
ViewLayerAOV * active_aov
ListBase aovs
char name[64]
i
Definition text_draw.cc:230
max
Definition text_draw.cc:251
uint len
#define N_(msgid)
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4238
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Scene * WM_window_get_active_scene(const wmWindow *win)
void WM_windows_scene_data_sync(const ListBase *win_lb, Scene *scene)