Blender V4.5
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_VERTEX, "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 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
136 {0, nullptr, 0, nullptr, nullptr},
137};
138
139/* clang-format off */
140#define RNA_SNAP_ELEMENTS_BASE \
141 {SCE_SNAP_TO_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments"}, \
142 {SCE_SNAP_TO_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"}, \
143 {SCE_SNAP_TO_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"}, \
144 {SCE_SNAP_TO_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"}, \
145 {SCE_SNAP_TO_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap by projecting onto faces"}, \
146 {SCE_SNAP_TO_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"}, \
147 {SCE_SNAP_TO_EDGE_MIDPOINT, "EDGE_MIDPOINT", ICON_SNAP_MIDPOINT, "Edge Center", "Snap to the middle of edges"}, \
148 {SCE_SNAP_TO_EDGE_PERPENDICULAR, "EDGE_PERPENDICULAR", ICON_SNAP_PERPENDICULAR, "Edge Perpendicular", "Snap to the nearest point on an edge"}
149/* clang-format on */
150
154 "FACE_PROJECT",
155 ICON_SNAP_FACE,
156 "Face Project",
157 "Snap by projecting onto faces"},
159 "FACE_NEAREST",
160 ICON_SNAP_FACE_NEAREST,
161 "Face Nearest",
162 "Snap to nearest point on faces"},
163 {0, nullptr, 0, nullptr, nullptr},
164};
165
168 {0, nullptr, 0, nullptr, nullptr},
169};
170
171#ifndef RNA_RUNTIME
172/* Last two snap elements from #rna_enum_snap_element_items. */
175#endif
176
178 {SCE_SNAP_TO_FRAME, "FRAME", 0, "Frame", "Snap to frame"},
179 {SCE_SNAP_TO_SECOND, "SECOND", 0, "Second", "Snap to seconds"},
180 {SCE_SNAP_TO_MARKERS, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
181 {0, nullptr, 0, nullptr, nullptr},
182};
183
184#ifndef RNA_RUNTIME
187 "INCREMENT",
188 ICON_SNAP_INCREMENT,
189 "Increment",
190 "Snap to increments of grid"},
191 {SCE_SNAP_TO_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"},
192 {SCE_SNAP_TO_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
193 {0, nullptr, 0, nullptr, nullptr},
194};
195
197 {SCE_SNAP_TO_FRAME, "FRAME", 0, "Frames", "Snap to frame increments"},
198 {SCE_SNAP_TO_SECOND, "SECOND", 0, "Seconds", "Snap to second increments"},
199 {SCE_SNAP_TO_MARKERS, "MARKER", 0, "Markers", "Snap to markers"},
200 {SCE_SNAP_TO_KEYS, "KEY", 0, "Keyframes", "Snap to keyframes"},
201 {SCE_SNAP_TO_STRIPS, "Strip", 0, "Strips", "Snap to Strips"},
202 {0, nullptr, 0, nullptr, nullptr},
203};
204
207 "OFF",
208 0,
209 "No Anti-Aliasing",
210 "Scene will be rendering without any anti-aliasing"},
212 "FXAA",
213 0,
214 "Single Pass Anti-Aliasing",
215 "Scene will be rendered using a single pass anti-aliasing method (FXAA)"},
217 "5",
218 0,
219 "5 Samples",
220 "Scene will be rendered using 5 anti-aliasing samples"},
222 "8",
223 0,
224 "8 Samples",
225 "Scene will be rendered using 8 anti-aliasing samples"},
227 "11",
228 0,
229 "11 Samples",
230 "Scene will be rendered using 11 anti-aliasing samples"},
232 "16",
233 0,
234 "16 Samples",
235 "Scene will be rendered using 16 anti-aliasing samples"},
237 "32",
238 0,
239 "32 Samples",
240 "Scene will be rendered using 32 anti-aliasing samples"},
241 {0, nullptr, 0, nullptr, nullptr},
242};
243#endif
244
247 "REFIT",
248 0,
249 "Refit",
250 "Incrementally refit the curve (high quality)"},
252 "SPLIT",
253 0,
254 "Split",
255 "Split the curve until the tolerance is met (fast)"},
256 {0, nullptr, 0, nullptr, nullptr},
257};
258
259/* workaround for duplicate enums,
260 * have each enum line as a define then conditionally set it or not
261 */
262
263#define R_IMF_ENUM_BMP \
264 {R_IMF_IMTYPE_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"},
265#define R_IMF_ENUM_IRIS \
266 {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in SGI IRIS format"},
267#define R_IMF_ENUM_PNG \
268 {R_IMF_IMTYPE_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"},
269#define R_IMF_ENUM_JPEG \
270 {R_IMF_IMTYPE_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"},
271#define R_IMF_ENUM_TAGA \
272 {R_IMF_IMTYPE_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"},
273#define R_IMF_ENUM_TAGA_RAW \
274 {R_IMF_IMTYPE_RAWTGA, \
275 "TARGA_RAW", \
276 ICON_FILE_IMAGE, \
277 "Targa Raw", \
278 "Output image in uncompressed Targa format"},
279
280#if 0 /* UNUSED (so far) */
281# define R_IMF_ENUM_DDS \
282 {R_IMF_IMTYPE_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"},
283#endif
284
285#ifdef WITH_IMAGE_OPENJPEG
286# define R_IMF_ENUM_JPEG2K \
287 {R_IMF_IMTYPE_JP2, \
288 "JPEG2000", \
289 ICON_FILE_IMAGE, \
290 "JPEG 2000", \
291 "Output image in JPEG 2000 format"},
292#else
293# define R_IMF_ENUM_JPEG2K
294#endif
295
296#ifdef WITH_IMAGE_CINEON
297# define R_IMF_ENUM_CINEON \
298 {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"},
299# define R_IMF_ENUM_DPX \
300 {R_IMF_IMTYPE_DPX, "DPX", ICON_FILE_IMAGE, "DPX", "Output image in DPX format"},
301#else
302# define R_IMF_ENUM_CINEON
303# define R_IMF_ENUM_DPX
304#endif
305
306#ifdef WITH_IMAGE_OPENEXR
307# define R_IMF_ENUM_EXR_MULTILAYER \
308 {R_IMF_IMTYPE_MULTILAYER, \
309 "OPEN_EXR_MULTILAYER", \
310 ICON_FILE_IMAGE, \
311 "OpenEXR MultiLayer", \
312 "Output image in multilayer OpenEXR format"},
313# define R_IMF_ENUM_EXR \
314 {R_IMF_IMTYPE_OPENEXR, \
315 "OPEN_EXR", \
316 ICON_FILE_IMAGE, \
317 "OpenEXR", \
318 "Output image in OpenEXR format"},
319#else
320# define R_IMF_ENUM_EXR_MULTILAYER
321# define R_IMF_ENUM_EXR
322#endif
323
324#define R_IMF_ENUM_HDR \
325 {R_IMF_IMTYPE_RADHDR, \
326 "HDR", \
327 ICON_FILE_IMAGE, \
328 "Radiance HDR", \
329 "Output image in Radiance HDR format"},
330
331#define R_IMF_ENUM_TIFF \
332 {R_IMF_IMTYPE_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"},
333
334#ifdef WITH_IMAGE_WEBP
335# define R_IMF_ENUM_WEBP \
336 {R_IMF_IMTYPE_WEBP, "WEBP", ICON_FILE_IMAGE, "WebP", "Output image in WebP format"},
337#else
338# define R_IMF_ENUM_WEBP
339#endif
340
341#define IMAGE_TYPE_ITEMS_IMAGE_ONLY \
342 R_IMF_ENUM_BMP \
343 /* DDS save not supported yet R_IMF_ENUM_DDS */ \
344 R_IMF_ENUM_IRIS \
345 R_IMF_ENUM_PNG \
346 R_IMF_ENUM_JPEG \
347 R_IMF_ENUM_JPEG2K \
348 R_IMF_ENUM_TAGA \
349 R_IMF_ENUM_TAGA_RAW \
350 RNA_ENUM_ITEM_SEPR_COLUMN, R_IMF_ENUM_CINEON R_IMF_ENUM_DPX R_IMF_ENUM_EXR_MULTILAYER \
351 R_IMF_ENUM_EXR R_IMF_ENUM_HDR R_IMF_ENUM_TIFF R_IMF_ENUM_WEBP
352
353#ifdef RNA_RUNTIME
354static const EnumPropertyItem image_only_type_items[] = {
355
357
358 {0, nullptr, 0, nullptr, nullptr},
359};
360#endif
361
363 RNA_ENUM_ITEM_HEADING(N_("Image"), nullptr),
364
366
367 RNA_ENUM_ITEM_HEADING(N_("Movie"), nullptr),
368#ifdef WITH_FFMPEG
369 {R_IMF_IMTYPE_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFmpeg Video", ""},
370#endif
371 {0, nullptr, 0, nullptr, nullptr},
372};
373
376 "BW",
377 0,
378 "BW",
379 "Images get saved in 8-bit grayscale (only PNG, JPEG, TGA, TIF)"},
380 {R_IMF_PLANES_RGB, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
382 "RGBA",
383 0,
384 "RGBA",
385 "Images are saved with RGB and Alpha data (if supported)"},
386 {0, nullptr, 0, nullptr, nullptr},
387};
388
389#ifdef RNA_RUNTIME
390# define IMAGE_COLOR_MODE_BW rna_enum_image_color_mode_items[0]
391# define IMAGE_COLOR_MODE_RGB rna_enum_image_color_mode_items[1]
392# define IMAGE_COLOR_MODE_RGBA rna_enum_image_color_mode_items[2]
393#endif
394
396 /* 1 (monochrome) not used */
397 {R_IMF_CHAN_DEPTH_8, "8", 0, "8", "8-bit color channels"},
398 {R_IMF_CHAN_DEPTH_10, "10", 0, "10", "10-bit color channels"},
399 {R_IMF_CHAN_DEPTH_12, "12", 0, "12", "12-bit color channels"},
400 {R_IMF_CHAN_DEPTH_16, "16", 0, "16", "16-bit color channels"},
401 /* 24 not used */
402 {R_IMF_CHAN_DEPTH_32, "32", 0, "32", "32-bit color channels"},
403 {0, nullptr, 0, nullptr, nullptr},
404};
405
407 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
408 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
409 {0, nullptr, 0, nullptr, nullptr},
410};
411
413 {R_BAKE_POSX, "POS_X", 0, "+X", ""},
414 {R_BAKE_POSY, "POS_Y", 0, "+Y", ""},
415 {R_BAKE_POSZ, "POS_Z", 0, "+Z", ""},
416 {R_BAKE_NEGX, "NEG_X", 0, "-X", ""},
417 {R_BAKE_NEGY, "NEG_Y", 0, "-Y", ""},
418 {R_BAKE_NEGZ, "NEG_Z", 0, "-Z", ""},
419 {0, nullptr, 0, nullptr, nullptr},
420};
421
424 "ADJACENT_FACES",
425 0,
426 "Adjacent Faces",
427 "Use pixels from adjacent faces across UV seams"},
428 {R_BAKE_EXTEND, "EXTEND", 0, "Extend", "Extend border pixels outwards"},
429 {0, nullptr, 0, nullptr, nullptr},
430};
431
434 "IMAGE_TEXTURES",
435 0,
436 "Image Textures",
437 "Bake to image data-blocks associated with active image texture nodes in materials"},
439 "VERTEX_COLORS",
440 0,
441 "Active Color Attribute",
442 "Bake to the active color attribute on meshes"},
443 {0, nullptr, 0, nullptr, nullptr},
444};
445
448 "INTERNAL",
449 0,
450 "Internal",
451 "Save the baking map in an internal image data-block"},
452 {R_BAKE_SAVE_EXTERNAL, "EXTERNAL", 0, "External", "Save the baking map in an external file"},
453 {0, nullptr, 0, nullptr, nullptr},
454};
455
458 "ABOVE_SURFACE",
459 0,
460 "Above Surface",
461 "Cast rays from above the surface"},
463 "ACTIVE_CAMERA",
464 0,
465 "Active Camera",
466 "Use the active camera's position to cast rays"},
467 {0, nullptr, 0, nullptr, nullptr},
468};
469
470#define R_IMF_VIEWS_ENUM_IND \
471 {R_IMF_VIEWS_INDIVIDUAL, \
472 "INDIVIDUAL", \
473 0, \
474 "Individual", \
475 "Individual files for each view with the prefix as defined by the scene views"},
476#define R_IMF_VIEWS_ENUM_S3D \
477 {R_IMF_VIEWS_STEREO_3D, "STEREO_3D", 0, "Stereo 3D", "Single file with an encoded stereo pair"},
478#define R_IMF_VIEWS_ENUM_MV \
479 {R_IMF_VIEWS_MULTIVIEW, "MULTIVIEW", 0, "Multi-View", "Single file with all the views"},
480
482 R_IMF_VIEWS_ENUM_IND R_IMF_VIEWS_ENUM_S3D{0, nullptr, 0, nullptr, nullptr},
483};
484
488
492
493#undef R_IMF_VIEWS_ENUM_IND
494#undef R_IMF_VIEWS_ENUM_S3D
495#undef R_IMF_VIEWS_ENUM_MV
496
499 "ANAGLYPH",
500 0,
501 "Anaglyph",
502 "Render views for left and right eyes as two differently filtered colors in a single image "
503 "(anaglyph glasses are required)"},
505 "INTERLACE",
506 0,
507 "Interlace",
508 "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
509 "required)"},
511 "TIMESEQUENTIAL",
512 0,
513 "Time Sequential",
514 "Render alternate eyes (also known as page flip, quad buffer support in the graphic card is "
515 "required)"},
517 "SIDEBYSIDE",
518 0,
519 "Side-by-Side",
520 "Render views for left and right eyes side-by-side"},
522 "TOPBOTTOM",
523 0,
524 "Top-Bottom",
525 "Render views for left and right eyes one above another"},
526 {0, nullptr, 0, nullptr, nullptr},
527};
528
530 {S3D_ANAGLYPH_REDCYAN, "RED_CYAN", 0, "Red-Cyan", ""},
531 {S3D_ANAGLYPH_GREENMAGENTA, "GREEN_MAGENTA", 0, "Green-Magenta", ""},
532 {S3D_ANAGLYPH_YELLOWBLUE, "YELLOW_BLUE", 0, "Yellow-Blue", ""},
533 {0, nullptr, 0, nullptr, nullptr},
534};
535
537 {S3D_INTERLACE_ROW, "ROW_INTERLEAVED", 0, "Row Interleaved", ""},
538 {S3D_INTERLACE_COLUMN, "COLUMN_INTERLEAVED", 0, "Column Interleaved", ""},
539 {S3D_INTERLACE_CHECKERBOARD, "CHECKERBOARD_INTERLEAVED", 0, "Checkerboard Interleaved", ""},
540 {0, nullptr, 0, nullptr, nullptr},
541};
542
544 {R_BAKE_PASS_FILTER_NONE, "NONE", 0, "None", ""},
545 {R_BAKE_PASS_FILTER_EMIT, "EMIT", 0, "Emit", ""},
546 {R_BAKE_PASS_FILTER_DIRECT, "DIRECT", 0, "Direct", ""},
547 {R_BAKE_PASS_FILTER_INDIRECT, "INDIRECT", 0, "Indirect", ""},
548 {R_BAKE_PASS_FILTER_COLOR, "COLOR", 0, "Color", ""},
549 {R_BAKE_PASS_FILTER_DIFFUSE, "DIFFUSE", 0, "Diffuse", ""},
550 {R_BAKE_PASS_FILTER_GLOSSY, "GLOSSY", 0, "Glossy", ""},
551 {R_BAKE_PASS_FILTER_TRANSM, "TRANSMISSION", 0, "Transmission", ""},
552 {0, nullptr, 0, nullptr, nullptr},
553};
554
556 {AOV_TYPE_COLOR, "COLOR", 0, "Color", ""},
557 {AOV_TYPE_VALUE, "VALUE", 0, "Value", ""},
558 {0, nullptr, 0, nullptr, nullptr},
559};
560
563 "BOUNDING_BOX_CENTER",
564 ICON_PIVOT_BOUNDBOX,
565 "Bounding Box Center",
566 "Pivot around bounding box center of selected object(s)"},
567 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
569 "INDIVIDUAL_ORIGINS",
570 ICON_PIVOT_INDIVIDUAL,
571 "Individual Origins",
572 "Pivot around each object's own origin"},
574 "MEDIAN_POINT",
575 ICON_PIVOT_MEDIAN,
576 "Median Point",
577 "Pivot around the median point of selected objects"},
579 "ACTIVE_ELEMENT",
580 ICON_PIVOT_ACTIVE,
581 "Active Element",
582 "Pivot around active object"},
583 {0, nullptr, 0, nullptr, nullptr},
584};
585
586/* Icons could be made a consistent set of images. */
589 "GLOBAL",
590 ICON_ORIENTATION_GLOBAL,
591 "Global",
592 "Align the transformation axes to world space"},
594 "LOCAL",
595 ICON_ORIENTATION_LOCAL,
596 "Local",
597 "Align the transformation axes to the selected objects' local space"},
599 "NORMAL",
600 ICON_ORIENTATION_NORMAL,
601 "Normal",
602 "Align the transformation axes to average normal of selected elements "
603 "(bone Y axis for pose mode)"},
605 "GIMBAL",
606 ICON_ORIENTATION_GIMBAL,
607 "Gimbal",
608 "Align each axis to the Euler rotation axis as used for input"},
610 "VIEW",
611 ICON_ORIENTATION_VIEW,
612 "View",
613 "Align the transformation axes to the window"},
615 "CURSOR",
616 ICON_ORIENTATION_CURSOR,
617 "Cursor",
618 "Align the transformation axes to the 3D cursor"},
620 "PARENT",
621 ICON_ORIENTATION_PARENT,
622 "Parent",
623 "Align the transformation axes to the object's parent space"},
624 // {V3D_ORIENT_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
625 {0, nullptr, 0, nullptr, nullptr},
626};
627
630 "SURFACE",
631 0,
632 "Surface",
633 "Start placing on the surface, using the 3D cursor position as a fallback"},
635 "CURSOR_PLANE",
636 0,
637 "Cursor Plane",
638 "Start placement using a point projected onto the orientation axis "
639 "at the 3D cursor position"},
641 "CURSOR_VIEW",
642 0,
643 "Cursor View",
644 "Start placement using a point projected onto the view plane at the 3D cursor position"},
645 {0, nullptr, 0, nullptr, nullptr},
646};
647
650 "SURFACE",
651 ICON_SNAP_NORMAL,
652 "Surface",
653 "Use the surface normal (using the transform orientation as a fallback)"},
655 "DEFAULT",
656 ICON_ORIENTATION_GLOBAL,
657 "Default",
658 "Use the current transform orientation"},
659 {0, nullptr, 0, nullptr, nullptr},
660};
661
663 {SCE_SNAP_TO_GEOM, "GEOMETRY", 0, "Geometry", "Snap to all geometry"},
664 {SCE_SNAP_TO_NONE, "DEFAULT", 0, "Default", "Use the current snap settings"},
665 {0, nullptr, 0, nullptr, nullptr},
666};
667
669 {GP_SELECTMODE_POINT, "POINT", ICON_GP_SELECT_POINTS, "Point", "Select only points"},
670 {GP_SELECTMODE_STROKE, "STROKE", ICON_GP_SELECT_STROKES, "Stroke", "Select all stroke points"},
672 "SEGMENT",
673 ICON_GP_SELECT_BETWEEN_STROKES,
674 "Segment",
675 "Select all stroke points between other strokes"},
676 {0, nullptr, 0, nullptr, nullptr},
677};
678
680 {1, "1", 0, "1:1", "Full resolution"},
681 {2, "2", 0, "1:2", "Render this effect at 50% render resolution"},
682 {4, "4", 0, "1:4", "Render this effect at 25% render resolution"},
683 {8, "8", 0, "1:8", "Render this effect at 12.5% render resolution"},
684 {16, "16", 0, "1:16", "Render this effect at 6.25% render resolution"},
685 {0, nullptr, 0, nullptr, nullptr},
686};
687
688#ifdef RNA_RUNTIME
689
690# include <algorithm>
691
692# include <fmt/format.h>
693
694# include "BLI_string_utils.hh"
695
696# include "DNA_anim_types.h"
697# include "DNA_cachefile_types.h"
698# include "DNA_color_types.h"
700# include "DNA_linestyle_types.h"
701# include "DNA_mesh_types.h"
702# include "DNA_node_types.h"
703# include "DNA_object_types.h"
704# include "DNA_particle_types.h"
705# include "DNA_text_types.h"
706# include "DNA_workspace_types.h"
707# include "DNA_world_types.h"
708
709# include "RNA_access.hh"
710
711# include "MEM_guardedalloc.h"
712
713# include "MOV_util.hh"
714
715# include "BKE_animsys.h"
716# include "BKE_armature.hh"
718# include "BKE_brush.hh"
719# include "BKE_collection.hh"
720# include "BKE_context.hh"
721# include "BKE_editmesh.hh"
722# include "BKE_freestyle.h"
723# include "BKE_global.hh"
724# include "BKE_gpencil_legacy.h"
725# include "BKE_idprop.hh"
726# include "BKE_image.hh"
727# include "BKE_image_format.hh"
728# include "BKE_layer.hh"
729# include "BKE_main.hh"
730# include "BKE_main_invariants.hh"
731# include "BKE_mesh.hh"
732# include "BKE_node.hh"
733# include "BKE_node_legacy_types.hh"
734# include "BKE_node_runtime.hh"
735# include "BKE_pointcache.h"
736# include "BKE_scene.hh"
737# include "BKE_screen.hh"
738# include "BKE_unit.hh"
739
740# include "NOD_composite.hh"
741
742# include "ED_grease_pencil.hh"
743# include "ED_image.hh"
744# include "ED_info.hh"
745# include "ED_keyframing.hh"
746# include "ED_mesh.hh"
747# include "ED_node.hh"
748# include "ED_render.hh"
749# include "ED_scene.hh"
750# include "ED_uvedit.hh"
751# include "ED_view3d.hh"
752
753# include "DEG_depsgraph.hh"
754# include "DEG_depsgraph_build.hh"
755# include "DEG_depsgraph_query.hh"
756
757# include "SEQ_relations.hh"
758# include "SEQ_sequencer.hh"
759# include "SEQ_sound.hh"
760
761# ifdef WITH_FREESTYLE
762# include "FRS_freestyle.h"
763# endif
764
765# ifdef WITH_ALEMBIC
766# include "ABC_alembic.h"
767# endif
768
769# include "RE_engine.h"
770
771# include "ANIM_keyingsets.hh"
772
773using blender::Vector;
774
775static int rna_ToolSettings_snap_mode_get(PointerRNA *ptr)
776{
777 ToolSettings *ts = (ToolSettings *)(ptr->data);
778 return ts->snap_mode;
779}
780
781static void rna_ToolSettings_snap_mode_set(PointerRNA *ptr, int value)
782{
783 ToolSettings *ts = (ToolSettings *)ptr->data;
784 if (value != 0) {
785 ts->snap_mode = value;
786 }
787}
788
789static void rna_ToolSettings_snap_uv_mode_set(PointerRNA *ptr, int value)
790{
791 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
792 if (value != 0) {
793 ts->snap_uv_mode = value;
794 }
795}
796
797static void rna_Gpencil_mask_point_update(bContext *C, PointerRNA *ptr)
798{
799 ToolSettings *ts = (ToolSettings *)ptr->data;
800
803
805 if (ob && ob->type == OB_GREASE_PENCIL) {
807 }
808}
809
810static void rna_Gpencil_mask_stroke_update(bContext *C, PointerRNA *ptr)
811{
812 ToolSettings *ts = (ToolSettings *)ptr->data;
813
816
818 if (ob && ob->type == OB_GREASE_PENCIL) {
820 }
821}
822
823static void rna_Gpencil_mask_segment_update(bContext *C, PointerRNA *ptr)
824{
825 ToolSettings *ts = (ToolSettings *)ptr->data;
826
829
831 if (ob && ob->type == OB_GREASE_PENCIL) {
833 }
834}
835
836static void rna_Gpencil_vertex_mask_point_update(bContext *C, PointerRNA *ptr)
837{
838 ToolSettings *ts = (ToolSettings *)ptr->data;
839
842
844 if (ob && ob->type == OB_GREASE_PENCIL) {
846 }
847}
848
849static void rna_Gpencil_vertex_mask_stroke_update(bContext *C, PointerRNA *ptr)
850{
851 ToolSettings *ts = (ToolSettings *)ptr->data;
852
855
857 if (ob && ob->type == OB_GREASE_PENCIL) {
859 }
860}
861
862static void rna_Gpencil_vertex_mask_segment_update(bContext *C, PointerRNA *ptr)
863{
864 ToolSettings *ts = (ToolSettings *)ptr->data;
865
868
870 if (ob && ob->type == OB_GREASE_PENCIL) {
872 }
873}
874
875static void rna_all_grease_pencil_update(bContext *C, PointerRNA * /*ptr*/)
876{
877 /* FIXME: We shouldn't have to tag all the Grease Pencil IDs for an update! */
878 Main *bmain = CTX_data_main(C);
879 LISTBASE_FOREACH (GreasePencil *, grease_pencil, &bmain->grease_pencils) {
880 DEG_id_tag_update(&grease_pencil->id, ID_RECALC_GEOMETRY);
881 }
883}
884
885/* Read-only Iterator of all the scene objects. */
886
887static void rna_Scene_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
888{
889 Scene *scene = (Scene *)ptr->data;
890 iter->internal.custom = MEM_callocN<BLI_Iterator>(__func__);
891
892 BKE_scene_objects_iterator_begin(static_cast<BLI_Iterator *>(iter->internal.custom),
893 (void *)scene);
894 iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
895}
896
897static void rna_Scene_objects_next(CollectionPropertyIterator *iter)
898{
900 iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
901}
902
903static void rna_Scene_objects_end(CollectionPropertyIterator *iter)
904{
907}
908
909static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
910{
911 Object *ob = static_cast<Object *>(((BLI_Iterator *)iter->internal.custom)->current);
912 return RNA_id_pointer_create(reinterpret_cast<ID *>(ob));
913}
914
915/* End of read-only Iterator of all the scene objects. */
916
917static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
918{
919 Scene *scene = (Scene *)ptr->data;
920 Scene *set = (Scene *)value.data;
921 Scene *nested_set;
922
923 for (nested_set = set; nested_set; nested_set = nested_set->set) {
924 if (nested_set == scene) {
925 return;
926 }
927 /* prevent eternal loops, set can point to next, and next to set, without problems usually */
928 if (nested_set->set == set) {
929 return;
930 }
931 }
932
933 id_lib_extern((ID *)set);
934 scene->set = set;
935}
936
937void rna_Scene_set_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
938{
939 Scene *scene = (Scene *)ptr->owner_id;
940
942 DEG_id_tag_update_ex(bmain, &scene->id, ID_RECALC_BASE_FLAGS);
943 if (scene->set != nullptr) {
944 /* Objects which are pulled into main scene's depsgraph needs to have
945 * their base flags updated.
946 */
947 DEG_id_tag_update_ex(bmain, &scene->set->id, ID_RECALC_BASE_FLAGS);
948 }
949}
950
951static void rna_Scene_camera_update(Main *bmain, Scene * /*scene_unused*/, PointerRNA *ptr)
952{
953 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
954 Scene *scene = (Scene *)ptr->data;
955
956 WM_windows_scene_data_sync(&wm->windows, scene);
959}
960
961static void rna_Scene_fps_update(Main *bmain, Scene * /*active_scene*/, PointerRNA *ptr)
962{
963 Scene *scene = (Scene *)ptr->owner_id;
965 /* NOTE: Tag via dependency graph will take care of all the updates ion the evaluated domain,
966 * however, changes in FPS actually modifies an original skip length,
967 * so this we take care about here. */
969 /* Reset simulation states because new frame interval doesn't apply anymore. */
971}
972
973static void rna_Scene_listener_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
974{
976}
977
978static void rna_Scene_volume_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
979{
980 Scene *scene = (Scene *)ptr->owner_id;
982}
983
984static const char *rna_Scene_statistics_string_get(Scene *scene,
985 Main *bmain,
987 ViewLayer *view_layer)
988{
989 if (!BKE_scene_has_view_layer(scene, view_layer)) {
991 RPT_ERROR,
992 "View Layer '%s' not found in scene '%s'",
993 view_layer->name,
994 scene->id.name + 2);
995 return "";
996 }
997
998 return ED_info_statistics_string(bmain, scene, view_layer);
999}
1000
1001static void rna_Scene_framelen_update(Main * /*bmain*/, Scene * /*active_scene*/, PointerRNA *ptr)
1002{
1003 Scene *scene = (Scene *)ptr->owner_id;
1004 scene->r.framelen = float(scene->r.framapto) / float(scene->r.images);
1005}
1006
1007static void rna_Scene_frame_current_set(PointerRNA *ptr, int value)
1008{
1009 Scene *data = (Scene *)ptr->data;
1010
1011 /* if negative frames aren't allowed, then we can't use them */
1012 FRAMENUMBER_MIN_CLAMP(value);
1013 data->r.cfra = value;
1014}
1015
1016static float rna_Scene_frame_float_get(PointerRNA *ptr)
1017{
1018 Scene *data = (Scene *)ptr->data;
1019 return float(data->r.cfra) + data->r.subframe;
1020}
1021
1022static void rna_Scene_frame_float_set(PointerRNA *ptr, float value)
1023{
1024 Scene *data = (Scene *)ptr->data;
1025 /* if negative frames aren't allowed, then we can't use them */
1026 FRAMENUMBER_MIN_CLAMP(value);
1027 data->r.cfra = int(value);
1028 data->r.subframe = value - data->r.cfra;
1029}
1030
1031static float rna_Scene_frame_current_final_get(PointerRNA *ptr)
1032{
1033 Scene *scene = (Scene *)ptr->data;
1034
1035 return BKE_scene_frame_to_ctime(scene, float(scene->r.cfra));
1036}
1037
1038static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
1039{
1040 Scene *data = (Scene *)ptr->data;
1041 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
1042 CLAMP(value, MINFRAME, MAXFRAME);
1043 data->r.sfra = value;
1044
1045 if (value > data->r.efra) {
1046 data->r.efra = std::min(value, MAXFRAME);
1047 }
1048}
1049
1050static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
1051{
1052 Scene *data = (Scene *)ptr->data;
1053 CLAMP(value, MINFRAME, MAXFRAME);
1054 data->r.efra = value;
1055
1056 if (data->r.sfra > value) {
1057 data->r.sfra = std::max(value, MINFRAME);
1058 }
1059}
1060
1061static void rna_Scene_use_preview_range_set(PointerRNA *ptr, bool value)
1062{
1063 Scene *data = (Scene *)ptr->data;
1064
1065 if (value) {
1066 /* copy range from scene if not set before */
1067 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
1068 data->r.psfra = data->r.sfra;
1069 data->r.pefra = data->r.efra;
1070 }
1071
1072 data->r.flag |= SCER_PRV_RANGE;
1073 }
1074 else {
1075 data->r.flag &= ~SCER_PRV_RANGE;
1076 }
1077}
1078
1079static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
1080{
1081 Scene *data = (Scene *)ptr->data;
1082
1083 /* check if enabled already */
1084 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
1085 /* set end of preview range to end frame, then clamp as per normal */
1086 /* TODO: or just refuse to set instead? */
1087 data->r.pefra = data->r.efra;
1088 }
1089 CLAMP(value, MINAFRAME, MAXFRAME);
1090 data->r.psfra = value;
1091
1092 if (value > data->r.pefra) {
1093 data->r.pefra = std::min(value, MAXFRAME);
1094 }
1095}
1096
1097static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
1098{
1099 Scene *data = (Scene *)ptr->data;
1100
1101 /* check if enabled already */
1102 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
1103 /* set start of preview range to start frame, then clamp as per normal */
1104 /* TODO: or just refuse to set instead? */
1105 data->r.psfra = data->r.sfra;
1106 }
1107 CLAMP(value, MINAFRAME, MAXFRAME);
1108 data->r.pefra = value;
1109
1110 if (data->r.psfra > value) {
1111 data->r.psfra = std::max(value, MINAFRAME);
1112 }
1113}
1114
1115static void rna_Scene_show_subframe_update(Main * /*bmain*/,
1116 Scene * /*current_scene*/,
1117 PointerRNA *ptr)
1118{
1119 Scene *scene = (Scene *)ptr->owner_id;
1120 scene->r.subframe = 0.0f;
1121}
1122
1123static void rna_Scene_frame_update(Main * /*bmain*/, Scene * /*current_scene*/, PointerRNA *ptr)
1124{
1125 Scene *scene = (Scene *)ptr->owner_id;
1128}
1129
1130static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
1131{
1132 Scene *scene = (Scene *)ptr->data;
1134 *ptr, &RNA_KeyingSet, blender::animrig::scene_get_active_keyingset(scene));
1135}
1136
1137static void rna_Scene_active_keying_set_set(PointerRNA *ptr,
1138 PointerRNA value,
1139 ReportList * /*reports*/)
1140{
1141 Scene *scene = (Scene *)ptr->data;
1142 KeyingSet *ks = (KeyingSet *)value.data;
1143
1144 scene->active_keyingset = ANIM_scene_get_keyingset_index(scene, ks);
1145}
1146
1147/* get KeyingSet index stuff for list of Keying Sets editing UI
1148 * - active_keyingset-1 since 0 is reserved for 'none'
1149 * - don't clamp, otherwise can never set builtin's types as active...
1150 */
1151static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
1152{
1153 Scene *scene = (Scene *)ptr->data;
1154 return scene->active_keyingset - 1;
1155}
1156
1157/* get KeyingSet index stuff for list of Keying Sets editing UI
1158 * - value+1 since 0 is reserved for 'none'
1159 */
1160static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
1161{
1162 Scene *scene = (Scene *)ptr->data;
1163 scene->active_keyingset = value + 1;
1164}
1165
1166/* XXX: evil... builtin_keyingsets is defined in `blender::animrig::keyingsets.cc`! */
1167/* TODO: make API function to retrieve this... */
1169
1170static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1171{
1172 Scene *scene = (Scene *)ptr->data;
1173
1174 /* start going over the scene KeyingSets first, while we still have pointer to it
1175 * but only if we have any Keying Sets to use...
1176 */
1177 if (scene->keyingsets.first) {
1178 rna_iterator_listbase_begin(iter, ptr, &scene->keyingsets, nullptr);
1179 }
1180 else {
1182 }
1183}
1184
1185static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
1186{
1187 ListBaseIterator *internal = &iter->internal.listbase;
1188 KeyingSet *ks = (KeyingSet *)internal->link;
1189
1190 /* If we've run out of links in Scene list,
1191 * jump over to the builtins list unless we're there already. */
1192 if ((ks->next == nullptr) && (ks != builtin_keyingsets.last)) {
1193 internal->link = (Link *)builtin_keyingsets.first;
1194 }
1195 else {
1196 internal->link = (Link *)ks->next;
1197 }
1198
1199 iter->valid = (internal->link != nullptr);
1200}
1201
1202static std::optional<std::string> rna_SceneEEVEE_path(const PointerRNA * /*ptr*/)
1203{
1204 return "eevee";
1205}
1206
1207static std::optional<std::string> rna_RaytraceEEVEE_path(const PointerRNA * /*ptr*/)
1208{
1209 return "eevee.ray_tracing_options";
1210}
1211
1212static std::optional<std::string> rna_SceneGpencil_path(const PointerRNA * /*ptr*/)
1213{
1214 return "grease_pencil_settings";
1215}
1216
1217static std::optional<std::string> rna_SceneHydra_path(const PointerRNA * /*ptr*/)
1218{
1219 return "hydra";
1220}
1221
1222static bool rna_RenderSettings_stereoViews_skip(CollectionPropertyIterator *iter, void * /*data*/)
1223{
1224 ListBaseIterator *internal = &iter->internal.listbase;
1225 SceneRenderView *srv = (SceneRenderView *)internal->link;
1226
1227 if (STR_ELEM(srv->name, STEREO_LEFT_NAME, STEREO_RIGHT_NAME)) {
1228 return false;
1229 }
1230
1231 return true;
1232};
1233
1234static void rna_RenderSettings_stereoViews_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1235{
1236 RenderData *rd = (RenderData *)ptr->data;
1237 rna_iterator_listbase_begin(iter, ptr, &rd->views, rna_RenderSettings_stereoViews_skip);
1238}
1239
1240static std::optional<std::string> rna_RenderSettings_path(const PointerRNA * /*ptr*/)
1241{
1242 return "render";
1243}
1244
1245static std::optional<std::string> rna_BakeSettings_path(const PointerRNA * /*ptr*/)
1246{
1247 return "render.bake";
1248}
1249
1250static std::optional<std::string> rna_ImageFormatSettings_path(
1251 const PointerRNA *ptr, blender::FunctionRef<bool(ImageFormatData *)> match)
1252{
1253 ID *id = ptr->owner_id;
1254
1255 switch (GS(id->name)) {
1256 case ID_SCE: {
1257 Scene *scene = (Scene *)id;
1258
1259 if (match(&scene->r.im_format)) {
1260 return "render.image_settings";
1261 }
1262 else if (match(&scene->r.bake.im_format)) {
1263 return "render.bake.image_settings";
1264 }
1265 return std::nullopt;
1266 }
1267 case ID_NT: {
1268 bNodeTree *ntree = (bNodeTree *)id;
1269
1270 for (bNode *node : ntree->all_nodes()) {
1271 if (node->type_legacy == CMP_NODE_OUTPUT_FILE) {
1272 if (match(&((NodeImageMultiFile *)node->storage)->format)) {
1273 char node_name_esc[sizeof(node->name) * 2];
1274 BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
1275 return fmt::format("nodes[\"{}\"].format", node_name_esc);
1276 }
1277 else {
1278 LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) {
1279 NodeImageMultiFileSocket *sockdata = static_cast<NodeImageMultiFileSocket *>(
1280 socket->storage);
1281 if (match(&sockdata->format)) {
1282 char node_name_esc[sizeof(node->name) * 2];
1283 BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
1284
1285 char socketdata_path_esc[sizeof(sockdata->path) * 2];
1286 BLI_str_escape(socketdata_path_esc, sockdata->path, sizeof(socketdata_path_esc));
1287
1288 return fmt::format(
1289 "nodes[\"{}\"].file_slots[\"{}\"].format", node_name_esc, socketdata_path_esc);
1290 }
1291 }
1292 }
1293 }
1294 }
1295 return std::nullopt;
1296 }
1297 default:
1298 return std::nullopt;
1299 }
1300}
1301
1302static std::optional<std::string> rna_ImageFormatSettings_path(const PointerRNA *ptr)
1303{
1304 ImageFormatData *data = static_cast<ImageFormatData *>(ptr->data);
1305 return rna_ImageFormatSettings_path(ptr, [&](ImageFormatData *imf) { return imf == data; });
1306}
1307
1308std::optional<std::string> rna_ColorManagedDisplaySettings_path(const PointerRNA *ptr)
1309{
1311 std::optional<std::string> path = rna_ImageFormatSettings_path(
1312 ptr, [&](ImageFormatData *imf) { return &imf->display_settings == data; });
1313 if (path) {
1314 return *path + ".display_settings";
1315 }
1316 if (GS(ptr->owner_id->name) == ID_SCE) {
1317 return "display_settings";
1318 }
1319
1320 return std::nullopt;
1321}
1322
1323std::optional<std::string> rna_ColorManagedViewSettings_path(const PointerRNA *ptr)
1324{
1326 std::optional<std::string> path = rna_ImageFormatSettings_path(
1327 ptr, [&](ImageFormatData *imf) { return &imf->view_settings == data; });
1328 if (path) {
1329 return *path + ".view_settings";
1330 }
1331 if (GS(ptr->owner_id->name) == ID_SCE) {
1332 return "view_settings";
1333 }
1334 return std::nullopt;
1335}
1336
1337std::optional<std::string> rna_ColorManagedInputColorspaceSettings_path(const PointerRNA *ptr)
1338{
1340 std::optional<std::string> path = rna_ImageFormatSettings_path(
1341 ptr, [&](ImageFormatData *imf) { return &imf->linear_colorspace_settings == data; });
1342 if (path) {
1343 return *path + ".linear_colorspace_settings";
1344 }
1345 return std::nullopt;
1346}
1347
1348static int rna_RenderSettings_threads_get(PointerRNA *ptr)
1349{
1350 RenderData *rd = (RenderData *)ptr->data;
1351 return BKE_render_num_threads(rd);
1352}
1353
1354static int rna_RenderSettings_threads_mode_get(PointerRNA *ptr)
1355{
1356 RenderData *rd = (RenderData *)ptr->data;
1357 int override = BLI_system_num_threads_override_get();
1358
1359 if (override > 0) {
1360 return R_FIXED_THREADS;
1361 }
1362 else {
1363 return (rd->mode & R_FIXED_THREADS);
1364 }
1365}
1366
1367static bool rna_RenderSettings_is_movie_format_get(PointerRNA *ptr)
1368{
1369 RenderData *rd = (RenderData *)ptr->data;
1370 return BKE_imtype_is_movie(rd->im_format.imtype);
1371}
1372
1373static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
1374{
1375 BKE_image_format_set((ImageFormatData *)ptr->data, ptr->owner_id, value);
1376}
1377
1378static const EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf(bContext * /*C*/,
1379 PointerRNA *ptr,
1380 PropertyRNA * /*prop*/,
1381 bool * /*r_free*/)
1382{
1383 ID *id = ptr->owner_id;
1384 if (id && GS(id->name) == ID_SCE) {
1386 }
1387 else {
1388 return image_only_type_items;
1389 }
1390}
1391
1392static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext * /*C*/,
1393 PointerRNA *ptr,
1394 PropertyRNA * /*prop*/,
1395 bool *r_free)
1396{
1397 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1398 ID *id = ptr->owner_id;
1399 const bool is_render = (id && GS(id->name) == ID_SCE);
1400
1401 /* NOTE(@ideasman42): we need to act differently for render
1402 * where 'BW' will force grayscale even if the output format writes
1403 * as RGBA, this is age old blender convention and not sure how useful
1404 * it really is but keep it for now. */
1405 char chan_flag = BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
1406
1407 /* a WAY more crappy case than B&W flag: depending on codec, file format MIGHT support
1408 * alpha channel. for example MPEG format with h264 codec can't do alpha channel, but
1409 * the same MPEG format with QTRLE codec can easily handle alpha channel.
1410 * not sure how to deal with such cases in a nicer way (sergey) */
1411 if (is_render) {
1412 Scene *scene = (Scene *)ptr->owner_id;
1413 RenderData *rd = &scene->r;
1414
1415 if (MOV_codec_supports_alpha(rd->ffcodecdata.codec_id_get(),
1417 {
1418 chan_flag |= IMA_CHAN_FLAG_RGBA;
1419 }
1420 }
1421
1422 if (chan_flag == (IMA_CHAN_FLAG_BW | IMA_CHAN_FLAG_RGB | IMA_CHAN_FLAG_RGBA)) {
1424 }
1425 else {
1426 int totitem = 0;
1427 EnumPropertyItem *item = nullptr;
1428
1429 if (chan_flag & IMA_CHAN_FLAG_BW) {
1430 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_BW);
1431 }
1432 if (chan_flag & IMA_CHAN_FLAG_RGB) {
1433 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB);
1434 }
1435 if (chan_flag & IMA_CHAN_FLAG_RGBA) {
1436 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA);
1437 }
1438
1439 RNA_enum_item_end(&item, &totitem);
1440 *r_free = true;
1441
1442 return item;
1443 }
1444}
1445
1446static const EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext * /*C*/,
1447 PointerRNA *ptr,
1448 PropertyRNA * /*prop*/,
1449 bool *r_free)
1450{
1451 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1452
1453 if (imf == nullptr) {
1455 }
1456 else {
1457 const int depth_ok = BKE_imtype_valid_depths_with_video(imf->imtype, ptr->owner_id);
1458 const int is_float = ELEM(
1460
1462 const EnumPropertyItem *item_10bit = &rna_enum_image_color_depth_items[1];
1463 const EnumPropertyItem *item_12bit = &rna_enum_image_color_depth_items[2];
1464 const EnumPropertyItem *item_16bit = &rna_enum_image_color_depth_items[3];
1465 const EnumPropertyItem *item_32bit = &rna_enum_image_color_depth_items[4];
1466
1467 int totitem = 0;
1468 EnumPropertyItem *item = nullptr;
1469 EnumPropertyItem tmp = {0, "", 0, "", ""};
1470
1471 if (depth_ok & R_IMF_CHAN_DEPTH_8) {
1472 RNA_enum_item_add(&item, &totitem, item_8bit);
1473 }
1474
1475 if (depth_ok & R_IMF_CHAN_DEPTH_10) {
1476 RNA_enum_item_add(&item, &totitem, item_10bit);
1477 }
1478
1479 if (depth_ok & R_IMF_CHAN_DEPTH_12) {
1480 RNA_enum_item_add(&item, &totitem, item_12bit);
1481 }
1482
1483 if (depth_ok & R_IMF_CHAN_DEPTH_16) {
1484 if (is_float) {
1485 tmp = *item_16bit;
1486 tmp.name = N_("Float (Half)");
1488 tmp.description = N_(
1489 "16-bit color channels. Data passes like Depth will still be saved using full "
1490 "32-bit precision.");
1491 }
1492 RNA_enum_item_add(&item, &totitem, &tmp);
1493 }
1494 else {
1495 RNA_enum_item_add(&item, &totitem, item_16bit);
1496 }
1497 }
1498
1499 if (depth_ok & R_IMF_CHAN_DEPTH_32) {
1500 if (is_float) {
1501 tmp = *item_32bit;
1502 tmp.name = N_("Float (Full)");
1503 RNA_enum_item_add(&item, &totitem, &tmp);
1504 }
1505 else {
1506 RNA_enum_item_add(&item, &totitem, item_32bit);
1507 }
1508 }
1509
1510 RNA_enum_item_end(&item, &totitem);
1511 *r_free = true;
1512
1513 return item;
1514 }
1515}
1516
1517static const EnumPropertyItem *rna_ImageFormatSettings_views_format_itemf(bContext * /*C*/,
1518 PointerRNA *ptr,
1519 PropertyRNA * /*prop*/,
1520 bool * /*r_free*/)
1521{
1522 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1523
1524 if (imf == nullptr) {
1526 }
1527 else if (imf->imtype == R_IMF_IMTYPE_OPENEXR) {
1529 }
1530 else if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) {
1532 }
1533 else {
1535 }
1536}
1537
1538# ifdef WITH_IMAGE_OPENEXR
1539/* OpenEXR */
1540
1541static const EnumPropertyItem *rna_ImageFormatSettings_exr_codec_itemf(bContext * /*C*/,
1542 PointerRNA *ptr,
1543 PropertyRNA * /*prop*/,
1544 bool *r_free)
1545{
1546 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1547
1548 EnumPropertyItem *item = nullptr;
1549 int i = 1, totitem = 0;
1550
1551 if (imf->depth == 16) {
1552 return rna_enum_exr_codec_items; /* All compression types are defined for half-float. */
1553 }
1554
1555 for (i = 0; i < R_IMF_EXR_CODEC_MAX; i++) {
1556 if (ELEM(rna_enum_exr_codec_items[i].value, R_IMF_EXR_CODEC_B44, R_IMF_EXR_CODEC_B44A)) {
1557 continue; /* B44 and B44A are not defined for 32 bit floats */
1558 }
1559
1560 RNA_enum_item_add(&item, &totitem, &rna_enum_exr_codec_items[i]);
1561 }
1562
1563 RNA_enum_item_end(&item, &totitem);
1564 *r_free = true;
1565
1566 return item;
1567}
1568
1569# endif
1570
1571static bool rna_ImageFormatSettings_has_linear_colorspace_get(PointerRNA *ptr)
1572{
1573 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1575}
1576
1577static void rna_ImageFormatSettings_color_management_set(PointerRNA *ptr, int value)
1578{
1579 ImageFormatData *imf = (ImageFormatData *)ptr->data;
1580
1581 if (imf->color_management != value) {
1582 imf->color_management = value;
1583
1584 /* Copy from scene when enabling override. */
1586 ID *owner_id = ptr->owner_id;
1587 if (owner_id && GS(owner_id->name) == ID_NT) {
1588 /* For compositing nodes, find the corresponding scene. */
1589 owner_id = BKE_id_owner_get(owner_id);
1590 }
1591 if (owner_id && GS(owner_id->name) == ID_SCE) {
1593 }
1594 }
1595 }
1596}
1597
1598static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
1599{
1600 const RenderData *rd = (RenderData *)ptr->data;
1601 const char *ext_array[BKE_IMAGE_PATH_EXT_MAX];
1602 int ext_num = BKE_image_path_ext_from_imformat(&rd->im_format, ext_array);
1603 return ext_num ? strlen(ext_array[0]) : 0;
1604}
1605
1606static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *value)
1607{
1608 const RenderData *rd = (RenderData *)ptr->data;
1609 const char *ext_array[BKE_IMAGE_PATH_EXT_MAX];
1610 int ext_num = BKE_image_path_ext_from_imformat(&rd->im_format, ext_array);
1611 strcpy(value, ext_num ? ext_array[0] : "");
1612}
1613
1614# ifdef WITH_FFMPEG
1615static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, bool value)
1616{
1617 Scene *scene = (Scene *)ptr->owner_id;
1618 RenderData *rd = &scene->r;
1619
1620 if (value) {
1622 }
1623 else {
1625 }
1626}
1627# endif
1628
1629static int rna_RenderSettings_active_view_index_get(PointerRNA *ptr)
1630{
1631 RenderData *rd = (RenderData *)ptr->data;
1632 return rd->actview;
1633}
1634
1635static void rna_RenderSettings_active_view_index_set(PointerRNA *ptr, int value)
1636{
1637 RenderData *rd = (RenderData *)ptr->data;
1638 rd->actview = value;
1639}
1640
1641static void rna_RenderSettings_active_view_index_range(
1642 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
1643{
1644 RenderData *rd = (RenderData *)ptr->data;
1645
1646 *min = 0;
1647 *max = max_ii(0, BLI_listbase_count(&rd->views) - 1);
1648}
1649
1650static PointerRNA rna_RenderSettings_active_view_get(PointerRNA *ptr)
1651{
1652 RenderData *rd = (RenderData *)ptr->data;
1653 SceneRenderView *srv = static_cast<SceneRenderView *>(BLI_findlink(&rd->views, rd->actview));
1654
1655 return RNA_pointer_create_with_parent(*ptr, &RNA_SceneRenderView, srv);
1656}
1657
1658static void rna_RenderSettings_active_view_set(PointerRNA *ptr,
1659 PointerRNA value,
1660 ReportList * /*reports*/)
1661{
1662 RenderData *rd = (RenderData *)ptr->data;
1663 SceneRenderView *srv = (SceneRenderView *)value.data;
1664 const int index = BLI_findindex(&rd->views, srv);
1665 if (index != -1) {
1666 rd->actview = index;
1667 }
1668}
1669
1670static SceneRenderView *rna_RenderView_new(ID *id, RenderData * /*rd*/, const char *name)
1671{
1672 Scene *scene = (Scene *)id;
1673 SceneRenderView *srv = BKE_scene_add_render_view(scene, name);
1674
1676
1677 return srv;
1678}
1679
1680static void rna_RenderView_remove(
1681 ID *id, RenderData * /*rd*/, Main * /*bmain*/, ReportList *reports, PointerRNA *srv_ptr)
1682{
1683 SceneRenderView *srv = static_cast<SceneRenderView *>(srv_ptr->data);
1684 Scene *scene = (Scene *)id;
1685
1686 if (!BKE_scene_remove_render_view(scene, srv)) {
1688 RPT_ERROR,
1689 "Render view '%s' could not be removed from scene '%s'",
1690 srv->name,
1691 scene->id.name + 2);
1692 return;
1693 }
1694
1695 srv_ptr->invalidate();
1696
1698}
1699
1700static void rna_RenderSettings_views_format_set(PointerRNA *ptr, int value)
1701{
1702 RenderData *rd = (RenderData *)ptr->data;
1703
1705 /* make sure the actview is visible */
1706 if (rd->actview > 1) {
1707 rd->actview = 1;
1708 }
1709 }
1710
1711 rd->views_format = value;
1712}
1713
1714static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
1715{
1716 RenderData *rd = (RenderData *)ptr->data;
1717 RenderEngineType *type = static_cast<RenderEngineType *>(BLI_findlink(&R_engines, value));
1718
1719 if (type) {
1720 STRNCPY_UTF8(rd->engine, type->idname);
1722 }
1723}
1724
1725static const EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext * /*C*/,
1726 PointerRNA * /*ptr*/,
1727 PropertyRNA * /*prop*/,
1728 bool *r_free)
1729{
1730 RenderEngineType *type;
1731 EnumPropertyItem *item = nullptr;
1732 EnumPropertyItem tmp = {0, "", 0, "", ""};
1733 int a = 0, totitem = 0;
1734
1735 for (type = static_cast<RenderEngineType *>(R_engines.first); type; type = type->next, a++) {
1736 tmp.value = a;
1737 tmp.identifier = type->idname;
1738 tmp.name = type->name;
1739 RNA_enum_item_add(&item, &totitem, &tmp);
1740 }
1741
1742 RNA_enum_item_end(&item, &totitem);
1743 *r_free = true;
1744
1745 return item;
1746}
1747
1748static int rna_RenderSettings_engine_get(PointerRNA *ptr)
1749{
1750 RenderData *rd = (RenderData *)ptr->data;
1751 RenderEngineType *type;
1752 int a = 0;
1753
1754 for (type = static_cast<RenderEngineType *>(R_engines.first); type; type = type->next, a++) {
1755 if (STREQ(type->idname, rd->engine)) {
1756 return a;
1757 }
1758 }
1759
1760 return 0;
1761}
1762
1763static void rna_RenderSettings_engine_update(Main *bmain, Scene * /*unused*/, PointerRNA * /*ptr*/)
1764{
1765 ED_render_engine_changed(bmain, true);
1766}
1767
1768static void rna_Scene_update_render_engine(Main *bmain)
1769{
1770 ED_render_engine_changed(bmain, true);
1771}
1772
1773static bool rna_RenderSettings_multiple_engines_get(PointerRNA * /*ptr*/)
1774{
1775 return (BLI_listbase_count(&R_engines) > 1);
1776}
1777
1778static bool rna_RenderSettings_use_spherical_stereo_get(PointerRNA *ptr)
1779{
1780 Scene *scene = (Scene *)ptr->owner_id;
1781 return BKE_scene_use_spherical_stereo(scene);
1782}
1783
1784void rna_Scene_render_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1785{
1786 Scene *scene = (Scene *)ptr->owner_id;
1787
1789}
1790
1791static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1792{
1793 Scene *screen = (Scene *)ptr->owner_id;
1794
1795 rna_Scene_render_update(bmain, scene, ptr);
1796 WM_main_add_notifier(NC_WORLD | ND_WORLD, &screen->id);
1798}
1799
1800static void rna_Scene_mesh_quality_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1801{
1802 Scene *scene = (Scene *)ptr->owner_id;
1803
1804 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1805 if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_VOLUME, OB_MBALL)) {
1807 }
1808 }
1810
1811 rna_Scene_render_update(bmain, scene, ptr);
1812}
1813
1814void rna_Scene_freestyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1815{
1816 Scene *scene = (Scene *)ptr->owner_id;
1817
1819}
1820
1821void rna_Scene_use_freestyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1822{
1823 Scene *scene = (Scene *)ptr->owner_id;
1824
1826
1827 if (scene->nodetree) {
1829 }
1830}
1831
1832void rna_Scene_compositor_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1833{
1834 Scene *scene = (Scene *)ptr->owner_id;
1835
1836 if (scene->nodetree) {
1837 bNodeTree *ntree = reinterpret_cast<bNodeTree *>(scene->nodetree);
1840 BKE_main_ensure_invariants(*bmain, ntree->id);
1841 }
1842}
1843
1844void rna_Scene_use_view_map_cache_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1845{
1846# ifdef WITH_FREESTYLE
1848# endif
1849}
1850
1851void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value)
1852{
1853 Scene *scene = (Scene *)ptr->owner_id;
1854 ViewLayer *view_layer = (ViewLayer *)ptr->data;
1856 BKE_view_layer_rename(G_MAIN, scene, view_layer, value);
1857}
1858
1859static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value)
1860{
1861 Scene *scene = (Scene *)ptr->owner_id;
1862 SceneRenderView *rv = (SceneRenderView *)ptr->data;
1863 STRNCPY_UTF8(rv->name, value);
1864 BLI_uniquename(&scene->r.views,
1865 rv,
1866 DATA_("RenderView"),
1867 '.',
1869 sizeof(rv->name));
1870}
1871
1872void rna_ViewLayer_override_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1873{
1874 Scene *scene = (Scene *)ptr->owner_id;
1875 rna_Scene_render_update(bmain, scene, ptr);
1877}
1878
1879void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
1880{
1881 Scene *scene = (Scene *)ptr->owner_id;
1882
1883 ViewLayer *view_layer = nullptr;
1884 if (ptr->type == &RNA_ViewLayer) {
1885 view_layer = (ViewLayer *)ptr->data;
1886 }
1887 else if (ptr->type == &RNA_AOV) {
1888 ViewLayerAOV *aov = (ViewLayerAOV *)ptr->data;
1889 view_layer = BKE_view_layer_find_with_aov(scene, aov);
1890 }
1891 else if (ptr->type == &RNA_Lightgroup) {
1892 ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
1893 view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
1894 }
1895
1896 if (view_layer) {
1897 RenderEngineType *engine_type = RE_engines_find(scene->r.engine);
1898 if (engine_type->update_render_passes) {
1899 RenderEngine *engine = RE_engine_create(engine_type);
1900 if (engine) {
1901 BKE_view_layer_verify_aov(engine, scene, view_layer);
1902 }
1903 RE_engine_free(engine);
1904 engine = nullptr;
1905 }
1906 }
1907
1908 if (scene->nodetree) {
1910 }
1911
1912 rna_Scene_render_update(bmain, activescene, ptr);
1913}
1914
1915static std::optional<std::string> rna_ViewLayerEEVEE_path(const PointerRNA *ptr)
1916{
1917 const ViewLayerEEVEE *view_layer_eevee = (ViewLayerEEVEE *)ptr->data;
1918 const ViewLayer *view_layer = (ViewLayer *)((uint8_t *)view_layer_eevee -
1919 offsetof(ViewLayer, eevee));
1920 char rna_path[sizeof(view_layer->name) * 3];
1921
1922 const size_t view_layer_path_len = rna_ViewLayer_path_buffer_get(
1923 view_layer, rna_path, sizeof(rna_path));
1924
1925 BLI_strncpy(rna_path + view_layer_path_len, ".eevee", sizeof(rna_path) - view_layer_path_len);
1926
1927 return rna_path;
1928}
1929
1930static void rna_SceneEEVEE_gi_cubemap_resolution_update(Main * /*main*/,
1931 Scene *scene,
1932 PointerRNA * /*ptr*/)
1933{
1934 /* Tag all light probes to recalc transform. This signals EEVEE to update the light probes. */
1935 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1936 if (ob->type == OB_LIGHTPROBE) {
1938 }
1939 }
1941}
1942
1943static void rna_SceneEEVEE_clamp_surface_indirect_update(Main * /*main*/,
1944 Scene *scene,
1945 PointerRNA * /*ptr*/)
1946{
1947 /* Tag all light probes to recalc transform. This signals EEVEE to update the light probes. */
1948 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1949 if (ob->type == OB_LIGHTPROBE) {
1951 }
1952 }
1954
1955 /* Also tag the world. */
1957}
1958
1959static void rna_SceneEEVEE_shadow_resolution_update(Main * /*bmain*/,
1960 Scene *scene,
1961 PointerRNA * /*ptr*/)
1962{
1963 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1964 if (ob->type == OB_LAMP) {
1966 }
1967 }
1969
1973}
1974
1975static std::optional<std::string> rna_SceneRenderView_path(const PointerRNA *ptr)
1976{
1977 const SceneRenderView *srv = (SceneRenderView *)ptr->data;
1978 char srv_name_esc[sizeof(srv->name) * 2];
1979 BLI_str_escape(srv_name_esc, srv->name, sizeof(srv_name_esc));
1980 return fmt::format("render.views[\"{}\"]", srv_name_esc);
1981}
1982
1983static void rna_Scene_use_nodes_update(bContext *C, PointerRNA *ptr)
1984{
1985 Scene *scene = (Scene *)ptr->data;
1986 if (scene->use_nodes && scene->nodetree == nullptr) {
1988 }
1990}
1991
1992static void rna_Physics_relations_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
1993{
1995}
1996
1997static void rna_Physics_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1998{
1999 Scene *scene = (Scene *)ptr->owner_id;
2000 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
2002 }
2004
2006}
2007
2008static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const bool *value)
2009{
2010 ToolSettings *ts = (ToolSettings *)ptr->data;
2011 const int selectmode = (value[0] ? SCE_SELECT_VERTEX : 0) | (value[1] ? SCE_SELECT_EDGE : 0) |
2012 (value[2] ? SCE_SELECT_FACE : 0);
2013
2014 if (selectmode) {
2015 ts->selectmode = selectmode;
2016
2017 /* Update select mode in all the workspaces in mesh edit mode. */
2018 wmWindowManager *wm = static_cast<wmWindowManager *>(G_MAIN->wm.first);
2019 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
2020 const Scene *scene = WM_window_get_active_scene(win);
2021 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
2022 if (view_layer) {
2023 BKE_view_layer_synced_ensure(scene, view_layer);
2024 Object *object = BKE_view_layer_active_object_get(view_layer);
2025 if (object && object->type == OB_MESH) {
2026 if (BMEditMesh *em = BKE_editmesh_from_object(object)) {
2027 if (em->selectmode != selectmode) {
2028 EDBM_selectmode_set(em, selectmode);
2029 }
2030 }
2031 }
2032 }
2033 }
2034 }
2035}
2036
2037static void rna_Scene_editmesh_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2038{
2039 const Scene *scene = CTX_data_scene(C);
2040 ViewLayer *view_layer = CTX_data_view_layer(C);
2041 Mesh *mesh = nullptr;
2042
2043 BKE_view_layer_synced_ensure(scene, view_layer);
2044 Object *object = BKE_view_layer_active_object_get(view_layer);
2045 if (object) {
2046 mesh = BKE_mesh_from_object(object);
2047 if (mesh && mesh->runtime->edit_mesh == nullptr) {
2048 mesh = nullptr;
2049 }
2050 }
2051
2052 if (mesh) {
2055 }
2056}
2057
2058static void rna_Scene_uv_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2059{
2060 /* Makes sure that the UV selection states are consistent with the current UV select mode and
2061 * sticky mode. */
2063}
2064
2065static void rna_Scene_uv_sticky_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2066{
2067 /* Some changes to sticky select mode require rebuilding. */
2069}
2070
2071static void object_simplify_update(Scene *scene,
2072 Object *ob,
2073 bool update_normals,
2074 Depsgraph *depsgraph)
2075{
2076 ModifierData *md;
2077 ParticleSystem *psys;
2078
2079 if ((ob->id.tag & ID_TAG_DOIT) == 0) {
2080 return;
2081 }
2082
2083 ob->id.tag &= ~ID_TAG_DOIT;
2084
2085 for (md = static_cast<ModifierData *>(ob->modifiers.first); md; md = md->next) {
2086 if (md->type == eModifierType_Nodes && depsgraph != nullptr) {
2087 Object *ob_eval = DEG_get_evaluated(depsgraph, ob);
2088 const blender::bke::GeometrySet *geometry_set = ob_eval->runtime->geometry_set_eval;
2089 if (geometry_set != nullptr && geometry_set->has_volume()) {
2091 }
2092 continue;
2093 }
2094 if (ELEM(
2096 {
2098 }
2099 }
2100
2101 for (psys = static_cast<ParticleSystem *>(ob->particlesystem.first); psys; psys = psys->next) {
2103 }
2104
2105 if (ob->instance_collection) {
2107 object_simplify_update(scene, ob_collection, update_normals, depsgraph);
2108 }
2110 }
2111
2112 if (ob->type == OB_VOLUME) {
2114 }
2115
2116 if (scene->r.mode & R_SIMPLIFY_NORMALS || update_normals) {
2117 if (OB_TYPE_IS_GEOMETRY(ob->type)) {
2119 }
2120 }
2121
2122 if (ob->type == OB_LAMP) {
2124 }
2125}
2126
2127static void rna_Scene_simplify_update_impl(Main *bmain,
2128 Scene *sce,
2129 bool update_normals,
2130 Depsgraph *depsgraph)
2131{
2132 Scene *sce_iter;
2133 Base *base;
2134
2136 FOREACH_SCENE_OBJECT_BEGIN (sce, ob) {
2137 object_simplify_update(sce, ob, update_normals, depsgraph);
2138 }
2140
2141 for (SETLOOPER_SET_ONLY(sce, sce_iter, base)) {
2142 object_simplify_update(sce, base->object, update_normals, depsgraph);
2143 }
2144
2148}
2149
2150static void rna_Scene_use_simplify_update(bContext *C, PointerRNA *ptr)
2151{
2152 Scene *scene = (Scene *)ptr->owner_id;
2153 Main *bmain = CTX_data_main(C);
2155 rna_Scene_simplify_update_impl(bmain, scene, false, depsgraph);
2156}
2157
2158static void rna_Scene_simplify_volume_update(bContext *C, PointerRNA *ptr)
2159{
2160 Scene *scene = (Scene *)ptr->owner_id;
2161 Main *bmain = CTX_data_main(C);
2163 if (scene->r.mode & R_SIMPLIFY) {
2164 rna_Scene_simplify_update_impl(bmain, scene, false, depsgraph);
2165 }
2166}
2167
2168static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
2169{
2170 if (scene->r.mode & R_SIMPLIFY) {
2171 rna_Scene_simplify_update_impl(bmain, scene, false, nullptr);
2172 }
2173}
2174
2175static void rna_Scene_use_simplify_normals_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
2176{
2177 /* NOTE: Ideally this would just force recalculation of the draw batch cache normals.
2178 * That's complicated enough to not be worth it here. */
2179 if (scene->r.mode & R_SIMPLIFY) {
2180 rna_Scene_simplify_update_impl(bmain, scene, true, nullptr);
2181 }
2182}
2183
2184static void rna_Scene_use_persistent_data_update(Main * /*bmain*/,
2185 Scene * /*scene*/,
2186 PointerRNA *ptr)
2187{
2188 Scene *scene = (Scene *)ptr->owner_id;
2189
2190 if (!(scene->r.mode & R_PERSISTENT_DATA)) {
2191 RE_FreePersistentData(scene);
2192 }
2193}
2194
2195/* Scene.transform_orientation_slots */
2196static void rna_Scene_transform_orientation_slots_begin(CollectionPropertyIterator *iter,
2197 PointerRNA *ptr)
2198{
2199 Scene *scene = (Scene *)ptr->owner_id;
2200 TransformOrientationSlot *orient_slot = &scene->orientation_slots[0];
2202 ptr,
2203 orient_slot,
2204 sizeof(*orient_slot),
2206 0,
2207 nullptr);
2208}
2209
2210static int rna_Scene_transform_orientation_slots_length(PointerRNA * /*ptr*/)
2211{
2212 return ARRAY_SIZE(((Scene *)nullptr)->orientation_slots);
2213}
2214
2215static bool rna_Scene_use_audio_get(PointerRNA *ptr)
2216{
2217 Scene *scene = (Scene *)ptr->data;
2218 return (scene->audio.flag & AUDIO_MUTE) == 0;
2219}
2220
2221static void rna_Scene_use_audio_set(PointerRNA *ptr, bool value)
2222{
2223 Scene *scene = (Scene *)ptr->data;
2224
2225 if (!value) {
2226 scene->audio.flag |= AUDIO_MUTE;
2227 }
2228 else {
2229 scene->audio.flag &= ~AUDIO_MUTE;
2230 }
2231}
2232
2233static void rna_Scene_use_audio_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2234{
2236}
2237
2238static int rna_Scene_sync_mode_get(PointerRNA *ptr)
2239{
2240 Scene *scene = (Scene *)ptr->data;
2241 if (scene->audio.flag & AUDIO_SYNC) {
2242 return AUDIO_SYNC;
2243 }
2244 return scene->flag & SCE_FRAME_DROP;
2245}
2246
2247static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
2248{
2249 Scene *scene = (Scene *)ptr->data;
2250
2251 if (value == AUDIO_SYNC) {
2252 scene->audio.flag |= AUDIO_SYNC;
2253 }
2254 else if (value == SCE_FRAME_DROP) {
2255 scene->audio.flag &= ~AUDIO_SYNC;
2256 scene->flag |= SCE_FRAME_DROP;
2257 }
2258 else {
2259 scene->audio.flag &= ~AUDIO_SYNC;
2260 scene->flag &= ~SCE_FRAME_DROP;
2261 }
2262}
2263
2264static void rna_View3DCursor_rotation_mode_set(PointerRNA *ptr, int value)
2265{
2266 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2267
2268 /* use API Method for conversions... */
2270 cursor->rotation_euler,
2271 cursor->rotation_axis,
2272 &cursor->rotation_angle,
2273 cursor->rotation_mode,
2274 short(value));
2275
2276 /* finally, set the new rotation type */
2277 cursor->rotation_mode = value;
2278}
2279
2280static void rna_View3DCursor_rotation_axis_angle_get(PointerRNA *ptr, float *value)
2281{
2282 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2283 value[0] = cursor->rotation_angle;
2284 copy_v3_v3(&value[1], cursor->rotation_axis);
2285}
2286
2287static void rna_View3DCursor_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
2288{
2289 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2290 cursor->rotation_angle = value[0];
2291 copy_v3_v3(cursor->rotation_axis, &value[1]);
2292}
2293
2294static void rna_View3DCursor_matrix_get(PointerRNA *ptr, float *values)
2295{
2296 const View3DCursor *cursor = static_cast<const View3DCursor *>(ptr->data);
2297 copy_m4_m4((float(*)[4])values, cursor->matrix<blender::float4x4>().ptr());
2298}
2299
2300static void rna_View3DCursor_matrix_set(PointerRNA *ptr, const float *values)
2301{
2302 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2303 float unit_mat[4][4];
2304 normalize_m4_m4(unit_mat, (const float(*)[4])values);
2305 cursor->set_matrix(blender::float4x4(unit_mat), false);
2306}
2307
2308static std::optional<std::string> rna_TransformOrientationSlot_path(const PointerRNA *ptr)
2309{
2310 const Scene *scene = (Scene *)ptr->owner_id;
2311 const TransformOrientationSlot *orientation_slot = static_cast<const TransformOrientationSlot *>(
2312 ptr->data);
2313
2314 if (!ELEM(nullptr, scene, orientation_slot)) {
2315 for (int i = 0; i < ARRAY_SIZE(scene->orientation_slots); i++) {
2316 if (&scene->orientation_slots[i] == orientation_slot) {
2317 return fmt::format("transform_orientation_slots[{}]", i);
2318 }
2319 }
2320 }
2321
2322 /* Should not happen, but in case, just return default path. */
2324 return "transform_orientation_slots[0]";
2325}
2326
2327static std::optional<std::string> rna_View3DCursor_path(const PointerRNA * /*ptr*/)
2328{
2329 return "cursor";
2330}
2331
2332static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[], int frame)
2333{
2334 TimeMarker *marker = MEM_callocN<TimeMarker>("TimeMarker");
2335 marker->flag = SELECT;
2336 marker->frame = frame;
2337 STRNCPY_UTF8(marker->name, name);
2338 BLI_addtail(&scene->markers, marker);
2339
2342
2343 return marker;
2344}
2345
2346static void rna_TimeLine_remove(Scene *scene, ReportList *reports, PointerRNA *marker_ptr)
2347{
2348 TimeMarker *marker = static_cast<TimeMarker *>(marker_ptr->data);
2349 if (BLI_remlink_safe(&scene->markers, marker) == false) {
2351 RPT_ERROR,
2352 "Timeline marker '%s' not found in scene '%s'",
2353 marker->name,
2354 scene->id.name + 2);
2355 return;
2356 }
2357
2358 MEM_freeN(marker);
2359 marker_ptr->invalidate();
2360
2363}
2364
2365static void rna_TimeLine_clear(Scene *scene)
2366{
2367 BLI_freelistN(&scene->markers);
2368
2371}
2372
2373static std::optional<std::string> rna_Scene_KeyingsSetsAll_path(const PointerRNA * /*ptr*/)
2374{
2375 return "keying_sets_all";
2376}
2377
2378static KeyingSet *rna_Scene_keying_set_new(Scene *sce,
2380 const char idname[],
2381 const char name[])
2382{
2383 KeyingSet *ks = nullptr;
2384
2385 /* call the API func, and set the active keyingset index */
2386 ks = BKE_keyingset_add(&sce->keyingsets, idname, name, KEYINGSET_ABSOLUTE, 0);
2387
2388 if (ks) {
2390 return ks;
2391 }
2392 else {
2393 BKE_report(reports, RPT_ERROR, "Keying set could not be added");
2394 return nullptr;
2395 }
2396}
2397
2398static void rna_UnifiedPaintSettings_update(bContext *C, PointerRNA * /*ptr*/)
2399{
2400 Scene *scene = CTX_data_scene(C);
2401 ViewLayer *view_layer = CTX_data_view_layer(C);
2402 Brush *br = BKE_paint_brush(BKE_paint_get_active(scene, view_layer));
2404}
2405
2406static void rna_UnifiedPaintSettings_size_set(PointerRNA *ptr, int value)
2407{
2408 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
2409
2410 /* scale unprojected radius so it stays consistent with brush size */
2412 ups->size = value;
2413}
2414
2415static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, float value)
2416{
2417 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
2418
2419 /* scale brush size so it stays consistent with unprojected_radius */
2420 BKE_brush_scale_size(&ups->size, value, ups->unprojected_radius);
2421 ups->unprojected_radius = value;
2422}
2423
2424static void rna_UnifiedPaintSettings_radius_update(bContext *C, PointerRNA *ptr)
2425{
2426 /* changing the unified size should invalidate the overlay but also update the brush */
2428 rna_UnifiedPaintSettings_update(C, ptr);
2429}
2430
2431static std::optional<std::string> rna_UnifiedPaintSettings_path(const PointerRNA * /*ptr*/)
2432{
2433 return "tool_settings.unified_paint_settings";
2434}
2435
2436static std::optional<std::string> rna_CurvePaintSettings_path(const PointerRNA * /*ptr*/)
2437{
2438 return "tool_settings.curve_paint_settings";
2439}
2440
2441static std::optional<std::string> rna_SequencerToolSettings_path(const PointerRNA * /*ptr*/)
2442{
2443 return "tool_settings.sequencer_tool_settings";
2444}
2445
2446/* generic function to recalc geometry */
2447static void rna_EditMesh_update(bContext *C, PointerRNA * /*ptr*/)
2448{
2449 const Scene *scene = CTX_data_scene(C);
2450 ViewLayer *view_layer = CTX_data_view_layer(C);
2451 BKE_view_layer_synced_ensure(scene, view_layer);
2452
2454 scene, view_layer, CTX_wm_view3d(C));
2455 for (Object *obedit : objects) {
2456 Mesh *mesh = BKE_mesh_from_object(obedit);
2457
2460 }
2461}
2462
2463static std::optional<std::string> rna_MeshStatVis_path(const PointerRNA * /*ptr*/)
2464{
2465 return "tool_settings.statvis";
2466}
2467
2468/* NOTE: without this, when Multi-Paint is activated/deactivated, the colors
2469 * will not change right away when multiple bones are selected, this function
2470 * is not for general use and only for the few cases where changing scene
2471 * settings and NOT for general purpose updates, possibly this should be
2472 * given its own notifier. */
2473static void rna_Scene_update_active_object_data(bContext *C, PointerRNA * /*ptr*/)
2474{
2475 const Scene *scene = CTX_data_scene(C);
2476 ViewLayer *view_layer = CTX_data_view_layer(C);
2477 BKE_view_layer_synced_ensure(scene, view_layer);
2478 Object *ob = BKE_view_layer_active_object_get(view_layer);
2479
2480 if (ob) {
2483 }
2484}
2485
2486static void rna_SceneCamera_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2487{
2488 Scene *scene = (Scene *)ptr->owner_id;
2489 Object *camera = scene->camera;
2490
2492
2493 if (camera && (camera->type == OB_CAMERA)) {
2495 }
2496}
2497
2498static void rna_SceneSequencer_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2499{
2501}
2502
2503static std::optional<std::string> rna_ToolSettings_path(const PointerRNA * /*ptr*/)
2504{
2505 return "tool_settings";
2506}
2507
2509{
2510 FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
2511
2512 return RNA_id_pointer_create(reinterpret_cast<ID *>(lineset->linestyle));
2513}
2514
2516 PointerRNA value,
2517 ReportList * /*reports*/)
2518{
2519 FreestyleLineSet *lineset = (FreestyleLineSet *)ptr->data;
2520
2521 if (lineset->linestyle) {
2522 id_us_min(&lineset->linestyle->id);
2523 }
2524 lineset->linestyle = (FreestyleLineStyle *)value.data;
2525 id_us_plus(&lineset->linestyle->id);
2526}
2527
2529 FreestyleSettings *config,
2530 Main *bmain,
2531 const char *name)
2532{
2533 Scene *scene = (Scene *)id;
2534 FreestyleLineSet *lineset = BKE_freestyle_lineset_add(bmain, (FreestyleConfig *)config, name);
2535
2538
2539 return lineset;
2540}
2541
2543 FreestyleSettings *config,
2545 PointerRNA *lineset_ptr)
2546{
2547 FreestyleLineSet *lineset = static_cast<FreestyleLineSet *>(lineset_ptr->data);
2548 Scene *scene = (Scene *)id;
2549
2550 if (!BKE_freestyle_lineset_delete((FreestyleConfig *)config, lineset)) {
2551 BKE_reportf(reports, RPT_ERROR, "Line set '%s' could not be removed", lineset->name);
2552 return;
2553 }
2554
2555 lineset_ptr->invalidate();
2556
2559}
2560
2562{
2563 FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2565 return RNA_pointer_create_with_parent(*ptr, &RNA_FreestyleLineSet, lineset);
2566}
2567
2569 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2570{
2571 FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2572
2573 *min = 0;
2574 *max = max_ii(0, BLI_listbase_count(&config->linesets) - 1);
2575}
2576
2578{
2579 FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2581}
2582
2584{
2585 FreestyleConfig *config = (FreestyleConfig *)ptr->data;
2587}
2588
2590{
2591 Scene *scene = (Scene *)id;
2593
2596
2597 return module;
2598}
2599
2601 FreestyleSettings *config,
2603 PointerRNA *module_ptr)
2604{
2605 Scene *scene = (Scene *)id;
2606 FreestyleModuleConfig *module = static_cast<FreestyleModuleConfig *>(module_ptr->data);
2607
2609 if (module->script) {
2611 RPT_ERROR,
2612 "Style module '%s' could not be removed",
2613 module->script->id.name + 2);
2614 }
2615 else {
2616 BKE_report(reports, RPT_ERROR, "Style module could not be removed");
2617 }
2618 return;
2619 }
2620
2621 module_ptr->invalidate();
2622
2625}
2626
2627static void rna_Stereo3dFormat_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
2628{
2629 ID *id = ptr->owner_id;
2630
2631 if (id && GS(id->name) == ID_IM) {
2632 Image *ima = (Image *)id;
2633 ImBuf *ibuf;
2634 void *lock;
2635
2636 if (!BKE_image_is_stereo(ima)) {
2637 return;
2638 }
2639
2640 ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
2641
2642 if (ibuf) {
2643 BKE_image_signal(bmain, ima, nullptr, IMA_SIGNAL_FREE);
2644 }
2645 BKE_image_release_ibuf(ima, ibuf, lock);
2646 }
2647}
2648
2649static ViewLayer *rna_ViewLayer_new(ID *id, Scene * /*sce*/, Main *bmain, const char *name)
2650{
2651 Scene *scene = (Scene *)id;
2652 ViewLayer *view_layer = BKE_view_layer_add(scene, name, nullptr, VIEWLAYER_ADD_NEW);
2653
2657
2658 return view_layer;
2659}
2660
2661static void rna_ViewLayer_remove(
2662 ID *id, Scene * /*sce*/, Main *bmain, ReportList *reports, PointerRNA *sl_ptr)
2663{
2664 Scene *scene = (Scene *)id;
2665 ViewLayer *view_layer = static_cast<ViewLayer *>(sl_ptr->data);
2666
2667 if (ED_scene_view_layer_delete(bmain, scene, view_layer, reports)) {
2668 sl_ptr->invalidate();
2669 }
2670}
2671
2672static void rna_ViewLayer_move(
2673 ID *id, Scene * /*sce*/, Main *bmain, ReportList *reports, int from, int to)
2674{
2675 if (from == to) {
2676 return;
2677 }
2678
2679 Scene *scene = (Scene *)id;
2680
2681 if (!BLI_listbase_move_index(&scene->view_layers, from, to)) {
2682 BKE_reportf(reports, RPT_ERROR, "Could not move layer from index '%d' to '%d'", from, to);
2683 return;
2684 }
2685
2689}
2690
2692 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2693{
2694 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2695
2696 *min = 0;
2697 *max = max_ii(0, BLI_listbase_count(&view_layer->aovs) - 1);
2698}
2699
2701{
2702 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2703 return BLI_findindex(&view_layer->aovs, view_layer->active_aov);
2704}
2705
2707{
2708 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2709 ViewLayerAOV *aov = static_cast<ViewLayerAOV *>(BLI_findlink(&view_layer->aovs, value));
2710 view_layer->active_aov = aov;
2711}
2712
2714 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2715{
2716 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2717
2718 *min = 0;
2719 *max = max_ii(0, BLI_listbase_count(&view_layer->lightgroups) - 1);
2720}
2721
2723{
2724 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2725 return BLI_findindex(&view_layer->lightgroups, view_layer->active_lightgroup);
2726}
2727
2729{
2730 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2731 ViewLayerLightgroup *lightgroup = static_cast<ViewLayerLightgroup *>(
2732 BLI_findlink(&view_layer->lightgroups, value));
2733 view_layer->active_lightgroup = lightgroup;
2734}
2735
2736static void rna_ViewLayerLightgroup_name_get(PointerRNA *ptr, char *value)
2737{
2738 ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
2739 strcpy(value, lightgroup->name);
2740}
2741
2742static int rna_ViewLayerLightgroup_name_length(PointerRNA *ptr)
2743{
2744 ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
2745 return strlen(lightgroup->name);
2746}
2747
2748static void rna_ViewLayerLightgroup_name_set(PointerRNA *ptr, const char *value)
2749{
2750 ViewLayerLightgroup *lightgroup = (ViewLayerLightgroup *)ptr->data;
2751 Scene *scene = (Scene *)ptr->owner_id;
2752 ViewLayer *view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
2753
2754 BKE_view_layer_rename_lightgroup(scene, view_layer, lightgroup, value);
2755}
2756
2757/* Fake value, used internally (not saved to DNA). */
2758# define V3D_ORIENT_DEFAULT -1
2759
2760static int rna_TransformOrientationSlot_type_get(PointerRNA *ptr)
2761{
2762 Scene *scene = (Scene *)ptr->owner_id;
2763 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2764 if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2765 if ((orient_slot->flag & SELECT) == 0) {
2766 return V3D_ORIENT_DEFAULT;
2767 }
2768 }
2769 return BKE_scene_orientation_slot_get_index(orient_slot);
2770}
2771
2772void rna_TransformOrientationSlot_type_set(PointerRNA *ptr, int value)
2773{
2774 Scene *scene = (Scene *)ptr->owner_id;
2775 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2776
2777 if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2778 if (value == V3D_ORIENT_DEFAULT) {
2779 orient_slot->flag &= ~SELECT;
2780 return;
2781 }
2782 else {
2783 orient_slot->flag |= SELECT;
2784 }
2785 }
2786
2787 BKE_scene_orientation_slot_set_index(orient_slot, value);
2788}
2789
2790static PointerRNA rna_TransformOrientationSlot_get(PointerRNA *ptr)
2791{
2792 Scene *scene = (Scene *)ptr->owner_id;
2793 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2794 TransformOrientation *orientation;
2795 if (orient_slot->type < V3D_ORIENT_CUSTOM) {
2796 orientation = nullptr;
2797 }
2798 else {
2799 orientation = BKE_scene_transform_orientation_find(scene, orient_slot->index_custom);
2800 }
2801 return RNA_pointer_create_with_parent(*ptr, &RNA_TransformOrientation, orientation);
2802}
2803
2804static const EnumPropertyItem *rna_TransformOrientation_impl_itemf(Scene *scene,
2805 const bool include_default,
2806 bool *r_free)
2807{
2808 EnumPropertyItem tmp = {0, "", 0, "", ""};
2809 EnumPropertyItem *item = nullptr;
2810 int i = V3D_ORIENT_CUSTOM, totitem = 0;
2811
2812 if (include_default) {
2813 tmp.identifier = "DEFAULT";
2814 tmp.name = N_("Default");
2815 tmp.description = N_("Use the scene orientation");
2816 tmp.value = V3D_ORIENT_DEFAULT;
2817 tmp.icon = ICON_OBJECT_ORIGIN;
2818 RNA_enum_item_add(&item, &totitem, &tmp);
2819 tmp.icon = 0;
2820
2821 RNA_enum_item_add_separator(&item, &totitem);
2822 }
2823
2825
2826 const ListBase *transform_orientations = scene ? &scene->transform_spaces : nullptr;
2827
2828 if (transform_orientations && (BLI_listbase_is_empty(transform_orientations) == false)) {
2829 RNA_enum_item_add_separator(&item, &totitem);
2830
2831 LISTBASE_FOREACH (TransformOrientation *, ts, transform_orientations) {
2832 tmp.identifier = ts->name;
2833 tmp.name = ts->name;
2834 tmp.value = i++;
2835 RNA_enum_item_add(&item, &totitem, &tmp);
2836 }
2837 }
2838
2839 RNA_enum_item_end(&item, &totitem);
2840 *r_free = true;
2841
2842 return item;
2843}
2845 PointerRNA *ptr,
2846 PropertyRNA * /*prop*/,
2847 bool *r_free)
2848{
2849 if (C == nullptr) {
2851 }
2852
2853 Scene *scene;
2854 if (ptr->owner_id && (GS(ptr->owner_id->name) == ID_SCE)) {
2855 scene = (Scene *)ptr->owner_id;
2856 }
2857 else {
2858 scene = CTX_data_scene(C);
2859 }
2860 return rna_TransformOrientation_impl_itemf(scene, false, r_free);
2861}
2862
2863const EnumPropertyItem *rna_TransformOrientation_with_scene_itemf(bContext *C,
2864 PointerRNA *ptr,
2865 PropertyRNA * /*prop*/,
2866 bool *r_free)
2867{
2868 if (C == nullptr) {
2870 }
2871
2872 Scene *scene = (Scene *)ptr->owner_id;
2873 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2874 bool include_default = (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]);
2875 return rna_TransformOrientation_impl_itemf(scene, include_default, r_free);
2876}
2877
2878# undef V3D_ORIENT_DEFAULT
2879
2880static const EnumPropertyItem *rna_UnitSettings_itemf_wrapper(const int system,
2881 const int type,
2882 bool *r_free)
2883{
2884 const void *usys;
2885 int len;
2886 BKE_unit_system_get(system, type, &usys, &len);
2887
2888 EnumPropertyItem *items = nullptr;
2889 int totitem = 0;
2890
2891 EnumPropertyItem adaptive = {0};
2892 adaptive.identifier = "ADAPTIVE";
2893 adaptive.name = N_("Adaptive");
2894 adaptive.value = USER_UNIT_ADAPTIVE;
2895 RNA_enum_item_add(&items, &totitem, &adaptive);
2896
2897 for (int i = 0; i < len; i++) {
2898 if (!BKE_unit_is_suppressed(usys, i)) {
2899 EnumPropertyItem tmp = {0};
2901 tmp.name = BKE_unit_display_name_get(usys, i);
2902 tmp.value = i;
2903 RNA_enum_item_add(&items, &totitem, &tmp);
2904 }
2905 }
2906
2907 RNA_enum_item_end(&items, &totitem);
2908 *r_free = true;
2909
2910 return items;
2911}
2912
2913const EnumPropertyItem *rna_UnitSettings_length_unit_itemf(bContext * /*C*/,
2914 PointerRNA *ptr,
2915 PropertyRNA * /*prop*/,
2916 bool *r_free)
2917{
2918 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2919 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_LENGTH, r_free);
2920}
2921
2922const EnumPropertyItem *rna_UnitSettings_mass_unit_itemf(bContext * /*C*/,
2923 PointerRNA *ptr,
2924 PropertyRNA * /*prop*/,
2925 bool *r_free)
2926{
2927 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2928 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_MASS, r_free);
2929}
2930
2931const EnumPropertyItem *rna_UnitSettings_time_unit_itemf(bContext * /*C*/,
2932 PointerRNA *ptr,
2933 PropertyRNA * /*prop*/,
2934 bool *r_free)
2935{
2936 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2937 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TIME, r_free);
2938}
2939
2940const EnumPropertyItem *rna_UnitSettings_temperature_unit_itemf(bContext * /*C*/,
2941 PointerRNA *ptr,
2942 PropertyRNA * /*prop*/,
2943 bool *r_free)
2944{
2945 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2946 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TEMPERATURE, r_free);
2947}
2948
2949static void rna_UnitSettings_system_update(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
2950{
2951 UnitSettings *unit = &scene->unit;
2952 if (unit->system == USER_UNIT_NONE) {
2955 }
2956 else {
2959 }
2960}
2961
2962static std::optional<std::string> rna_UnitSettings_path(const PointerRNA * /*ptr*/)
2963{
2964 return "unit_settings";
2965}
2966
2967static std::optional<std::string> rna_FFmpegSettings_path(const PointerRNA * /*ptr*/)
2968{
2969 return "render.ffmpeg";
2970}
2971
2972# ifdef WITH_FFMPEG
2973/* FFMpeg Codec setting update hook. */
2974static void rna_FFmpegSettings_codec_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2975{
2976 FFMpegCodecData *codec_data = (FFMpegCodecData *)ptr->data;
2977 if (!MOV_codec_supports_crf(codec_data->codec_id_get())) {
2978 /* Constant Rate Factor (CRF) setting is only available for some codecs. Change encoder quality
2979 * mode to CBR for others. */
2980 codec_data->constant_rate_factor = FFM_CRF_NONE;
2981 }
2982
2983 /* Ensure valid color depth when changing the codec. */
2984 const ID *id = ptr->owner_id;
2985 const bool is_render = (id && GS(id->name) == ID_SCE);
2986 if (is_render) {
2987 Scene *scene = (Scene *)ptr->owner_id;
2988 const int valid_depths = BKE_imtype_valid_depths_with_video(scene->r.im_format.imtype, id);
2989 if ((scene->r.im_format.depth & valid_depths) == 0) {
2990 scene->r.im_format.depth = BKE_imtype_first_valid_depth(valid_depths);
2991 }
2992 }
2993}
2994# endif
2995
2996#else
2997
2998/* Grease Pencil Interpolation tool settings */
3000{
3001 StructRNA *srna;
3002 PropertyRNA *prop;
3003
3004 srna = RNA_def_struct(brna, "GPencilInterpolateSettings", nullptr);
3005 RNA_def_struct_sdna(srna, "GP_Interpolate_Settings");
3007 "Grease Pencil Interpolate Settings",
3008 "Settings for Grease Pencil interpolation tools");
3010
3011 /* Custom curve-map. */
3012 prop = RNA_def_property(srna, "interpolation_curve", PROP_POINTER, PROP_NONE);
3013 RNA_def_property_pointer_sdna(prop, nullptr, "custom_ipo");
3014 RNA_def_property_struct_type(prop, "CurveMapping");
3016 prop,
3017 "Interpolation Curve",
3018 "Custom curve to control 'sequence' interpolation between Grease Pencil frames");
3019}
3020
3022{
3023 StructRNA *srna;
3024 PropertyRNA *prop;
3025
3026 srna = RNA_def_struct(brna, "TransformOrientation", nullptr);
3027
3028 prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
3029 RNA_def_property_float_sdna(prop, nullptr, "mat");
3032
3033 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
3034 RNA_def_struct_name_property(srna, prop);
3035 RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation");
3037}
3038
3040{
3041 StructRNA *srna;
3042 PropertyRNA *prop;
3043
3044 srna = RNA_def_struct(brna, "TransformOrientationSlot", nullptr);
3045 RNA_def_struct_sdna(srna, "TransformOrientationSlot");
3046 RNA_def_struct_path_func(srna, "rna_TransformOrientationSlot_path");
3047 RNA_def_struct_ui_text(srna, "Orientation Slot", "");
3048
3049 /* Orientations */
3050 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3053 "rna_TransformOrientationSlot_type_get",
3054 "rna_TransformOrientationSlot_type_set",
3055 "rna_TransformOrientation_with_scene_itemf");
3056 RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
3058
3059 prop = RNA_def_property(srna, "custom_orientation", PROP_POINTER, PROP_NONE);
3060 RNA_def_property_struct_type(prop, "TransformOrientation");
3062 prop, "rna_TransformOrientationSlot_get", nullptr, nullptr, nullptr);
3063 RNA_def_property_ui_text(prop, "Current Transform Orientation", "");
3064
3065 /* flag */
3066 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
3067 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SELECT);
3068 RNA_def_property_ui_text(prop, "Use", "Use scene orientation instead of a custom setting");
3070}
3071
3073{
3074 StructRNA *srna;
3075 PropertyRNA *prop;
3076
3077 srna = RNA_def_struct(brna, "View3DCursor", nullptr);
3078 RNA_def_struct_sdna(srna, "View3DCursor");
3079 RNA_def_struct_path_func(srna, "rna_View3DCursor_path");
3080 RNA_def_struct_ui_text(srna, "3D Cursor", "");
3081 RNA_def_struct_ui_icon(srna, ICON_CURSOR);
3083
3084 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ_LENGTH);
3086 RNA_def_property_float_sdna(prop, nullptr, "location");
3087 RNA_def_property_ui_text(prop, "Location", "");
3088 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
3089 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3090
3091 prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
3093 RNA_def_property_float_sdna(prop, nullptr, "rotation_quaternion");
3095 prop, "Quaternion Rotation", "Rotation in quaternions (keep normalized)");
3096 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3097
3098 prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
3100 RNA_def_property_array(prop, 4);
3102 "rna_View3DCursor_rotation_axis_angle_get",
3103 "rna_View3DCursor_rotation_axis_angle_set",
3104 nullptr);
3107 prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
3108 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3109
3110 prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
3112 RNA_def_property_float_sdna(prop, nullptr, "rotation_euler");
3113 RNA_def_property_ui_text(prop, "Euler Rotation", "3D rotation");
3115 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3116
3117 prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
3119 RNA_def_property_enum_sdna(prop, nullptr, "rotation_mode");
3121 RNA_def_property_enum_funcs(prop, nullptr, "rna_View3DCursor_rotation_mode_set", nullptr);
3123 prop,
3124 "Rotation Mode",
3125 /* This description is shared by other "rotation_mode" properties. */
3126 "The kind of rotation to apply, values from other rotation modes aren't used");
3127 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3128
3129 /* Matrix access to avoid having to check current rotation mode. */
3130 prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
3132 RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */
3134 prop, "Transform Matrix", "Matrix combining location and rotation of the cursor");
3136 prop, "rna_View3DCursor_matrix_get", "rna_View3DCursor_matrix_set", nullptr);
3137 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3138}
3139
3141{
3142 StructRNA *srna;
3143 PropertyRNA *prop;
3144
3145 /* the construction of this enum is quite special - everything is stored as bitflags,
3146 * with 1st position only for on/off (and exposed as boolean), while others are mutually
3147 * exclusive options but which will only have any effect when autokey is enabled
3148 */
3149 static const EnumPropertyItem auto_key_items[] = {
3150 {AUTOKEY_MODE_NORMAL & ~AUTOKEY_ON, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
3151 {AUTOKEY_MODE_EDITKEYS & ~AUTOKEY_ON, "REPLACE_KEYS", 0, "Replace", ""},
3152 {0, nullptr, 0, nullptr, nullptr},
3153 };
3154
3155 static const EnumPropertyItem draw_groupuser_items[] = {
3156 {OB_DRAW_GROUPUSER_NONE, "NONE", 0, "None", ""},
3158 "ACTIVE",
3159 0,
3160 "Active",
3161 "Show vertices with no weights in the active group"},
3162 {OB_DRAW_GROUPUSER_ALL, "ALL", 0, "All", "Show vertices with no weights in any group"},
3163 {0, nullptr, 0, nullptr, nullptr},
3164 };
3165
3166 static const EnumPropertyItem vertex_group_select_items[] = {
3167 {WT_VGROUP_ALL, "ALL", 0, "All", "All Vertex Groups"},
3169 "BONE_DEFORM",
3170 0,
3171 "Deform",
3172 "Vertex Groups assigned to Deform Bones"},
3174 "OTHER_DEFORM",
3175 0,
3176 "Other",
3177 "Vertex Groups assigned to non Deform Bones"},
3178 {0, nullptr, 0, nullptr, nullptr},
3179 };
3180
3181 static const EnumPropertyItem gpencil_stroke_placement_items[] = {
3183 "ORIGIN",
3184 ICON_OBJECT_ORIGIN,
3185 "Origin",
3186 "Draw stroke at Object origin"},
3188 "CURSOR",
3189 ICON_PIVOT_CURSOR,
3190 "3D Cursor",
3191 "Draw stroke at 3D cursor location"},
3193 "SURFACE",
3194 ICON_SNAP_FACE,
3195 "Surface",
3196 "Stick stroke to surfaces"},
3198 "STROKE",
3199 ICON_STROKE,
3200 "Stroke",
3201 "Stick stroke to other strokes"},
3202 {0, nullptr, 0, nullptr, nullptr},
3203 };
3204
3205 static const EnumPropertyItem gpencil_stroke_snap_items[] = {
3206 {0, "NONE", 0, "All Points", "Snap to all points"},
3208 "ENDS",
3209 0,
3210 "End Points",
3211 "Snap to first and last points and interpolate"},
3212 {GP_PROJECT_DEPTH_STROKE_FIRST, "FIRST", 0, "First Point", "Snap to first point"},
3213 {0, nullptr, 0, nullptr, nullptr},
3214 };
3215
3216 static const EnumPropertyItem annotation_stroke_placement_view2d_items[] = {
3218 "IMAGE",
3219 ICON_IMAGE_DATA,
3220 "Image",
3221 "Stick stroke to the image"},
3222 /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
3223 {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
3224 {0, nullptr, 0, nullptr, nullptr},
3225 };
3226
3227 static const EnumPropertyItem annotation_stroke_placement_view3d_items[] = {
3229 "CURSOR",
3230 ICON_PIVOT_CURSOR,
3231 "3D Cursor",
3232 "Draw stroke at 3D cursor location"},
3233 /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
3234 {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
3236 "SURFACE",
3237 ICON_FACESEL,
3238 "Surface",
3239 "Stick stroke to surfaces"},
3240 {0, nullptr, 0, nullptr, nullptr},
3241 };
3242
3243 static const EnumPropertyItem uv_sticky_mode_items[] = {
3245 "DISABLED",
3246 ICON_STICKY_UVS_DISABLE,
3247 "Disabled",
3248 "Sticky vertex selection disabled"},
3250 "SHARED_LOCATION",
3251 ICON_STICKY_UVS_LOC,
3252 "Shared Location",
3253 "Select UVs that are at the same location and share a mesh vertex"},
3255 "SHARED_VERTEX",
3256 ICON_STICKY_UVS_VERT,
3257 "Shared Vertex",
3258 "Select UVs that share a mesh vertex, whether or not they are at the same location"},
3259 {0, nullptr, 0, nullptr, nullptr},
3260 };
3261
3262 srna = RNA_def_struct(brna, "ToolSettings", nullptr);
3263 RNA_def_struct_path_func(srna, "rna_ToolSettings_path");
3264 RNA_def_struct_ui_text(srna, "Tool Settings", "");
3265 /*
3266 * `STRUCT_UNDO` only applies to the top level attributes and not nested structs, any struct
3267 * contained within the `ToolSettings` struct should also clear this flag to avoid pushing empty
3268 * undo steps.
3269 */
3271
3272 prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
3273 RNA_def_property_struct_type(prop, "Sculpt");
3274 RNA_def_property_ui_text(prop, "Sculpt", "");
3275
3276 prop = RNA_def_property(srna, "curves_sculpt", PROP_POINTER, PROP_NONE);
3277 RNA_def_property_struct_type(prop, "CurvesSculpt");
3278 RNA_def_property_ui_text(prop, "Curves Sculpt", "");
3279
3280 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
3282 RNA_def_property_boolean_sdna(prop, nullptr, "auto_normalize", 1);
3284 "Weight Paint Auto-Normalize",
3285 "Ensure all bone-deforming vertex groups add up "
3286 "to 1.0 while weight painting or assigning to vertices");
3287 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3288
3289 prop = RNA_def_property(srna, "use_lock_relative", PROP_BOOLEAN, PROP_NONE);
3291 RNA_def_property_boolean_sdna(prop, nullptr, "wpaint_lock_relative", 1);
3293 "Weight Paint Lock-Relative",
3294 "Display bone-deforming groups as if all locked deform groups "
3295 "were deleted, and the remaining ones were re-normalized");
3296 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3297
3298 prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
3300 RNA_def_property_boolean_sdna(prop, nullptr, "multipaint", 1);
3302 "Weight Paint Multi-Paint",
3303 "Paint across the weights of all selected bones, "
3304 "maintaining their relative influence");
3305 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3306
3307 prop = RNA_def_property(srna, "vertex_group_user", PROP_ENUM, PROP_NONE);
3309 RNA_def_property_enum_sdna(prop, nullptr, "weightuser");
3310 RNA_def_property_enum_items(prop, draw_groupuser_items);
3311 RNA_def_property_ui_text(prop, "Mask Non-Group Vertices", "Display unweighted vertices");
3312 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3313
3314 prop = RNA_def_property(srna, "vertex_group_subset", PROP_ENUM, PROP_NONE);
3316 RNA_def_property_enum_sdna(prop, nullptr, "vgroupsubset");
3317 RNA_def_property_enum_items(prop, vertex_group_select_items);
3318 RNA_def_property_ui_text(prop, "Subset", "Filter Vertex groups for Display");
3319 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3320
3321 prop = RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
3322 RNA_def_property_pointer_sdna(prop, nullptr, "vpaint");
3323 RNA_def_property_ui_text(prop, "Vertex Paint", "");
3324
3325 prop = RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
3326 RNA_def_property_pointer_sdna(prop, nullptr, "wpaint");
3327 RNA_def_property_ui_text(prop, "Weight Paint", "");
3328
3329 prop = RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
3330 RNA_def_property_pointer_sdna(prop, nullptr, "imapaint");
3331 RNA_def_property_ui_text(prop, "Image Paint", "");
3332
3333 prop = RNA_def_property(srna, "paint_mode", PROP_POINTER, PROP_NONE);
3334 RNA_def_property_pointer_sdna(prop, nullptr, "paint_mode");
3335 RNA_def_property_ui_text(prop, "Paint Mode", "");
3336
3337 prop = RNA_def_property(srna, "uv_sculpt", PROP_POINTER, PROP_NONE);
3338 RNA_def_property_pointer_sdna(prop, nullptr, "uvsculpt");
3339 RNA_def_property_ui_text(prop, "UV Sculpt", "");
3340
3341 prop = RNA_def_property(srna, "gpencil_paint", PROP_POINTER, PROP_NONE);
3342 RNA_def_property_pointer_sdna(prop, nullptr, "gp_paint");
3343 RNA_def_property_ui_text(prop, "Grease Pencil Paint", "");
3344
3345 prop = RNA_def_property(srna, "gpencil_vertex_paint", PROP_POINTER, PROP_NONE);
3346 RNA_def_property_pointer_sdna(prop, nullptr, "gp_vertexpaint");
3347 RNA_def_property_ui_text(prop, "Grease Pencil Vertex Paint", "");
3348
3349 prop = RNA_def_property(srna, "gpencil_sculpt_paint", PROP_POINTER, PROP_NONE);
3350 RNA_def_property_pointer_sdna(prop, nullptr, "gp_sculptpaint");
3351 RNA_def_property_ui_text(prop, "Grease Pencil Sculpt Paint", "");
3352
3353 prop = RNA_def_property(srna, "gpencil_weight_paint", PROP_POINTER, PROP_NONE);
3354 RNA_def_property_pointer_sdna(prop, nullptr, "gp_weightpaint");
3355 RNA_def_property_ui_text(prop, "Grease Pencil Weight Paint", "");
3356
3357 prop = RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
3358 RNA_def_property_pointer_sdna(prop, nullptr, "particle");
3359 RNA_def_property_ui_text(prop, "Particle Edit", "");
3360
3361 prop = RNA_def_property(srna, "uv_sculpt_lock_borders", PROP_BOOLEAN, PROP_NONE);
3362 RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_LOCK_BORDERS);
3364 RNA_def_property_ui_text(prop, "Lock Borders", "Disable editing of boundary edges");
3365
3366 prop = RNA_def_property(srna, "uv_sculpt_all_islands", PROP_BOOLEAN, PROP_NONE);
3367 RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_ALL_ISLANDS);
3369 RNA_def_property_ui_text(prop, "Sculpt All Islands", "Brush operates on all islands");
3370
3371 prop = RNA_def_property(srna, "lock_object_mode", PROP_BOOLEAN, PROP_NONE);
3372 RNA_def_property_boolean_sdna(prop, nullptr, "object_flag", SCE_OBJECT_MODE_LOCK);
3375 "Lock Object Modes",
3376 "Restrict selection to objects using the same mode as the active "
3377 "object, to prevent accidental mode switch when selecting");
3379
3380 static const EnumPropertyItem workspace_tool_items[] = {
3381 {SCE_WORKSPACE_TOOL_DEFAULT, "DEFAULT", 0, "Active Tool", ""},
3382 {SCE_WORKSPACE_TOOL_FALLBACK, "FALLBACK", 0, "Select", ""},
3383 {0, nullptr, 0, nullptr, nullptr},
3384 };
3385
3386 prop = RNA_def_property(srna, "workspace_tool_type", PROP_ENUM, PROP_NONE);
3387 RNA_def_property_enum_sdna(prop, nullptr, "workspace_tool_type");
3389 RNA_def_property_enum_items(prop, workspace_tool_items);
3391 RNA_def_property_ui_text(prop, "Drag", "Action when dragging in the viewport");
3392
3393 /* Transform */
3394 prop = RNA_def_property(srna, "use_proportional_edit", PROP_BOOLEAN, PROP_NONE);
3395 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_USE);
3397 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional edit mode");
3398 RNA_def_property_ui_icon(prop, ICON_PROP_ON, 0);
3399 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3400
3401 prop = RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
3402 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_objects", 0);
3405 prop, "Proportional Editing Objects", "Proportional editing object mode");
3406 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3407 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3408
3409 prop = RNA_def_property(srna, "use_proportional_projected", PROP_BOOLEAN, PROP_NONE);
3410 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_PROJECTED);
3413 prop, "Projected from View", "Proportional Editing using screen space locations");
3414 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3415
3416 prop = RNA_def_property(srna, "use_proportional_connected", PROP_BOOLEAN, PROP_NONE);
3417 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_CONNECTED);
3420 prop, "Connected Only", "Proportional Editing using connected geometry only");
3421 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3422
3423 prop = RNA_def_property(srna, "use_proportional_edit_mask", PROP_BOOLEAN, PROP_NONE);
3424 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_mask", 0);
3426 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing mask mode");
3427 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3428 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3429
3430 prop = RNA_def_property(srna, "use_proportional_action", PROP_BOOLEAN, PROP_NONE);
3431 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_action", 0);
3434 prop, "Proportional Editing Actions", "Proportional editing in action editor");
3435 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3436 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3437
3438 prop = RNA_def_property(srna, "use_proportional_fcurve", PROP_BOOLEAN, PROP_NONE);
3439 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_fcurve", 0);
3442 prop, "Proportional Editing F-Curves", "Proportional editing in F-Curve editor");
3443 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3444 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3445
3446 prop = RNA_def_property(srna, "lock_markers", PROP_BOOLEAN, PROP_NONE);
3447 RNA_def_property_boolean_sdna(prop, nullptr, "lock_markers", 0);
3449 RNA_def_property_ui_text(prop, "Lock Markers", "Prevent marker editing");
3450
3451 prop = RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
3452 RNA_def_property_enum_sdna(prop, nullptr, "prop_mode");
3456 prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
3457 /* Abusing id_curve :/ */
3459 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3460
3461 prop = RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_NONE);
3462 RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
3465 prop, "Proportional Size", "Display size for proportional editing circle");
3466 RNA_def_property_range(prop, 0.00001, 5000.0);
3467
3468 prop = RNA_def_property(srna, "proportional_distance", PROP_FLOAT, PROP_DISTANCE);
3469 RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
3472 prop, "Proportional Size", "Display size for proportional editing circle");
3473 RNA_def_property_range(prop, 0.00001, 5000.0);
3474
3475 prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE);
3476 RNA_def_property_float_sdna(prop, nullptr, "doublimit");
3478 RNA_def_property_ui_text(prop, "Merge Threshold", "Threshold distance for Auto Merge");
3479 RNA_def_property_range(prop, 0.0, 1.0);
3480 RNA_def_property_ui_range(prop, 0.0, 0.1, 0.01, 6);
3481
3482 /* Pivot Point */
3483 prop = RNA_def_property(srna, "transform_pivot_point", PROP_ENUM, PROP_NONE);
3484 RNA_def_property_enum_sdna(prop, nullptr, "transform_pivot_point");
3487 RNA_def_property_ui_text(prop, "Transform Pivot Point", "Pivot center for rotation/scaling");
3489
3490 prop = RNA_def_property(srna, "use_transform_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
3491 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_AXIS_ALIGN);
3494 prop,
3495 "Only Locations",
3496 "Only transform object locations, without affecting rotation or scaling");
3498
3499 prop = RNA_def_property(srna, "use_transform_data_origin", PROP_BOOLEAN, PROP_NONE);
3500 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_DATA_ORIGIN);
3503 prop, "Transform Origins", "Transform object origins, while leaving the shape in place");
3505
3506 prop = RNA_def_property(srna, "use_transform_skip_children", PROP_BOOLEAN, PROP_NONE);
3507 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_SKIP_CHILDREN);
3510 prop, "Transform Parents", "Transform the parents, leaving the children in place");
3512
3513 prop = RNA_def_property(srna, "use_transform_correct_face_attributes", PROP_BOOLEAN, PROP_NONE);
3514 RNA_def_property_boolean_sdna(prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT);
3517 "Correct Face Attributes",
3518 "Correct data such as UVs and color attributes when transforming");
3520
3521 prop = RNA_def_property(srna, "use_transform_correct_keep_connected", PROP_BOOLEAN, PROP_NONE);
3523 prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED);
3526 prop,
3527 "Keep Connected",
3528 "During the Face Attributes correction, merge attributes connected to the same vertex");
3530
3531 prop = RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
3532 RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE);
3535 prop, "Auto Merge Vertices", "Automatically merge vertices moved to the same location");
3536 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3537 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3538
3539 prop = RNA_def_property(srna, "use_mesh_automerge_and_split", PROP_BOOLEAN, PROP_NONE);
3540 RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE_AND_SPLIT);
3542 RNA_def_property_ui_text(prop, "Split Edges & Faces", "Automatically split edges and faces");
3543 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3544 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3545
3546 prop = RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
3547 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP);
3549 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
3550 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3551 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3552
3553 prop = RNA_def_property(srna, "use_snap_node", PROP_BOOLEAN, PROP_NONE);
3554 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_node", SCE_SNAP);
3556 RNA_def_property_ui_text(prop, "Snap", "Snap Node during transform");
3557 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3558 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3559
3560 prop = RNA_def_property(srna, "use_snap_sequencer", PROP_BOOLEAN, PROP_NONE);
3561 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_seq", SCE_SNAP);
3563 RNA_def_property_ui_text(prop, "Use Snapping", "Snap strips during transform");
3564 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3566 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* Publish message-bus. */
3567
3568 prop = RNA_def_property(srna, "use_snap_uv", PROP_BOOLEAN, PROP_NONE);
3569 RNA_def_property_boolean_sdna(prop, nullptr, "snap_uv_flag", SCE_SNAP);
3571 RNA_def_property_ui_text(prop, "Snap", "Snap UV during transform");
3572 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3573 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3574
3575 prop = RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
3576 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ROTATE);
3579 prop, "Align Rotation to Target", "Align rotation with the snapping target");
3580 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3581
3582 prop = RNA_def_property(srna, "use_snap_grid_absolute", PROP_BOOLEAN, PROP_NONE);
3583 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ABS_GRID);
3586 prop,
3587 "Absolute Increment Snap",
3588 "Absolute grid alignment while translating (based on the pivot center)");
3589 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3590
3591 prop = RNA_def_property(srna, "snap_angle_increment_2d", PROP_FLOAT, PROP_ANGLE);
3592 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_2d");
3594 prop, "Rotation Increment", "Angle used for rotation increments in 2D editors");
3595 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3596 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 100.0f, 2);
3597 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3598
3599 prop = RNA_def_property(srna, "snap_angle_increment_2d_precision", PROP_FLOAT, PROP_ANGLE);
3600 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_2d_precision");
3602 "Rotation Precision Increment",
3603 "Precision angle used for rotation increments in 2D editors");
3604 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3605 RNA_def_property_ui_range(prop, DEG2RADF(0.1f), DEG2RADF(180.0f), 10.0f, 3);
3606 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3607
3608 prop = RNA_def_property(srna, "snap_angle_increment_3d", PROP_FLOAT, PROP_ANGLE);
3609 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_3d");
3611 prop, "Rotation Increment", "Angle used for rotation increments in 3D editors");
3612 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3613 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 100.0f, 2);
3614 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3615
3616 prop = RNA_def_property(srna, "snap_angle_increment_3d_precision", PROP_FLOAT, PROP_ANGLE);
3617 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_3d_precision");
3619 "Rotation Precision Increment",
3620 "Precision angle used for rotation increments in 3D editors");
3621 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3622 RNA_def_property_ui_range(prop, DEG2RADF(0.1f), DEG2RADF(180.0f), 10.0f, 3);
3623 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3624
3625 prop = RNA_def_property(srna, "snap_elements", PROP_ENUM, PROP_NONE);
3626 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3630 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3632 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
3633 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3634
3635 prop = RNA_def_property(srna, "snap_elements_base", PROP_ENUM, PROP_NONE);
3636 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3640 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3643 prop, "Snap Element", "Type of element for the \"Snap Base\" to snap to");
3644 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3645
3646 prop = RNA_def_property(srna, "snap_elements_individual", PROP_ENUM, PROP_NONE);
3647 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3651 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3654 prop, "Project Mode", "Type of element for individual transformed elements to snap to");
3655 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3656
3657 prop = RNA_def_property(srna, "snap_face_nearest_steps", PROP_INT, PROP_FACTOR);
3658 RNA_def_property_int_sdna(prop, nullptr, "snap_face_nearest_steps");
3660 RNA_def_property_range(prop, 1, 100);
3662 prop,
3663 "Face Nearest Steps",
3664 "Number of steps to break transformation into for face nearest snapping");
3665
3666 prop = RNA_def_property(srna, "use_snap_to_same_target", PROP_BOOLEAN, PROP_NONE);
3670 prop,
3671 "Snap to Same Target",
3672 "Snap only to target that source was initially near (\"Face Nearest\" only)");
3673
3674 prop = RNA_def_property(srna, "use_snap_anim", PROP_BOOLEAN, PROP_NONE);
3675 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP);
3677 RNA_def_property_ui_text(prop, "Snap", "Enable snapping when transforming keyframes");
3678 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3679 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3680
3681 prop = RNA_def_property(srna, "use_snap_driver", PROP_BOOLEAN, PROP_NONE);
3682 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_driver", SCE_SNAP);
3685 prop, "Snap", "Enable snapping when transforming keys in the Driver Editor");
3686 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3687 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3688
3689 prop = RNA_def_property(srna, "use_snap_time_absolute", PROP_BOOLEAN, PROP_NONE);
3690 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP_ABS_TIME_STEP);
3693 prop, "Absolute Time Snap", "Absolute time alignment when transforming keyframes");
3694 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3695
3696 prop = RNA_def_property(srna, "use_snap_driver_absolute", PROP_BOOLEAN, PROP_NONE);
3697 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_driver", SCE_SNAP_ABS_TIME_STEP);
3699 RNA_def_property_ui_text(prop, "Absolute Snap", "Snap to full values");
3700 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3701
3702 prop = RNA_def_property(srna, "snap_anim_element", PROP_ENUM, PROP_NONE);
3703 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_anim_mode");
3706 RNA_def_property_ui_text(prop, "Snap Animation Element", "Type of element to snap to");
3708 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3709
3710 prop = RNA_def_property(srna, "use_snap_playhead", PROP_BOOLEAN, PROP_NONE);
3711 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_playhead", SCE_SNAP);
3713 RNA_def_property_ui_text(prop, "Use Snapping", "Snap playhead when scrubbing");
3716
3717 prop = RNA_def_property(srna, "snap_playhead_element", PROP_ENUM, PROP_NONE);
3718 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_playhead_mode");
3722 RNA_def_property_ui_text(prop, "Snap Playhead Element", "Type of element to snap to");
3725
3726 prop = RNA_def_property(srna, "snap_playhead_frame_step", PROP_INT, PROP_NONE);
3727 RNA_def_property_int_sdna(prop, nullptr, "snap_step_frames");
3728 RNA_def_property_range(prop, 1, 32768);
3729 RNA_def_property_ui_text(prop, "Frame Step", "At which interval to snap to frames");
3731
3732 prop = RNA_def_property(srna, "snap_playhead_second_step", PROP_INT, PROP_NONE);
3733 RNA_def_property_int_sdna(prop, nullptr, "snap_step_seconds");
3734 RNA_def_property_ui_text(prop, "Second Step", "At which interval to snap to seconds");
3735 RNA_def_property_range(prop, 1, 32768);
3737
3738 prop = RNA_def_property(srna, "playhead_snap_distance", PROP_INT, PROP_PIXEL);
3739 RNA_def_property_int_sdna(prop, nullptr, "playhead_snap_distance");
3740 RNA_def_property_ui_range(prop, 1, 100, 1, 1);
3741 RNA_def_property_ui_text(prop, "Snap Distance", "Maximum distance for snapping in pixels");
3742
3743 /* image editor uses its own set of snap modes */
3744 prop = RNA_def_property(srna, "snap_uv_element", PROP_ENUM, PROP_NONE);
3745 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_uv_mode");
3747 RNA_def_property_enum_funcs(prop, nullptr, "rna_ToolSettings_snap_uv_mode_set", nullptr);
3749 RNA_def_property_ui_text(prop, "Snap UV Element", "Type of element to snap to");
3750 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3751
3752 /* TODO(@gfxcoder): Rename `snap_target` to `snap_source` to avoid previous ambiguity of "target"
3753 * (now, "source" is geometry to be moved and "target" is geometry to which moved geometry is
3754 * snapped). */
3755 prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
3756 RNA_def_property_enum_sdna(prop, nullptr, "snap_target");
3759 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
3760 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3761
3762 prop = RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
3763 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_PEEL_OBJECT);
3766 prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
3767 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3768
3769 prop = RNA_def_property(srna, "use_snap_backface_culling", PROP_BOOLEAN, PROP_NONE);
3770 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_BACKFACE_CULLING);
3772 RNA_def_property_ui_text(prop, "Backface Culling", "Exclude back facing geometry from snapping");
3773 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3774
3775 /* TODO(@gfxcoder): Rename `use_snap_self` to `use_snap_active`, because active is correct but
3776 * self is not (breaks API). This only makes a difference when more than one mesh is edited. */
3777 prop = RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
3781 prop, "Snap onto Active", "Snap onto itself only if enabled (edit mode only)");
3782 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3783
3784 prop = RNA_def_property(srna, "use_snap_edit", PROP_BOOLEAN, PROP_NONE);
3785 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_TO_INCLUDE_EDITED);
3788 prop, "Snap onto Edited", "Snap onto non-active objects in edit mode (edit mode only)");
3789 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3790
3791 prop = RNA_def_property(srna, "use_snap_nonedit", PROP_BOOLEAN, PROP_NONE);
3795 prop, "Snap onto Non-edited", "Snap onto objects not in edit mode (edit mode only)");
3796 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3797
3798 prop = RNA_def_property(srna, "use_snap_selectable", PROP_BOOLEAN, PROP_NONE);
3802 prop, "Snap onto Selectable Only", "Snap only onto objects that are selectable");
3803 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3804
3805 prop = RNA_def_property(srna, "use_snap_translate", PROP_BOOLEAN, PROP_NONE);
3807 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_TRANSLATE);
3810 prop, "Use Snap for Translation", "Move is affected by snapping settings");
3811 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3812
3813 prop = RNA_def_property(srna, "use_snap_rotate", PROP_BOOLEAN, PROP_NONE);
3815 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_ROTATE);
3819 prop, "Use Snap for Rotation", "Rotate is affected by the snapping settings");
3820 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3821
3822 prop = RNA_def_property(srna, "use_snap_scale", PROP_BOOLEAN, PROP_NONE);
3824 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_SCALE);
3827 RNA_def_property_ui_text(prop, "Use Snap for Scale", "Scale is affected by snapping settings");
3828 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3829
3830 prop = RNA_def_property(srna, "plane_axis", PROP_ENUM, PROP_NONE);
3831 RNA_def_property_enum_sdna(prop, nullptr, "plane_axis");
3835 RNA_def_property_ui_text(prop, "Plane Axis", "The axis used for placing the base region");
3836
3837 prop = RNA_def_property(srna, "plane_axis_auto", PROP_BOOLEAN, PROP_NONE);
3838 RNA_def_property_boolean_sdna(prop, nullptr, "use_plane_axis_auto", 1);
3842 "Auto Axis",
3843 "Select the closest axis when placing objects "
3844 "(surface overrides)");
3845
3846 prop = RNA_def_property(srna, "plane_depth", PROP_ENUM, PROP_NONE);
3847 RNA_def_property_enum_sdna(prop, nullptr, "plane_depth");
3851 RNA_def_property_ui_text(prop, "Position", "The initial depth used when placing the cursor");
3852
3853 prop = RNA_def_property(srna, "plane_orientation", PROP_ENUM, PROP_NONE);
3854 RNA_def_property_enum_sdna(prop, nullptr, "plane_orient");
3858 RNA_def_property_ui_text(prop, "Orientation", "The initial depth used when placing the cursor");
3859
3860 prop = RNA_def_property(srna, "snap_elements_tool", PROP_ENUM, PROP_NONE);
3861 RNA_def_property_enum_sdna(prop, nullptr, "snap_mode_tools");
3865 RNA_def_property_ui_text(prop, "Snap to", "The target to use while snapping");
3866
3867 /* Grease Pencil */
3868 prop = RNA_def_property(srna, "use_gpencil_draw_additive", PROP_BOOLEAN, PROP_NONE);
3869 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_RETAIN_LAST);
3872 "Use Additive Drawing",
3873 "When creating new frames, the strokes from the previous/active frame "
3874 "are included as the basis for the new one");
3876
3877 prop = RNA_def_property(srna, "use_gpencil_draw_onback", PROP_BOOLEAN, PROP_NONE);
3878 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_PAINT_ONBACK);
3881 prop, "Draw Strokes on Back", "New strokes are drawn below of all strokes in the layer");
3883
3884 prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE);
3886 prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_THUMBNAIL_LIST);
3889 prop, "Compact List", "Show compact list of colors instead of thumbnails");
3891
3892 prop = RNA_def_property(srna, "use_gpencil_weight_data_add", PROP_BOOLEAN, PROP_NONE);
3893 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_CREATE_WEIGHTS);
3896 "Add weight data for new strokes",
3897 "Weight data for new strokes is added according to the current vertex "
3898 "group and weight. If no vertex group selected, weight is not added.");
3900
3901 prop = RNA_def_property(srna, "use_gpencil_automerge_strokes", PROP_BOOLEAN, PROP_NONE);
3902 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_AUTOMERGE_STROKE);
3905 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3907 prop,
3908 "Automerge",
3909 "Join the last drawn stroke with previous strokes in the active layer by distance");
3912
3913 prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE);
3914 RNA_def_property_pointer_sdna(prop, nullptr, "gp_sculpt");
3916 RNA_def_property_struct_type(prop, "GPencilSculptSettings");
3918 prop, "Grease Pencil Sculpt", "Settings for stroke sculpting tools and brushes");
3919
3920 prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE);
3921 RNA_def_property_pointer_sdna(prop, nullptr, "gp_interpolate");
3923 RNA_def_property_struct_type(prop, "GPencilInterpolateSettings");
3925 prop, "Grease Pencil Interpolate", "Settings for Grease Pencil interpolation tools");
3926
3927 /* Grease Pencil - 3D View Stroke Placement */
3928 prop = RNA_def_property(srna, "gpencil_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
3929 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
3931 RNA_def_property_enum_items(prop, gpencil_stroke_placement_items);
3932 RNA_def_property_ui_text(prop, "Stroke Placement (3D View)", "");
3933 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3934
3935 prop = RNA_def_property(srna, "gpencil_stroke_snap_mode", PROP_ENUM, PROP_NONE);
3936 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
3938 RNA_def_property_enum_items(prop, gpencil_stroke_snap_items);
3939 RNA_def_property_ui_text(prop, "Stroke Snap", "");
3940 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3941
3942 prop = RNA_def_property(srna, "gpencil_surface_offset", PROP_FLOAT, PROP_DISTANCE);
3943 RNA_def_property_float_sdna(prop, nullptr, "gpencil_surface_offset");
3946 prop, "Surface Offset", "Offset along the normal when drawing on surfaces");
3947 RNA_def_property_range(prop, 0.0f, 1.0f);
3948 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 3);
3949 RNA_def_property_float_default(prop, 0.150f);
3950
3951 prop = RNA_def_property(srna, "use_gpencil_project_only_selected", PROP_BOOLEAN, PROP_NONE);
3953 prop, nullptr, "gpencil_v3d_align", GP_PROJECT_DEPTH_ONLY_SELECTED);
3956 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
3957 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3958
3959 /* Grease Pencil - Select mode Edit */
3960 prop = RNA_def_property(srna, "gpencil_selectmode_edit", PROP_ENUM, PROP_NONE);
3961 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_selectmode_edit");
3964 RNA_def_property_ui_text(prop, "Select Mode", "");
3968
3969 /* Grease Pencil - Select mode Sculpt */
3970 prop = RNA_def_property(srna, "use_gpencil_select_mask_point", PROP_BOOLEAN, PROP_NONE);
3972 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_POINT);
3974 RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points");
3975 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
3978 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_point_update");
3979
3980 prop = RNA_def_property(srna, "use_gpencil_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
3982 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_STROKE);
3984 RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected strokes");
3985 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
3988 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_stroke_update");
3989
3990 prop = RNA_def_property(srna, "use_gpencil_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
3992 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_SEGMENT);
3995 prop, "Selection Mask", "Only sculpt selected stroke points between other strokes");
3996 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
3999 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_segment_update");
4000
4001 /* Grease Pencil - Select mode Vertex Paint */
4002 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_point", PROP_BOOLEAN, PROP_NONE);
4004 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_POINT);
4006 RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected stroke points");
4007 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
4011 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_point_update");
4012
4013 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
4015 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_STROKE);
4017 RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected strokes");
4018 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
4022 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_stroke_update");
4023
4024 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
4026 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_SEGMENT);
4029 prop, "Selection Mask", "Only paint selected stroke points between other strokes");
4030 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
4034 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_segment_update");
4035
4036 prop = RNA_def_property(srna, "use_grease_pencil_multi_frame_editing", PROP_BOOLEAN, PROP_NONE);
4037 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_USE_MULTI_FRAME_EDITING);
4039 RNA_def_property_ui_text(prop, "Multi-frame Editing", "Enable multi-frame editing");
4040 RNA_def_property_ui_icon(prop, ICON_GP_MULTIFRAME_EDITING, 0);
4042 /* FIXME: We shouldn't have to tag all the Grease Pencil IDs for an update! */
4044 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_all_grease_pencil_update");
4045
4046 /* Annotations - 2D Views Stroke Placement */
4047 prop = RNA_def_property(srna, "annotation_stroke_placement_view2d", PROP_ENUM, PROP_NONE);
4048 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v2d_align");
4050 RNA_def_property_enum_items(prop, annotation_stroke_placement_view2d_items);
4051 RNA_def_property_ui_text(prop, "Stroke Placement (2D View)", "");
4052 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4053
4054 /* Annotations - 3D View Stroke Placement */
4055 /* XXX: Do we need to decouple the stroke_endpoints setting too? */
4056 prop = RNA_def_property(srna, "annotation_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
4057 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "annotate_v3d_align");
4059 RNA_def_property_enum_items(prop, annotation_stroke_placement_view3d_items);
4062 "Annotation Stroke Placement (3D View)",
4063 "How annotation strokes are orientated in 3D space");
4064 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4065
4066 prop = RNA_def_property(srna, "use_annotation_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
4068 prop, nullptr, "annotate_v3d_align", GP_PROJECT_DEPTH_STROKE_ENDPOINTS);
4071 prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");
4072 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4073
4074 prop = RNA_def_property(srna, "use_annotation_project_only_selected", PROP_BOOLEAN, PROP_NONE);
4076 prop, nullptr, "annotate_v3d_align", GP_PROJECT_DEPTH_ONLY_SELECTED);
4079 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
4080 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4081
4082 /* Annotations - Stroke Thickness */
4083 prop = RNA_def_property(srna, "annotation_thickness", PROP_INT, PROP_PIXEL);
4084 RNA_def_property_int_sdna(prop, nullptr, "annotate_thickness");
4086 RNA_def_property_range(prop, 1, 10);
4087 RNA_def_property_ui_text(prop, "Annotation Stroke Thickness", "Thickness of annotation strokes");
4088 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
4089
4090 /* Auto Keying */
4091 prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
4092 RNA_def_property_boolean_sdna(prop, nullptr, "autokey_mode", AUTOKEY_ON);
4095 prop, "Auto Keying", "Automatic keyframe insertion for objects, bones and masks");
4096 RNA_def_property_ui_icon(prop, ICON_RECORD_OFF, 1);
4098
4099 prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
4100 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "autokey_mode");
4102 RNA_def_property_enum_items(prop, auto_key_items);
4104 "Auto-Keying Mode",
4105 "Mode of automatic keyframe insertion for objects, bones and masks");
4106
4107 prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
4108 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_LAYERED_RECORD);
4111 prop,
4112 "Layered",
4113 "Add a new NLA Track + Strip for every loop/pass made over the animation "
4114 "to allow non-destructive tweaking");
4115
4116 prop = RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
4117 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
4120 "Auto Keyframe Insert Keying Set",
4121 "Automatic keyframe insertion using active Keying Set only");
4122 RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0);
4123
4124 prop = RNA_def_property(srna, "use_keyframe_cycle_aware", PROP_BOOLEAN, PROP_NONE);
4125 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", KEYING_FLAG_CYCLEAWARE);
4128 prop,
4129 "Cycle-Aware Keying",
4130 "For channels with cyclic extrapolation, keyframe insertion is automatically "
4131 "remapped inside the cycle time range, and keeps ends in sync. Curves newly added to "
4132 "actions with a Manual Frame Range and Cyclic Animation are automatically made cyclic.");
4133
4134 /* Keyframing */
4135 prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE);
4136 RNA_def_property_enum_sdna(prop, nullptr, "keyframe_type");
4140 prop, "New Keyframe Type", "Type of keyframes to create when inserting keyframes");
4142
4143 /* UV */
4144 prop = RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
4145 RNA_def_property_enum_sdna(prop, nullptr, "uv_selectmode");
4148 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
4150 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_select_mode_update");
4151
4152 prop = RNA_def_property(srna, "uv_sticky_select_mode", PROP_ENUM, PROP_NONE);
4153 RNA_def_property_enum_sdna(prop, nullptr, "uv_sticky");
4155 RNA_def_property_enum_items(prop, uv_sticky_mode_items);
4157 prop, "Sticky Selection Mode", "Method for extending UV vertex selection");
4160 prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_sticky_select_mode_update");
4161
4162 prop = RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
4163 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_SYNC_SELECTION);
4166 prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
4167 RNA_def_property_ui_icon(prop, ICON_UV_SYNC_SELECT, 0);
4169
4170 prop = RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
4171 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_SHOW_SAME_IMAGE);
4174 prop, "UV Local View", "Display only faces with the currently displayed image assigned");
4176
4177 /* Mesh */
4178 prop = RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
4179 RNA_def_property_boolean_bitset_array_sdna(prop, nullptr, "selectmode", 1 << 0, 3);
4181 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Scene_editmesh_select_mode_set");
4182 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
4184 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
4185
4186 prop = RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
4187 RNA_def_property_float_sdna(prop, nullptr, "vgroup_weight");
4189 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
4190
4191 prop = RNA_def_property(srna, "use_edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
4192 RNA_def_property_boolean_sdna(prop, nullptr, "edge_mode_live_unwrap", 1);
4194 RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edge seams recalculates UV unwrap");
4195
4196 prop = RNA_def_property(srna, "normal_vector", PROP_FLOAT, PROP_XYZ);
4197 RNA_def_property_ui_text(prop, "Normal Vector", "Normal vector used to copy, add or multiply");
4198 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, 3);
4199
4200 /* Unified Paint Settings */
4201 prop = RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
4203 RNA_def_property_struct_type(prop, "UnifiedPaintSettings");
4204 RNA_def_property_ui_text(prop, "Unified Paint Settings", nullptr);
4205
4206 /* Curve Paint Settings */
4207 prop = RNA_def_property(srna, "curve_paint_settings", PROP_POINTER, PROP_NONE);
4209 RNA_def_property_struct_type(prop, "CurvePaintSettings");
4210 RNA_def_property_ui_text(prop, "Curve Paint Settings", nullptr);
4211
4212 /* Mesh Statistics */
4213 prop = RNA_def_property(srna, "statvis", PROP_POINTER, PROP_NONE);
4215 RNA_def_property_struct_type(prop, "MeshStatVis");
4216 RNA_def_property_ui_text(prop, "Mesh Statistics Visualization", nullptr);
4217
4218 /* CurveProfile */
4219 prop = RNA_def_property(srna, "custom_bevel_profile_preset", PROP_POINTER, PROP_NONE);
4220 RNA_def_property_pointer_sdna(prop, nullptr, "custom_bevel_profile_preset");
4221 RNA_def_property_struct_type(prop, "CurveProfile");
4222 RNA_def_property_ui_text(prop, "Curve Profile Widget", "Used for defining a profile's path");
4223
4224 /* Sequencer tool settings */
4225 prop = RNA_def_property(srna, "sequencer_tool_settings", PROP_POINTER, PROP_NONE);
4227 RNA_def_property_struct_type(prop, "SequencerToolSettings");
4228 RNA_def_property_ui_text(prop, "Sequencer Tool Settings", nullptr);
4229}
4230
4232{
4233 StructRNA *srna;
4234 PropertyRNA *prop;
4235
4236 static const EnumPropertyItem scale_fit_methods[] = {
4237 {SEQ_SCALE_TO_FIT, "FIT", 0, "Scale to Fit", "Scale image to fit within the canvas"},
4238 {SEQ_SCALE_TO_FILL, "FILL", 0, "Scale to Fill", "Scale image to completely fill the canvas"},
4239 {SEQ_STRETCH_TO_FILL, "STRETCH", 0, "Stretch to Fill", "Stretch image to fill the canvas"},
4241 "ORIGINAL",
4242 0,
4243 "Use Original Size",
4244 "Keep image at its original size"},
4245 {0, nullptr, 0, nullptr, nullptr},
4246 };
4247
4248 static const EnumPropertyItem scale_overlap_modes[] = {
4249 {SEQ_OVERLAP_EXPAND, "EXPAND", 0, "Expand", "Move strips so transformed strips fit"},
4251 "OVERWRITE",
4252 0,
4253 "Overwrite",
4254 "Trim or split strips to resolve overlap"},
4256 "SHUFFLE",
4257 0,
4258 "Shuffle",
4259 "Move transformed strips to nearest free space to resolve overlap"},
4260 {0, nullptr, 0, nullptr, nullptr},
4261 };
4262
4263 static const EnumPropertyItem pivot_points[] = {
4264 {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
4265 {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
4266 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
4268 "INDIVIDUAL_ORIGINS",
4269 ICON_PIVOT_INDIVIDUAL,
4270 "Individual Origins",
4271 "Pivot around each selected island's own median point"},
4272 {0, nullptr, 0, nullptr, nullptr},
4273
4274 };
4275 srna = RNA_def_struct(brna, "SequencerToolSettings", nullptr);
4276 RNA_def_struct_path_func(srna, "rna_SequencerToolSettings_path");
4277 RNA_def_struct_ui_text(srna, "Sequencer Tool Settings", "");
4279
4280 /* Add strip settings. */
4281 prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_NONE);
4282 RNA_def_property_enum_items(prop, scale_fit_methods);
4283 RNA_def_property_ui_text(prop, "Fit Method", "Scale fit method");
4284
4285 /* Transform snapping. */
4286 prop = RNA_def_property(srna, "snap_to_current_frame", PROP_BOOLEAN, PROP_NONE);
4287 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_CURRENT_FRAME);
4288 RNA_def_property_ui_text(prop, "Current Frame", "Snap to current frame");
4289 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4290
4291 prop = RNA_def_property(srna, "snap_to_hold_offset", PROP_BOOLEAN, PROP_NONE);
4292 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_STRIP_HOLD);
4293 RNA_def_property_ui_text(prop, "Hold Offset", "Snap to strip hold offsets");
4294 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4295
4296 prop = RNA_def_property(srna, "snap_to_markers", PROP_BOOLEAN, PROP_NONE);
4297 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_MARKERS);
4298 RNA_def_property_ui_text(prop, "Markers", "Snap to markers");
4299 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4300
4301 prop = RNA_def_property(srna, "snap_to_retiming_keys", PROP_BOOLEAN, PROP_NONE);
4302 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_RETIMING);
4303 RNA_def_property_ui_text(prop, "Retiming Keys", "Snap to retiming keys");
4304 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4305
4306 prop = RNA_def_property(srna, "snap_to_frame_range", PROP_BOOLEAN, PROP_NONE);
4307 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_FRAME_RANGE);
4308 RNA_def_property_ui_text(prop, "Frame Range", "Snap to preview or scene start and end frame");
4309 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4310
4311 prop = RNA_def_property(srna, "snap_to_borders", PROP_BOOLEAN, PROP_NONE);
4313 RNA_def_property_ui_text(prop, "Borders", "Snap to preview borders");
4314 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4315
4316 prop = RNA_def_property(srna, "snap_to_center", PROP_BOOLEAN, PROP_NONE);
4317 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_PREVIEW_CENTER);
4318 RNA_def_property_ui_text(prop, "Center", "Snap to preview center");
4319 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4320
4321 prop = RNA_def_property(srna, "snap_to_strips_preview", PROP_BOOLEAN, PROP_NONE);
4322 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_STRIPS_PREVIEW);
4324 prop, "Other Strips", "Snap to borders and origins of deselected, visible strips");
4325 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4326
4327 prop = RNA_def_property(srna, "snap_ignore_muted", PROP_BOOLEAN, PROP_NONE);
4328 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SEQ_SNAP_IGNORE_MUTED);
4329 RNA_def_property_ui_text(prop, "Ignore Muted Strips", "Don't snap to hidden strips");
4330
4331 prop = RNA_def_property(srna, "snap_ignore_sound", PROP_BOOLEAN, PROP_NONE);
4332 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SEQ_SNAP_IGNORE_SOUND);
4333 RNA_def_property_ui_text(prop, "Ignore Sound Strips", "Don't snap to sound strips");
4334
4335 prop = RNA_def_property(srna, "use_snap_current_frame_to_strips", PROP_BOOLEAN, PROP_NONE);
4338 prop, "Snap Current Frame to Strips", "Snap current frame to strip start or end");
4339
4340 prop = RNA_def_property(srna, "snap_distance", PROP_INT, PROP_PIXEL);
4341 RNA_def_property_int_sdna(prop, nullptr, "snap_distance");
4343 RNA_def_property_ui_range(prop, 0, 50, 1, 1);
4344 RNA_def_property_ui_text(prop, "Snapping Distance", "Maximum distance for snapping in pixels");
4345
4346 /* Transform overlap handling. */
4347 prop = RNA_def_property(srna, "overlap_mode", PROP_ENUM, PROP_NONE);
4348 RNA_def_property_enum_items(prop, scale_overlap_modes);
4349 RNA_def_property_ui_text(prop, "Overlap Mode", "How to resolve overlap after transformation");
4350
4351 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
4352 RNA_def_property_enum_items(prop, pivot_points);
4353 RNA_def_property_ui_text(prop, "Pivot Point", "Rotation or scaling pivot point");
4355}
4356
4358{
4359 StructRNA *srna;
4360 PropertyRNA *prop;
4361
4362 static const EnumPropertyItem brush_size_unit_items[] = {
4363 {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
4365 "SCENE",
4366 0,
4367 "Scene",
4368 "Measure brush size relative to the scene"},
4369 {0, nullptr, 0, nullptr, nullptr},
4370 };
4371
4372 srna = RNA_def_struct(brna, "UnifiedPaintSettings", nullptr);
4373 RNA_def_struct_path_func(srna, "rna_UnifiedPaintSettings_path");
4375 srna, "Unified Paint Settings", "Overrides for some of the active brush's settings");
4377
4378 /* high-level flags to enable or disable unified paint settings */
4379 prop = RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE);
4380 RNA_def_property_boolean_sdna(prop, nullptr, "flag", UNIFIED_PAINT_SIZE);
4382 "Use Unified Radius",
4383 "Instead of per-brush radius, the radius is shared across brushes");
4385
4386 prop = RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE);
4387 RNA_def_property_boolean_sdna(prop, nullptr, "flag", UNIFIED_PAINT_ALPHA);
4389 "Use Unified Strength",
4390 "Instead of per-brush strength, the strength is shared across brushes");
4392
4393 prop = RNA_def_property(srna, "use_unified_weight", PROP_BOOLEAN, PROP_NONE);
4396 "Use Unified Weight",
4397 "Instead of per-brush weight, the weight is shared across brushes");
4399
4400 prop = RNA_def_property(srna, "use_unified_color", PROP_BOOLEAN, PROP_NONE);
4401 RNA_def_property_boolean_sdna(prop, nullptr, "flag", UNIFIED_PAINT_COLOR);
4403 prop, "Use Unified Color", "Instead of per-brush color, the color is shared across brushes");
4405
4406 prop = RNA_def_property(srna, "use_unified_input_samples", PROP_BOOLEAN, PROP_NONE);
4409 prop,
4410 "Use Unified Input Samples",
4411 "Instead of per-brush input samples, the value is shared across brushes");
4413
4414 /* unified paint settings that override the equivalent settings
4415 * from the active brush */
4416 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
4417 RNA_def_property_int_funcs(prop, nullptr, "rna_UnifiedPaintSettings_size_set", nullptr);
4421 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush");
4422 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_radius_update");
4423
4424 prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
4426 prop, nullptr, "rna_UnifiedPaintSettings_unprojected_radius_set", nullptr);
4428 RNA_def_property_range(prop, 0.001, FLT_MAX);
4429 RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
4430 RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
4431 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_radius_update");
4432
4433 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
4434 RNA_def_property_float_sdna(prop, nullptr, "alpha");
4436 RNA_def_property_range(prop, 0.0f, 10.0f);
4437 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
4439 prop, "Strength", "How powerful the effect of the brush is when applied");
4440 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4441
4442 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
4443 RNA_def_property_float_sdna(prop, nullptr, "weight");
4445 RNA_def_property_range(prop, 0.0f, 1.0f);
4446 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
4447 RNA_def_property_ui_text(prop, "Weight", "Weight to assign in vertex groups");
4448 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4449
4450 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
4452 RNA_def_property_range(prop, 0.0, 1.0);
4453 RNA_def_property_float_sdna(prop, nullptr, "rgb");
4454 RNA_def_property_ui_text(prop, "Color", "");
4455 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4456
4457 prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR_GAMMA);
4459 RNA_def_property_range(prop, 0.0, 1.0);
4460 RNA_def_property_float_sdna(prop, nullptr, "secondary_rgb");
4461 RNA_def_property_ui_text(prop, "Secondary Color", "");
4462 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4463
4464 prop = RNA_def_property(srna, "use_color_jitter", PROP_BOOLEAN, PROP_NONE);
4467 RNA_def_property_ui_text(prop, "Use Color Jitter", "Jitter brush color");
4468 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4469
4470 prop = RNA_def_property(srna, "hue_jitter", PROP_FLOAT, PROP_NONE);
4472 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[0]");
4473 RNA_def_property_range(prop, 0, 1.0f);
4474 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
4475 RNA_def_property_ui_text(prop, "Hue Jitter", "Color jitter effect on hue");
4476 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4477
4478 prop = RNA_def_property(srna, "saturation_jitter", PROP_FLOAT, PROP_NONE);
4480 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[1]");
4481 RNA_def_property_range(prop, 0, 1.0f);
4482 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
4483 RNA_def_property_ui_text(prop, "Saturation Jitter", "Color jitter effect on saturation");
4484 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4485
4486 prop = RNA_def_property(srna, "value_jitter", PROP_FLOAT, PROP_NONE);
4488 RNA_def_property_float_sdna(prop, nullptr, "hsv_jitter[2]");
4489 RNA_def_property_range(prop, 0, 1.0f);
4490 RNA_def_property_ui_range(prop, 0, 1, 0.05, 2);
4491 RNA_def_property_ui_text(prop, "Value Jitter", "Color jitter effect on value");
4492 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4493
4494 prop = RNA_def_property(srna, "use_stroke_random_hue", PROP_BOOLEAN, PROP_NONE);
4497 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE);
4498 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
4499 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
4500 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4501
4502 prop = RNA_def_property(srna, "use_stroke_random_sat", PROP_BOOLEAN, PROP_NONE);
4505 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE);
4506 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
4507 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
4508 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4509
4510 prop = RNA_def_property(srna, "use_stroke_random_val", PROP_BOOLEAN, PROP_NONE);
4513 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE);
4514 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
4515 RNA_def_property_ui_text(prop, "Stroke Random", "Use randomness at stroke level");
4516 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4517
4518 prop = RNA_def_property(srna, "use_random_press_hue", PROP_BOOLEAN, PROP_NONE);
4521 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS);
4522 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
4523 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
4524 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4525
4526 prop = RNA_def_property(srna, "use_random_press_sat", PROP_BOOLEAN, PROP_NONE);
4529 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS);
4530 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
4531 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
4532 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4533
4534 prop = RNA_def_property(srna, "use_random_press_val", PROP_BOOLEAN, PROP_NONE);
4537 prop, nullptr, "color_jitter_flag", BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS);
4538 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
4539 RNA_def_property_ui_text(prop, "Use Pressure", "Use pressure to modulate randomness");
4540 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4541
4542 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
4543 RNA_def_property_int_sdna(prop, nullptr, "input_samples");
4548 prop,
4549 "Input Samples",
4550 "Number of input samples to average together to smooth the brush stroke");
4551 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4552
4553 prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
4555 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
4556 RNA_def_property_enum_items(prop, brush_size_unit_items);
4558 prop, "Radius Unit", "Measure brush size relative to the view or the scene");
4559 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4560}
4561
4563{
4564 StructRNA *srna;
4565 PropertyRNA *prop;
4566
4567 srna = RNA_def_struct(brna, "CurvePaintSettings", nullptr);
4568 RNA_def_struct_path_func(srna, "rna_CurvePaintSettings_path");
4569 RNA_def_struct_ui_text(srna, "Curve Paint Settings", "");
4571
4572 static const EnumPropertyItem curve_type_items[] = {
4573 {CU_POLY, "POLY", 0, "Poly", ""},
4574 {CU_BEZIER, "BEZIER", 0, "Bézier", ""},
4575 {0, nullptr, 0, nullptr, nullptr},
4576 };
4577
4578 prop = RNA_def_property(srna, "curve_type", PROP_ENUM, PROP_NONE);
4580 RNA_def_property_enum_sdna(prop, nullptr, "curve_type");
4582 RNA_def_property_ui_text(prop, "Type", "Type of curve to use for new strokes");
4583
4584 prop = RNA_def_property(srna, "use_corners_detect", PROP_BOOLEAN, PROP_NONE);
4587 RNA_def_property_ui_text(prop, "Detect Corners", "Detect corners and use non-aligned handles");
4588
4589 prop = RNA_def_property(srna, "use_pressure_radius", PROP_BOOLEAN, PROP_NONE);
4592 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
4593 RNA_def_property_ui_text(prop, "Use Pressure", "Map tablet pressure to curve radius");
4594
4595 prop = RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
4598 RNA_def_property_ui_text(prop, "Only First", "Use the start of the stroke for the depth");
4599
4600 prop = RNA_def_property(srna, "use_offset_absolute", PROP_BOOLEAN, PROP_NONE);
4604 prop, "Absolute Offset", "Apply a fixed offset (don't scale by the radius)");
4605
4606 prop = RNA_def_property(srna, "use_project_only_selected", PROP_BOOLEAN, PROP_NONE);
4610 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
4611
4612 prop = RNA_def_property(srna, "error_threshold", PROP_INT, PROP_PIXEL);
4614 RNA_def_property_range(prop, 1, 100);
4615 RNA_def_property_ui_text(prop, "Tolerance", "Allow deviation for a smoother, less precise line");
4616
4617 prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_PIXEL);
4619 RNA_def_property_enum_sdna(prop, nullptr, "fit_method");
4621 RNA_def_property_ui_text(prop, "Method", "Curve fitting method");
4622
4623 prop = RNA_def_property(srna, "corner_angle", PROP_FLOAT, PROP_ANGLE);
4625 RNA_def_property_range(prop, 0, M_PI);
4626 RNA_def_property_ui_text(prop, "Corner Angle", "Angles above this are considered corners");
4627
4628 prop = RNA_def_property(srna, "radius_min", PROP_FLOAT, PROP_NONE);
4630 RNA_def_property_range(prop, 0.0, 100.0);
4631 RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
4633 prop,
4634 "Radius Min",
4635 "Minimum radius when the minimum pressure is applied (also the minimum when tapering)");
4636
4637 prop = RNA_def_property(srna, "radius_max", PROP_FLOAT, PROP_NONE);
4639 RNA_def_property_range(prop, 0.0, 100.0);
4640 RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
4642 prop,
4643 "Radius Max",
4644 "Radius to use when the maximum pressure is applied (or when a tablet isn't used)");
4645
4646 prop = RNA_def_property(srna, "radius_taper_start", PROP_FLOAT, PROP_NONE);
4648 RNA_def_property_range(prop, 0.0, 1.0);
4649 RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
4651 prop, "Radius Min", "Taper factor for the radius of each point along the curve");
4652
4653 prop = RNA_def_property(srna, "radius_taper_end", PROP_FLOAT, PROP_NONE);
4655 RNA_def_property_range(prop, 0.0, 10.0);
4656 RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
4658 prop, "Radius Max", "Taper factor for the radius of each point along the curve");
4659
4660 prop = RNA_def_property(srna, "surface_offset", PROP_FLOAT, PROP_NONE);
4662 RNA_def_property_range(prop, -10.0, 10.0);
4663 RNA_def_property_ui_range(prop, -1.0f, 1.0, 1, 2);
4664 RNA_def_property_ui_text(prop, "Offset", "Offset the stroke from the surface");
4665
4666 static const EnumPropertyItem depth_mode_items[] = {
4667 {CURVE_PAINT_PROJECT_CURSOR, "CURSOR", 0, "Cursor", ""},
4668 {CURVE_PAINT_PROJECT_SURFACE, "SURFACE", 0, "Surface", ""},
4669 {0, nullptr, 0, nullptr, nullptr},
4670 };
4671
4672 prop = RNA_def_property(srna, "depth_mode", PROP_ENUM, PROP_NONE);
4674 RNA_def_property_enum_sdna(prop, nullptr, "depth_mode");
4675 RNA_def_property_enum_items(prop, depth_mode_items);
4676 RNA_def_property_ui_text(prop, "Depth", "Method of projecting depth");
4677
4678 static const EnumPropertyItem surface_plane_items[] = {
4680 "NORMAL_VIEW",
4681 0,
4682 "Normal to Surface",
4683 "Draw in a plane perpendicular to the surface"},
4685 "NORMAL_SURFACE",
4686 0,
4687 "Tangent to Surface",
4688 "Draw in the surface plane"},
4690 "VIEW",
4691 0,
4692 "View",
4693 "Draw in a plane aligned to the viewport"},
4694 {0, nullptr, 0, nullptr, nullptr},
4695 };
4696
4697 prop = RNA_def_property(srna, "surface_plane", PROP_ENUM, PROP_NONE);
4699 RNA_def_property_enum_sdna(prop, nullptr, "surface_plane");
4700 RNA_def_property_enum_items(prop, surface_plane_items);
4701 RNA_def_property_ui_text(prop, "Plane", "Plane for projected stroke");
4702}
4703
4704static void rna_def_statvis(BlenderRNA *brna)
4705{
4706 StructRNA *srna;
4707 PropertyRNA *prop;
4708
4709 static const EnumPropertyItem stat_type[] = {
4710 {SCE_STATVIS_OVERHANG, "OVERHANG", 0, "Overhang", ""},
4711 {SCE_STATVIS_THICKNESS, "THICKNESS", 0, "Thickness", ""},
4712 {SCE_STATVIS_INTERSECT, "INTERSECT", 0, "Intersect", ""},
4713 {SCE_STATVIS_DISTORT, "DISTORT", 0, "Distortion", ""},
4714 {SCE_STATVIS_SHARP, "SHARP", 0, "Sharp", ""},
4715 {0, nullptr, 0, nullptr, nullptr},
4716 };
4717
4718 srna = RNA_def_struct(brna, "MeshStatVis", nullptr);
4719 RNA_def_struct_path_func(srna, "rna_MeshStatVis_path");
4720 RNA_def_struct_ui_text(srna, "Mesh Visualize Statistics", "");
4722
4723 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4724 RNA_def_property_enum_items(prop, stat_type);
4725 RNA_def_property_ui_text(prop, "Type", "Type of data to visualize/check");
4727 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4728
4729 /* overhang */
4730 prop = RNA_def_property(srna, "overhang_min", PROP_FLOAT, PROP_ANGLE);
4731 RNA_def_property_float_sdna(prop, nullptr, "overhang_min");
4732 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4733 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4734 RNA_def_property_ui_text(prop, "Overhang Min", "Minimum angle to display");
4736 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4737
4738 prop = RNA_def_property(srna, "overhang_max", PROP_FLOAT, PROP_ANGLE);
4739 RNA_def_property_float_sdna(prop, nullptr, "overhang_max");
4740 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4741 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4742 RNA_def_property_ui_text(prop, "Overhang Max", "Maximum angle to display");
4744 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4745
4746 prop = RNA_def_property(srna, "overhang_axis", PROP_ENUM, PROP_NONE);
4747 RNA_def_property_enum_sdna(prop, nullptr, "overhang_axis");
4749 RNA_def_property_ui_text(prop, "Axis", "");
4751 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4752
4753 /* thickness */
4754 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_DISTANCE);
4755 RNA_def_property_float_sdna(prop, nullptr, "thickness_min");
4756 RNA_def_property_range(prop, 0.0f, 1000.0);
4757 RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4758 RNA_def_property_ui_text(prop, "Thickness Min", "Minimum for measuring thickness");
4760 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4761
4762 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_DISTANCE);
4763 RNA_def_property_float_sdna(prop, nullptr, "thickness_max");
4764 RNA_def_property_range(prop, 0.0f, 1000.0);
4765 RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4766 RNA_def_property_ui_text(prop, "Thickness Max", "Maximum for measuring thickness");
4768 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4769
4770 prop = RNA_def_property(srna, "thickness_samples", PROP_INT, PROP_UNSIGNED);
4771 RNA_def_property_int_sdna(prop, nullptr, "thickness_samples");
4772 RNA_def_property_range(prop, 1, 32);
4773 RNA_def_property_ui_text(prop, "Samples", "Number of samples to test per face");
4775 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4776
4777 /* distort */
4778 prop = RNA_def_property(srna, "distort_min", PROP_FLOAT, PROP_ANGLE);
4779 RNA_def_property_float_sdna(prop, nullptr, "distort_min");
4780 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4781 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4782 RNA_def_property_ui_text(prop, "Distort Min", "Minimum angle to display");
4784 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4785
4786 prop = RNA_def_property(srna, "distort_max", PROP_FLOAT, PROP_ANGLE);
4787 RNA_def_property_float_sdna(prop, nullptr, "distort_max");
4788 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4789 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4790 RNA_def_property_ui_text(prop, "Distort Max", "Maximum angle to display");
4792 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4793
4794 /* sharp */
4795 prop = RNA_def_property(srna, "sharp_min", PROP_FLOAT, PROP_ANGLE);
4796 RNA_def_property_float_sdna(prop, nullptr, "sharp_min");
4797 RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
4798 RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
4799 RNA_def_property_ui_text(prop, "Sharpness Min", "Minimum angle to display");
4801 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4802
4803 prop = RNA_def_property(srna, "sharp_max", PROP_FLOAT, PROP_ANGLE);
4804 RNA_def_property_float_sdna(prop, nullptr, "sharp_max");
4805 RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
4806 RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
4807 RNA_def_property_ui_text(prop, "Sharpness Max", "Maximum angle to display");
4809 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4810}
4811
4813{
4814 StructRNA *srna;
4815 PropertyRNA *prop;
4816
4817 static const EnumPropertyItem unit_systems[] = {
4818 {USER_UNIT_NONE, "NONE", 0, "None", ""},
4819 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
4820 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
4821 {0, nullptr, 0, nullptr, nullptr},
4822 };
4823
4824 static const EnumPropertyItem rotation_units[] = {
4825 {0, "DEGREES", 0, "Degrees", "Use degrees for measuring angles and rotations"},
4826 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
4827 {0, nullptr, 0, nullptr, nullptr},
4828 };
4829
4830 srna = RNA_def_struct(brna, "UnitSettings", nullptr);
4831 RNA_def_struct_ui_text(srna, "Unit Settings", "");
4832 RNA_def_struct_nested(brna, srna, "Scene");
4833 RNA_def_struct_path_func(srna, "rna_UnitSettings_path");
4834
4835 /* Units */
4836 prop = RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
4837 RNA_def_property_enum_items(prop, unit_systems);
4839 prop, "Unit System", "The unit system to use for user interface controls");
4840 RNA_def_property_update(prop, NC_WINDOW, "rna_UnitSettings_system_update");
4841
4842 prop = RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
4843 RNA_def_property_enum_items(prop, rotation_units);
4845 prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
4846 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4847
4848 prop = RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
4850 prop,
4851 "Unit Scale",
4852 "Scale to use when converting between Blender units and dimensions."
4853 " When working at microscopic or astronomical scale, a small or large unit scale"
4854 " respectively can be used to avoid numerical precision problems");
4855 RNA_def_property_range(prop, 1e-9f, 1e+9f);
4856 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 6);
4857 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4858
4859 prop = RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
4860 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_UNIT_OPT_SPLIT);
4861 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs (e.g. 1m 0cm)");
4862 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4863
4864 prop = RNA_def_property(srna, "length_unit", PROP_ENUM, PROP_NONE);
4866 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_length_unit_itemf");
4867 RNA_def_property_ui_text(prop, "Length Unit", "Unit that will be used to display length values");
4868 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4869
4870 prop = RNA_def_property(srna, "mass_unit", PROP_ENUM, PROP_NONE);
4872 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_mass_unit_itemf");
4873 RNA_def_property_ui_text(prop, "Mass Unit", "Unit that will be used to display mass values");
4874 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4875
4876 prop = RNA_def_property(srna, "time_unit", PROP_ENUM, PROP_NONE);
4878 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_time_unit_itemf");
4879 RNA_def_property_ui_text(prop, "Time Unit", "Unit that will be used to display time values");
4880 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4881
4882 prop = RNA_def_property(srna, "temperature_unit", PROP_ENUM, PROP_NONE);
4884 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_temperature_unit_itemf");
4886 prop, "Temperature Unit", "Unit that will be used to display temperature values");
4887 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4888}
4889
4891{
4892 StructRNA *srna;
4893 PropertyRNA *prop;
4894 srna = RNA_def_struct(brna, "ViewLayerEEVEE", nullptr);
4895 RNA_def_struct_path_func(srna, "rna_ViewLayerEEVEE_path");
4896 RNA_def_struct_ui_text(srna, "EEVEE Settings", "View Layer settings for EEVEE");
4897
4898 prop = RNA_def_property(srna, "use_pass_volume_direct", PROP_BOOLEAN, PROP_NONE);
4899 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", EEVEE_RENDER_PASS_VOLUME_LIGHT);
4900 RNA_def_property_ui_text(prop, "Volume Light", "Deliver volume direct light pass");
4901 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4902
4903# if 1
4904 /* Bloom is deprecated since Blender 4.2, is kept for add-on compatibility reasons and needs to
4905 * be removed in a future release. */
4906 prop = RNA_def_property(srna, "use_pass_bloom", PROP_BOOLEAN, PROP_NONE);
4907 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", 0 /*EEVEE_RENDER_PASS_BLOOM*/);
4908 RNA_def_property_ui_text(prop, "Bloom", "Deliver bloom pass (deprecated)");
4909 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4910# endif
4911
4912 prop = RNA_def_property(srna, "use_pass_transparent", PROP_BOOLEAN, PROP_NONE);
4913 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", EEVEE_RENDER_PASS_TRANSPARENT);
4915 prop, "Transparent", "Deliver alpha blended surfaces in a separate pass");
4916 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4917}
4918
4920{
4921 StructRNA *srna;
4922 // PropertyRNA *prop;
4923
4924 FunctionRNA *func;
4925 PropertyRNA *parm;
4926
4927 RNA_def_property_srna(cprop, "AOVs");
4928 srna = RNA_def_struct(brna, "AOVs", nullptr);
4929 RNA_def_struct_sdna(srna, "ViewLayer");
4930 RNA_def_struct_ui_text(srna, "List of AOVs", "Collection of AOVs");
4931
4932 func = RNA_def_function(srna, "add", "BKE_view_layer_add_aov");
4933 parm = RNA_def_pointer(func, "aov", "AOV", "", "Newly created AOV");
4934 RNA_def_function_return(func, parm);
4935
4936 /* Defined in `rna_layer.cc`. */
4937 func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove_aov");
4938 parm = RNA_def_pointer(func, "aov", "AOV", "", "AOV to remove");
4939 RNA_def_function_ui_description(func, "Remove an AOV");
4943}
4944
4946{
4947 StructRNA *srna;
4948 PropertyRNA *prop;
4949 srna = RNA_def_struct(brna, "AOV", nullptr);
4950 RNA_def_struct_sdna(srna, "ViewLayerAOV");
4951 RNA_def_struct_ui_text(srna, "Shader AOV", "");
4952
4953 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4954 RNA_def_property_string_sdna(prop, nullptr, "name");
4956 RNA_def_property_ui_text(prop, "Name", "Name of the AOV");
4957 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4958 RNA_def_struct_name_property(srna, prop);
4959
4960 prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
4962 RNA_def_property_ui_text(prop, "Valid", "Is the name of the AOV conflicting");
4963
4964 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4965 RNA_def_property_enum_sdna(prop, nullptr, "type");
4968 RNA_def_property_ui_text(prop, "Type", "Data type of the AOV");
4969 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4970}
4971
4973{
4974 StructRNA *srna;
4975 // PropertyRNA *prop;
4976
4977 FunctionRNA *func;
4978 PropertyRNA *parm;
4979
4980 RNA_def_property_srna(cprop, "Lightgroups");
4981 srna = RNA_def_struct(brna, "Lightgroups", nullptr);
4982 RNA_def_struct_sdna(srna, "ViewLayer");
4983 RNA_def_struct_ui_text(srna, "List of Lightgroups", "Collection of Lightgroups");
4984
4985 func = RNA_def_function(srna, "add", "BKE_view_layer_add_lightgroup");
4986 parm = RNA_def_pointer(func, "lightgroup", "Lightgroup", "", "Newly created Lightgroup");
4987 RNA_def_function_return(func, parm);
4988 parm = RNA_def_string(func, "name", nullptr, 0, "Name", "Name of newly created lightgroup");
4989
4990 func = RNA_def_function(srna, "remove", "BKE_view_layer_remove_lightgroup");
4991 parm = RNA_def_pointer(func, "lightgroup", "Lightgroup", "", "Lightgroup to remove");
4992 RNA_def_function_ui_description(func, "Remove given light group");
4995}
4996
4998{
4999 StructRNA *srna;
5000 PropertyRNA *prop;
5001 srna = RNA_def_struct(brna, "Lightgroup", nullptr);
5002 RNA_def_struct_sdna(srna, "ViewLayerLightgroup");
5003 RNA_def_struct_ui_text(srna, "Light Group", "");
5004
5005 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5008 "rna_ViewLayerLightgroup_name_get",
5009 "rna_ViewLayerLightgroup_name_length",
5010 "rna_ViewLayerLightgroup_name_set");
5011 RNA_def_property_ui_text(prop, "Name", "Name of the Lightgroup");
5012 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5013 RNA_def_struct_name_property(srna, prop);
5014}
5015
5016void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool scene)
5017{
5018 PropertyRNA *prop;
5019
5020 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5021 if (scene) {
5022 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_ViewLayer_name_set");
5023 }
5024 else {
5025 RNA_def_property_string_sdna(prop, nullptr, "name");
5026 }
5027 RNA_def_property_ui_text(prop, "Name", "View layer name");
5028 RNA_def_struct_name_property(srna, prop);
5029 if (scene) {
5031 }
5032 else {
5034 }
5035
5036 if (scene) {
5037 prop = RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
5038 RNA_def_property_pointer_sdna(prop, nullptr, "mat_override");
5039 RNA_def_property_struct_type(prop, "Material");
5043 prop, "Material Override", "Material to override all other materials in this view layer");
5044 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_override_update");
5045
5046 prop = RNA_def_property(srna, "world_override", PROP_POINTER, PROP_NONE);
5047 RNA_def_property_pointer_sdna(prop, nullptr, "world_override");
5048 RNA_def_property_struct_type(prop, "World");
5051 RNA_def_property_ui_text(prop, "World Override", "Override world in this view layer");
5052 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_override_update");
5053
5054 prop = RNA_def_property(srna, "samples", PROP_INT, PROP_UNSIGNED);
5056 "Samples",
5057 "Override number of render samples for this view layer, "
5058 "0 will use the scene setting");
5060
5061 prop = RNA_def_property(srna, "pass_alpha_threshold", PROP_FLOAT, PROP_FACTOR);
5063 prop,
5064 "Alpha Threshold",
5065 "Z, Index, normal, UV and vector passes are only affected by surfaces with "
5066 "alpha transparency equal to or higher than this threshold");
5068
5069 prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
5071 RNA_def_property_struct_type(prop, "ViewLayerEEVEE");
5072 RNA_def_property_ui_text(prop, "EEVEE Settings", "View layer settings for EEVEE");
5073
5074 prop = RNA_def_property(srna, "aovs", PROP_COLLECTION, PROP_NONE);
5075 RNA_def_property_collection_sdna(prop, nullptr, "aovs", nullptr);
5076 RNA_def_property_struct_type(prop, "AOV");
5077 RNA_def_property_ui_text(prop, "Shader AOV", "");
5078 rna_def_view_layer_aovs(brna, prop);
5079
5080 prop = RNA_def_property(srna, "active_aov", PROP_POINTER, PROP_NONE);
5081 RNA_def_property_struct_type(prop, "AOV");
5083 RNA_def_property_ui_text(prop, "Shader AOV", "Active AOV");
5084
5085 prop = RNA_def_property(srna, "active_aov_index", PROP_INT, PROP_UNSIGNED);
5087 "rna_ViewLayer_active_aov_index_get",
5088 "rna_ViewLayer_active_aov_index_set",
5089 "rna_ViewLayer_active_aov_index_range");
5090 RNA_def_property_ui_text(prop, "Active AOV Index", "Index of active AOV");
5092
5093 prop = RNA_def_property(srna, "lightgroups", PROP_COLLECTION, PROP_NONE);
5094 RNA_def_property_collection_sdna(prop, nullptr, "lightgroups", nullptr);
5095 RNA_def_property_struct_type(prop, "Lightgroup");
5096 RNA_def_property_ui_text(prop, "Light Groups", "");
5098
5099 prop = RNA_def_property(srna, "active_lightgroup", PROP_POINTER, PROP_NONE);
5100 RNA_def_property_struct_type(prop, "Lightgroup");
5102 RNA_def_property_ui_text(prop, "Light Groups", "Active Lightgroup");
5103
5104 prop = RNA_def_property(srna, "active_lightgroup_index", PROP_INT, PROP_UNSIGNED);
5106 "rna_ViewLayer_active_lightgroup_index_get",
5107 "rna_ViewLayer_active_lightgroup_index_set",
5108 "rna_ViewLayer_active_lightgroup_index_range");
5109 RNA_def_property_ui_text(prop, "Active Lightgroup Index", "Index of active lightgroup");
5111
5112 prop = RNA_def_property(srna, "use_pass_cryptomatte_object", PROP_BOOLEAN, PROP_NONE);
5114 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_OBJECT);
5116 prop,
5117 "Cryptomatte Object",
5118 "Render cryptomatte object pass, for isolating objects in compositing");
5119 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5120
5121 prop = RNA_def_property(srna, "use_pass_cryptomatte_material", PROP_BOOLEAN, PROP_NONE);
5123 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_MATERIAL);
5125 prop,
5126 "Cryptomatte Material",
5127 "Render cryptomatte material pass, for isolating materials in compositing");
5128 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5129
5130 prop = RNA_def_property(srna, "use_pass_cryptomatte_asset", PROP_BOOLEAN, PROP_NONE);
5131 RNA_def_property_boolean_sdna(prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_ASSET);
5133 prop,
5134 "Cryptomatte Asset",
5135 "Render cryptomatte asset pass, for isolating groups of objects with the same parent");
5136 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5137
5138 prop = RNA_def_property(srna, "pass_cryptomatte_depth", PROP_INT, PROP_NONE);
5139 RNA_def_property_int_sdna(prop, nullptr, "cryptomatte_levels");
5141 RNA_def_property_range(prop, 2.0, 16.0);
5143 prop, "Cryptomatte Levels", "Sets how many unique objects can be distinguished per pixel");
5144 RNA_def_property_ui_range(prop, 2.0, 16.0, 2.0, 0.0);
5145 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5146
5147 prop = RNA_def_property(srna, "use_pass_cryptomatte_accurate", PROP_BOOLEAN, PROP_NONE);
5149 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_ACCURATE);
5152 prop, "Cryptomatte Accurate", "Generate a more accurate cryptomatte pass");
5153 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5154 }
5155
5156 prop = RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
5157 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_SOLID);
5158 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
5159 if (scene) {
5161 }
5162 else {
5164 }
5165 prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
5166 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_SKY);
5167 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
5168 if (scene) {
5169 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
5170 }
5171 else {
5173 }
5174
5175 prop = RNA_def_property(srna, "use_ao", PROP_BOOLEAN, PROP_NONE);
5176 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_AO);
5177 RNA_def_property_ui_text(prop, "Ambient Occlusion", "Render Ambient Occlusion in this Layer");
5178 if (scene) {
5179 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
5180 }
5181 else {
5183 }
5184
5185 prop = RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
5186 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_STRAND);
5187 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
5188 if (scene) {
5190 }
5191 else {
5193 }
5194
5195 prop = RNA_def_property(srna, "use_volumes", PROP_BOOLEAN, PROP_NONE);
5196 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_VOLUMES);
5197 RNA_def_property_ui_text(prop, "Volumes", "Render volumes in this Layer");
5198 if (scene) {
5200 }
5201 else {
5203 }
5204
5205 prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
5206 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_MOTION_BLUR);
5208 prop, "Motion Blur", "Render motion blur in this Layer, if enabled in the scene");
5209 if (scene) {
5211 }
5212 else {
5214 }
5215
5216 prop = RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
5217 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_GREASE_PENCIL);
5218 RNA_def_property_ui_text(prop, "Grease Pencil", "Render Grease Pencil on this layer");
5219 if (scene) {
5221 }
5222 else {
5224 }
5225
5226 /* passes */
5227 prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
5228 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_COMBINED);
5229 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
5230 if (scene) {
5231 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5232 }
5233 else {
5235 }
5236
5237 prop = RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
5238 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_Z);
5239 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
5240 if (scene) {
5241 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5242 }
5243 else {
5245 }
5246
5247 prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
5248 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_VECTOR);
5249 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
5250 if (scene) {
5251 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5252 }
5253 else {
5255 }
5256
5257 prop = RNA_def_property(srna, "use_pass_position", PROP_BOOLEAN, PROP_NONE);
5258 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_POSITION);
5259 RNA_def_property_ui_text(prop, "Position", "Deliver position pass");
5260 if (scene) {
5261 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5262 }
5263 else {
5265 }
5266
5267 prop = RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
5268 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_NORMAL);
5269 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
5270 if (scene) {
5271 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5272 }
5273 else {
5275 }
5276
5277 prop = RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
5278 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_UV);
5279 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
5280 if (scene) {
5281 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5282 }
5283 else {
5285 }
5286
5287 prop = RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
5288 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_MIST);
5289 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0 to 1.0)");
5290 if (scene) {
5291 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5292 }
5293 else {
5295 }
5296
5297 prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
5298 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_INDEXOB);
5299 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
5301 if (scene) {
5302 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5303 }
5304 else {
5306 }
5307
5308 prop = RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
5309 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_INDEXMA);
5310 RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
5311 if (scene) {
5312 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5313 }
5314 else {
5316 }
5317
5318 prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
5319 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_SHADOW);
5320 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
5321 if (scene) {
5322 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5323 }
5324 else {
5326 }
5327
5328 prop = RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
5329 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_AO);
5330 RNA_def_property_ui_text(prop, "Ambient Occlusion", "Deliver Ambient Occlusion pass");
5331 if (scene) {
5332 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5333 }
5334 else {
5336 }
5337
5338 prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
5339 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_EMIT);
5340 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
5341 if (scene) {
5342 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5343 }
5344 else {
5346 }
5347
5348 prop = RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
5349 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_ENVIRONMENT);
5350 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
5351 if (scene) {
5352 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5353 }
5354 else {
5356 }
5357
5358 prop = RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
5359 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_DIRECT);
5360 RNA_def_property_ui_text(prop, "Diffuse Direct", "Deliver diffuse direct pass");
5361 if (scene) {
5362 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5363 }
5364 else {
5366 }
5367
5368 prop = RNA_def_property(srna, "use_pass_diffuse_indirect", PROP_BOOLEAN, PROP_NONE);
5369 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_INDIRECT);
5370 RNA_def_property_ui_text(prop, "Diffuse Indirect", "Deliver diffuse indirect pass");
5371 if (scene) {
5372 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5373 }
5374 else {
5376 }
5377
5378 prop = RNA_def_property(srna, "use_pass_diffuse_color", PROP_BOOLEAN, PROP_NONE);
5379 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_COLOR);
5380 RNA_def_property_ui_text(prop, "Diffuse Color", "Deliver diffuse color pass");
5381 if (scene) {
5382 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5383 }
5384 else {
5386 }
5387
5388 prop = RNA_def_property(srna, "use_pass_glossy_direct", PROP_BOOLEAN, PROP_NONE);
5389 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_DIRECT);
5390 RNA_def_property_ui_text(prop, "Glossy Direct", "Deliver glossy direct pass");
5391 if (scene) {
5392 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5393 }
5394 else {
5396 }
5397
5398 prop = RNA_def_property(srna, "use_pass_glossy_indirect", PROP_BOOLEAN, PROP_NONE);
5399 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_INDIRECT);
5400 RNA_def_property_ui_text(prop, "Glossy Indirect", "Deliver glossy indirect pass");
5401 if (scene) {
5402 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5403 }
5404 else {
5406 }
5407
5408 prop = RNA_def_property(srna, "use_pass_glossy_color", PROP_BOOLEAN, PROP_NONE);
5409 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_COLOR);
5410 RNA_def_property_ui_text(prop, "Glossy Color", "Deliver glossy color pass");
5411 if (scene) {
5412 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5413 }
5414 else {
5416 }
5417
5418 prop = RNA_def_property(srna, "use_pass_transmission_direct", PROP_BOOLEAN, PROP_NONE);
5419 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_DIRECT);
5420 RNA_def_property_ui_text(prop, "Transmission Direct", "Deliver transmission direct pass");
5421 if (scene) {
5422 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5423 }
5424 else {
5426 }
5427
5428 prop = RNA_def_property(srna, "use_pass_transmission_indirect", PROP_BOOLEAN, PROP_NONE);
5429 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_INDIRECT);
5430 RNA_def_property_ui_text(prop, "Transmission Indirect", "Deliver transmission indirect pass");
5431 if (scene) {
5432 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5433 }
5434 else {
5436 }
5437
5438 prop = RNA_def_property(srna, "use_pass_transmission_color", PROP_BOOLEAN, PROP_NONE);
5439 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_COLOR);
5440 RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass");
5441 if (scene) {
5442 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5443 }
5444 else {
5446 }
5447
5448 prop = RNA_def_property(srna, "use_pass_subsurface_direct", PROP_BOOLEAN, PROP_NONE);
5450 RNA_def_property_ui_text(prop, "Subsurface Direct", "Deliver subsurface direct pass");
5451 if (scene) {
5452 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5453 }
5454 else {
5456 }
5457
5458 prop = RNA_def_property(srna, "use_pass_subsurface_indirect", PROP_BOOLEAN, PROP_NONE);
5460 RNA_def_property_ui_text(prop, "Subsurface Indirect", "Deliver subsurface indirect pass");
5461 if (scene) {
5462 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5463 }
5464 else {
5466 }
5467
5468 prop = RNA_def_property(srna, "use_pass_subsurface_color", PROP_BOOLEAN, PROP_NONE);
5469 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_SUBSURFACE_COLOR);
5470 RNA_def_property_ui_text(prop, "Subsurface Color", "Deliver subsurface color pass");
5471 if (scene) {
5472 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5473 }
5474 else {
5476 }
5477}
5478
5480{
5481 StructRNA *srna;
5482 FunctionRNA *func;
5483 PropertyRNA *parm;
5484
5485 RNA_def_property_srna(cprop, "FreestyleModules");
5486 srna = RNA_def_struct(brna, "FreestyleModules", nullptr);
5487 RNA_def_struct_sdna(srna, "FreestyleSettings");
5489 srna, "Style Modules", "A list of style modules (to be applied from top to bottom)");
5490
5491 func = RNA_def_function(srna, "new", "rna_FreestyleSettings_module_add");
5493 "Add a style module to scene render layer Freestyle settings");
5495 parm = RNA_def_pointer(
5496 func, "module", "FreestyleModuleSettings", "", "Newly created style module");
5497 RNA_def_function_return(func, parm);
5498
5499 func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_module_remove");
5501 func, "Remove a style module from scene render layer Freestyle settings");
5503 parm = RNA_def_pointer(func, "module", "FreestyleModuleSettings", "", "Style module to remove");
5506}
5507
5509{
5510 StructRNA *srna;
5511 PropertyRNA *prop;
5512 FunctionRNA *func;
5513 PropertyRNA *parm;
5514
5515 RNA_def_property_srna(cprop, "Linesets");
5516 srna = RNA_def_struct(brna, "Linesets", nullptr);
5517 RNA_def_struct_sdna(srna, "FreestyleSettings");
5519 srna, "Line Sets", "Line sets for associating lines and style parameters");
5520
5521 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
5522 RNA_def_property_struct_type(prop, "FreestyleLineSet");
5524 prop, "rna_FreestyleSettings_active_lineset_get", nullptr, nullptr, nullptr);
5525 RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed");
5527
5528 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
5530 "rna_FreestyleSettings_active_lineset_index_get",
5531 "rna_FreestyleSettings_active_lineset_index_set",
5532 "rna_FreestyleSettings_active_lineset_index_range");
5533 RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
5535
5536 func = RNA_def_function(srna, "new", "rna_FreestyleSettings_lineset_add");
5537 RNA_def_function_ui_description(func, "Add a line set to scene render layer Freestyle settings");
5539 parm = RNA_def_string(func, "name", "LineSet", 0, "", "New name for the line set (not unique)");
5541 parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Newly created line set");
5542 RNA_def_function_return(func, parm);
5543
5544 func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_lineset_remove");
5546 "Remove a line set from scene render layer Freestyle settings");
5548 parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Line set to remove");
5551}
5552
5554{
5555 StructRNA *srna;
5556 PropertyRNA *prop;
5557
5558 static const EnumPropertyItem edge_type_negation_items[] = {
5559 {0,
5560 "INCLUSIVE",
5561 0,
5562 "Inclusive",
5563 "Select feature edges satisfying the given edge type conditions"},
5565 "EXCLUSIVE",
5566 0,
5567 "Exclusive",
5568 "Select feature edges not satisfying the given edge type conditions"},
5569 {0, nullptr, 0, nullptr, nullptr},
5570 };
5571
5572 static const EnumPropertyItem edge_type_combination_items[] = {
5573 {0,
5574 "OR",
5575 0,
5576 "Logical OR",
5577 "Select feature edges satisfying at least one of edge type conditions"},
5579 "AND",
5580 0,
5581 "Logical AND",
5582 "Select feature edges satisfying all edge type conditions"},
5583 {0, nullptr, 0, nullptr, nullptr},
5584 };
5585
5586 static const EnumPropertyItem collection_negation_items[] = {
5587 {0,
5588 "INCLUSIVE",
5589 0,
5590 "Inclusive",
5591 "Select feature edges belonging to some object in the group"},
5593 "EXCLUSIVE",
5594 0,
5595 "Exclusive",
5596 "Select feature edges not belonging to any object in the group"},
5597 {0, nullptr, 0, nullptr, nullptr},
5598 };
5599
5600 static const EnumPropertyItem face_mark_negation_items[] = {
5601 {0,
5602 "INCLUSIVE",
5603 0,
5604 "Inclusive",
5605 "Select feature edges satisfying the given face mark conditions"},
5607 "EXCLUSIVE",
5608 0,
5609 "Exclusive",
5610 "Select feature edges not satisfying the given face mark conditions"},
5611 {0, nullptr, 0, nullptr, nullptr},
5612 };
5613
5614 static const EnumPropertyItem face_mark_condition_items[] = {
5615 {0, "ONE", 0, "One Face", "Select a feature edge if either of its adjacent faces is marked"},
5617 "BOTH",
5618 0,
5619 "Both Faces",
5620 "Select a feature edge if both of its adjacent faces are marked"},
5621 {0, nullptr, 0, nullptr, nullptr},
5622 };
5623
5624 static const EnumPropertyItem freestyle_ui_mode_items[] = {
5626 "SCRIPT",
5627 0,
5628 "Python Scripting",
5629 "Advanced mode for using style modules written in Python"},
5631 "EDITOR",
5632 0,
5633 "Parameter Editor",
5634 "Basic mode for interactive style parameter editing"},
5635 {0, nullptr, 0, nullptr, nullptr},
5636 };
5637
5638 static const EnumPropertyItem visibility_items[] = {
5639 {FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible feature edges"},
5640 {FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden feature edges"},
5642 "RANGE",
5643 0,
5644 "Quantitative Invisibility",
5645 "Select feature edges within a range of quantitative invisibility (QI) values"},
5646 {0, nullptr, 0, nullptr, nullptr},
5647 };
5648
5649 /* FreestyleLineSet */
5650
5651 srna = RNA_def_struct(brna, "FreestyleLineSet", nullptr);
5653 srna, "Freestyle Line Set", "Line set for associating lines and style parameters");
5654
5655 /* access to line style settings is redirected through functions
5656 * to allow proper id-buttons functionality
5657 */
5658 prop = RNA_def_property(srna, "linestyle", PROP_POINTER, PROP_NONE);
5659 RNA_def_property_struct_type(prop, "FreestyleLineStyle");
5662 "rna_FreestyleLineSet_linestyle_get",
5663 "rna_FreestyleLineSet_linestyle_set",
5664 nullptr,
5665 nullptr);
5666 RNA_def_property_ui_text(prop, "Line Style", "Line style settings");
5667 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5668
5669 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5670 RNA_def_property_string_sdna(prop, nullptr, "name");
5671 RNA_def_property_ui_text(prop, "Line Set Name", "Line set name");
5673 RNA_def_struct_name_property(srna, prop);
5674
5675 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
5678 prop, "Render", "Enable or disable this line set during stroke rendering");
5679 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5680
5681 prop = RNA_def_property(srna, "select_by_visibility", PROP_BOOLEAN, PROP_NONE);
5682 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_VISIBILITY);
5684 prop, "Selection by Visibility", "Select feature edges based on visibility");
5685 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5686
5687 prop = RNA_def_property(srna, "select_by_edge_types", PROP_BOOLEAN, PROP_NONE);
5688 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_EDGE_TYPES);
5690 prop, "Selection by Edge Types", "Select feature edges based on edge types");
5691 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5692
5693 prop = RNA_def_property(srna, "select_by_collection", PROP_BOOLEAN, PROP_NONE);
5694 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_GROUP);
5696 prop, "Selection by Collection", "Select feature edges based on a collection of objects");
5697 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5698
5699 prop = RNA_def_property(srna, "select_by_image_border", PROP_BOOLEAN, PROP_NONE);
5700 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_IMAGE_BORDER);
5702 "Selection by Image Border",
5703 "Select feature edges by image border (less memory consumption)");
5704 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5705
5706 prop = RNA_def_property(srna, "select_by_face_marks", PROP_BOOLEAN, PROP_NONE);
5707 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_FACE_MARK);
5708 RNA_def_property_ui_text(prop, "Selection by Face Marks", "Select feature edges by face marks");
5709 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5710
5711 prop = RNA_def_property(srna, "edge_type_negation", PROP_ENUM, PROP_NONE);
5712 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5713 RNA_def_property_enum_items(prop, edge_type_negation_items);
5715 prop,
5716 "Edge Type Negation",
5717 "Specify either inclusion or exclusion of feature edges selected by edge types");
5718 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5719
5720 prop = RNA_def_property(srna, "edge_type_combination", PROP_ENUM, PROP_NONE);
5721 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5722 RNA_def_property_enum_items(prop, edge_type_combination_items);
5724 prop,
5725 "Edge Type Combination",
5726 "Specify a logical combination of selection conditions on feature edge types");
5727 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5728
5729 prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
5730 RNA_def_property_pointer_sdna(prop, nullptr, "group");
5731 RNA_def_property_struct_type(prop, "Collection");
5734 prop, "Collection", "A collection of objects based on which feature edges are selected");
5735 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5736
5737 prop = RNA_def_property(srna, "collection_negation", PROP_ENUM, PROP_NONE);
5738 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5739 RNA_def_property_enum_items(prop, collection_negation_items);
5741 "Collection Negation",
5742 "Specify either inclusion or exclusion of feature edges belonging to a "
5743 "collection of objects");
5744 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5745
5746 prop = RNA_def_property(srna, "face_mark_negation", PROP_ENUM, PROP_NONE);
5747 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5748 RNA_def_property_enum_items(prop, face_mark_negation_items);
5750 prop,
5751 "Face Mark Negation",
5752 "Specify either inclusion or exclusion of feature edges selected by face marks");
5753 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5754
5755 prop = RNA_def_property(srna, "face_mark_condition", PROP_ENUM, PROP_NONE);
5756 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5757 RNA_def_property_enum_items(prop, face_mark_condition_items);
5759 "Face Mark Condition",
5760 "Specify a feature edge selection condition based on face marks");
5761 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5762
5763 prop = RNA_def_property(srna, "select_silhouette", PROP_BOOLEAN, PROP_NONE);
5764 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_SILHOUETTE);
5766 prop,
5767 "Silhouette",
5768 "Select silhouettes (edges at the boundary of visible and hidden faces)");
5769 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5770
5771 prop = RNA_def_property(srna, "select_border", PROP_BOOLEAN, PROP_NONE);
5772 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_BORDER);
5773 RNA_def_property_ui_text(prop, "Border", "Select border edges (open mesh edges)");
5774 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5775
5776 prop = RNA_def_property(srna, "select_crease", PROP_BOOLEAN, PROP_NONE);
5777 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_CREASE);
5779 "Crease",
5780 "Select crease edges (those between two faces making an angle smaller "
5781 "than the Crease Angle)");
5782 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5783
5784 prop = RNA_def_property(srna, "select_ridge_valley", PROP_BOOLEAN, PROP_NONE);
5785 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_RIDGE_VALLEY);
5787 prop,
5788 "Ridge & Valley",
5789 "Select ridges and valleys (boundary lines between convex and concave areas of surface)");
5790 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5791
5792 prop = RNA_def_property(srna, "select_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
5795 prop, "Suggestive Contour", "Select suggestive contours (almost silhouette/contour edges)");
5796 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5797
5798 prop = RNA_def_property(srna, "select_material_boundary", PROP_BOOLEAN, PROP_NONE);
5800 RNA_def_property_ui_text(prop, "Material Boundary", "Select edges at material boundaries");
5801 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5802
5803 prop = RNA_def_property(srna, "select_contour", PROP_BOOLEAN, PROP_NONE);
5804 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_CONTOUR);
5805 RNA_def_property_ui_text(prop, "Contour", "Select contours (outer silhouettes of each object)");
5806 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5807
5808 prop = RNA_def_property(srna, "select_external_contour", PROP_BOOLEAN, PROP_NONE);
5811 prop,
5812 "External Contour",
5813 "Select external contours (outer silhouettes of occluding and occluded objects)");
5814 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5815
5816 prop = RNA_def_property(srna, "select_edge_mark", PROP_BOOLEAN, PROP_NONE);
5817 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_EDGE_MARK);
5819 prop, "Edge Mark", "Select edge marks (edges annotated by Freestyle edge marks)");
5820 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5821
5822 prop = RNA_def_property(srna, "exclude_silhouette", PROP_BOOLEAN, PROP_NONE);
5823 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_SILHOUETTE);
5824 RNA_def_property_ui_text(prop, "Silhouette", "Exclude silhouette edges");
5825 RNA_def_property_ui_icon(prop, ICON_X, 0);
5826 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5827
5828 prop = RNA_def_property(srna, "exclude_border", PROP_BOOLEAN, PROP_NONE);
5829 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_BORDER);
5830 RNA_def_property_ui_text(prop, "Border", "Exclude border edges");
5831 RNA_def_property_ui_icon(prop, ICON_X, 0);
5832 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5833
5834 prop = RNA_def_property(srna, "exclude_crease", PROP_BOOLEAN, PROP_NONE);
5835 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_CREASE);
5836 RNA_def_property_ui_text(prop, "Crease", "Exclude crease edges");
5837 RNA_def_property_ui_icon(prop, ICON_X, 0);
5838 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5839
5840 prop = RNA_def_property(srna, "exclude_ridge_valley", PROP_BOOLEAN, PROP_NONE);
5841 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_RIDGE_VALLEY);
5842 RNA_def_property_ui_text(prop, "Ridge & Valley", "Exclude ridges and valleys");
5843 RNA_def_property_ui_icon(prop, ICON_X, 0);
5844 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5845
5846 prop = RNA_def_property(srna, "exclude_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
5848 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_SUGGESTIVE_CONTOUR);
5849 RNA_def_property_ui_text(prop, "Suggestive Contour", "Exclude suggestive contours");
5850 RNA_def_property_ui_icon(prop, ICON_X, 0);
5851 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5852
5853 prop = RNA_def_property(srna, "exclude_material_boundary", PROP_BOOLEAN, PROP_NONE);
5855 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_MATERIAL_BOUNDARY);
5856 RNA_def_property_ui_text(prop, "Material Boundary", "Exclude edges at material boundaries");
5857 RNA_def_property_ui_icon(prop, ICON_X, 0);
5858 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5859
5860 prop = RNA_def_property(srna, "exclude_contour", PROP_BOOLEAN, PROP_NONE);
5861 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_CONTOUR);
5862 RNA_def_property_ui_text(prop, "Contour", "Exclude contours");
5863 RNA_def_property_ui_icon(prop, ICON_X, 0);
5864 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5865
5866 prop = RNA_def_property(srna, "exclude_external_contour", PROP_BOOLEAN, PROP_NONE);
5868 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_EXTERNAL_CONTOUR);
5869 RNA_def_property_ui_text(prop, "External Contour", "Exclude external contours");
5870 RNA_def_property_ui_icon(prop, ICON_X, 0);
5871 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5872
5873 prop = RNA_def_property(srna, "exclude_edge_mark", PROP_BOOLEAN, PROP_NONE);
5874 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_EDGE_MARK);
5875 RNA_def_property_ui_text(prop, "Edge Mark", "Exclude edge marks");
5876 RNA_def_property_ui_icon(prop, ICON_X, 0);
5877 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5878
5879 prop = RNA_def_property(srna, "visibility", PROP_ENUM, PROP_NONE);
5880 RNA_def_property_enum_sdna(prop, nullptr, "qi");
5881 RNA_def_property_enum_items(prop, visibility_items);
5883 prop, "Visibility", "Determine how to use visibility for feature edge selection");
5884 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5885
5886 prop = RNA_def_property(srna, "qi_start", PROP_INT, PROP_UNSIGNED);
5887 RNA_def_property_int_sdna(prop, nullptr, "qi_start");
5888 RNA_def_property_range(prop, 0, INT_MAX);
5889 RNA_def_property_ui_text(prop, "Start", "First QI value of the QI range");
5890 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5891
5892 prop = RNA_def_property(srna, "qi_end", PROP_INT, PROP_UNSIGNED);
5893 RNA_def_property_int_sdna(prop, nullptr, "qi_end");
5894 RNA_def_property_range(prop, 0, INT_MAX);
5895 RNA_def_property_ui_text(prop, "End", "Last QI value of the QI range");
5896 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5897
5898 /* FreestyleModuleSettings */
5899
5900 srna = RNA_def_struct(brna, "FreestyleModuleSettings", nullptr);
5901 RNA_def_struct_sdna(srna, "FreestyleModuleConfig");
5903 srna, "Freestyle Module", "Style module configuration for specifying a style module");
5904
5905 prop = RNA_def_property(srna, "script", PROP_POINTER, PROP_NONE);
5906 RNA_def_property_struct_type(prop, "Text");
5908 RNA_def_property_ui_text(prop, "Style Module", "Python script to define a style module");
5909 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5910
5911 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
5912 RNA_def_property_boolean_sdna(prop, nullptr, "is_displayed", 1);
5914 prop, "Use", "Enable or disable this style module during stroke rendering");
5915 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5916
5917 /* FreestyleSettings */
5918
5919 srna = RNA_def_struct(brna, "FreestyleSettings", nullptr);
5920 RNA_def_struct_sdna(srna, "FreestyleConfig");
5921 RNA_def_struct_nested(brna, srna, "ViewLayer");
5923 srna, "Freestyle Settings", "Freestyle settings for a ViewLayer data-block");
5924
5925 prop = RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
5926 RNA_def_property_collection_sdna(prop, nullptr, "modules", nullptr);
5927 RNA_def_property_struct_type(prop, "FreestyleModuleSettings");
5929 prop, "Style Modules", "A list of style modules (to be applied from top to bottom)");
5930 rna_def_freestyle_modules(brna, prop);
5931
5932 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
5933 RNA_def_property_enum_sdna(prop, nullptr, "mode");
5934 RNA_def_property_enum_items(prop, freestyle_ui_mode_items);
5935 RNA_def_property_ui_text(prop, "Control Mode", "Select the Freestyle control mode");
5936 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5937
5938 prop = RNA_def_property(srna, "use_culling", PROP_BOOLEAN, PROP_NONE);
5939 RNA_def_property_boolean_sdna(prop, nullptr, "flags", FREESTYLE_CULLING);
5940 RNA_def_property_ui_text(prop, "Culling", "If enabled, out-of-view edges are ignored");
5941 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5942
5943 prop = RNA_def_property(srna, "use_suggestive_contours", PROP_BOOLEAN, PROP_NONE);
5945 RNA_def_property_ui_text(prop, "Suggestive Contours", "Enable suggestive contours");
5946 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5947
5948 prop = RNA_def_property(srna, "use_ridges_and_valleys", PROP_BOOLEAN, PROP_NONE);
5950 RNA_def_property_ui_text(prop, "Ridges and Valleys", "Enable ridges and valleys");
5951 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5952
5953 prop = RNA_def_property(srna, "use_material_boundaries", PROP_BOOLEAN, PROP_NONE);
5955 RNA_def_property_ui_text(prop, "Material Boundaries", "Enable material boundaries");
5956 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5957
5958 prop = RNA_def_property(srna, "use_smoothness", PROP_BOOLEAN, PROP_NONE);
5961 prop, "Face Smoothness", "Take face smoothness into account in view map calculation");
5962 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5963
5964 prop = RNA_def_property(srna, "use_view_map_cache", PROP_BOOLEAN, PROP_NONE);
5967 prop,
5968 "View Map Cache",
5969 "Keep the computed view map and avoid recalculating it if mesh geometry is unchanged");
5971 prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_view_map_cache_update");
5972
5973 prop = RNA_def_property(srna, "as_render_pass", PROP_BOOLEAN, PROP_NONE);
5976 prop,
5977 "As Render Pass",
5978 "Renders Freestyle output to a separate pass instead of overlaying it on the Combined pass");
5979 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5980
5981 prop = RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
5982 RNA_def_property_float_sdna(prop, nullptr, "sphere_radius");
5984 RNA_def_property_range(prop, 0.0, 1000.0);
5985 RNA_def_property_ui_text(prop, "Sphere Radius", "Sphere radius for computing curvatures");
5986 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5987
5988 prop = RNA_def_property(srna, "kr_derivative_epsilon", PROP_FLOAT, PROP_NONE);
5990 RNA_def_property_float_sdna(prop, nullptr, "dkr_epsilon");
5991 RNA_def_property_range(prop, -1000.0, 1000.0);
5993 prop, "Kr Derivative Epsilon", "Kr derivative epsilon for computing suggestive contours");
5994 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5995
5996 prop = RNA_def_property(srna, "crease_angle", PROP_FLOAT, PROP_ANGLE);
5997 RNA_def_property_float_sdna(prop, nullptr, "crease_angle");
5998 RNA_def_property_range(prop, 0.0, DEG2RAD(180.0));
5999 RNA_def_property_ui_text(prop, "Crease Angle", "Angular threshold for detecting crease edges");
6000 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
6001
6002 prop = RNA_def_property(srna, "linesets", PROP_COLLECTION, PROP_NONE);
6003 RNA_def_property_collection_sdna(prop, nullptr, "linesets", nullptr);
6004 RNA_def_property_struct_type(prop, "FreestyleLineSet");
6005 RNA_def_property_ui_text(prop, "Line Sets", "");
6006 rna_def_freestyle_linesets(brna, prop);
6007}
6008
6010{
6011 StructRNA *srna;
6012 PropertyRNA *prop;
6013
6014 srna = RNA_def_struct(brna, "BakeSettings", nullptr);
6015 RNA_def_struct_sdna(srna, "BakeData");
6016 RNA_def_struct_nested(brna, srna, "RenderSettings");
6017 RNA_def_struct_ui_text(srna, "Bake Data", "Bake data for a Scene data-block");
6018 RNA_def_struct_path_func(srna, "rna_BakeSettings_path");
6019
6020 prop = RNA_def_property(srna, "cage_object", PROP_POINTER, PROP_NONE);
6022 prop,
6023 "Cage Object",
6024 "Object to use as cage "
6025 "instead of calculating the cage from the active object with cage extrusion");
6028
6029 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
6030 RNA_def_property_ui_text(prop, "File Path", "Image filepath to use when saving externally");
6033
6034 prop = RNA_def_property(srna, "width", PROP_INT, PROP_PIXEL);
6035 RNA_def_property_range(prop, 4, 10000);
6036 RNA_def_property_ui_text(prop, "Width", "Horizontal dimension of the baking map");
6038
6039 prop = RNA_def_property(srna, "height", PROP_INT, PROP_PIXEL);
6040 RNA_def_property_range(prop, 4, 10000);
6041 RNA_def_property_ui_text(prop, "Height", "Vertical dimension of the baking map");
6043
6044 prop = RNA_def_property(srna, "margin", PROP_INT, PROP_PIXEL);
6045 RNA_def_property_range(prop, 0, SHRT_MAX);
6046 RNA_def_property_ui_range(prop, 0, 64, 1, 1);
6047 RNA_def_property_ui_text(prop, "Margin", "Extends the baked result as a post process filter");
6049
6050 prop = RNA_def_property(srna, "margin_type", PROP_ENUM, PROP_NONE);
6052 RNA_def_property_ui_text(prop, "Margin Type", "Algorithm to extend the baked result");
6054
6055 prop = RNA_def_property(srna, "max_ray_distance", PROP_FLOAT, PROP_DISTANCE);
6056 RNA_def_property_range(prop, 0.0, FLT_MAX);
6057 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
6059 "Max Ray Distance",
6060 "The maximum ray distance for matching points between the active and "
6061 "selected objects. If zero, there is no limit.");
6063
6064 prop = RNA_def_property(srna, "cage_extrusion", PROP_FLOAT, PROP_DISTANCE);
6065 RNA_def_property_range(prop, 0.0, FLT_MAX);
6066 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
6068 prop,
6069 "Cage Extrusion",
6070 "Inflate the active object by the specified distance for baking. This helps matching to "
6071 "points nearer to the outside of the selected object meshes.");
6073
6074 prop = RNA_def_property(srna, "normal_space", PROP_ENUM, PROP_NONE);
6075 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_space");
6077 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
6079
6080 prop = RNA_def_property(srna, "normal_r", PROP_ENUM, PROP_NONE);
6081 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[0]");
6083 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in red channel");
6085
6086 prop = RNA_def_property(srna, "normal_g", PROP_ENUM, PROP_NONE);
6087 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[1]");
6089 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in green channel");
6091
6092 prop = RNA_def_property(srna, "normal_b", PROP_ENUM, PROP_NONE);
6093 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[2]");
6095 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in blue channel");
6097
6098 prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
6100 RNA_def_property_pointer_sdna(prop, nullptr, "im_format");
6101 RNA_def_property_struct_type(prop, "ImageFormatSettings");
6102 RNA_def_property_ui_text(prop, "Image Format", "");
6103
6104 prop = RNA_def_property(srna, "target", PROP_ENUM, PROP_NONE);
6106 RNA_def_property_ui_text(prop, "Target", "Where to output the baked map");
6108
6109 prop = RNA_def_property(srna, "save_mode", PROP_ENUM, PROP_NONE);
6110 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "save_mode");
6112 RNA_def_property_ui_text(prop, "Save Mode", "Where to save baked image textures");
6114
6115 prop = RNA_def_property(srna, "view_from", PROP_ENUM, PROP_NONE);
6117 RNA_def_property_ui_text(prop, "View From", "Source of reflection ray directions");
6119
6120 /* flags */
6121 prop = RNA_def_property(srna, "use_selected_to_active", PROP_BOOLEAN, PROP_NONE);
6122 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_TO_ACTIVE);
6124 "Selected to Active",
6125 "Bake shading on the surface of selected objects to the active object");
6127
6128 prop = RNA_def_property(srna, "use_clear", PROP_BOOLEAN, PROP_NONE);
6129 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_CLEAR);
6130 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking (internal only)");
6132
6133 prop = RNA_def_property(srna, "use_split_materials", PROP_BOOLEAN, PROP_NONE);
6134 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_SPLIT_MAT);
6136 prop, "Split Materials", "Split external images per material (external only)");
6138
6139 prop = RNA_def_property(srna, "use_automatic_name", PROP_BOOLEAN, PROP_NONE);
6140 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_AUTO_NAME);
6142 prop,
6143 "Automatic Name",
6144 "Automatically name the output file with the pass type (external only)");
6146
6147 prop = RNA_def_property(srna, "use_cage", PROP_BOOLEAN, PROP_NONE);
6148 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_CAGE);
6149 RNA_def_property_ui_text(prop, "Cage", "Cast rays to active object from a cage");
6151
6152 /* custom passes flags */
6153 prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
6154 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_EMIT);
6155 RNA_def_property_ui_text(prop, "Emit", "Add emission contribution");
6156
6157 prop = RNA_def_property(srna, "use_pass_direct", PROP_BOOLEAN, PROP_NONE);
6158 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_DIRECT);
6159 RNA_def_property_ui_text(prop, "Direct", "Add direct lighting contribution");
6161
6162 prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
6163 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_INDIRECT);
6164 RNA_def_property_ui_text(prop, "Indirect", "Add indirect lighting contribution");
6166
6167 prop = RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
6168 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_COLOR);
6169 RNA_def_property_ui_text(prop, "Color", "Color the pass");
6171
6172 prop = RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
6173 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_DIFFUSE);
6174 RNA_def_property_ui_text(prop, "Diffuse", "Add diffuse contribution");
6176
6177 prop = RNA_def_property(srna, "use_pass_glossy", PROP_BOOLEAN, PROP_NONE);
6178 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_GLOSSY);
6179 RNA_def_property_ui_text(prop, "Glossy", "Add glossy contribution");
6181
6182 prop = RNA_def_property(srna, "use_pass_transmission", PROP_BOOLEAN, PROP_NONE);
6183 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_TRANSM);
6184 RNA_def_property_ui_text(prop, "Transmission", "Add transmission contribution");
6186
6187 prop = RNA_def_property(srna, "pass_filter", PROP_ENUM, PROP_NONE);
6188 RNA_def_property_enum_sdna(prop, nullptr, "pass_filter");
6191 RNA_def_property_ui_text(prop, "Pass Filter", "Passes to include in the active baking pass");
6193}
6194
6196{
6197 StructRNA *srna;
6198 FunctionRNA *func;
6199 PropertyRNA *parm;
6200
6201 RNA_def_property_srna(cprop, "ViewLayers");
6202 srna = RNA_def_struct(brna, "ViewLayers", nullptr);
6203 RNA_def_struct_sdna(srna, "Scene");
6204 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
6205
6206 func = RNA_def_function(srna, "new", "rna_ViewLayer_new");
6207 RNA_def_function_ui_description(func, "Add a view layer to scene");
6209 parm = RNA_def_string(
6210 func, "name", "ViewLayer", 0, "", "New name for the view layer (not unique)");
6212 parm = RNA_def_pointer(func, "result", "ViewLayer", "", "Newly created view layer");
6213 RNA_def_function_return(func, parm);
6214
6215 func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove");
6216 RNA_def_function_ui_description(func, "Remove a view layer");
6218 parm = RNA_def_pointer(func, "layer", "ViewLayer", "", "View layer to remove");
6221
6222 func = RNA_def_function(srna, "move", "rna_ViewLayer_move");
6223 RNA_def_function_ui_description(func, "Move a view layer");
6225 parm = RNA_def_int(
6226 func, "from_index", -1, INT_MIN, INT_MAX, "From Index", "Index to move", 0, 10000);
6228 parm = RNA_def_int(func, "to_index", -1, INT_MIN, INT_MAX, "To Index", "Target index", 0, 10000);
6230}
6231
6232/* Render Views - MultiView */
6234{
6235 StructRNA *srna;
6236 PropertyRNA *prop;
6237
6238 srna = RNA_def_struct(brna, "SceneRenderView", nullptr);
6240 srna, "Scene Render View", "Render viewpoint for 3D stereo and multiview rendering");
6241 RNA_def_struct_ui_icon(srna, ICON_RESTRICT_RENDER_OFF);
6242 RNA_def_struct_path_func(srna, "rna_SceneRenderView_path");
6243
6244 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
6245 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_SceneRenderView_name_set");
6246 RNA_def_property_ui_text(prop, "Name", "Render view name");
6247 RNA_def_struct_name_property(srna, prop);
6249
6250 prop = RNA_def_property(srna, "file_suffix", PROP_STRING, PROP_NONE);
6251 RNA_def_property_string_sdna(prop, nullptr, "suffix");
6252 RNA_def_property_ui_text(prop, "File Suffix", "Suffix added to the render images for this view");
6254
6255 prop = RNA_def_property(srna, "camera_suffix", PROP_STRING, PROP_NONE);
6256 RNA_def_property_string_sdna(prop, nullptr, "suffix");
6258 prop,
6259 "Camera Suffix",
6260 "Suffix to identify the cameras to use, and added to the render images for this view");
6262
6263 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
6264 RNA_def_property_boolean_negative_sdna(prop, nullptr, "viewflag", SCE_VIEW_DISABLE);
6266 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render view");
6268 prop, NC_SCENE | ND_RENDER_OPTIONS | NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
6269}
6270
6272{
6273 StructRNA *srna;
6274 PropertyRNA *prop;
6275
6276 FunctionRNA *func;
6277 PropertyRNA *parm;
6278
6279 RNA_def_property_srna(cprop, "RenderViews");
6280 srna = RNA_def_struct(brna, "RenderViews", nullptr);
6281 RNA_def_struct_sdna(srna, "RenderData");
6282 RNA_def_struct_ui_text(srna, "Render Views", "Collection of render views");
6283
6284 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
6285 RNA_def_property_int_sdna(prop, nullptr, "actview");
6287 "rna_RenderSettings_active_view_index_get",
6288 "rna_RenderSettings_active_view_index_set",
6289 "rna_RenderSettings_active_view_index_range");
6290 RNA_def_property_ui_text(prop, "Active View Index", "Active index in render view array");
6292
6293 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
6294 RNA_def_property_struct_type(prop, "SceneRenderView");
6296 "rna_RenderSettings_active_view_get",
6297 "rna_RenderSettings_active_view_set",
6298 nullptr,
6299 nullptr);
6301 RNA_def_property_ui_text(prop, "Active Render View", "Active Render View");
6303
6304 func = RNA_def_function(srna, "new", "rna_RenderView_new");
6305 RNA_def_function_ui_description(func, "Add a render view to scene");
6307 parm = RNA_def_string(func, "name", "RenderView", 0, "", "New name for the marker (not unique)");
6309 parm = RNA_def_pointer(func, "result", "SceneRenderView", "", "Newly created render view");
6310 RNA_def_function_return(func, parm);
6311
6312 func = RNA_def_function(srna, "remove", "rna_RenderView_remove");
6313 RNA_def_function_ui_description(func, "Remove a render view");
6315 parm = RNA_def_pointer(func, "view", "SceneRenderView", "", "Render view to remove");
6318}
6319
6321{
6322 StructRNA *srna;
6323 PropertyRNA *prop;
6324
6325 /* rna_enum_stereo3d_display_items, without (S3D_DISPLAY_PAGEFLIP) */
6326 static const EnumPropertyItem stereo3d_display_items[] = {
6328 "ANAGLYPH",
6329 0,
6330 "Anaglyph",
6331 "Render views for left and right eyes as two differently filtered colors in a single image "
6332 "(anaglyph glasses are required)"},
6334 "INTERLACE",
6335 0,
6336 "Interlace",
6337 "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
6338 "required)"},
6340 "SIDEBYSIDE",
6341 0,
6342 "Side-by-Side",
6343 "Render views for left and right eyes side-by-side"},
6345 "TOPBOTTOM",
6346 0,
6347 "Top-Bottom",
6348 "Render views for left and right eyes one above another"},
6349 {0, nullptr, 0, nullptr, nullptr},
6350 };
6351
6352 srna = RNA_def_struct(brna, "Stereo3dFormat", nullptr);
6353 RNA_def_struct_sdna(srna, "Stereo3dFormat");
6354 RNA_def_struct_ui_text(srna, "Stereo Output", "Settings for stereo output");
6355
6356 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
6357 RNA_def_property_enum_sdna(prop, nullptr, "display_mode");
6358 RNA_def_property_enum_items(prop, stereo3d_display_items);
6359 RNA_def_property_ui_text(prop, "Stereo Mode", "");
6360 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6361
6362 prop = RNA_def_property(srna, "anaglyph_type", PROP_ENUM, PROP_NONE);
6364 RNA_def_property_ui_text(prop, "Anaglyph Type", "");
6365 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6366
6367 prop = RNA_def_property(srna, "interlace_type", PROP_ENUM, PROP_NONE);
6369 RNA_def_property_ui_text(prop, "Interlace Type", "");
6370 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6371
6372 prop = RNA_def_property(srna, "use_interlace_swap", PROP_BOOLEAN, PROP_BOOLEAN);
6373 RNA_def_property_boolean_sdna(prop, nullptr, "flag", S3D_INTERLACE_SWAP);
6374 RNA_def_property_ui_text(prop, "Swap Left/Right", "Swap left and right stereo channels");
6375 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6376
6377 prop = RNA_def_property(srna, "use_sidebyside_crosseyed", PROP_BOOLEAN, PROP_BOOLEAN);
6379 RNA_def_property_ui_text(prop, "Cross-Eyed", "Right eye should see left image and vice versa");
6380 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6381
6382 prop = RNA_def_property(srna, "use_squeezed_frame", PROP_BOOLEAN, PROP_BOOLEAN);
6383 RNA_def_property_boolean_sdna(prop, nullptr, "flag", S3D_SQUEEZED_FRAME);
6384 RNA_def_property_ui_text(prop, "Squeezed Frame", "Combine both views in a squeezed image");
6385 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6386}
6387
6388/* use for render output and image save operator,
6389 * NOTE: there are some cases where the members act differently when this is
6390 * used from a scene, video formats can only be selected for render output
6391 * for example, this is checked by seeing if the ptr->owner_id is a Scene id */
6392
6394{
6395
6396# ifdef WITH_IMAGE_OPENJPEG
6397 static const EnumPropertyItem jp2_codec_items[] = {
6398 {R_IMF_JP2_CODEC_JP2, "JP2", 0, "JP2", ""},
6399 {R_IMF_JP2_CODEC_J2K, "J2K", 0, "J2K", ""},
6400 {0, nullptr, 0, nullptr, nullptr},
6401 };
6402# endif
6403
6404 static const EnumPropertyItem tiff_codec_items[] = {
6405 {R_IMF_TIFF_CODEC_NONE, "NONE", 0, "None", ""},
6406 {R_IMF_TIFF_CODEC_DEFLATE, "DEFLATE", 0, "Deflate", ""},
6407 {R_IMF_TIFF_CODEC_LZW, "LZW", 0, "LZW", ""},
6408 {R_IMF_TIFF_CODEC_PACKBITS, "PACKBITS", 0, "Pack Bits", ""},
6409 {0, nullptr, 0, nullptr, nullptr},
6410 };
6411
6412 static const EnumPropertyItem color_management_items[] = {
6413 {R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE, "FOLLOW_SCENE", 0, "Follow Scene", ""},
6414 {R_IMF_COLOR_MANAGEMENT_OVERRIDE, "OVERRIDE", 0, "Override", ""},
6415 {0, nullptr, 0, nullptr, nullptr},
6416 };
6417
6418 StructRNA *srna;
6419 PropertyRNA *prop;
6420
6422
6423 srna = RNA_def_struct(brna, "ImageFormatSettings", nullptr);
6424 RNA_def_struct_sdna(srna, "ImageFormatData");
6425 RNA_def_struct_nested(brna, srna, "Scene");
6426 RNA_def_struct_path_func(srna, "rna_ImageFormatSettings_path");
6427 RNA_def_struct_ui_text(srna, "Image Format", "Settings for image formats");
6428
6429 prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
6430 RNA_def_property_enum_sdna(prop, nullptr, "imtype");
6433 nullptr,
6434 "rna_ImageFormatSettings_file_format_set",
6435 "rna_ImageFormatSettings_file_format_itemf");
6436 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
6438
6439 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
6440 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "planes");
6442 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_color_mode_itemf");
6444 prop,
6445 "Color Mode",
6446 "Choose BW for saving grayscale images, RGB for saving red, green and blue channels, "
6447 "and RGBA for saving red, green, blue and alpha channels");
6449
6450 prop = RNA_def_property(srna, "color_depth", PROP_ENUM, PROP_NONE);
6451 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "depth");
6453 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_color_depth_itemf");
6454 RNA_def_property_ui_text(prop, "Color Depth", "Bit depth per channel");
6456
6457 /* was 'file_quality' */
6458 prop = RNA_def_property(srna, "quality", PROP_INT, PROP_PERCENTAGE);
6459 RNA_def_property_int_sdna(prop, nullptr, "quality");
6460 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
6462 prop, "Quality", "Quality for image formats that support lossy compression");
6464
6465 /* was shared with file_quality */
6466 prop = RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE);
6467 RNA_def_property_int_sdna(prop, nullptr, "compress");
6468 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
6470 "Compression",
6471 "Amount of time to determine best compression: "
6472 "0 = no compression with fast file output, "
6473 "100 = maximum lossless compression with slow file output");
6475
6476 prop = RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE);
6479 prop, "Preview", "When rendering animations, save JPG preview images in same directory");
6481
6482 /* format specific */
6483
6484# ifdef WITH_IMAGE_OPENEXR
6485 /* OpenEXR */
6486
6487 prop = RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
6488 RNA_def_property_enum_sdna(prop, nullptr, "exr_codec");
6489 RNA_def_property_enum_items(prop, rna_enum_exr_codec_items);
6490 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_exr_codec_itemf");
6491 RNA_def_property_ui_text(prop, "Codec", "Compression codec settings for OpenEXR");
6493# endif
6494
6495# ifdef WITH_IMAGE_OPENJPEG
6496 /* JPEG 2000 */
6497 prop = RNA_def_property(srna, "use_jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
6498 RNA_def_property_boolean_sdna(prop, nullptr, "jp2_flag", R_IMF_JP2_FLAG_YCC);
6500 prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
6502
6503 prop = RNA_def_property(srna, "use_jpeg2k_cinema_preset", PROP_BOOLEAN, PROP_NONE);
6505 RNA_def_property_ui_text(prop, "Cinema", "Use OpenJPEG Cinema Preset");
6507
6508 prop = RNA_def_property(srna, "use_jpeg2k_cinema_48", PROP_BOOLEAN, PROP_NONE);
6509 RNA_def_property_boolean_sdna(prop, nullptr, "jp2_flag", R_IMF_JP2_FLAG_CINE_48);
6510 RNA_def_property_ui_text(prop, "Cinema (48)", "Use OpenJPEG Cinema Preset (48fps)");
6512
6513 prop = RNA_def_property(srna, "jpeg2k_codec", PROP_ENUM, PROP_NONE);
6514 RNA_def_property_enum_sdna(prop, nullptr, "jp2_codec");
6515 RNA_def_property_enum_items(prop, jp2_codec_items);
6516 RNA_def_property_ui_text(prop, "Codec", "Codec settings for JPEG 2000");
6518# endif
6519
6520 /* TIFF */
6521 prop = RNA_def_property(srna, "tiff_codec", PROP_ENUM, PROP_NONE);
6522 RNA_def_property_enum_sdna(prop, nullptr, "tiff_codec");
6523 RNA_def_property_enum_items(prop, tiff_codec_items);
6524 RNA_def_property_ui_text(prop, "Compression", "Compression mode for TIFF");
6526
6527 /* Cineon and DPX */
6528
6529 prop = RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
6530 RNA_def_property_boolean_sdna(prop, nullptr, "cineon_flag", R_IMF_CINEON_FLAG_LOG);
6531 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
6533
6534 prop = RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
6535 RNA_def_property_int_sdna(prop, nullptr, "cineon_black");
6536 RNA_def_property_range(prop, 0, 1024);
6537 RNA_def_property_ui_text(prop, "Black", "Log conversion reference blackpoint");
6539
6540 prop = RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
6541 RNA_def_property_int_sdna(prop, nullptr, "cineon_white");
6542 RNA_def_property_range(prop, 0, 1024);
6543 RNA_def_property_ui_text(prop, "White", "Log conversion reference whitepoint");
6545
6546 prop = RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
6547 RNA_def_property_float_sdna(prop, nullptr, "cineon_gamma");
6548 RNA_def_property_range(prop, 0.0f, 10.0f);
6549 RNA_def_property_ui_text(prop, "Gamma", "Log conversion gamma");
6551
6552 /* multiview */
6553 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
6554 RNA_def_property_enum_sdna(prop, nullptr, "views_format");
6557 prop, nullptr, nullptr, "rna_ImageFormatSettings_views_format_itemf");
6558 RNA_def_property_ui_text(prop, "Views Format", "Format of multiview media");
6560
6561 prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
6562 RNA_def_property_pointer_sdna(prop, nullptr, "stereo3d_format");
6564 RNA_def_property_struct_type(prop, "Stereo3dFormat");
6565 RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3D");
6566
6567 /* color management */
6568 prop = RNA_def_property(srna, "color_management", PROP_ENUM, PROP_NONE);
6569 RNA_def_property_enum_items(prop, color_management_items);
6571 prop, "Color Management", "Which color management settings to use for file saving");
6573 prop, nullptr, "rna_ImageFormatSettings_color_management_set", nullptr);
6575
6576 prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
6577 RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
6579 prop, "View Settings", "Color management settings applied on image before saving");
6580
6581 prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
6582 RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
6584 prop, "Display Settings", "Settings of device saved image would be displayed on");
6585
6586 prop = RNA_def_property(srna, "linear_colorspace_settings", PROP_POINTER, PROP_NONE);
6587 RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
6588 RNA_def_property_ui_text(prop, "Color Space Settings", "Output color space settings");
6589
6590 prop = RNA_def_property(srna, "has_linear_colorspace", PROP_BOOLEAN, PROP_NONE);
6592 prop, "rna_ImageFormatSettings_has_linear_colorspace_get", nullptr);
6595 prop, "Has Linear Color Space", "File format expects linear color space");
6596}
6597
6599{
6600 StructRNA *srna;
6601 PropertyRNA *prop;
6602
6603# ifdef WITH_FFMPEG
6604 /* Container types */
6605 static const EnumPropertyItem ffmpeg_format_items[] = {
6606 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
6607 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
6608 {FFMPEG_WEBM, "WEBM", 0, "WebM", ""},
6609 /* Legacy containers. */
6611 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
6612 {FFMPEG_DV, "DV", 0, "DV", ""},
6613 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
6614 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
6615 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
6616 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
6617 {FFMPEG_MOV, "QUICKTIME", 0, "QuickTime", ""},
6618 {0, nullptr, 0, nullptr, nullptr},
6619 };
6620
6621 static const EnumPropertyItem ffmpeg_codec_items[] = {
6623 "NONE",
6624 0,
6625 "No Video",
6626 "Disables video output, for audio-only renders"},
6627 {FFMPEG_CODEC_ID_AV1, "AV1", 0, "AV1", ""},
6628 {FFMPEG_CODEC_ID_H264, "H264", 0, "H.264", ""},
6629 {FFMPEG_CODEC_ID_H265, "H265", 0, "H.265 / HEVC", ""},
6630 {FFMPEG_CODEC_ID_VP9, "WEBM", 0, "WebM / VP9", ""},
6631 /* Legacy / rare codecs. */
6633 {FFMPEG_CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""},
6634 {FFMPEG_CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
6635 {FFMPEG_CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
6636 {FFMPEG_CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
6637 {FFMPEG_CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
6638 {FFMPEG_CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
6639 {FFMPEG_CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
6640 {FFMPEG_CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4 (divx)", ""},
6641 {FFMPEG_CODEC_ID_PNG, "PNG", 0, "PNG", ""},
6642 {FFMPEG_CODEC_ID_PRORES, "PRORES", 0, "ProRes", ""},
6643 {FFMPEG_CODEC_ID_QTRLE, "QTRLE", 0, "QuickTime Animation", ""},
6644 {FFMPEG_CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
6645 {0, nullptr, 0, nullptr, nullptr},
6646 };
6647
6648 /* Recommendations come from the FFmpeg wiki, https://trac.ffmpeg.org/wiki/Encode/VP9.
6649 * The label for BEST has been changed to "Slowest" so that it fits the "Encoding Speed"
6650 * property label in the UI. */
6651 static const EnumPropertyItem ffmpeg_preset_items[] = {
6653 "BEST",
6654 0,
6655 "Slowest",
6656 "Recommended if you have lots of time and want the best compression efficiency"},
6657 {FFM_PRESET_GOOD, "GOOD", 0, "Good", "The default and recommended for most applications"},
6658 {FFM_PRESET_REALTIME, "REALTIME", 0, "Realtime", "Recommended for fast encoding"},
6659 {0, nullptr, 0, nullptr, nullptr},
6660 };
6661
6662 static const EnumPropertyItem ffmpeg_prores_profiles_items[] = {
6663 {FFM_PRORES_PROFILE_422_PROXY, "422_PROXY", 0, "ProRes 422 Proxy", ""},
6664 {FFM_PRORES_PROFILE_422_LT, "422_LT", 0, "ProRes 422 LT", ""},
6665 {FFM_PRORES_PROFILE_422_STD, "422_STD", 0, "ProRes 422", ""},
6666 {FFM_PRORES_PROFILE_422_HQ, "422_HQ", 0, "ProRes 422 HQ", ""},
6667 {FFM_PRORES_PROFILE_4444, "4444", 0, "ProRes 4444", ""},
6668 {FFM_PRORES_PROFILE_4444_XQ, "4444_XQ", 0, "ProRes 4444 XQ", ""},
6669 {0, nullptr, 0, nullptr, nullptr},
6670 };
6671
6672 static const EnumPropertyItem ffmpeg_crf_items[] = {
6673 {FFM_CRF_NONE,
6674 "NONE",
6675 0,
6676 "Constant Bitrate",
6677 "Configure constant bit rate, rather than constant output quality"},
6678 {FFM_CRF_LOSSLESS, "LOSSLESS", 0, "Lossless", ""},
6679 {FFM_CRF_PERC_LOSSLESS, "PERC_LOSSLESS", 0, "Perceptually Lossless", ""},
6680 {FFM_CRF_HIGH, "HIGH", 0, "High Quality", ""},
6681 {FFM_CRF_MEDIUM, "MEDIUM", 0, "Medium Quality", ""},
6682 {FFM_CRF_LOW, "LOW", 0, "Low Quality", ""},
6683 {FFM_CRF_VERYLOW, "VERYLOW", 0, "Very Low Quality", ""},
6684 {FFM_CRF_LOWEST, "LOWEST", 0, "Lowest Quality", ""},
6685 {0, nullptr, 0, nullptr, nullptr},
6686 };
6687
6688 static const EnumPropertyItem ffmpeg_audio_codec_items[] = {
6690 "NONE",
6691 0,
6692 "No Audio",
6693 "Disables audio output, for video-only renders"},
6694 {FFMPEG_CODEC_ID_AAC, "AAC", 0, "AAC", ""},
6695 {FFMPEG_CODEC_ID_AC3, "AC3", 0, "AC3", ""},
6696 {FFMPEG_CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
6697 {FFMPEG_CODEC_ID_MP2, "MP2", 0, "MP2", ""},
6698 {FFMPEG_CODEC_ID_MP3, "MP3", 0, "MP3", ""},
6699 {FFMPEG_CODEC_ID_OPUS, "OPUS", 0, "Opus", ""},
6700 {FFMPEG_CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
6701 {FFMPEG_CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
6702 {0, nullptr, 0, nullptr, nullptr},
6703 };
6704# endif
6705
6706 static const EnumPropertyItem audio_channel_items[] = {
6707 {FFM_CHANNELS_MONO, "MONO", 0, "Mono", "Set audio channels to mono"},
6708 {FFM_CHANNELS_STEREO, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
6709 {FFM_CHANNELS_SURROUND4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
6711 "SURROUND51",
6712 0,
6713 "5.1 Surround",
6714 "Set audio channels to 5.1 surround sound"},
6716 "SURROUND71",
6717 0,
6718 "7.1 Surround",
6719 "Set audio channels to 7.1 surround sound"},
6720 {0, nullptr, 0, nullptr, nullptr},
6721 };
6722
6723 srna = RNA_def_struct(brna, "FFmpegSettings", nullptr);
6724 RNA_def_struct_sdna(srna, "FFMpegCodecData");
6725 RNA_def_struct_path_func(srna, "rna_FFmpegSettings_path");
6726 RNA_def_struct_ui_text(srna, "FFmpeg Settings", "FFmpeg related settings for the scene");
6727
6728# ifdef WITH_FFMPEG
6729 prop = RNA_def_property(srna, "format", PROP_ENUM, PROP_NONE);
6730 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "type");
6732 RNA_def_property_enum_items(prop, ffmpeg_format_items);
6734 RNA_def_property_ui_text(prop, "Container", "Output file container");
6735
6736 prop = RNA_def_property(srna, "codec", PROP_ENUM, PROP_NONE);
6737 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "codec");
6739 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
6741 RNA_def_property_ui_text(prop, "Video Codec", "FFmpeg codec to use for video output");
6742 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_FFmpegSettings_codec_update");
6743
6744 prop = RNA_def_property(srna, "video_bitrate", PROP_INT, PROP_NONE);
6745 RNA_def_property_int_sdna(prop, nullptr, "video_bitrate");
6747 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kbit/s)");
6749
6750 prop = RNA_def_property(srna, "minrate", PROP_INT, PROP_NONE);
6751 RNA_def_property_int_sdna(prop, nullptr, "rc_min_rate");
6753 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kbit/s)");
6755
6756 prop = RNA_def_property(srna, "maxrate", PROP_INT, PROP_NONE);
6757 RNA_def_property_int_sdna(prop, nullptr, "rc_max_rate");
6759 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kbit/s)");
6761
6762 prop = RNA_def_property(srna, "muxrate", PROP_INT, PROP_NONE);
6763 RNA_def_property_int_sdna(prop, nullptr, "mux_rate");
6765 RNA_def_property_range(prop, 0, 100000000);
6766 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/second)");
6768
6769 prop = RNA_def_property(srna, "gopsize", PROP_INT, PROP_NONE);
6770 RNA_def_property_int_sdna(prop, nullptr, "gop_size");
6772 RNA_def_property_range(prop, 0, 500);
6775 "Keyframe Interval",
6776 "Distance between key frames, also known as GOP size; "
6777 "influences file size and seekability");
6779
6780 prop = RNA_def_property(srna, "max_b_frames", PROP_INT, PROP_NONE);
6781 RNA_def_property_int_sdna(prop, nullptr, "max_b_frames");
6783 RNA_def_property_range(prop, 0, 16);
6785 prop,
6786 "Max B-Frames",
6787 "Maximum number of B-frames between non-B-frames; influences file size and seekability");
6789
6790 prop = RNA_def_property(srna, "use_max_b_frames", PROP_BOOLEAN, PROP_NONE);
6793 RNA_def_property_ui_text(prop, "Use Max B-Frames", "Set a maximum number of B-frames");
6795
6796 prop = RNA_def_property(srna, "buffersize", PROP_INT, PROP_NONE);
6797 RNA_def_property_int_sdna(prop, nullptr, "rc_buffer_size");
6799 RNA_def_property_range(prop, 0, 2000);
6800 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
6802
6803 prop = RNA_def_property(srna, "packetsize", PROP_INT, PROP_NONE);
6804 RNA_def_property_int_sdna(prop, nullptr, "mux_packet_size");
6806 RNA_def_property_range(prop, 0, 16384);
6807 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
6809
6810 prop = RNA_def_property(srna, "constant_rate_factor", PROP_ENUM, PROP_NONE);
6811 RNA_def_property_enum_sdna(prop, nullptr, "constant_rate_factor");
6813 RNA_def_property_enum_items(prop, ffmpeg_crf_items);
6816 prop,
6817 "Output Quality",
6818 "Constant Rate Factor (CRF); tradeoff between video quality and file size");
6820
6821 prop = RNA_def_property(srna, "ffmpeg_preset", PROP_ENUM, PROP_NONE);
6822 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "ffmpeg_preset");
6824 RNA_def_property_enum_items(prop, ffmpeg_preset_items);
6827 prop, "Encoding Speed", "Tradeoff between encoding speed and compression ratio");
6829
6830 prop = RNA_def_property(srna, "ffmpeg_prores_profile", PROP_ENUM, PROP_NONE);
6831 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "ffmpeg_prores_profile");
6833 RNA_def_property_enum_items(prop, ffmpeg_prores_profiles_items);
6835 RNA_def_property_ui_text(prop, "Profile", "ProRes Profile");
6837
6838 prop = RNA_def_property(srna, "use_autosplit", PROP_BOOLEAN, PROP_NONE);
6841 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
6843
6844 prop = RNA_def_property(srna, "use_lossless_output", PROP_BOOLEAN, PROP_NONE);
6847 RNA_def_property_boolean_funcs(prop, nullptr, "rna_FFmpegSettings_lossless_output_set");
6848 RNA_def_property_ui_text(prop, "Lossless Output", "Use lossless output for video streams");
6850
6851 /* FFMPEG Audio. */
6852 prop = RNA_def_property(srna, "audio_codec", PROP_ENUM, PROP_NONE);
6853 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "audio_codec");
6855 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
6856 RNA_def_property_ui_text(prop, "Audio Codec", "FFmpeg audio codec to use");
6858
6859 prop = RNA_def_property(srna, "audio_bitrate", PROP_INT, PROP_NONE);
6860 RNA_def_property_int_sdna(prop, nullptr, "audio_bitrate");
6862 RNA_def_property_range(prop, 32, 384);
6863 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)");
6865
6866 prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
6867 RNA_def_property_float_sdna(prop, nullptr, "audio_volume");
6869 RNA_def_property_range(prop, 0.0f, 1.0f);
6870 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
6873# endif
6874
6875 /* the following two "ffmpeg" settings are general audio settings */
6876 prop = RNA_def_property(srna, "audio_mixrate", PROP_INT, PROP_NONE);
6877 RNA_def_property_int_sdna(prop, nullptr, "audio_mixrate");
6879 RNA_def_property_range(prop, 8000, 192000);
6880 RNA_def_property_ui_text(prop, "Sample Rate", "Audio sample rate (samples/s)");
6882
6883 prop = RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
6884 RNA_def_property_enum_sdna(prop, nullptr, "audio_channels");
6886 RNA_def_property_enum_items(prop, audio_channel_items);
6887 RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
6888}
6889
6891{
6892 StructRNA *srna;
6893 PropertyRNA *prop;
6894
6895 /* Bake */
6896 static const EnumPropertyItem bake_mode_items[] = {
6897 //{RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
6898 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"},
6899 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"},
6900 {0, nullptr, 0, nullptr, nullptr},
6901 };
6902
6903 static const EnumPropertyItem bake_margin_type_items[] = {
6905 "ADJACENT_FACES",
6906 0,
6907 "Adjacent Faces",
6908 "Use pixels from adjacent faces across UV seams"},
6909 {R_BAKE_EXTEND, "EXTEND", 0, "Extend", "Extend border pixels outwards"},
6910 {0, nullptr, 0, nullptr, nullptr},
6911 };
6912
6913 static const EnumPropertyItem pixel_size_items[] = {
6914 {0, "AUTO", 0, "Automatic", "Automatic pixel size, depends on the user interface scale"},
6915 {1, "1", 0, "1" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at full resolution"},
6916 {2, "2", 0, "2" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 50% resolution"},
6917 {4, "4", 0, "4" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 25% resolution"},
6918 {8, "8", 0, "8" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 12.5% resolution"},
6919 {0, nullptr, 0, nullptr, nullptr},
6920 };
6921
6922 static const EnumPropertyItem threads_mode_items[] = {
6923 {0,
6924 "AUTO",
6925 0,
6926 "Auto-Detect",
6927 "Automatically determine the number of threads, based on CPUs"},
6928 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
6929 {0, nullptr, 0, nullptr, nullptr},
6930 };
6931
6932 static const EnumPropertyItem engine_items[] = {
6933 {0, "BLENDER_EEVEE_NEXT", 0, "EEVEE", ""},
6934 {0, nullptr, 0, nullptr, nullptr},
6935 };
6936
6937 static const EnumPropertyItem freestyle_thickness_items[] = {
6939 "ABSOLUTE",
6940 0,
6941 "Absolute",
6942 "Specify unit line thickness in pixels"},
6944 "RELATIVE",
6945 0,
6946 "Relative",
6947 "Unit line thickness is scaled by the proportion of the present vertical image "
6948 "resolution to 480 pixels"},
6949 {0, nullptr, 0, nullptr, nullptr},
6950 };
6951
6952 static const EnumPropertyItem views_format_items[] = {
6954 "STEREO_3D",
6955 0,
6956 "Stereo 3D",
6957 "Single stereo camera system, adjust the stereo settings in the camera panel"},
6959 "MULTIVIEW",
6960 0,
6961 "Multi-View",
6962 "Multi camera system, adjust the cameras individually"},
6963 {0, nullptr, 0, nullptr, nullptr},
6964 };
6965
6966 static const EnumPropertyItem motion_blur_position_items[] = {
6967 {SCE_MB_START, "START", 0, "Start on Frame", "The shutter opens at the current frame"},
6969 "CENTER",
6970 0,
6971 "Center on Frame",
6972 "The shutter is open during the current frame"},
6973 {SCE_MB_END, "END", 0, "End on Frame", "The shutter closes at the current frame"},
6974 {0, nullptr, 0, nullptr, nullptr},
6975 };
6976
6977 static const EnumPropertyItem hair_shape_type_items[] = {
6978 {SCE_HAIR_SHAPE_STRAND, "STRAND", 0, "Strand", ""},
6979 {SCE_HAIR_SHAPE_STRIP, "STRIP", 0, "Strip", ""},
6980 {0, nullptr, 0, nullptr, nullptr},
6981 };
6982
6983 static const EnumPropertyItem meta_input_items[] = {
6984 {0, "SCENE", 0, "Scene", "Use metadata from the current scene"},
6986 "STRIPS",
6987 0,
6988 "Sequencer Strips",
6989 "Use metadata from the strips in the sequencer"},
6990 {0, nullptr, 0, nullptr, nullptr},
6991 };
6992
6993 static const EnumPropertyItem compositor_device_items[] = {
6994 {SCE_COMPOSITOR_DEVICE_CPU, "CPU", 0, "CPU", ""},
6995 {SCE_COMPOSITOR_DEVICE_GPU, "GPU", 0, "GPU", ""},
6996 {0, nullptr, 0, nullptr, nullptr},
6997 };
6998
6999 static const EnumPropertyItem compositor_precision_items[] = {
7001 "AUTO",
7002 0,
7003 "Auto",
7004 "Full precision for final renders, half precision otherwise"},
7005 {SCE_COMPOSITOR_PRECISION_FULL, "FULL", 0, "Full", "Full precision"},
7006 {0, nullptr, 0, nullptr, nullptr},
7007 };
7008
7009 static const EnumPropertyItem compositor_denoise_device_items[] = {
7011 "AUTO",
7012 0,
7013 "Auto",
7014 "Use the same device used by the compositor to process the denoise node"},
7016 "CPU",
7017 0,
7018 "CPU",
7019 "Use the CPU to process the denoise node"},
7021 "GPU",
7022 0,
7023 "GPU",
7024 "Use the GPU to process the denoise node if available, otherwise fallback to CPU"},
7025 {0, nullptr, 0, nullptr, nullptr},
7026 };
7027
7028 static const EnumPropertyItem compositor_denoise_quality_items[] = {
7029 {SCE_COMPOSITOR_DENOISE_HIGH, "HIGH", 0, "High", "High quality"},
7031 "BALANCED",
7032 0,
7033 "Balanced",
7034 "Balanced between performance and quality"},
7035 {SCE_COMPOSITOR_DENOISE_FAST, "FAST", 0, "Fast", "High perfomance"},
7036 {0, nullptr, 0, nullptr, nullptr},
7037 };
7038
7040
7041 srna = RNA_def_struct(brna, "RenderSettings", nullptr);
7042 RNA_def_struct_sdna(srna, "RenderData");
7043 RNA_def_struct_nested(brna, srna, "Scene");
7044 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
7045 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene data-block");
7046
7047 /* Render Data */
7048 prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
7050 RNA_def_property_pointer_sdna(prop, nullptr, "im_format");
7051 RNA_def_property_struct_type(prop, "ImageFormatSettings");
7052 RNA_def_property_ui_text(prop, "Image Format", "");
7053
7054 prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL);
7055 RNA_def_property_int_sdna(prop, nullptr, "xsch");
7058 RNA_def_property_range(prop, 4, 65536);
7060 prop, "Resolution X", "Number of horizontal pixels in the rendered image");
7061 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7062
7063 prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL);
7064 RNA_def_property_int_sdna(prop, nullptr, "ysch");
7067 RNA_def_property_range(prop, 4, 65536);
7069 prop, "Resolution Y", "Number of vertical pixels in the rendered image");
7070 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7071
7072 prop = RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
7073 RNA_def_property_int_sdna(prop, nullptr, "size");
7075 RNA_def_property_range(prop, 1, SHRT_MAX);
7076 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
7077 RNA_def_property_ui_text(prop, "Resolution Scale", "Percentage scale for render resolution");
7078 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneSequencer_update");
7079
7080 prop = RNA_def_property(srna, "preview_pixel_size", PROP_ENUM, PROP_NONE);
7081 RNA_def_property_enum_sdna(prop, nullptr, "preview_pixel_size");
7082 RNA_def_property_enum_items(prop, pixel_size_items);
7083 RNA_def_property_ui_text(prop, "Pixel Size", "Pixel size for viewport rendering");
7085
7086 prop = RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
7087 RNA_def_property_float_sdna(prop, nullptr, "xasp");
7090 RNA_def_property_range(prop, 1.0f, 200.0f);
7092 "Pixel Aspect X",
7093 "Horizontal aspect ratio - for anamorphic or non-square pixel output");
7094 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7095
7096 prop = RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
7097 RNA_def_property_float_sdna(prop, nullptr, "yasp");
7100 RNA_def_property_range(prop, 1.0f, 200.0f);
7102 prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
7103 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
7104
7105 /* Pixels per meters (also DPI). */
7106 prop = RNA_def_property(srna, "ppm_factor", PROP_FLOAT, PROP_NONE);
7107 RNA_def_property_float_sdna(prop, nullptr, "ppm_factor");
7109 RNA_def_property_range(prop, 1e-5f, 1e6f);
7110 RNA_def_property_ui_range(prop, 0.0001f, 10000.0f, 2, 2);
7112 "PPM Factor",
7113 "The pixel density meta-data written to supported image formats. "
7114 "This value is multiplied by the PPM-base which defines the unit "
7115 "(typically inches or meters)");
7116
7117 prop = RNA_def_property(srna, "ppm_base", PROP_FLOAT, PROP_NONE);
7118 RNA_def_property_float_sdna(prop, nullptr, "ppm_base");
7120 RNA_def_property_range(prop, 1e-5f, 1e6f);
7121 /* Important to show at least 3 decimal points because multiple presets set this to 1.001. */
7122 RNA_def_property_ui_range(prop, 0.0001f, 10000.0f, 2, 4);
7123 RNA_def_property_ui_text(prop, "PPM Base", "The base unit for pixels per meter.");
7124
7125 prop = RNA_def_property(srna, "ffmpeg", PROP_POINTER, PROP_NONE);
7126 RNA_def_property_struct_type(prop, "FFmpegSettings");
7127 RNA_def_property_pointer_sdna(prop, nullptr, "ffcodecdata");
7129 RNA_def_property_ui_text(prop, "FFmpeg Settings", "FFmpeg related settings for the scene");
7130
7131 prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
7132 RNA_def_property_int_sdna(prop, nullptr, "frs_sec");
7134 RNA_def_property_range(prop, 1, SHRT_MAX);
7135 RNA_def_property_ui_range(prop, 1, 240, 1, -1);
7136 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
7137 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
7138
7139 prop = RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
7140 RNA_def_property_float_sdna(prop, nullptr, "frs_sec_base");
7142 RNA_def_property_range(prop, 1e-5f, 1e6f);
7143 /* Important to show at least 3 decimal points because multiple presets set this to 1.001. */
7144 RNA_def_property_ui_range(prop, 0.1f, 120.0f, 2, 3);
7145 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
7146 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
7147
7148 /* frame mapping */
7149 prop = RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
7150 RNA_def_property_int_sdna(prop, nullptr, "framapto");
7152 RNA_def_property_range(prop, 1, 900);
7153 RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames");
7154 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
7155
7156 prop = RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
7157 RNA_def_property_int_sdna(prop, nullptr, "images");
7159 RNA_def_property_range(prop, 1, 900);
7160 RNA_def_property_ui_text(prop, "Frame Map New", "How many frames the Map Old will last");
7161 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
7162
7163 prop = RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
7164 RNA_def_property_float_sdna(prop, nullptr, "dither_intensity");
7165 RNA_def_property_range(prop, 0.0, FLT_MAX);
7166 RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 2);
7168 prop,
7169 "Dither Intensity",
7170 "Amount of dithering noise added to the rendered image to break up banding");
7172
7173 prop = RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_PIXEL);
7174 RNA_def_property_float_sdna(prop, nullptr, "gauss");
7175 RNA_def_property_range(prop, 0.0f, 500.0f);
7176 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 1, 2);
7178 prop, "Filter Size", "Width over which the reconstruction filter combines samples");
7180
7181 prop = RNA_def_property(srna, "film_transparent", PROP_BOOLEAN, PROP_NONE);
7182 RNA_def_property_boolean_sdna(prop, nullptr, "alphamode", R_ALPHAPREMUL);
7184 prop,
7185 "Transparent",
7186 "World background is transparent, for compositing the render over another background");
7187 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7188
7189 prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
7191 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_EDGE_FRS);
7192 RNA_def_property_ui_text(prop, "Use Freestyle", "Draw stylized strokes using Freestyle");
7193 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_freestyle_update");
7194
7195 /* threads */
7196 prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
7197 RNA_def_property_int_sdna(prop, nullptr, "threads");
7199 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", nullptr, nullptr);
7201 "Threads",
7202 "Maximum number of CPU cores to use simultaneously while rendering "
7203 "(for multi-core/CPU systems)");
7205
7206 prop = RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
7207 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "mode");
7208 RNA_def_property_enum_items(prop, threads_mode_items);
7209 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_threads_mode_get", nullptr, nullptr);
7210 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
7212
7213 /* motion blur */
7214 prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
7215 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_MBLUR);
7216 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
7218 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7219
7220 prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR);
7221 RNA_def_property_range(prop, 0.0f, FLT_MAX);
7222 RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 2);
7223 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
7224 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7225
7226 prop = RNA_def_property(srna, "motion_blur_position", PROP_ENUM, PROP_NONE);
7227 RNA_def_property_enum_items(prop, motion_blur_position_items);
7229 "Motion Blur Position",
7230 "Offset for the shutter's time interval, "
7231 "allows to change the motion blur trails");
7234
7235 prop = RNA_def_property(srna, "motion_blur_shutter_curve", PROP_POINTER, PROP_NONE);
7236 RNA_def_property_pointer_sdna(prop, nullptr, "mblur_shutter_curve");
7237 RNA_def_property_struct_type(prop, "CurveMapping");
7239 prop, "Shutter Curve", "Curve defining the shutter's openness over time");
7240
7241 /* Hairs */
7242 prop = RNA_def_property(srna, "hair_type", PROP_ENUM, PROP_NONE);
7243 RNA_def_property_enum_items(prop, hair_shape_type_items);
7244 RNA_def_property_ui_text(prop, "Curves Shape Type", "Curves shape type");
7246 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7247
7248 prop = RNA_def_property(srna, "hair_subdiv", PROP_INT, PROP_NONE);
7249 RNA_def_property_range(prop, 0, 3);
7251 prop, "Additional Subdivision", "Additional subdivision along the curves");
7252 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
7253
7254 /* Performance */
7255 prop = RNA_def_property(srna, "use_high_quality_normals", PROP_BOOLEAN, PROP_NONE);
7256 RNA_def_property_boolean_sdna(prop, nullptr, "perf_flag", SCE_PERF_HQ_NORMALS);
7258 "High Quality Normals",
7259 "Use high quality tangent space at the cost of lower performance");
7260 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_mesh_quality_update");
7261
7262 /* border */
7263 prop = RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
7264 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_BORDER);
7267 prop, "Render Region", "Render a user-defined render region, within the frame size");
7269
7270 prop = RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
7271 RNA_def_property_float_sdna(prop, nullptr, "border.xmin");
7272 RNA_def_property_range(prop, 0.0f, 1.0f);
7274 RNA_def_property_ui_text(prop, "Region Minimum X", "Minimum X value for the render region");
7276
7277 prop = RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
7278 RNA_def_property_float_sdna(prop, nullptr, "border.ymin");
7279 RNA_def_property_range(prop, 0.0f, 1.0f);
7281 RNA_def_property_ui_text(prop, "Region Minimum Y", "Minimum Y value for the render region");
7283
7284 prop = RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
7285 RNA_def_property_float_sdna(prop, nullptr, "border.xmax");
7286 RNA_def_property_range(prop, 0.0f, 1.0f);
7288 RNA_def_property_ui_text(prop, "Region Maximum X", "Maximum X value for the render region");
7290
7291 prop = RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
7292 RNA_def_property_float_sdna(prop, nullptr, "border.ymax");
7293 RNA_def_property_range(prop, 0.0f, 1.0f);
7295 RNA_def_property_ui_text(prop, "Region Maximum Y", "Maximum Y value for the render region");
7297
7298 prop = RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
7299 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_CROP);
7302 prop, "Crop to Render Region", "Crop the rendered frame to the defined render region size");
7304
7305 prop = RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
7306 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_TOUCH);
7309 prop,
7310 "Placeholders",
7311 "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
7313
7314 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
7316 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
7318
7319 prop = RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
7320 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_DOCOMP);
7323 "Compositing",
7324 "Process the render result through the compositing pipeline, "
7325 "if compositing nodes are enabled");
7327
7328 prop = RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
7329 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_DOSEQ);
7332 "Sequencer",
7333 "Process the render (and composited) result through the video sequence "
7334 "editor pipeline, if sequencer strips exist");
7336
7337 prop = RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
7338 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_EXTENSION);
7341 prop,
7342 "File Extensions",
7343 "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
7345
7346# if 0 /* moved */
7347 prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
7348 RNA_def_property_enum_sdna(prop, nullptr, "imtype");
7350 RNA_def_property_enum_funcs(prop, nullptr, "rna_RenderSettings_file_format_set", nullptr);
7351 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
7353# endif
7354
7355 prop = RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
7357 prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", nullptr);
7358 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
7360
7361 prop = RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
7362 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_format_get", nullptr);
7364 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
7365
7366 prop = RNA_def_property(srna, "use_lock_interface", PROP_BOOLEAN, PROP_NONE);
7367 RNA_def_property_boolean_sdna(prop, nullptr, "use_lock_interface", 1);
7369 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
7371 prop,
7372 "Lock Interface",
7373 "Lock interface during rendering in favor of giving more memory to the renderer");
7375
7376 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
7377 RNA_def_property_string_sdna(prop, nullptr, "pic");
7382 "Output Path",
7383 "Directory/name to save animations, # characters define the position "
7384 "and padding of frame numbers");
7386
7387 /* Render result EXR cache. */
7388 prop = RNA_def_property(srna, "use_render_cache", PROP_BOOLEAN, PROP_NONE);
7389 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_EXR_CACHE_FILE);
7392 "Cache Result",
7393 "Save render cache to EXR files (useful for heavy compositing, "
7394 "Note: affects indirectly rendered scenes)");
7396
7397 /* Bake */
7398
7399 prop = RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
7400 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "bake_mode");
7401 RNA_def_property_enum_items(prop, bake_mode_items);
7402 RNA_def_property_ui_text(prop, "Bake Type", "Choose shading information to bake into the image");
7404
7405 prop = RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
7406 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_TO_ACTIVE);
7408 "Selected to Active",
7409 "Bake shading on the surface of selected objects to the active object");
7411
7412 prop = RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
7413 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_CLEAR);
7414 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
7416
7417 prop = RNA_def_property(srna, "bake_margin", PROP_INT, PROP_PIXEL);
7418 RNA_def_property_int_sdna(prop, nullptr, "bake_margin");
7419 RNA_def_property_range(prop, 0, 64);
7420 RNA_def_property_ui_text(prop, "Margin", "Extends the baked result as a post process filter");
7422
7423 prop = RNA_def_property(srna, "bake_margin_type", PROP_ENUM, PROP_NONE);
7424 RNA_def_property_enum_sdna(prop, nullptr, "bake_margin_type");
7425 RNA_def_property_enum_items(prop, bake_margin_type_items);
7426 RNA_def_property_ui_text(prop, "Margin Type", "Algorithm to generate the margin");
7428
7429 prop = RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
7430 RNA_def_property_float_sdna(prop, nullptr, "bake_biasdist");
7431 RNA_def_property_range(prop, 0.0, 1000.0);
7433 prop, "Bias", "Bias towards faces further away from the object (in Blender units)");
7435
7436 prop = RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
7437 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_MULTIRES);
7438 RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object");
7440
7441 prop = RNA_def_property(srna, "use_bake_lores_mesh", PROP_BOOLEAN, PROP_NONE);
7442 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_LORES_MESH);
7444 prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh");
7446
7447 prop = RNA_def_property(srna, "bake_samples", PROP_INT, PROP_NONE);
7448 RNA_def_property_int_sdna(prop, nullptr, "bake_samples");
7449 RNA_def_property_range(prop, 64, 1024);
7451 prop, "Samples", "Number of samples used for ambient occlusion baking from multires");
7453
7454 prop = RNA_def_property(srna, "use_bake_user_scale", PROP_BOOLEAN, PROP_NONE);
7455 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_USERSCALE);
7456 RNA_def_property_ui_text(prop, "User Scale", "Use a user scale for the derivative map");
7457
7458 prop = RNA_def_property(srna, "bake_user_scale", PROP_FLOAT, PROP_NONE);
7459 RNA_def_property_float_sdna(prop, nullptr, "bake_user_scale");
7460 RNA_def_property_range(prop, 0.0, 1000.0);
7462 "Scale",
7463 "Instead of automatically normalizing to the range 0 to 1, "
7464 "apply a user scale to the derivative map");
7465
7466 /* stamp */
7467
7468 prop = RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
7469 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_TIME);
7471 prop, "Stamp Time", "Include the rendered frame timecode as HH:MM:SS.FF in image metadata");
7473
7474 prop = RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
7475 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_DATE);
7476 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image/video metadata");
7478
7479 prop = RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
7480 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FRAME);
7481 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
7483
7484 prop = RNA_def_property(srna, "use_stamp_frame_range", PROP_BOOLEAN, PROP_NONE);
7485 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FRAME_RANGE);
7487 prop, "Stamp Frame", "Include the rendered frame range in image/video metadata");
7489
7490 prop = RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
7491 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_CAMERA);
7493 prop, "Stamp Camera", "Include the name of the active camera in image metadata");
7495
7496 prop = RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
7497 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_CAMERALENS);
7499 prop, "Stamp Lens", "Include the active camera's lens in image metadata");
7501
7502 prop = RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
7503 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_SCENE);
7505 prop, "Stamp Scene", "Include the name of the active scene in image/video metadata");
7507
7508 prop = RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
7509 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_NOTE);
7510 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image/video metadata");
7512
7513 prop = RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
7514 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_MARKER);
7516 prop, "Stamp Marker", "Include the name of the last marker in image metadata");
7518
7519 prop = RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
7520 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FILENAME);
7522 prop, "Stamp Filename", "Include the .blend filename in image/video metadata");
7524
7525 prop = RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
7526 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_SEQSTRIP);
7528 "Stamp Sequence Strip",
7529 "Include the name of the foreground sequence strip in image metadata");
7531
7532 prop = RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
7533 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_RENDERTIME);
7534 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in image metadata");
7536
7537 prop = RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
7538 RNA_def_property_string_sdna(prop, nullptr, "stamp_udata");
7539 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
7541
7542 prop = RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
7543 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_DRAW);
7545 prop, "Stamp Output", "Render the stamp info text in the rendered image");
7547
7548 prop = RNA_def_property(srna, "use_stamp_labels", PROP_BOOLEAN, PROP_NONE);
7551 prop, "Stamp Labels", "Display stamp labels (\"Camera\" in front of camera name, etc.)");
7553
7554 prop = RNA_def_property(srna, "metadata_input", PROP_ENUM, PROP_NONE); /* as an enum */
7555 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "stamp");
7556 RNA_def_property_enum_items(prop, meta_input_items);
7557 RNA_def_property_ui_text(prop, "Metadata Input", "Where to take the metadata from");
7559
7560 prop = RNA_def_property(srna, "use_stamp_memory", PROP_BOOLEAN, PROP_NONE);
7561 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_MEMORY);
7563 prop, "Stamp Peak Memory", "Include the peak memory usage in image metadata");
7565
7566 prop = RNA_def_property(srna, "use_stamp_hostname", PROP_BOOLEAN, PROP_NONE);
7567 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_HOSTNAME);
7569 prop, "Stamp Hostname", "Include the hostname of the machine that rendered the frame");
7571
7572 prop = RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_PIXEL);
7573 RNA_def_property_int_sdna(prop, nullptr, "stamp_font_id");
7574 RNA_def_property_range(prop, 8, 64);
7575 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
7577
7578 prop = RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
7579 RNA_def_property_float_sdna(prop, nullptr, "fg_stamp");
7580 RNA_def_property_array(prop, 4);
7581 RNA_def_property_range(prop, 0.0, 1.0);
7582 RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text");
7584
7585 prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
7586 RNA_def_property_float_sdna(prop, nullptr, "bg_stamp");
7587 RNA_def_property_array(prop, 4);
7588 RNA_def_property_range(prop, 0.0, 1.0);
7589 RNA_def_property_ui_text(prop, "Background", "Color to use behind stamp text");
7591
7592 /* sequencer draw options */
7593
7594 prop = RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
7595 RNA_def_property_enum_sdna(prop, nullptr, "seq_prev_type");
7598 prop, "Sequencer Preview Shading", "Display method used in the sequencer view");
7599 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
7600
7601 prop = RNA_def_property(srna, "use_sequencer_override_scene_strip", PROP_BOOLEAN, PROP_NONE);
7604 "Override Scene Settings",
7605 "Use workbench render settings from the sequencer scene, instead of "
7606 "each individual scene used in the strip");
7607 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
7608
7609 prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
7610 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_SINGLE_LAYER);
7612 "Render Single Layer",
7613 "Only render the active layer. Only affects rendering from the "
7614 "interface, ignored for rendering from command line.");
7617
7618 /* views (stereoscopy et al) */
7619 prop = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE);
7620 RNA_def_property_struct_type(prop, "SceneRenderView");
7621 RNA_def_property_ui_text(prop, "Render Views", "");
7622 rna_def_render_views(brna, prop);
7623
7624 prop = RNA_def_property(srna, "stereo_views", PROP_COLLECTION, PROP_NONE);
7625 RNA_def_property_collection_sdna(prop, nullptr, "views", nullptr);
7627 "rna_RenderSettings_stereoViews_begin",
7628 "rna_iterator_listbase_next",
7629 "rna_iterator_listbase_end",
7630 "rna_iterator_listbase_get",
7631 nullptr,
7632 nullptr,
7633 nullptr,
7634 nullptr);
7635 RNA_def_property_struct_type(prop, "SceneRenderView");
7636 RNA_def_property_ui_text(prop, "Render Views", "");
7637
7638 prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
7639 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_MULTIVIEW);
7640 RNA_def_property_ui_text(prop, "Multiple Views", "Use multiple views in the scene");
7641 RNA_def_property_update(prop, NC_WINDOW, nullptr);
7642
7643 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
7644 RNA_def_property_enum_items(prop, views_format_items);
7646 RNA_def_property_ui_text(prop, "Setup Stereo Mode", "");
7647 RNA_def_property_enum_funcs(prop, nullptr, "rna_RenderSettings_views_format_set", nullptr);
7648 RNA_def_property_update(prop, NC_WINDOW, nullptr);
7649
7650 /* engine */
7651 prop = RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
7652 RNA_def_property_enum_items(prop, engine_items);
7654 "rna_RenderSettings_engine_get",
7655 "rna_RenderSettings_engine_set",
7656 "rna_RenderSettings_engine_itemf");
7658 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
7659 RNA_def_property_update(prop, NC_WINDOW, "rna_RenderSettings_engine_update");
7660
7661 prop = RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
7662 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", nullptr);
7665 prop, "Multiple Engines", "More than one rendering engine is available");
7666
7667 prop = RNA_def_property(srna, "use_spherical_stereo", PROP_BOOLEAN, PROP_NONE);
7668 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_spherical_stereo_get", nullptr);
7671 prop, "Use Spherical Stereo", "Active render engine supports spherical stereo rendering");
7672
7673 /* simplify */
7674 prop = RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
7675 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_SIMPLIFY);
7677 prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
7679 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
7680
7681 prop = RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
7682 RNA_def_property_int_sdna(prop, nullptr, "simplify_subsurf");
7683 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
7684 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
7685 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7686
7687 prop = RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
7688 RNA_def_property_float_sdna(prop, nullptr, "simplify_particles");
7689 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
7690 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7691
7692 prop = RNA_def_property(srna, "simplify_subdivision_render", PROP_INT, PROP_UNSIGNED);
7693 RNA_def_property_int_sdna(prop, nullptr, "simplify_subsurf_render");
7694 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
7696 prop, "Simplify Subdivision", "Global maximum subdivision level during rendering");
7697 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7698
7699 prop = RNA_def_property(srna, "simplify_child_particles_render", PROP_FLOAT, PROP_FACTOR);
7700 RNA_def_property_float_sdna(prop, nullptr, "simplify_particles_render");
7702 prop, "Simplify Child Particles", "Global child particles percentage during rendering");
7703 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7704
7705 prop = RNA_def_property(srna, "simplify_volumes", PROP_FLOAT, PROP_FACTOR);
7706 RNA_def_property_range(prop, 0.0, 1.0f);
7708 prop, "Simplify Volumes", "Resolution percentage of volume objects in viewport");
7710 RNA_def_property_update(prop, 0, "rna_Scene_simplify_volume_update");
7711
7712 prop = RNA_def_property(srna, "use_simplify_normals", PROP_BOOLEAN, PROP_NONE);
7713 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_SIMPLIFY_NORMALS);
7715 "Mesh Normals",
7716 "Skip computing custom normals and face corner normals for displaying "
7717 "meshes in the viewport");
7718 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_normals_update");
7719
7720 /* Grease Pencil - Simplify Options */
7721 prop = RNA_def_property(srna, "simplify_gpencil", PROP_BOOLEAN, PROP_NONE);
7722 RNA_def_property_boolean_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_ENABLE);
7723 RNA_def_property_ui_text(prop, "Simplify", "Simplify Grease Pencil drawing");
7724 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7725
7726 prop = RNA_def_property(srna, "simplify_gpencil_onplay", PROP_BOOLEAN, PROP_NONE);
7727 RNA_def_property_boolean_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_ON_PLAY);
7729 prop, "Playback Only", "Simplify Grease Pencil only during animation playback");
7730 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7731
7732 prop = RNA_def_property(srna, "simplify_gpencil_antialiasing", PROP_BOOLEAN, PROP_NONE);
7733 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_AA);
7734 RNA_def_property_ui_text(prop, "Antialiasing", "Use Antialiasing to smooth stroke edges");
7735 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7736
7737 prop = RNA_def_property(srna, "simplify_gpencil_view_fill", PROP_BOOLEAN, PROP_NONE);
7738 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_FILL);
7739 RNA_def_property_ui_text(prop, "Fill", "Display fill strokes in the viewport");
7740 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7741
7742 prop = RNA_def_property(srna, "simplify_gpencil_modifier", PROP_BOOLEAN, PROP_NONE);
7744 prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_MODIFIER);
7745 RNA_def_property_ui_text(prop, "Modifiers", "Display modifiers");
7746 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7747
7748 prop = RNA_def_property(srna, "simplify_gpencil_shader_fx", PROP_BOOLEAN, PROP_NONE);
7749 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_FX);
7750 RNA_def_property_ui_text(prop, "Shader Effects", "Display Shader Effects");
7751 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7752
7753 prop = RNA_def_property(srna, "simplify_gpencil_tint", PROP_BOOLEAN, PROP_NONE);
7754 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_TINT);
7755 RNA_def_property_ui_text(prop, "Layers Tinting", "Display layer tint");
7756 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7757
7758 /* persistent data */
7759 prop = RNA_def_property(srna, "use_persistent_data", PROP_BOOLEAN, PROP_NONE);
7760 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_PERSISTENT_DATA);
7762 "Persistent Data",
7763 "Keep render data around for faster re-renders and animation renders, "
7764 "at the cost of increased memory usage");
7765 RNA_def_property_update(prop, 0, "rna_Scene_use_persistent_data_update");
7766
7767 /* Freestyle line thickness options */
7768 prop = RNA_def_property(srna, "line_thickness_mode", PROP_ENUM, PROP_NONE);
7769 RNA_def_property_enum_sdna(prop, nullptr, "line_thickness_mode");
7770 RNA_def_property_enum_items(prop, freestyle_thickness_items);
7772 prop, "Line Thickness Mode", "Line thickness mode for Freestyle line drawing");
7773 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
7774
7775 prop = RNA_def_property(srna, "line_thickness", PROP_FLOAT, PROP_PIXEL);
7776 RNA_def_property_float_sdna(prop, nullptr, "unit_line_thickness");
7777 RNA_def_property_range(prop, 0.0f, 10000.0f);
7778 RNA_def_property_ui_text(prop, "Line Thickness", "Line thickness in pixels");
7779 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
7780
7781 /* Bake Settings */
7782 prop = RNA_def_property(srna, "bake", PROP_POINTER, PROP_NONE);
7784 RNA_def_property_pointer_sdna(prop, nullptr, "bake");
7785 RNA_def_property_struct_type(prop, "BakeSettings");
7786 RNA_def_property_ui_text(prop, "Bake Data", "");
7787
7788 /* Compositor. */
7789
7790 prop = RNA_def_property(srna, "compositor_device", PROP_ENUM, PROP_NONE);
7791 RNA_def_property_enum_items(prop, compositor_device_items);
7792 RNA_def_property_ui_text(prop, "Compositor Device", "Set how compositing is executed");
7793 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7794
7795 prop = RNA_def_property(srna, "compositor_precision", PROP_ENUM, PROP_NONE);
7796 RNA_def_property_enum_sdna(prop, nullptr, "compositor_precision");
7797 RNA_def_property_enum_items(prop, compositor_precision_items);
7799 prop, "Compositor Precision", "The precision of compositor intermediate result");
7800 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7801
7802 prop = RNA_def_property(srna, "compositor_denoise_device", PROP_ENUM, PROP_NONE);
7803 RNA_def_property_enum_sdna(prop, nullptr, "compositor_denoise_device");
7804 RNA_def_property_enum_items(prop, compositor_denoise_device_items);
7807 "Compositor Denoise Node Device",
7808 "The device to use to process the denoise nodes in the compositor");
7809 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7810
7811 prop = RNA_def_property(srna, "compositor_denoise_preview_quality", PROP_ENUM, PROP_NONE);
7812 RNA_def_property_enum_sdna(prop, nullptr, "compositor_denoise_preview_quality");
7813 RNA_def_property_enum_items(prop, compositor_denoise_quality_items);
7816 "Compositor Preview Denoise Quality",
7817 "The quality used by denoise nodes during viewport and interactive "
7818 "compositing if the nodes' quality option is set to Follow Scene");
7819 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7820
7821 prop = RNA_def_property(srna, "compositor_denoise_final_quality", PROP_ENUM, PROP_NONE);
7822 RNA_def_property_enum_sdna(prop, nullptr, "compositor_denoise_final_quality");
7823 RNA_def_property_enum_items(prop, compositor_denoise_quality_items);
7826 "Compositor Final Denoise Quality",
7827 "The quality used by denoise nodes during the compositing of final "
7828 "renders if the nodes' quality option is set to Follow Scene");
7829 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7830
7831 /* Nestled Data. */
7832 /* *** Non-Animated *** */
7834 rna_def_bake_data(brna);
7836
7837 /* *** Animated *** */
7838
7839 /* Scene API */
7841}
7842
7843/* scene.objects */
7845{
7846 StructRNA *srna;
7847
7848 RNA_def_property_srna(cprop, "SceneObjects");
7849 srna = RNA_def_struct(brna, "SceneObjects", nullptr);
7850 RNA_def_struct_sdna(srna, "Scene");
7851 RNA_def_struct_ui_text(srna, "Scene Objects", "All of the scene objects");
7852}
7853
7854/* scene.timeline_markers */
7856{
7857 StructRNA *srna;
7858
7859 FunctionRNA *func;
7860 PropertyRNA *parm;
7861
7862 RNA_def_property_srna(cprop, "TimelineMarkers");
7863 srna = RNA_def_struct(brna, "TimelineMarkers", nullptr);
7864 RNA_def_struct_sdna(srna, "Scene");
7865 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
7866
7867 func = RNA_def_function(srna, "new", "rna_TimeLine_add");
7868 RNA_def_function_ui_description(func, "Add a timeline marker");
7869 parm = RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
7871 parm = RNA_def_int(func,
7872 "frame",
7873 1,
7874 -MAXFRAME,
7875 MAXFRAME,
7876 "",
7877 "The frame for the new marker",
7878 -MAXFRAME,
7879 MAXFRAME);
7880 parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
7881 RNA_def_function_return(func, parm);
7882
7883 func = RNA_def_function(srna, "remove", "rna_TimeLine_remove");
7884 RNA_def_function_ui_description(func, "Remove a timeline marker");
7886 parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
7889
7890 func = RNA_def_function(srna, "clear", "rna_TimeLine_clear");
7891 RNA_def_function_ui_description(func, "Remove all timeline markers");
7892}
7893
7894/* scene.keying_sets */
7896{
7897 StructRNA *srna;
7898 PropertyRNA *prop;
7899
7900 FunctionRNA *func;
7901 PropertyRNA *parm;
7902
7903 RNA_def_property_srna(cprop, "KeyingSets");
7904 srna = RNA_def_struct(brna, "KeyingSets", nullptr);
7905 RNA_def_struct_sdna(srna, "Scene");
7906 RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
7907
7908 /* Add Keying Set */
7909 func = RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
7910 RNA_def_function_ui_description(func, "Add a new Keying Set to Scene");
7912 /* name */
7913 RNA_def_string(func, "idname", "KeyingSet", 64, "IDName", "Internal identifier of Keying Set");
7914 RNA_def_string(func, "name", "KeyingSet", 64, "Name", "User visible name of Keying Set");
7915 /* returns the new KeyingSet */
7916 parm = RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set");
7917 RNA_def_function_return(func, parm);
7918
7919 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
7920 RNA_def_property_struct_type(prop, "KeyingSet");
7923 "rna_Scene_active_keying_set_get",
7924 "rna_Scene_active_keying_set_set",
7925 nullptr,
7926 nullptr);
7928 prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
7930
7931 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
7932 RNA_def_property_int_sdna(prop, nullptr, "active_keyingset");
7934 "rna_Scene_active_keying_set_index_get",
7935 "rna_Scene_active_keying_set_index_set",
7936 nullptr);
7938 prop,
7939 "Active Keying Set Index",
7940 "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
7942}
7943
7945{
7946 StructRNA *srna;
7947 PropertyRNA *prop;
7948
7949 RNA_def_property_srna(cprop, "KeyingSetsAll");
7950 srna = RNA_def_struct(brna, "KeyingSetsAll", nullptr);
7951 RNA_def_struct_sdna(srna, "Scene");
7952 RNA_def_struct_path_func(srna, "rna_Scene_KeyingsSetsAll_path");
7953 RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
7954
7955 /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
7956
7957 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
7958 RNA_def_property_struct_type(prop, "KeyingSet");
7961 "rna_Scene_active_keying_set_get",
7962 "rna_Scene_active_keying_set_set",
7963 nullptr,
7964 nullptr);
7966 prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
7968
7969 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
7970 RNA_def_property_int_sdna(prop, nullptr, "active_keyingset");
7972 "rna_Scene_active_keying_set_index_get",
7973 "rna_Scene_active_keying_set_index_set",
7974 nullptr);
7976 prop,
7977 "Active Keying Set Index",
7978 "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
7980}
7981
7982/* Runtime property, used to remember uv indices, used only in UV stitch for now.
7983 */
7985{
7986 StructRNA *srna;
7987 PropertyRNA *prop;
7988
7989 srna = RNA_def_struct(brna, "SelectedUvElement", "PropertyGroup");
7990 RNA_def_struct_ui_text(srna, "Selected UV Element", "");
7991
7992 /* store the index to the UV element selected */
7993 prop = RNA_def_property(srna, "element_index", PROP_INT, PROP_UNSIGNED);
7995 RNA_def_property_ui_text(prop, "Element Index", "");
7996
7997 prop = RNA_def_property(srna, "face_index", PROP_INT, PROP_UNSIGNED);
7999 RNA_def_property_ui_text(prop, "Face Index", "");
8000}
8001
8003{
8004 StructRNA *srna;
8005 PropertyRNA *prop;
8006
8007 srna = RNA_def_struct(brna, "DisplaySafeAreas", nullptr);
8008 RNA_def_struct_ui_text(srna, "Safe Areas", "Safe areas used in 3D view and the sequencer");
8009 RNA_def_struct_sdna(srna, "DisplaySafeAreas");
8010
8011 /* SAFE AREAS */
8012 prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_XYZ);
8013 RNA_def_property_float_sdna(prop, nullptr, "title");
8014 RNA_def_property_array(prop, 2);
8015 RNA_def_property_range(prop, 0.0f, 1.0f);
8016 RNA_def_property_ui_text(prop, "Title Safe Margins", "Safe area for text and graphics");
8018
8019 prop = RNA_def_property(srna, "action", PROP_FLOAT, PROP_XYZ);
8020 RNA_def_property_float_sdna(prop, nullptr, "action");
8021 RNA_def_property_array(prop, 2);
8022 RNA_def_property_range(prop, 0.0f, 1.0f);
8023 RNA_def_property_ui_text(prop, "Action Safe Margins", "Safe area for general elements");
8025
8026 prop = RNA_def_property(srna, "title_center", PROP_FLOAT, PROP_XYZ);
8027 RNA_def_property_float_sdna(prop, nullptr, "title_center");
8028 RNA_def_property_array(prop, 2);
8029 RNA_def_property_range(prop, 0.0f, 1.0f);
8031 "Center Title Safe Margins",
8032 "Safe area for text and graphics in a different aspect ratio");
8034
8035 prop = RNA_def_property(srna, "action_center", PROP_FLOAT, PROP_XYZ);
8036 RNA_def_property_float_sdna(prop, nullptr, "action_center");
8037 RNA_def_property_array(prop, 2);
8038 RNA_def_property_range(prop, 0.0f, 1.0f);
8040 "Center Action Safe Margins",
8041 "Safe area for general elements in a different aspect ratio");
8043}
8044
8046{
8047 StructRNA *srna;
8048 PropertyRNA *prop;
8049
8050 srna = RNA_def_struct(brna, "SceneDisplay", nullptr);
8051 RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
8052 RNA_def_struct_sdna(srna, "SceneDisplay");
8053
8054 prop = RNA_def_property(srna, "light_direction", PROP_FLOAT, PROP_DIRECTION);
8055 RNA_def_property_float_sdna(prop, nullptr, "light_direction");
8057 RNA_def_property_array(prop, 3);
8059 prop, "Light Direction", "Direction of the light for shadows and highlights");
8060 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
8061
8062 prop = RNA_def_property(srna, "shadow_shift", PROP_FLOAT, PROP_ANGLE);
8063 RNA_def_property_ui_text(prop, "Shadow Shift", "Shadow termination angle");
8064 RNA_def_property_range(prop, 0.0f, 1.0f);
8065 RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 2);
8067 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
8068
8069 prop = RNA_def_property(srna, "shadow_focus", PROP_FLOAT, PROP_FACTOR);
8071 RNA_def_property_ui_text(prop, "Shadow Focus", "Shadow factor hardness");
8072 RNA_def_property_range(prop, 0.0f, 1.0f);
8073 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
8075 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
8076
8077 prop = RNA_def_property(srna, "matcap_ssao_distance", PROP_FLOAT, PROP_DISTANCE);
8079 prop, "Distance", "Distance of object that contribute to the cavity/edge effect");
8080 RNA_def_property_range(prop, 0.0f, 100000.0f);
8081 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
8082
8083 prop = RNA_def_property(srna, "matcap_ssao_attenuation", PROP_FLOAT, PROP_NONE);
8084 RNA_def_property_ui_text(prop, "Attenuation", "Attenuation constant");
8085 RNA_def_property_range(prop, 1.0f, 100000.0f);
8086 RNA_def_property_ui_range(prop, 1.0f, 100.0f, 1, 3);
8087
8088 prop = RNA_def_property(srna, "matcap_ssao_samples", PROP_INT, PROP_NONE);
8089 RNA_def_property_ui_text(prop, "Samples", "Number of samples");
8090 RNA_def_property_range(prop, 1, 500);
8091
8092 prop = RNA_def_property(srna, "render_aa", PROP_ENUM, PROP_NONE);
8095 prop, "Render Anti-Aliasing", "Method of anti-aliasing when rendering final image");
8097
8098 prop = RNA_def_property(srna, "viewport_aa", PROP_ENUM, PROP_NONE);
8101 prop, "Viewport Anti-Aliasing", "Method of anti-aliasing when rendering 3d viewport");
8103
8104 /* OpenGL render engine settings. */
8105 prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
8106 RNA_def_property_ui_text(prop, "Shading Settings", "Shading settings for OpenGL render engine");
8107}
8108
8110{
8111 StructRNA *srna;
8112 PropertyRNA *prop;
8113
8114 srna = RNA_def_struct(brna, "RaytraceEEVEE", nullptr);
8115 RNA_def_struct_path_func(srna, "rna_RaytraceEEVEE_path");
8117 srna, "EEVEE Raytrace Options", "Quality options for the raytracing pipeline");
8118
8119 prop = RNA_def_property(srna, "resolution_scale", PROP_ENUM, PROP_NONE);
8122 "Resolution",
8123 "Determines the number of rays per pixel. "
8124 "Higher resolution uses more memory.");
8127
8128 prop = RNA_def_property(srna, "use_denoise", PROP_BOOLEAN, PROP_NONE);
8131 prop, "Denoise", "Enable noise reduction techniques for raytraced effects");
8134
8135 prop = RNA_def_property(srna, "denoise_spatial", PROP_BOOLEAN, PROP_NONE);
8136 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_SPATIAL);
8137 RNA_def_property_ui_text(prop, "Spatial Reuse", "Reuse neighbor pixels' rays");
8140
8141 prop = RNA_def_property(srna, "denoise_temporal", PROP_BOOLEAN, PROP_NONE);
8142 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_TEMPORAL);
8144 prop, "Temporal Accumulation", "Accumulate samples by reprojecting last tracing results");
8147
8148 prop = RNA_def_property(srna, "denoise_bilateral", PROP_BOOLEAN, PROP_NONE);
8149 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_BILATERAL);
8151 prop, "Bilateral Filter", "Blur the resolved radiance using a bilateral filter");
8154
8155 prop = RNA_def_property(srna, "screen_trace_thickness", PROP_FLOAT, PROP_DISTANCE);
8157 prop,
8158 "Screen-Trace Thickness",
8159 "Surface thickness used to detect intersection when using screen-tracing");
8160 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8161 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3);
8164
8165 prop = RNA_def_property(srna, "trace_max_roughness", PROP_FLOAT, PROP_FACTOR);
8167 "Raytrace Max Roughness",
8168 "Maximum roughness to use the tracing pipeline for. Higher "
8169 "roughness surfaces will use fast GI approximation. A value of 1 will "
8170 "disable fast GI approximation.");
8171 RNA_def_property_range(prop, 0.0f, 1.0f);
8174
8175 prop = RNA_def_property(srna, "screen_trace_quality", PROP_FLOAT, PROP_FACTOR);
8177 prop, "Screen-Trace Precision", "Precision of the screen space ray-tracing");
8178 RNA_def_property_range(prop, 0.0f, 1.0f);
8181}
8182
8184{
8185 StructRNA *srna;
8186 PropertyRNA *prop;
8187
8188 static const EnumPropertyItem eevee_shadow_size_items[] = {
8189 {128, "128", 0, "128 px", ""},
8190 {256, "256", 0, "256 px", ""},
8191 {512, "512", 0, "512 px", ""},
8192 {1024, "1024", 0, "1024 px", ""},
8193 {2048, "2048", 0, "2048 px", ""},
8194 {4096, "4096", 0, "4096 px", ""},
8195 {0, nullptr, 0, nullptr, nullptr},
8196 };
8197
8198 static const EnumPropertyItem eevee_pool_size_items[] = {
8199 {16, "16", 0, "16 MB", ""},
8200 {32, "32", 0, "32 MB", ""},
8201 {64, "64", 0, "64 MB", ""},
8202 {128, "128", 0, "128 MB", ""},
8203 {256, "256", 0, "256 MB", ""},
8204 {512, "512", 0, "512 MB", ""},
8205 {1024, "1024", 0, "1 GB", ""},
8206 {0, nullptr, 0, nullptr, nullptr},
8207 };
8208
8209 static const EnumPropertyItem eevee_gi_visibility_size_items[] = {
8210 {8, "8", 0, "8 px", ""},
8211 {16, "16", 0, "16 px", ""},
8212 {32, "32", 0, "32 px", ""},
8213 {64, "64", 0, "64 px", ""},
8214 {0, nullptr, 0, nullptr, nullptr},
8215 };
8216
8217 static const EnumPropertyItem ray_tracing_method_items[] = {
8219 "PROBE",
8220 0,
8221 "Light Probe",
8222 "Use light probes to find scene intersection"},
8224 "SCREEN",
8225 0,
8226 "Screen-Trace",
8227 "Raytrace against the depth buffer. Fallback to light probes for invalid rays."},
8228 {0, nullptr, 0, nullptr, nullptr},
8229 };
8230
8231 static const EnumPropertyItem fast_gi_method_items[] = {
8233 "AMBIENT_OCCLUSION_ONLY",
8234 0,
8235 "Ambient Occlusion",
8236 "Use ambient occlusion instead of full global illumination"},
8237 {FAST_GI_FULL,
8238 "GLOBAL_ILLUMINATION",
8239 0,
8240 "Global Illumination",
8241 "Compute global illumination taking into account light bouncing off surrounding objects"},
8242 {0, nullptr, 0, nullptr, nullptr},
8243 };
8244
8245 srna = RNA_def_struct(brna, "SceneEEVEE", nullptr);
8246 RNA_def_struct_path_func(srna, "rna_SceneEEVEE_path");
8247 RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
8248
8249 /* Indirect Lighting */
8250 prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE);
8252 "Diffuse Bounces",
8253 "Number of times the light is reinjected inside light grids, "
8254 "0 disable indirect diffuse light");
8255 RNA_def_property_range(prop, 0, INT_MAX);
8257
8258 prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
8259 RNA_def_property_enum_items(prop, eevee_shadow_size_items);
8260 RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
8262 RNA_def_property_update(prop, 0, "rna_SceneEEVEE_gi_cubemap_resolution_update");
8263
8264 prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE);
8265 RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items);
8267 "Irradiance Visibility Size",
8268 "Size of the shadow map applied to each irradiance sample");
8270
8271 prop = RNA_def_property(srna, "gi_glossy_clamp", PROP_FLOAT, PROP_NONE);
8273 "Clamp Glossy",
8274 "Clamp pixel intensity to reduce noise inside glossy reflections "
8275 "from reflection cubemaps (0 to disable)");
8276 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8278
8279 prop = RNA_def_property(srna, "gi_irradiance_pool_size", PROP_ENUM, PROP_NONE);
8280 RNA_def_property_enum_items(prop, eevee_pool_size_items);
8282 "Irradiance Pool Size",
8283 "Size of the irradiance pool, "
8284 "a bigger pool size allows for more irradiance grid in the scene "
8285 "but might not fit into GPU memory and decrease performance");
8288
8289 /* Temporal Anti-Aliasing (super sampling) */
8290 prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
8291 RNA_def_property_ui_text(prop, "Viewport Samples", "Number of samples, unlimited if 0");
8292 RNA_def_property_range(prop, 0, INT_MAX);
8296
8297 prop = RNA_def_property(srna, "taa_render_samples", PROP_INT, PROP_NONE);
8298 RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixel for rendering");
8299 RNA_def_property_range(prop, 1, INT_MAX);
8303
8304 prop = RNA_def_property(srna, "use_taa_reprojection", PROP_BOOLEAN, PROP_NONE);
8307 "Viewport Denoising",
8308 "Denoise image using temporal reprojection "
8309 "(can leave some ghosting)");
8313
8314 prop = RNA_def_property(srna, "ray_tracing_method", PROP_ENUM, PROP_NONE);
8315 RNA_def_property_enum_items(prop, ray_tracing_method_items);
8317 prop, "Tracing Method", "Select the tracing method used to find scene-ray intersections");
8319
8320 prop = RNA_def_property(srna, "use_shadow_jitter_viewport", PROP_BOOLEAN, PROP_NONE);
8323 "Jittered Shadows (Viewport)",
8324 "Enable jittered shadows on the viewport. (Jittered shadows are always "
8325 "enabled for final renders).");
8327
8328 /* Clamping */
8329 prop = RNA_def_property(srna, "clamp_surface_direct", PROP_FLOAT, PROP_NONE);
8331 "Clamp Surface Direct",
8332 "If non-zero, the maximum value for lights contribution on a surface. "
8333 "Higher values will be scaled down to avoid too "
8334 "much noise and slow convergence at the cost of accuracy. "
8335 "Used by light objects.");
8336 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8339
8340 prop = RNA_def_property(srna, "clamp_surface_indirect", PROP_FLOAT, PROP_NONE);
8342 "Clamp Surface Indirect",
8343 "If non-zero, the maximum value for indirect lighting on surface. "
8344 "Higher values will be scaled down to avoid too "
8345 "much noise and slow convergence at the cost of accuracy. "
8346 "Used by ray-tracing and light-probes.");
8347 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8350 prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneEEVEE_clamp_surface_indirect_update");
8351
8352 prop = RNA_def_property(srna, "clamp_volume_direct", PROP_FLOAT, PROP_NONE);
8354 "Clamp Volume Direct",
8355 "If non-zero, the maximum value for lights contribution in volumes. "
8356 "Higher values will be scaled down to avoid too "
8357 "much noise and slow convergence at the cost of accuracy. "
8358 "Used by light objects.");
8359 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8362
8363 prop = RNA_def_property(srna, "clamp_volume_indirect", PROP_FLOAT, PROP_NONE);
8365 "Clamp Volume Indirect",
8366 "If non-zero, the maximum value for indirect lighting in volumes. "
8367 "Higher values will be scaled down to avoid too "
8368 "much noise and slow convergence at the cost of accuracy. "
8369 "Used by light-probes.");
8370 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8373
8374 /* Volumetrics */
8375 prop = RNA_def_property(srna, "volumetric_start", PROP_FLOAT, PROP_DISTANCE);
8376 RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect");
8377 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8378 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
8381
8382 prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE);
8383 RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect");
8384 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8385 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
8388
8389 prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE);
8392 "Resolution",
8393 "Control the quality of the volumetric effects. "
8394 "Higher resolution uses more memory.");
8397
8398 prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE);
8400 "Steps",
8401 "Number of steps to compute volumetric effects. "
8402 "Higher step count increase VRAM usage and quality.");
8403 RNA_def_property_range(prop, 1, 256);
8406
8407 prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR);
8409 prop, "Exponential Sampling", "Distribute more samples closer to the camera");
8412
8413 prop = RNA_def_property(srna, "volumetric_ray_depth", PROP_INT, PROP_NONE);
8415 "Volume Max Ray Depth",
8416 "Maximum surface intersection count used by the accurate volume "
8417 "intersection method. Will create artifact if it is exceeded. "
8418 "Higher count increases VRAM usage.");
8419 RNA_def_property_range(prop, 1, 16);
8422
8423 prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE);
8424 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8425 RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise");
8428
8429 prop = RNA_def_property(srna, "use_volumetric_shadows", PROP_BOOLEAN, PROP_NONE);
8432 prop,
8433 "Volumetric Shadows",
8434 "Cast shadows from volumetric materials onto volumetric materials (Very expensive)");
8437
8438 prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE);
8439 RNA_def_property_range(prop, 1, 128);
8441 prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing");
8444
8445 prop = RNA_def_property(srna, "use_volume_custom_range", PROP_BOOLEAN, PROP_NONE);
8448 "Volume Custom Range",
8449 "Enable custom start and end clip distances for volume computation");
8451
8452 /* Ambient Occlusion */
8453 prop = RNA_def_property(srna, "use_gtao", PROP_BOOLEAN, PROP_NONE);
8456 "Ambient Occlusion",
8457 "Enable ambient occlusion to simulate medium scale indirect shadowing");
8460
8461 /* TODO: remove this, kept for EEVEE 4.2 compatibility,
8462 * this is a duplicate of "fast_gi_quality"). */
8463 prop = RNA_def_property(srna, "gtao_quality", PROP_FLOAT, PROP_FACTOR);
8464 RNA_def_property_float_sdna(prop, nullptr, "fast_gi_quality");
8465 RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the horizon search");
8466 RNA_def_property_range(prop, 0.0f, 1.0f);
8469
8470 prop = RNA_def_property(srna, "gtao_distance", PROP_FLOAT, PROP_DISTANCE);
8472 prop, "Distance", "Distance of object that contribute to the ambient occlusion effect");
8473 RNA_def_property_range(prop, 0.0f, 100000.0f);
8474 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
8477
8478 /* Fast GI approximation */
8479
8480 prop = RNA_def_property(srna, "use_fast_gi", PROP_BOOLEAN, PROP_NONE);
8483 "Fast GI Approximation",
8484 "Use faster global illumination technique for high roughness surfaces");
8487
8488 prop = RNA_def_property(srna, "fast_gi_thickness_near", PROP_FLOAT, PROP_DISTANCE);
8490 prop,
8491 "Near Thickness",
8492 "Geometric thickness of the surfaces when computing fast GI and ambient occlusion. "
8493 "Reduces light leaking and missing contact occlusion.");
8494 RNA_def_property_range(prop, 0.0f, 100000.0f);
8495 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1.0f, 3);
8498
8499 prop = RNA_def_property(srna, "fast_gi_thickness_far", PROP_FLOAT, PROP_ANGLE);
8501 prop,
8502 "Far Thickness",
8503 "Angular thickness of the surfaces when computing fast GI and ambient occlusion. "
8504 "Reduces energy loss and missing occlusion of far geometry.");
8505 RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f));
8506 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 10.0f, 3);
8509
8510 prop = RNA_def_property(srna, "fast_gi_quality", PROP_FLOAT, PROP_FACTOR);
8511 RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the fast GI ray marching");
8512 RNA_def_property_range(prop, 0.0f, 1.0f);
8515
8516 prop = RNA_def_property(srna, "fast_gi_step_count", PROP_INT, PROP_UNSIGNED);
8517 RNA_def_property_range(prop, 1, 64);
8518 RNA_def_property_ui_text(prop, "Step Count", "Amount of screen sample per GI ray");
8521
8522 prop = RNA_def_property(srna, "fast_gi_ray_count", PROP_INT, PROP_UNSIGNED);
8523 RNA_def_property_range(prop, 1, 16);
8524 RNA_def_property_ui_text(prop, "Ray Count", "Amount of GI ray to trace for each pixel");
8527
8528 prop = RNA_def_property(srna, "fast_gi_method", PROP_ENUM, PROP_NONE);
8529 RNA_def_property_enum_items(prop, fast_gi_method_items);
8530 RNA_def_property_ui_text(prop, "Method", "Fast GI approximation method");
8532
8533 prop = RNA_def_property(srna, "fast_gi_distance", PROP_FLOAT, PROP_DISTANCE);
8534 RNA_def_property_range(prop, 0.0f, 100000.0f);
8535 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
8537 "Distance",
8538 "If non-zero, the maximum distance at which other surfaces will "
8539 "contribute to the fast GI approximation");
8541
8542 prop = RNA_def_property(srna, "fast_gi_bias", PROP_FLOAT, PROP_FACTOR);
8543 RNA_def_property_float_sdna(prop, nullptr, "gtao_focus");
8545 prop, "Bias", "Bias the shading normal to reduce self intersection artifacts");
8546 RNA_def_property_range(prop, 0.0f, 1.0f);
8547 RNA_def_property_ui_range(prop, 0.0f, 0.5f, 1.0f, 2);
8550
8551 prop = RNA_def_property(srna, "fast_gi_resolution", PROP_ENUM, PROP_NONE);
8552 RNA_def_property_enum_sdna(prop, nullptr, "gtao_resolution");
8555 "Resolution",
8556 "Control the quality of the fast GI lighting. "
8557 "Higher resolution uses more memory.");
8560
8561 /* Depth of Field */
8562
8563 prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_PIXEL);
8565 prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)");
8566 RNA_def_property_range(prop, 0.0f, 2000.0f);
8567 RNA_def_property_ui_range(prop, 0.0f, 200.0f, 100.0f, 1);
8569
8570 prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR);
8572 prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field");
8573 RNA_def_property_range(prop, 0.0f, 100000.0f);
8574 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 2);
8577
8578 prop = RNA_def_property(srna, "bokeh_neighbor_max", PROP_FLOAT, PROP_FACTOR);
8580 "Neighbor Rejection",
8581 "Maximum brightness to consider when rejecting bokeh sprites "
8582 "based on neighborhood (lower is faster)");
8583 RNA_def_property_range(prop, 0.0f, 100000.0f);
8584 RNA_def_property_ui_range(prop, 0.0f, 40.0f, 10, 2);
8587
8588 prop = RNA_def_property(srna, "use_bokeh_jittered", PROP_BOOLEAN, PROP_NONE);
8591 "Jitter Camera",
8592 "Jitter camera position to create accurate blurring "
8593 "using render samples (only for final render)");
8596
8597 prop = RNA_def_property(srna, "bokeh_overblur", PROP_FLOAT, PROP_PERCENTAGE);
8599 "Over-blur",
8600 "Apply blur to each jittered sample to reduce "
8601 "under-sampling artifacts");
8602 RNA_def_property_range(prop, 0, 100);
8603 RNA_def_property_ui_range(prop, 0.0f, 20.0f, 1, 1);
8605
8606 /* Motion blur */
8607 prop = RNA_def_property(srna, "motion_blur_depth_scale", PROP_FLOAT, PROP_NONE);
8609 "Bleeding Bias",
8610 "Lower values will reduce background"
8611 " bleeding onto foreground elements");
8612 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8613 RNA_def_property_ui_range(prop, 0.01f, 1000.0f, 1, 2);
8616
8617 prop = RNA_def_property(srna, "motion_blur_max", PROP_INT, PROP_PIXEL);
8618 RNA_def_property_ui_text(prop, "Max Blur", "Maximum blur distance a pixel can spread over");
8619 RNA_def_property_range(prop, 0, 2048);
8620 RNA_def_property_ui_range(prop, 0, 512, 1, -1);
8623
8624 prop = RNA_def_property(srna, "motion_blur_steps", PROP_INT, PROP_NONE);
8626 "Motion steps",
8627 "Controls accuracy of motion blur, "
8628 "more steps means longer render time");
8629 RNA_def_property_range(prop, 1, INT_MAX);
8630 RNA_def_property_ui_range(prop, 1, 64, 1, -1);
8633
8634 /* Shadows */
8635 prop = RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
8637 RNA_def_property_ui_text(prop, "Shadows", "Enable shadow casting from lights");
8640
8641 prop = RNA_def_property(srna, "shadow_pool_size", PROP_ENUM, PROP_NONE);
8642 RNA_def_property_enum_items(prop, eevee_pool_size_items);
8644 "Shadow Pool Size",
8645 "Size of the shadow pool, "
8646 "a bigger pool size allows for more shadows in the scene "
8647 "but might not fit into GPU memory");
8650
8651 prop = RNA_def_property(srna, "shadow_ray_count", PROP_INT, PROP_UNSIGNED);
8652 RNA_def_property_range(prop, 1, 4);
8654 prop, "Shadow Ray Count", "Amount of shadow ray to trace for each light");
8657
8658 prop = RNA_def_property(srna, "shadow_step_count", PROP_INT, PROP_UNSIGNED);
8659 RNA_def_property_range(prop, 1, 16);
8661 prop, "Shadow Step Count", "Amount of shadow map sample per shadow ray");
8664
8665 prop = RNA_def_property(srna, "light_threshold", PROP_FLOAT, PROP_UNSIGNED);
8667 "Light Threshold",
8668 "Minimum light intensity for a light to contribute to the lighting");
8669 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8670 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
8673
8674 /* Overscan */
8675 prop = RNA_def_property(srna, "use_overscan", PROP_BOOLEAN, PROP_NONE);
8676 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_EEVEE_OVERSCAN);
8678 "Overscan",
8679 "Internally render past the image border to avoid "
8680 "screen-space effects disappearing");
8682
8683 prop = RNA_def_property(srna, "overscan_size", PROP_FLOAT, PROP_PERCENTAGE);
8684 RNA_def_property_float_sdna(prop, nullptr, "overscan");
8686 "Overscan Size",
8687 "Percentage of render size to add as overscan to the "
8688 "internal render buffers");
8689 RNA_def_property_range(prop, 0.0f, 50.0f);
8690 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 2);
8692
8693 prop = RNA_def_property(srna, "ray_tracing_options", PROP_POINTER, PROP_NONE);
8694 RNA_def_property_struct_type(prop, "RaytraceEEVEE");
8696 prop, "Reflection Trace Options", "EEVEE settings for tracing reflections");
8697
8698 prop = RNA_def_property(srna, "use_raytracing", PROP_BOOLEAN, PROP_NONE);
8699 /* Reuse the same property as legacy EEVEE for compatibility. */
8701 RNA_def_property_ui_text(prop, "Use Ray-Tracing", "Enable the ray-tracing module");
8704
8705 prop = RNA_def_property(srna, "shadow_resolution_scale", PROP_FLOAT, PROP_FACTOR);
8706 RNA_def_property_range(prop, 0.0f, 1.0f);
8708 prop, "Shadows Resolution Scale", "Resolution percentage of shadow maps");
8710 RNA_def_property_update(prop, 0, "rna_SceneEEVEE_shadow_resolution_update");
8711}
8712
8714{
8715 StructRNA *srna;
8716 PropertyRNA *prop;
8717
8718 srna = RNA_def_struct(brna, "SceneGpencil", nullptr);
8719 RNA_def_struct_path_func(srna, "rna_SceneGpencil_path");
8720 RNA_def_struct_ui_text(srna, "Grease Pencil Render", "Render settings");
8721
8722 prop = RNA_def_property(srna, "antialias_threshold", PROP_FLOAT, PROP_NONE);
8723 RNA_def_property_float_sdna(prop, nullptr, "smaa_threshold");
8724 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8725 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
8727 "SMAA Threshold Viewport",
8728 "Threshold for edge detection algorithm (higher values might over-blur "
8729 "some part of the image)");
8731
8732 prop = RNA_def_property(srna, "antialias_threshold_render", PROP_FLOAT, PROP_NONE);
8733 RNA_def_property_float_sdna(prop, nullptr, "smaa_threshold_render");
8734 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8735 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
8737 "SMAA Threshold Render",
8738 "Threshold for edge detection algorithm (higher values might over-blur "
8739 "some part of the image). Only applies to final render");
8741
8742 prop = RNA_def_property(srna, "aa_samples", PROP_INT, PROP_NONE);
8744 prop,
8745 "Anti-Aliasing Samples",
8746 "Number of supersampling anti-aliasing samples per pixel for final render");
8747 RNA_def_property_range(prop, 1, INT_MAX);
8748 RNA_def_property_ui_range(prop, 1, 256, 1, 3);
8752
8755}
8756
8758{
8759 StructRNA *srna;
8760 PropertyRNA *prop;
8761
8762 static const EnumPropertyItem hydra_export_method_items[] = {
8764 "HYDRA",
8765 0,
8766 "Hydra",
8767 "Fast interactive editing through native Hydra integration"},
8769 "USD",
8770 0,
8771 "USD",
8772 "Export scene through USD file, for accurate comparison with USD file export"},
8773 {0, nullptr, 0, nullptr, nullptr},
8774 };
8775
8776 srna = RNA_def_struct(brna, "SceneHydra", nullptr);
8777 RNA_def_struct_path_func(srna, "rna_SceneHydra_path");
8778 RNA_def_struct_ui_text(srna, "Scene Hydra", "Scene Hydra render engine settings");
8779
8780 prop = RNA_def_property(srna, "export_method", PROP_ENUM, PROP_NONE);
8781 RNA_def_property_enum_items(prop, hydra_export_method_items);
8783 prop, "Export Method", "How to export the Blender scene to the Hydra render engine");
8785}
8786
8788{
8789 StructRNA *srna;
8790 PropertyRNA *prop;
8791
8792 FunctionRNA *func;
8793 PropertyRNA *parm;
8794
8795 static const EnumPropertyItem audio_distance_model_items[] = {
8796 {0, "NONE", 0, "None", "No distance attenuation"},
8797 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
8798 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
8799 {3, "LINEAR", 0, "Linear", "Linear distance model"},
8800 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
8801 {5, "EXPONENT", 0, "Exponential", "Exponential distance model"},
8802 {6,
8803 "EXPONENT_CLAMPED",
8804 0,
8805 "Exponential Clamped",
8806 "Exponential distance model with clamping"},
8807 {0, nullptr, 0, nullptr, nullptr},
8808 };
8809
8810 static const EnumPropertyItem sync_mode_items[] = {
8811 {0, "NONE", 0, "Play Every Frame", "Do not sync, play every frame"},
8812 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
8813 {AUDIO_SYNC, "AUDIO_SYNC", 0, "Sync to Audio", "Sync to audio playback, dropping frames"},
8814 {0, nullptr, 0, nullptr, nullptr},
8815 };
8816
8817 /* Struct definition */
8818 srna = RNA_def_struct(brna, "Scene", "ID");
8820 "Scene",
8821 "Scene data-block, consisting in objects and "
8822 "defining time and render related settings");
8823 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
8825
8826 /* Global Settings */
8827 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
8830 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Camera_object_poll");
8831 RNA_def_property_ui_text(prop, "Camera", "Active camera, used for rendering the scene");
8832 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_camera_update");
8833
8834 prop = RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
8835 RNA_def_property_pointer_sdna(prop, nullptr, "set");
8836 RNA_def_property_struct_type(prop, "Scene");
8839 RNA_def_property_pointer_funcs(prop, nullptr, "rna_Scene_set_set", nullptr, nullptr);
8840 RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
8841 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
8842
8843 prop = RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
8846 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
8848 RNA_def_property_update(prop, NC_SCENE | ND_WORLD, "rna_Scene_world_update");
8849
8850 prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
8851 RNA_def_property_struct_type(prop, "Object");
8852 RNA_def_property_ui_text(prop, "Objects", "");
8854 "rna_Scene_objects_begin",
8855 "rna_Scene_objects_next",
8856 "rna_Scene_objects_end",
8857 "rna_Scene_objects_get",
8858 nullptr,
8859 nullptr,
8860 nullptr,
8861 nullptr);
8862 rna_def_scene_objects(brna, prop);
8863
8864 /* Frame Range Stuff */
8865 prop = RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
8867 RNA_def_property_int_sdna(prop, nullptr, "r.cfra");
8869 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_frame_current_set", nullptr);
8871 prop,
8872 "Current Frame",
8873 "Current frame, to update animation data from Python frame_set() instead");
8874 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
8875
8876 prop = RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME);
8877 RNA_def_property_float_sdna(prop, nullptr, "r.subframe");
8878 RNA_def_property_ui_text(prop, "Current Subframe", "");
8880 RNA_def_property_range(prop, 0.0f, 1.0f);
8881 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2);
8882 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
8883
8884 prop = RNA_def_property(srna, "frame_float", PROP_FLOAT, PROP_TIME);
8885 RNA_def_property_ui_text(prop, "Current Subframe", "");
8890 prop, "rna_Scene_frame_float_get", "rna_Scene_frame_float_set", nullptr);
8891 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
8892
8893 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
8895 RNA_def_property_int_sdna(prop, nullptr, "r.sfra");
8896 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_start_frame_set", nullptr);
8898 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
8900
8901 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
8903 RNA_def_property_int_sdna(prop, nullptr, "r.efra");
8904 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_end_frame_set", nullptr);
8906 RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
8908
8909 prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
8911 RNA_def_property_int_sdna(prop, nullptr, "r.frame_step");
8913 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
8915 prop,
8916 "Frame Step",
8917 "Number of frames to skip forward while rendering/playing back each frame");
8918 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8919
8920 prop = RNA_def_property(srna, "frame_current_final", PROP_FLOAT, PROP_TIME);
8923 RNA_def_property_float_funcs(prop, "rna_Scene_frame_current_final_get", nullptr, nullptr);
8925 prop, "Current Frame Final", "Current frame with subframe and time remapping applied");
8926
8927 prop = RNA_def_property(srna, "lock_frame_selection_to_range", PROP_BOOLEAN, PROP_NONE);
8931 "Lock Frame Selection",
8932 "Don't allow frame to be selected with mouse outside of frame range");
8933 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8934
8935 /* Preview Range (frame-range for UI playback) */
8936 prop = RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
8938 RNA_def_property_boolean_sdna(prop, nullptr, "r.flag", SCER_PRV_RANGE);
8939 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Scene_use_preview_range_set");
8941 prop,
8942 "Use Preview Range",
8943 "Use an alternative start/end frame range for animation playback and view renders");
8944 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8945 RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
8946
8947 prop = RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
8949 RNA_def_property_int_sdna(prop, nullptr, "r.psfra");
8950 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_preview_range_start_frame_set", nullptr);
8952 prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
8953 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8954
8955 prop = RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
8957 RNA_def_property_int_sdna(prop, nullptr, "r.pefra");
8958 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_preview_range_end_frame_set", nullptr);
8960 prop, "Preview Range End Frame", "Alternative end frame for UI playback");
8961 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8962
8963 /* Sub-frame for motion-blur debug. */
8964 prop = RNA_def_property(srna, "show_subframe", PROP_BOOLEAN, PROP_NONE);
8966 RNA_def_property_boolean_sdna(prop, nullptr, "r.flag", SCER_SHOW_SUBFRAME);
8968 prop,
8969 "Show Subframe",
8970 "Display and allow setting fractional frame values for the current frame");
8971 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_show_subframe_update");
8972
8973 /* Timeline / Time Navigation settings */
8974 prop = RNA_def_property(srna, "show_keys_from_selected_only", PROP_BOOLEAN, PROP_NONE);
8977 prop, "Only Show Selected", "Only include channels relating to selected objects and data");
8978 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8979
8980 /* Stamp */
8981 prop = RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
8982 RNA_def_property_string_sdna(prop, nullptr, "r.stamp_udata");
8983 RNA_def_property_ui_text(prop, "Stamp Note", "User defined note for the render stamping");
8985
8986 /* Animation Data (for Scene) */
8988
8989 /* Readonly Properties */
8990 prop = RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
8991 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_NLA_EDIT_ON);
8993 PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
8995 prop,
8996 "NLA Tweak Mode",
8997 "Whether there is any action referenced by NLA being edited (strictly read-only)");
8999
9000 /* Frame dropping flag for playback and sync enum */
9001# if 0 /* XXX: Is this actually needed? */
9002 prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
9003 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_FRAME_DROP);
9005 prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
9006 RNA_def_property_update(prop, NC_SCENE, nullptr);
9007# endif
9008
9009 prop = RNA_def_property(srna, "use_custom_simulation_range", PROP_BOOLEAN, PROP_NONE);
9012 "Custom Simulation Range",
9013 "Use a simulation range that is different from the scene range for "
9014 "simulation nodes that don't override the frame range themselves");
9016 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
9017
9018 prop = RNA_def_property(srna, "simulation_frame_start", PROP_INT, PROP_NONE);
9019 RNA_def_property_ui_text(prop, "Simulation Frame Start", "Frame at which simulations start");
9021 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
9022
9023 prop = RNA_def_property(srna, "simulation_frame_end", PROP_INT, PROP_NONE);
9024 RNA_def_property_ui_text(prop, "Simulation Frame End", "Frame at which simulations end");
9026 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
9027
9028 prop = RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
9029 RNA_def_property_enum_funcs(prop, "rna_Scene_sync_mode_get", "rna_Scene_sync_mode_set", nullptr);
9030 RNA_def_property_enum_items(prop, sync_mode_items);
9032 RNA_def_property_ui_text(prop, "Sync Mode", "How to sync playback");
9033 RNA_def_property_update(prop, NC_SCENE, nullptr);
9034
9035 /* Nodes (Compositing) */
9036 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
9037 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
9040 RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree");
9041
9042 prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
9043 RNA_def_property_boolean_sdna(prop, nullptr, "use_nodes", 1);
9045 RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree");
9046 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_nodes_update");
9047
9048 /* Sequencer */
9049 prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
9050 RNA_def_property_pointer_sdna(prop, nullptr, "ed");
9051 RNA_def_property_struct_type(prop, "SequenceEditor");
9052 RNA_def_property_ui_text(prop, "Sequence Editor", "");
9053
9054 /* Keying Sets */
9055 prop = RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
9056 RNA_def_property_collection_sdna(prop, nullptr, "keyingsets", nullptr);
9057 RNA_def_property_struct_type(prop, "KeyingSet");
9058 RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
9060 rna_def_scene_keying_sets(brna, prop);
9061
9062 prop = RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
9064 "rna_Scene_all_keyingsets_begin",
9065 "rna_Scene_all_keyingsets_next",
9066 "rna_iterator_listbase_end",
9067 "rna_iterator_listbase_get",
9068 nullptr,
9069 nullptr,
9070 nullptr,
9071 nullptr);
9072 RNA_def_property_struct_type(prop, "KeyingSet");
9074 prop,
9075 "All Keying Sets",
9076 "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
9079
9080 /* Rigid Body Simulation */
9081 prop = RNA_def_property(srna, "rigidbody_world", PROP_POINTER, PROP_NONE);
9082 RNA_def_property_pointer_sdna(prop, nullptr, "rigidbody_world");
9083 RNA_def_property_struct_type(prop, "RigidBodyWorld");
9084 RNA_def_property_ui_text(prop, "Rigid Body World", "");
9085 RNA_def_property_update(prop, NC_SCENE, "rna_Physics_relations_update");
9086
9087 /* Tool Settings */
9088 prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
9091 RNA_def_property_pointer_sdna(prop, nullptr, "toolsettings");
9092 RNA_def_property_struct_type(prop, "ToolSettings");
9093 RNA_def_property_ui_text(prop, "Tool Settings", "");
9094
9095 /* Unit Settings */
9096 prop = RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
9098 RNA_def_property_pointer_sdna(prop, nullptr, "unit");
9099 RNA_def_property_struct_type(prop, "UnitSettings");
9100 RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
9101
9102 /* Physics Settings */
9103 prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
9104 RNA_def_property_float_sdna(prop, nullptr, "physics_settings.gravity");
9105 RNA_def_property_array(prop, 3);
9106 RNA_def_property_ui_range(prop, -200.0f, 200.0f, 1, 2);
9107 RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
9108 RNA_def_property_update(prop, 0, "rna_Physics_update");
9109
9110 prop = RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
9111 RNA_def_property_boolean_sdna(prop, nullptr, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
9112 RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics");
9113 RNA_def_property_update(prop, 0, "rna_Physics_update");
9114
9115 /* Render Data */
9116 prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
9118 RNA_def_property_pointer_sdna(prop, nullptr, "r");
9119 RNA_def_property_struct_type(prop, "RenderSettings");
9120 RNA_def_property_ui_text(prop, "Render Data", "");
9121
9122 /* Safe Areas */
9123 prop = RNA_def_property(srna, "safe_areas", PROP_POINTER, PROP_NONE);
9124 RNA_def_property_pointer_sdna(prop, nullptr, "safe_areas");
9126 RNA_def_property_struct_type(prop, "DisplaySafeAreas");
9127 RNA_def_property_ui_text(prop, "Safe Areas", "");
9128
9129 /* Markers */
9130 prop = RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
9131 RNA_def_property_collection_sdna(prop, nullptr, "markers", nullptr);
9132 RNA_def_property_struct_type(prop, "TimelineMarker");
9134 prop, "Timeline Markers", "Markers used in all timelines for the current scene");
9135 rna_def_timeline_markers(brna, prop);
9136
9137 /* Transform Orientations */
9138 prop = RNA_def_property(srna, "transform_orientation_slots", PROP_COLLECTION, PROP_NONE);
9140 "rna_Scene_transform_orientation_slots_begin",
9141 "rna_iterator_array_next",
9142 "rna_iterator_array_end",
9143 "rna_iterator_array_get",
9144 "rna_Scene_transform_orientation_slots_length",
9145 nullptr,
9146 nullptr,
9147 nullptr);
9148 RNA_def_property_struct_type(prop, "TransformOrientationSlot");
9149 RNA_def_property_ui_text(prop, "Transform Orientation Slots", "");
9150
9151 /* 3D View Cursor */
9152 prop = RNA_def_property(srna, "cursor", PROP_POINTER, PROP_NONE);
9154 RNA_def_property_pointer_sdna(prop, nullptr, "cursor");
9155 RNA_def_property_struct_type(prop, "View3DCursor");
9156 RNA_def_property_ui_text(prop, "3D Cursor", "");
9157
9158 /* Audio Settings */
9159 prop = RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE);
9160 RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set");
9162 prop, "Play Audio", "Play back of audio from Sequence Editor, otherwise mute audio");
9163 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_use_audio_update");
9164
9165# if 0 /* XXX: Is this actually needed? */
9166 prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
9167 RNA_def_property_boolean_sdna(prop, nullptr, "audio.flag", AUDIO_SYNC);
9169 prop,
9170 "Audio Sync",
9171 "Play back and sync with audio clock, dropping frames if frame display is too slow");
9172 RNA_def_property_update(prop, NC_SCENE, nullptr);
9173# endif
9174
9175 prop = RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
9176 RNA_def_property_boolean_sdna(prop, nullptr, "audio.flag", AUDIO_SCRUB);
9178 prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing");
9179 RNA_def_property_update(prop, NC_SCENE, nullptr);
9180
9181 prop = RNA_def_property(srna, "audio_doppler_speed", PROP_FLOAT, PROP_NONE);
9182 RNA_def_property_float_sdna(prop, nullptr, "audio.speed_of_sound");
9184 RNA_def_property_range(prop, 0.01f, FLT_MAX);
9186 prop, "Speed of Sound", "Speed of sound for Doppler effect calculation");
9187 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
9188
9189 prop = RNA_def_property(srna, "audio_doppler_factor", PROP_FLOAT, PROP_NONE);
9190 RNA_def_property_float_sdna(prop, nullptr, "audio.doppler_factor");
9192 RNA_def_property_range(prop, 0.0, FLT_MAX);
9193 RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for Doppler effect calculation");
9194 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
9195
9196 prop = RNA_def_property(srna, "audio_distance_model", PROP_ENUM, PROP_NONE);
9197 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "audio.distance_model");
9199 RNA_def_property_enum_items(prop, audio_distance_model_items);
9201 prop, "Distance Model", "Distance model for distance attenuation calculation");
9202 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
9203
9204 prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
9205 RNA_def_property_float_sdna(prop, nullptr, "audio.volume");
9206 RNA_def_property_range(prop, 0.0f, 100.0f);
9207 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
9209 RNA_def_property_update(prop, NC_SCENE, nullptr);
9210 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_volume_update");
9211
9212 func = RNA_def_function(srna, "update_render_engine", "rna_Scene_update_render_engine");
9214 RNA_def_function_ui_description(func, "Trigger a render engine update");
9215
9216 /* Statistics */
9217 func = RNA_def_function(srna, "statistics", "rna_Scene_statistics_string_get");
9219 parm = RNA_def_pointer(func, "view_layer", "ViewLayer", "View Layer", "");
9221 parm = RNA_def_string(func, "statistics", nullptr, 0, "Statistics", "");
9222 RNA_def_function_return(func, parm);
9223
9224 /* Grease Pencil */
9225 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
9226 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
9227 RNA_def_property_struct_type(prop, "GreasePencil");
9229 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
9233 prop, "Annotations", "Grease Pencil data-block used for annotations in the 3D view");
9235
9236 /* active MovieClip */
9237 prop = RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE);
9238 RNA_def_property_pointer_sdna(prop, nullptr, "clip");
9240 RNA_def_property_struct_type(prop, "MovieClip");
9242 "Active Movie Clip",
9243 "Active Movie Clip that can be used by motion tracking constraints "
9244 "or as a camera's background image");
9246
9247 /* color management */
9248 prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
9249 RNA_def_property_pointer_sdna(prop, nullptr, "view_settings");
9250 RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
9252 prop, "View Settings", "Color management settings applied on image before saving");
9253
9254 prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
9255 RNA_def_property_pointer_sdna(prop, nullptr, "display_settings");
9256 RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
9258 prop, "Display Settings", "Settings of device saved image would be displayed on");
9259
9260 prop = RNA_def_property(srna, "sequencer_colorspace_settings", PROP_POINTER, PROP_NONE);
9261 RNA_def_property_pointer_sdna(prop, nullptr, "sequencer_colorspace_settings");
9262 RNA_def_property_struct_type(prop, "ColorManagedSequencerColorspaceSettings");
9264 prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
9265
9266 /* Layer and Collections */
9267 prop = RNA_def_property(srna, "view_layers", PROP_COLLECTION, PROP_NONE);
9268 RNA_def_property_collection_sdna(prop, nullptr, "view_layers", nullptr);
9269 RNA_def_property_struct_type(prop, "ViewLayer");
9270 RNA_def_property_ui_text(prop, "View Layers", "");
9271 rna_def_view_layers(brna, prop);
9272
9273 prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
9275 RNA_def_property_pointer_sdna(prop, nullptr, "master_collection");
9276 RNA_def_property_struct_type(prop, "Collection");
9280 "Collection",
9281 "Scene root collection that owns all the objects and other collections "
9282 "instantiated in the scene");
9283
9284 /* Scene Display */
9285 prop = RNA_def_property(srna, "display", PROP_POINTER, PROP_NONE);
9286 RNA_def_property_pointer_sdna(prop, nullptr, "display");
9287 RNA_def_property_struct_type(prop, "SceneDisplay");
9288 RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3D viewport");
9289
9290 /* EEVEE */
9291 prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
9292 RNA_def_property_struct_type(prop, "SceneEEVEE");
9293 RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene");
9294
9295 /* Grease Pencil */
9296 prop = RNA_def_property(srna, "grease_pencil_settings", PROP_POINTER, PROP_NONE);
9297 RNA_def_property_struct_type(prop, "SceneGpencil");
9298 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil settings for the scene");
9299
9300 /* Hydra */
9301 prop = RNA_def_property(srna, "hydra", PROP_POINTER, PROP_NONE);
9302 RNA_def_property_struct_type(prop, "SceneHydra");
9303 RNA_def_property_ui_text(prop, "Hydra", "Hydra settings for the scene");
9304
9305 /* Nestled Data. */
9306 /* *** Non-Animated *** */
9313 rna_def_statvis(brna);
9323 rna_def_scene_eevee(brna);
9324 rna_def_scene_hydra(brna);
9330 /* *** Animated *** */
9333
9334 /* Scene API */
9335 RNA_api_scene(srna);
9336}
9337
9338#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:131
void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode)
Definition armature.cc:2414
void BKE_brush_scale_size(int *r_brush_size, float new_unprojected_radius, float old_unprojected_radius)
Definition brush.cc:1328
void BKE_brush_scale_unprojected_radius(float *unprojected_radius, int new_brush_size, int old_brush_size)
Definition brush.cc:1316
#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:162
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_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:285
void id_us_plus(ID *id)
Definition lib_id.cc:353
ID * BKE_id_owner_get(ID *id, const bool debug_relationship_assert=true)
Definition lib_id.cc:2491
void id_us_min(ID *id)
Definition lib_id.cc:361
void BKE_main_id_tag_listbase(ListBase *lb, int tag, bool value)
Definition lib_id.cc:1191
bool BKE_id_is_in_global_main(ID *id)
Definition lib_id.cc:2480
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
Paint * BKE_paint_get_active(Scene *sce, ViewLayer *view_layer)
Definition paint.cc:428
Brush * BKE_paint_brush(Paint *paint)
Definition paint.cc:636
void BKE_paint_invalidate_overlay_all()
Definition paint.cc:283
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
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:126
bool BKE_scene_has_view_layer(const Scene *scene, const ViewLayer *layer)
Definition scene.cc:2208
int BKE_render_num_threads(const RenderData *r)
Definition scene.cc:2900
#define SETLOOPER_SET_ONLY(_sce_basis, _sce_iter, _base)
Definition BKE_scene.hh:49
TransformOrientation * BKE_scene_transform_orientation_find(const Scene *scene, int index)
Definition scene.cc:3536
int BKE_scene_orientation_slot_get_index(const TransformOrientationSlot *orient_slot)
Definition scene.cc:2429
bool BKE_scene_use_spherical_stereo(Scene *scene)
Definition scene.cc:2815
void BKE_scene_orientation_slot_set_index(TransformOrientationSlot *orient_slot, int orientation)
Definition scene.cc:2422
bool BKE_scene_remove_render_view(Scene *scene, SceneRenderView *srv)
Definition scene.cc:2728
SceneRenderView * BKE_scene_add_render_view(Scene *sce, const char *name)
Definition scene.cc:2709
float BKE_scene_frame_to_ctime(const Scene *scene, int frame)
Definition scene.cc:2372
int BKE_unit_base_of_type_get(int system, int type)
Definition unit.cc:2531
const char * BKE_unit_identifier_get(const void *usys_pt, int index)
Definition unit.cc:2548
bool BKE_unit_is_suppressed(const void *usys_pt, int index)
Definition unit.cc:2566
void BKE_unit_system_get(int system, int type, const void **r_usys_pt, int *r_len)
Definition unit.cc:2513
const char * BKE_unit_display_name_get(const void *usys_pt, int index)
Definition unit.cc:2542
@ B_UNIT_LENGTH
Definition BKE_unit.hh:124
@ B_UNIT_TEMPERATURE
Definition BKE_unit.hh:135
@ B_UNIT_MASS
Definition BKE_unit.hh:127
@ B_UNIT_TIME
Definition BKE_unit.hh:129
#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:656
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)
float[3] Vector
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_RECALC_AUDIO_FPS
Definition DNA_ID.h:1035
@ ID_RECALC_AUDIO_LISTENER
Definition DNA_ID.h:1038
@ ID_RECALC_TRANSFORM
Definition DNA_ID.h:962
@ ID_RECALC_SHADING
Definition DNA_ID.h:1002
@ ID_RECALC_FRAME_CHANGE
Definition DNA_ID.h:1033
@ ID_RECALC_SELECT
Definition DNA_ID.h:1009
@ ID_RECALC_PSYS_CHILD
Definition DNA_ID.h:993
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1026
@ ID_RECALC_AUDIO_MUTE
Definition DNA_ID.h:1037
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1030
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:982
@ ID_RECALC_AUDIO_VOLUME
Definition DNA_ID.h:1036
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1012
@ ID_TAG_DOIT
Definition DNA_ID.h:944
@ ID_IM
@ ID_NT
@ ID_SCE
@ KEYINGSET_ABSOLUTE
@ BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS
#define MAX_BRUSH_PIXEL_RADIUS
@ CU_BEZIER
@ CU_POLY
@ FREESTYLE_CONTROL_EDITOR_MODE
@ FREESTYLE_CONTROL_SCRIPT_MODE
@ 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_LINESET_FE_AND
@ FREESTYLE_LINESET_ENABLED
@ FREESTYLE_LINESET_FM_NOT
@ FREESTYLE_LINESET_FE_NOT
@ FREESTYLE_LINESET_FM_BOTH
@ FREESTYLE_LINESET_GR_NOT
@ FREESTYLE_QI_VISIBLE
@ FREESTYLE_QI_RANGE
@ FREESTYLE_QI_HIDDEN
@ 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_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
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
@ UNIFIED_PAINT_COLOR_JITTER
@ UNIFIED_PAINT_WEIGHT
@ UNIFIED_PAINT_SIZE
@ UNIFIED_PAINT_BRUSH_LOCK_SIZE
@ UNIFIED_PAINT_ALPHA
@ UNIFIED_PAINT_COLOR
@ UNIFIED_PAINT_INPUT_SAMPLES
@ SEQ_SCALE_TO_FILL
@ SEQ_STRETCH_TO_FILL
@ SEQ_USE_ORIGINAL_SIZE
@ SEQ_SCALE_TO_FIT
@ WT_VGROUP_ALL
@ WT_VGROUP_BONE_DEFORM_OFF
@ WT_VGROUP_BONE_DEFORM
@ SCE_OBJECT_MODE_LOCK
@ CURVE_PAINT_FIT_METHOD_REFIT
@ CURVE_PAINT_FIT_METHOD_SPLIT
@ SCE_COMPOSITOR_DENOISE_FAST
@ SCE_COMPOSITOR_DENOISE_BALANCED
@ SCE_COMPOSITOR_DENOISE_HIGH
@ R_IMF_CINEON_FLAG_LOG
#define STEREO_LEFT_NAME
#define MINFRAME
@ USER_UNIT_IMPERIAL
@ USER_UNIT_METRIC
@ USER_UNIT_NONE
@ FFMPEG_LOSSLESS_OUTPUT
@ FFMPEG_AUTOSPLIT_OUTPUT
@ FFMPEG_USE_MAX_B_FRAMES
@ 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
@ R_BAKE_SPACE_TANGENT
@ R_BAKE_SPACE_OBJECT
@ SCE_COMPOSITOR_PRECISION_FULL
@ SCE_COMPOSITOR_PRECISION_AUTO
@ SCE_WORKSPACE_TOOL_DEFAULT
@ SCE_WORKSPACE_TOOL_FALLBACK
@ 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_SELECT_FACE
@ SCE_SELECT_VERTEX
@ SCE_SELECT_EDGE
@ CURVE_PAINT_PROJECT_CURSOR
@ CURVE_PAINT_PROJECT_SURFACE
@ 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
@ PHYS_GLOBAL_GRAVITY
@ RAYTRACE_EEVEE_METHOD_SCREEN
@ RAYTRACE_EEVEE_METHOD_PROBE
@ SCE_VIEWS_FORMAT_STEREO_3D
@ SCE_VIEWS_FORMAT_MULTIVIEW
@ R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE
@ R_IMF_COLOR_MANAGEMENT_OVERRIDE
@ UV_SYNC_SELECTION
@ UV_SHOW_SAME_IMAGE
@ SCE_PERF_HQ_NORMALS
#define MINAFRAME
#define SCE_SNAP_TO_GEOM
@ SCE_MB_START
@ SCE_MB_END
@ SCE_MB_CENTER
@ SCE_STATVIS_DISTORT
@ SCE_STATVIS_SHARP
@ SCE_STATVIS_INTERSECT
@ SCE_STATVIS_THICKNESS
@ SCE_STATVIS_OVERHANG
@ FFM_PRESET_GOOD
@ FFM_PRESET_REALTIME
@ FFM_PRESET_BEST
@ GP_SELECTMODE_POINT
@ GP_SELECTMODE_SEGMENT
@ GP_SELECTMODE_STROKE
@ R_IMF_JP2_CODEC_JP2
@ R_IMF_JP2_CODEC_J2K
@ R_IMF_IMTYPE_FFMPEG
@ R_IMF_IMTYPE_RADHDR
@ R_IMF_IMTYPE_OPENEXR
@ R_IMF_IMTYPE_MULTILAYER
@ SI_STICKY_VERTEX
@ SI_STICKY_LOC
@ SI_STICKY_DISABLE
@ AUDIO_MUTE
@ AUDIO_SCRUB
@ AUDIO_SYNC
@ 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
@ SCE_ORIENT_DEFAULT
@ 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
@ R_BAKE_ADJACENT_FACES
@ R_BAKE_EXTEND
@ USER_UNIT_ROT_RADIANS
@ USER_UNIT_OPT_SPLIT
@ SEQ_OVERLAP_EXPAND
@ SEQ_OVERLAP_SHUFFLE
@ SEQ_OVERLAP_OVERWRITE
@ R_IMF_PLANES_RGB
@ R_IMF_PLANES_RGBA
@ R_IMF_PLANES_BW
@ PROP_SMOOTH
@ PROP_ROOT
@ PROP_SHARP
@ PROP_RANDOM
@ PROP_LIN
@ PROP_CONST
@ PROP_INVSQUARE
@ PROP_SPHERE
@ S3D_SQUEEZED_FRAME
@ S3D_INTERLACE_SWAP
@ S3D_SIDEBYSIDE_CROSSEYED
#define PAINT_MAX_INPUT_SAMPLES
@ R_BAKE_SPLIT_MAT
@ R_BAKE_LORES_MESH
@ R_BAKE_AUTO_NAME
@ R_BAKE_TO_ACTIVE
@ R_BAKE_CAGE
@ R_BAKE_USERSCALE
@ R_BAKE_CLEAR
@ R_BAKE_MULTIRES
@ SCE_COMPOSITOR_DENOISE_DEVICE_GPU
@ SCE_COMPOSITOR_DENOISE_DEVICE_AUTO
@ SCE_COMPOSITOR_DENOISE_DEVICE_CPU
@ SCE_LAY_SOLID
@ SCE_LAY_STRAND
@ SCE_LAY_SKY
@ SCE_LAY_AO
@ SCE_LAY_MOTION_BLUR
@ SCE_LAY_VOLUMES
@ SCE_LAY_GREASE_PENCIL
@ S3D_DISPLAY_ANAGLYPH
@ S3D_DISPLAY_INTERLACE
@ S3D_DISPLAY_TOPBOTTOM
@ S3D_DISPLAY_SIDEBYSIDE
@ S3D_DISPLAY_PAGEFLIP
@ FFM_CRF_LOW
@ FFM_CRF_MEDIUM
@ FFM_CRF_VERYLOW
@ FFM_CRF_LOSSLESS
@ FFM_CRF_PERC_LOSSLESS
@ FFM_CRF_NONE
@ FFM_CRF_LOWEST
@ FFM_CRF_HIGH
@ 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
@ UV_SCULPT_ALL_ISLANDS
@ UV_SCULPT_LOCK_BORDERS
@ R_BAKE_VIEW_FROM_ABOVE_SURFACE
@ R_BAKE_VIEW_FROM_ACTIVE_CAMERA
@ SCER_SHOW_SUBFRAME
@ SCER_PRV_RANGE
@ SCER_LOCK_FRAME_SELECTION
@ GP_SCULPT_MASK_SELECTMODE_POINT
@ GP_SCULPT_MASK_SELECTMODE_STROKE
@ GP_SCULPT_MASK_SELECTMODE_SEGMENT
@ AUTO_MERGE
@ AUTO_MERGE_AND_SPLIT
@ R_LINE_THICKNESS_ABSOLUTE
@ R_LINE_THICKNESS_RELATIVE
@ GP_VERTEX_MASK_SELECTMODE_SEGMENT
@ GP_VERTEX_MASK_SELECTMODE_STROKE
@ GP_VERTEX_MASK_SELECTMODE_POINT
@ SCE_XFORM_SKIP_CHILDREN
@ SCE_XFORM_AXIS_ALIGN
@ SCE_XFORM_DATA_ORIGIN
#define SCE_SNAP_TO_VERTEX
@ S3D_INTERLACE_ROW
@ S3D_INTERLACE_COLUMN
@ S3D_INTERLACE_CHECKERBOARD
@ 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
@ R_SEQ_OVERRIDE_SCENE_SETTINGS
@ 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
@ 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
@ SIMPLIFY_GPENCIL_FILL
@ SIMPLIFY_GPENCIL_ON_PLAY
@ SIMPLIFY_GPENCIL_AA
@ SIMPLIFY_GPENCIL_MODIFIER
@ SIMPLIFY_GPENCIL_TINT
@ SIMPLIFY_GPENCIL_ENABLE
@ SIMPLIFY_GPENCIL_FX
@ 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
@ UVCALC_TRANSFORM_CORRECT
@ UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED
@ FAST_GI_FULL
@ FAST_GI_AO_ONLY
@ 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
@ SEQ_SNAP_IGNORE_SOUND
@ SEQ_SNAP_IGNORE_MUTED
@ SEQ_SNAP_CURRENT_FRAME_TO_STRIPS
#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
@ FFM_CHANNELS_SURROUND4
@ FFM_CHANNELS_STEREO
@ FFM_CHANNELS_SURROUND51
@ FFM_CHANNELS_SURROUND71
@ FFM_CHANNELS_MONO
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE
@ CURVE_PAINT_SURFACE_PLANE_VIEW
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW
#define USER_UNIT_ADAPTIVE
@ 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
@ R_MULTIVIEW
@ R_SINGLE_LAYER
@ R_DOSEQ
@ R_EXR_CACHE_FILE
@ R_DOCOMP
@ R_EXTENSION
@ SCE_COMPOSITOR_DEVICE_GPU
@ SCE_COMPOSITOR_DEVICE_CPU
@ SCE_CUSTOM_SIMULATION_RANGE
@ SCE_FRAME_DROP
@ SCE_KEYS_NO_SELONLY
@ SCE_NLA_EDIT_ON
@ R_IMF_TIFF_CODEC_PACKBITS
@ R_IMF_TIFF_CODEC_DEFLATE
@ R_IMF_TIFF_CODEC_NONE
@ R_IMF_TIFF_CODEC_LZW
@ SCE_SNAP_SOURCE_MEDIAN
@ SCE_SNAP_SOURCE_CLOSEST
@ SCE_SNAP_SOURCE_ACTIVE
@ SCE_SNAP_SOURCE_CENTER
@ UV_SELECT_VERTEX
@ UV_SELECT_FACE
@ UV_SELECT_EDGE
@ UV_SELECT_ISLAND
@ R_IMF_FLAG_PREVIEW_JPG
@ 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_GTAO_ENABLED
@ SCE_EEVEE_DOF_JITTER
@ SCE_HYDRA_EXPORT_HYDRA
@ SCE_HYDRA_EXPORT_USD
@ R_BAKE_SAVE_EXTERNAL
@ R_BAKE_SAVE_INTERNAL
@ R_IMF_JP2_FLAG_CINE_48
@ R_IMF_JP2_FLAG_CINE_PRESET
@ R_IMF_JP2_FLAG_YCC
@ SCE_VIEW_DISABLE
@ 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
@ R_ALPHAPREMUL
@ SCE_PASS_NORMAL
@ SCE_PASS_GLOSSY_DIRECT
@ SCE_PASS_AO
@ SCE_PASS_DIFFUSE_COLOR
@ SCE_PASS_POSITION
@ SCE_PASS_UV
@ SCE_PASS_SUBSURFACE_INDIRECT
@ SCE_PASS_TRANSM_DIRECT
@ SCE_PASS_SUBSURFACE_COLOR
@ SCE_PASS_GLOSSY_COLOR
@ SCE_PASS_DIFFUSE_DIRECT
@ SCE_PASS_GLOSSY_INDIRECT
@ SCE_PASS_INDEXMA
@ SCE_PASS_INDEXOB
@ SCE_PASS_TRANSM_INDIRECT
@ SCE_PASS_COMBINED
@ SCE_PASS_Z
@ SCE_PASS_VECTOR
@ SCE_PASS_DIFFUSE_INDIRECT
@ SCE_PASS_SUBSURFACE_DIRECT
@ SCE_PASS_SHADOW
@ SCE_PASS_TRANSM_COLOR
@ SCE_PASS_MIST
@ SCE_PASS_EMIT
@ SCE_PASS_ENVIRONMENT
@ RAYTRACE_EEVEE_DENOISE_BILATERAL
@ RAYTRACE_EEVEE_DENOISE_SPATIAL
@ RAYTRACE_EEVEE_DENOISE_TEMPORAL
@ PROP_EDIT_PROJECTED
@ PROP_EDIT_USE
@ PROP_EDIT_CONNECTED
@ 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
#define MAXFRAME
@ OB_DRAW_GROUPUSER_ACTIVE
@ OB_DRAW_GROUPUSER_NONE
@ OB_DRAW_GROUPUSER_ALL
#define FRAMENUMBER_MIN_CLAMP(cfra)
@ AUTOKEY_FLAG_LAYERED_RECORD
@ KEYING_FLAG_CYCLEAWARE
@ AUTOKEY_FLAG_ONLYKEYINGSET
@ 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_node_composit_default(const bContext *C, Scene *scene)
Definition node_edit.cc:643
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 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
#define RE_BAKE_NORMALS
#define RE_BAKE_DISPLACEMENT
const EnumPropertyItem * rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
ParameterFlag
Definition RNA_types.hh:510
@ PARM_RNAPTR
Definition RNA_types.hh:513
@ PARM_REQUIRED
Definition RNA_types.hh:511
@ FUNC_USE_REPORTS
Definition RNA_types.hh:805
@ FUNC_NO_SELF
Definition RNA_types.hh:798
@ FUNC_USE_MAIN
Definition RNA_types.hh:803
@ FUNC_USE_SELF_ID
Definition RNA_types.hh:792
@ STRUCT_ID_REFCOUNT
Definition RNA_types.hh:845
@ STRUCT_UNDO
Definition RNA_types.hh:847
@ PROP_FLOAT
Definition RNA_types.hh:152
@ PROP_BOOLEAN
Definition RNA_types.hh:150
@ PROP_ENUM
Definition RNA_types.hh:154
@ PROP_INT
Definition RNA_types.hh:151
@ PROP_STRING
Definition RNA_types.hh:153
@ PROP_POINTER
Definition RNA_types.hh:155
@ PROP_COLLECTION
Definition RNA_types.hh:156
#define RNA_ENUM_ITEM_SEPR
Definition RNA_types.hh:645
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:212
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:469
@ PROPOVERRIDE_NO_COMPARISON
Definition RNA_types.hh:477
@ PROP_VARIABLES_RENDER_OUTPUT
Definition RNA_types.hh:458
PropertyFlag
Definition RNA_types.hh:286
@ PROP_THICK_WRAP
Definition RNA_types.hh:397
@ PROP_PATH_OUTPUT
Definition RNA_types.hh:425
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:381
@ PROP_ANIMATABLE
Definition RNA_types.hh:305
@ PROP_PROPORTIONAL
Definition RNA_types.hh:335
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:430
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:358
@ PROP_EDITABLE
Definition RNA_types.hh:292
@ PROP_ENUM_FLAG
Definition RNA_types.hh:378
@ PROP_NEVER_NULL
Definition RNA_types.hh:351
@ PROP_PATH_SUPPORTS_TEMPLATES
Definition RNA_types.hh:443
@ PROP_PTR_NO_OWNERSHIP
Definition RNA_types.hh:369
@ PROP_DEG_SYNC_ONLY
Definition RNA_types.hh:419
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:344
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:338
@ PROP_IDPROPERTY
Definition RNA_types.hh:400
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition RNA_types.hh:639
@ PROP_TIME
Definition RNA_types.hh:241
@ PROP_MATRIX
Definition RNA_types.hh:253
@ PROP_DIRECTION
Definition RNA_types.hh:250
@ PROP_XYZ
Definition RNA_types.hh:257
@ PROP_DISTANCE
Definition RNA_types.hh:244
@ PROP_ACCELERATION
Definition RNA_types.hh:252
@ PROP_COLOR
Definition RNA_types.hh:248
@ PROP_PIXEL
Definition RNA_types.hh:236
@ PROP_ANGLE
Definition RNA_types.hh:240
@ PROP_AXISANGLE
Definition RNA_types.hh:256
@ PROP_EULER
Definition RNA_types.hh:254
@ PROP_NONE
Definition RNA_types.hh:221
@ PROP_PERCENTAGE
Definition RNA_types.hh:238
@ PROP_FACTOR
Definition RNA_types.hh:239
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:260
@ PROP_XYZ_LENGTH
Definition RNA_types.hh:258
@ PROP_UNSIGNED
Definition RNA_types.hh:237
@ PROP_QUATERNION
Definition RNA_types.hh:255
@ PROP_FILEPATH
Definition RNA_types.hh:224
#define C
Definition RandGen.cpp:29
#define ND_SEQUENCER
Definition WM_types.hh:434
#define NC_WORLD
Definition WM_types.hh:384
#define ND_WORLD
Definition WM_types.hh:449
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:532
#define NC_WINDOW
Definition WM_types.hh:372
#define NC_NODE
Definition WM_types.hh:391
#define NC_GEOM
Definition WM_types.hh:390
#define ND_DRAW
Definition WM_types.hh:458
#define NC_BRUSH
Definition WM_types.hh:382
#define ND_DATA
Definition WM_types.hh:506
#define ND_RENDER_OPTIONS
Definition WM_types.hh:432
#define NC_ANIMATION
Definition WM_types.hh:385
#define ND_DISPLAY
Definition WM_types.hh:488
#define ND_KEYINGSET
Definition WM_types.hh:445
#define NC_SCENE
Definition WM_types.hh:375
#define ND_NODES
Definition WM_types.hh:433
#define ND_TOOLSETTINGS
Definition WM_types.hh:446
#define ND_SPACE_IMAGE
Definition WM_types.hh:519
#define NA_EDITED
Definition WM_types.hh:581
#define ND_SPACE_GRAPH
Definition WM_types.hh:529
ReportList * reports
Definition WM_types.hh:1025
#define ND_FRAME_RANGE
Definition WM_types.hh:448
#define NC_IMAGE
Definition WM_types.hh:381
#define ND_MARKERS
Definition WM_types.hh:430
#define ND_FRAME
Definition WM_types.hh:431
#define NC_GPENCIL
Definition WM_types.hh:396
#define ND_TRANSFORM
Definition WM_types.hh:453
#define ND_LAYER
Definition WM_types.hh:447
#define ND_KEYFRAME_AUTO
Definition WM_types.hh:498
#define ND_SPACE_VIEW3D
Definition WM_types.hh:525
#define NC_OBJECT
Definition WM_types.hh:376
#define NC_SPACE
Definition WM_types.hh:389
#define ND_DRAW_RENDER_VIEWPORT
Definition WM_types.hh:467
ListBase builtin_keyingsets
volatile int lock
BMesh const char void * data
BPy_StructRNA * depsgraph
#define SELECT
#define offsetof(t, d)
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *keyingset)
#define GS(a)
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)
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 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
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, 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_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)
void rna_def_freestyle_settings(BlenderRNA *brna)
const EnumPropertyItem rna_enum_image_color_depth_items[]
Definition rna_scene.cc:395
const EnumPropertyItem rna_enum_image_type_items[]
Definition rna_scene.cc:362
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:628
static const EnumPropertyItem eevee_resolution_scale_items[]
Definition rna_scene.cc:679
static const EnumPropertyItem plane_orientation_items[]
Definition rna_scene.cc:648
const EnumPropertyItem rna_enum_views_format_multilayer_items[]
Definition rna_scene.cc:485
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:196
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:497
const EnumPropertyItem rna_enum_normal_swizzle_items[]
Definition rna_scene.cc:412
static const EnumPropertyItem rna_enum_scene_display_aa_methods[]
Definition rna_scene.cc:205
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:185
#define R_IMF_VIEWS_ENUM_MV
Definition rna_scene.cc:478
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:668
const EnumPropertyItem rna_enum_proportional_falloff_items[]
Definition rna_scene.cc:95
void RNA_def_scene(BlenderRNA *brna)
const EnumPropertyItem rna_enum_snap_animation_element_items[]
Definition rna_scene.cc:177
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:470
static const EnumPropertyItem rna_enum_snap_element_base_items[]
Definition rna_scene.cc:166
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:543
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:151
const EnumPropertyItem rna_enum_bake_save_mode_items[]
Definition rna_scene.cc:446
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:662
static const EnumPropertyItem rna_enum_view_layer_aov_type_items[]
Definition rna_scene.cc:555
static const EnumPropertyItem rna_enum_bake_view_from_items[]
Definition rna_scene.cc:456
const EnumPropertyItem rna_enum_bake_margin_type_items[]
Definition rna_scene.cc:422
static void rna_def_view_layer_eevee(BlenderRNA *brna)
const EnumPropertyItem rna_enum_bake_target_items[]
Definition rna_scene.cc:432
static void rna_def_freestyle_modules(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_curve_fit_method_items[]
Definition rna_scene.cc:245
const EnumPropertyItem rna_enum_views_format_items[]
Definition rna_scene.cc:481
const EnumPropertyItem rna_enum_transform_pivot_full_items[]
Definition rna_scene.cc:561
static void rna_def_render_views(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_normal_space_items[]
Definition rna_scene.cc:406
static void rna_def_unified_paint_settings(BlenderRNA *brna)
const EnumPropertyItem rna_enum_views_format_multiview_items[]
Definition rna_scene.cc:489
#define IMAGE_TYPE_ITEMS_IMAGE_ONLY
Definition rna_scene.cc:341
const EnumPropertyItem rna_enum_transform_orientation_items[]
Definition rna_scene.cc:587
const EnumPropertyItem rna_enum_stereo3d_anaglyph_type_items[]
Definition rna_scene.cc:529
const EnumPropertyItem rna_enum_stereo3d_interlace_type_items[]
Definition rna_scene.cc:536
#define R_IMF_VIEWS_ENUM_S3D
Definition rna_scene.cc:476
#define RNA_SNAP_ELEMENTS_BASE
Definition rna_scene.cc:140
static const EnumPropertyItem * rna_enum_snap_element_individual_items
Definition rna_scene.cc:173
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:374
static void rna_def_scene_render_data(BlenderRNA *brna)
static void rna_def_view_layers(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_shading_type_items[]
Definition rna_space.cc:387
#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
ListBaseIterator listbase
Definition RNA_types.hh:572
union CollectionPropertyIterator::@277172262001176145116102322066145204253046376362 internal
const char * identifier
Definition RNA_types.hh:623
const char * name
Definition RNA_types.hh:627
const char * description
Definition RNA_types.hh:629
Definition DNA_ID.h:404
int tag
Definition DNA_ID.h:424
char name[66]
Definition DNA_ID.h:415
ColorManagedColorspaceSettings linear_colorspace_settings
ColorManagedDisplaySettings display_settings
ColorManagedViewSettings view_settings
void * first
ListBase grease_pencils
Definition BKE_main.hh:279
ListBase wm
Definition BKE_main.hh:276
ListBase objects
Definition BKE_main.hh:247
MeshRuntimeHandle * runtime
struct ModifierData * next
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:75
struct RenderEngineType * next
Definition RE_engine.h:71
char idname[64]
Definition RE_engine.h:74
void(* update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition RE_engine.h:111
struct bNodeTree * nodetree
int active_keyingset
ListBase keyingsets
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:4226
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)