Blender V4.3
rna_scene.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdlib>
10
11#include "DNA_brush_types.h"
15#include "DNA_layer_types.h"
16#include "DNA_linestyle_types.h"
17#include "DNA_modifier_types.h"
18#include "DNA_particle_types.h"
19#include "DNA_rigidbody_types.h"
20#include "DNA_scene_types.h"
21#include "DNA_screen_types.h" /* TransformOrientation */
22#include "DNA_userdef_types.h"
23#include "DNA_view3d_types.h"
24#include "DNA_world_types.h"
25
27#include "IMB_imbuf_types.hh"
28
29#include "BLI_listbase.h"
30#include "BLI_math_matrix.h"
31#include "BLI_math_rotation.h"
32#include "BLI_math_vector.h"
34
35#include "BLT_translation.hh"
36
37#include "BKE_armature.hh"
38#include "BKE_editmesh.hh"
39#include "BKE_idtype.hh"
40#include "BKE_paint.hh"
41#include "BKE_volume.hh"
42
43#include "ED_gpencil_legacy.hh"
44#include "ED_object.hh"
45#include "ED_uvedit.hh"
46
47#include "RNA_define.hh"
48#include "RNA_enum_types.hh"
49
50#include "rna_internal.hh"
51
52/* Include for Bake Options */
53#include "RE_engine.h"
54#include "RE_pipeline.h"
55
56#ifdef WITH_FFMPEG
57# include "BKE_writeffmpeg.hh"
58# include "ffmpeg_compat.h"
59# include <libavcodec/avcodec.h>
60# include <libavformat/avformat.h>
61#endif
62
63#include "ED_render.hh"
64#include "ED_transform.hh"
65
66#include "WM_api.hh"
67#include "WM_types.hh"
68
69#include "BLI_threads.h"
70
71#include "DEG_depsgraph.hh"
72
73#ifdef WITH_OPENEXR
74const EnumPropertyItem rna_enum_exr_codec_items[] = {
75 {R_IMF_EXR_CODEC_NONE, "NONE", 0, "None", ""},
76 {R_IMF_EXR_CODEC_PXR24, "PXR24", 0, "Pxr24 (lossy)", ""},
77 {R_IMF_EXR_CODEC_ZIP, "ZIP", 0, "ZIP (lossless)", ""},
78 {R_IMF_EXR_CODEC_PIZ, "PIZ", 0, "PIZ (lossless)", ""},
79 {R_IMF_EXR_CODEC_RLE, "RLE", 0, "RLE (lossless)", ""},
80 {R_IMF_EXR_CODEC_ZIPS, "ZIPS", 0, "ZIPS (lossless)", ""},
81 {R_IMF_EXR_CODEC_B44, "B44", 0, "B44 (lossy)", ""},
82 {R_IMF_EXR_CODEC_B44A, "B44A", 0, "B44A (lossy)", ""},
83 {R_IMF_EXR_CODEC_DWAA, "DWAA", 0, "DWAA (lossy)", ""},
84 {R_IMF_EXR_CODEC_DWAB, "DWAB", 0, "DWAB (lossy)", ""},
85 {0, nullptr, 0, nullptr, nullptr},
86};
87#endif
88
90 {SCE_SNAP_SOURCE_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
91 {SCE_SNAP_SOURCE_CENTER, "CENTER", 0, "Center", "Snap transformation center onto target"},
92 {SCE_SNAP_SOURCE_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target"},
93 {SCE_SNAP_SOURCE_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"},
94 {0, nullptr, 0, nullptr, nullptr},
95};
96
98 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
99 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
100 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
102 "INVERSE_SQUARE",
103 ICON_INVERSESQUARECURVE,
104 "Inverse Square",
105 "Inverse Square falloff"},
106 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
107 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
108 {PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Constant falloff"},
109 {PROP_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", "Random falloff"},
110 {0, nullptr, 0, nullptr, nullptr},
111};
112
113/* subset of the enum - only curves, missing random and const */
115 {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
116 {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
117 {PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
118 {PROP_INVSQUARE, "INVERSE_SQUARE", ICON_ROOTCURVE, "Inverse Square", "Inverse Square falloff"},
119 {PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
120 {PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
121 {0, nullptr, 0, nullptr, nullptr},
122};
123
124/* Keep for operators, not used here. */
125
127 {SCE_SELECT_VERTEX, "VERT", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"},
128 {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"},
129 {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"},
130 {0, nullptr, 0, nullptr, nullptr},
131};
132
134 {UV_SELECT_VERTEX, "VERTEX", ICON_UV_VERTEXSEL, "Vertex", "Vertex selection mode"},
135 {UV_SELECT_EDGE, "EDGE", ICON_UV_EDGESEL, "Edge", "Edge selection mode"},
136 {UV_SELECT_FACE, "FACE", ICON_UV_FACESEL, "Face", "Face selection mode"},
137 {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"},
138 {0, nullptr, 0, nullptr, nullptr},
139};
140
141/* clang-format off */
142#define RNA_SNAP_ELEMENTS_BASE \
143 {SCE_SNAP_TO_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments"}, \
144 {SCE_SNAP_TO_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"}, \
145 {SCE_SNAP_TO_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"}, \
146 {SCE_SNAP_TO_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges"}, \
147 {SCE_SNAP_TO_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap by projecting onto faces"}, \
148 {SCE_SNAP_TO_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume"}, \
149 {SCE_SNAP_TO_EDGE_MIDPOINT, "EDGE_MIDPOINT", ICON_SNAP_MIDPOINT, "Edge Center", "Snap to the middle of edges"}, \
150 {SCE_SNAP_TO_EDGE_PERPENDICULAR, "EDGE_PERPENDICULAR", ICON_SNAP_PERPENDICULAR, "Edge Perpendicular", "Snap to the nearest point on an edge"}
151/* clang-format on */
152
156 "FACE_PROJECT",
157 ICON_SNAP_FACE,
158 "Face Project",
159 "Snap by projecting onto faces"},
161 "FACE_NEAREST",
162 ICON_SNAP_FACE_NEAREST,
163 "Face Nearest",
164 "Snap to nearest point on faces"},
165 {0, nullptr, 0, nullptr, nullptr},
166};
167
170 {0, nullptr, 0, nullptr, nullptr},
171};
172
173#ifndef RNA_RUNTIME
174/* Last two snap elements from #rna_enum_snap_element_items. */
177#endif
178
180 {SCE_SNAP_TO_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"},
181 {SCE_SNAP_TO_NODE_X, "NODE_X", ICON_NODE_SIDE, "Node X", "Snap to left/right node border"},
182 {SCE_SNAP_TO_NODE_Y, "NODE_Y", ICON_NODE_TOP, "Node Y", "Snap to top/bottom node border"},
184 "NODE_XY",
185 ICON_NODE_CORNER,
186 "Node X / Y",
187 "Snap to any node border"},
188 {0, nullptr, 0, nullptr, nullptr},
189};
190
192 {SCE_SNAP_TO_FRAME, "FRAME", 0, "Frame", "Snap to frame"},
193 {SCE_SNAP_TO_SECOND, "SECOND", 0, "Second", "Snap to seconds"},
194 {SCE_SNAP_TO_MARKERS, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
195 {0, nullptr, 0, nullptr, nullptr},
196};
197
198#ifndef RNA_RUNTIME
201 "INCREMENT",
202 ICON_SNAP_INCREMENT,
203 "Increment",
204 "Snap to increments of grid"},
205 {SCE_SNAP_TO_GRID, "GRID", ICON_SNAP_GRID, "Grid", "Snap to grid"},
206 {SCE_SNAP_TO_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
207 {0, nullptr, 0, nullptr, nullptr},
208};
209
212 "OFF",
213 0,
214 "No Anti-Aliasing",
215 "Scene will be rendering without any anti-aliasing"},
217 "FXAA",
218 0,
219 "Single Pass Anti-Aliasing",
220 "Scene will be rendered using a single pass anti-aliasing method (FXAA)"},
222 "5",
223 0,
224 "5 Samples",
225 "Scene will be rendered using 5 anti-aliasing samples"},
227 "8",
228 0,
229 "8 Samples",
230 "Scene will be rendered using 8 anti-aliasing samples"},
232 "11",
233 0,
234 "11 Samples",
235 "Scene will be rendered using 11 anti-aliasing samples"},
237 "16",
238 0,
239 "16 Samples",
240 "Scene will be rendered using 16 anti-aliasing samples"},
242 "32",
243 0,
244 "32 Samples",
245 "Scene will be rendered using 32 anti-aliasing samples"},
246 {0, nullptr, 0, nullptr, nullptr},
247};
248#endif
249
252 "REFIT",
253 0,
254 "Refit",
255 "Incrementally refit the curve (high quality)"},
257 "SPLIT",
258 0,
259 "Split",
260 "Split the curve until the tolerance is met (fast)"},
261 {0, nullptr, 0, nullptr, nullptr},
262};
263
264/* workaround for duplicate enums,
265 * have each enum line as a define then conditionally set it or not
266 */
267
268#define R_IMF_ENUM_BMP \
269 {R_IMF_IMTYPE_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"},
270#define R_IMF_ENUM_IRIS \
271 {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", "Output image in SGI IRIS format"},
272#define R_IMF_ENUM_PNG \
273 {R_IMF_IMTYPE_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"},
274#define R_IMF_ENUM_JPEG \
275 {R_IMF_IMTYPE_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"},
276#define R_IMF_ENUM_TAGA \
277 {R_IMF_IMTYPE_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"},
278#define R_IMF_ENUM_TAGA_RAW \
279 {R_IMF_IMTYPE_RAWTGA, \
280 "TARGA_RAW", \
281 ICON_FILE_IMAGE, \
282 "Targa Raw", \
283 "Output image in uncompressed Targa format"},
284
285#if 0 /* UNUSED (so far) */
286# define R_IMF_ENUM_DDS \
287 {R_IMF_IMTYPE_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"},
288#endif
289
290#ifdef WITH_OPENJPEG
291# define R_IMF_ENUM_JPEG2K \
292 {R_IMF_IMTYPE_JP2, \
293 "JPEG2000", \
294 ICON_FILE_IMAGE, \
295 "JPEG 2000", \
296 "Output image in JPEG 2000 format"},
297#else
298# define R_IMF_ENUM_JPEG2K
299#endif
300
301#ifdef WITH_CINEON
302# define R_IMF_ENUM_CINEON \
303 {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", "Output image in Cineon format"},
304# define R_IMF_ENUM_DPX \
305 {R_IMF_IMTYPE_DPX, "DPX", ICON_FILE_IMAGE, "DPX", "Output image in DPX format"},
306#else
307# define R_IMF_ENUM_CINEON
308# define R_IMF_ENUM_DPX
309#endif
310
311#ifdef WITH_OPENEXR
312# define R_IMF_ENUM_EXR_MULTILAYER \
313 {R_IMF_IMTYPE_MULTILAYER, \
314 "OPEN_EXR_MULTILAYER", \
315 ICON_FILE_IMAGE, \
316 "OpenEXR MultiLayer", \
317 "Output image in multilayer OpenEXR format"},
318# define R_IMF_ENUM_EXR \
319 {R_IMF_IMTYPE_OPENEXR, \
320 "OPEN_EXR", \
321 ICON_FILE_IMAGE, \
322 "OpenEXR", \
323 "Output image in OpenEXR format"},
324#else
325# define R_IMF_ENUM_EXR_MULTILAYER
326# define R_IMF_ENUM_EXR
327#endif
328
329#define R_IMF_ENUM_HDR \
330 {R_IMF_IMTYPE_RADHDR, \
331 "HDR", \
332 ICON_FILE_IMAGE, \
333 "Radiance HDR", \
334 "Output image in Radiance HDR format"},
335
336#define R_IMF_ENUM_TIFF \
337 {R_IMF_IMTYPE_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"},
338
339#ifdef WITH_WEBP
340# define R_IMF_ENUM_WEBP \
341 {R_IMF_IMTYPE_WEBP, "WEBP", ICON_FILE_IMAGE, "WebP", "Output image in WebP format"},
342#else
343# define R_IMF_ENUM_WEBP
344#endif
345
346#define IMAGE_TYPE_ITEMS_IMAGE_ONLY \
347 R_IMF_ENUM_BMP \
348 /* DDS save not supported yet R_IMF_ENUM_DDS */ \
349 R_IMF_ENUM_IRIS \
350 R_IMF_ENUM_PNG \
351 R_IMF_ENUM_JPEG \
352 R_IMF_ENUM_JPEG2K \
353 R_IMF_ENUM_TAGA \
354 R_IMF_ENUM_TAGA_RAW \
355 RNA_ENUM_ITEM_SEPR_COLUMN, R_IMF_ENUM_CINEON R_IMF_ENUM_DPX R_IMF_ENUM_EXR_MULTILAYER \
356 R_IMF_ENUM_EXR R_IMF_ENUM_HDR R_IMF_ENUM_TIFF R_IMF_ENUM_WEBP
357
358#ifdef RNA_RUNTIME
359static const EnumPropertyItem image_only_type_items[] = {
360
362
363 {0, nullptr, 0, nullptr, nullptr},
364};
365#endif
366
368 RNA_ENUM_ITEM_HEADING(N_("Image"), nullptr),
369
371
372 RNA_ENUM_ITEM_HEADING(N_("Movie"), nullptr),
373#ifdef WITH_FFMPEG
374 {R_IMF_IMTYPE_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFmpeg Video", ""},
375#endif
376 {0, nullptr, 0, nullptr, nullptr},
377};
378
381 "BW",
382 0,
383 "BW",
384 "Images get saved in 8-bit grayscale (only PNG, JPEG, TGA, TIF)"},
385 {R_IMF_PLANES_RGB, "RGB", 0, "RGB", "Images are saved with RGB (color) data"},
387 "RGBA",
388 0,
389 "RGBA",
390 "Images are saved with RGB and Alpha data (if supported)"},
391 {0, nullptr, 0, nullptr, nullptr},
392};
393
394#ifdef RNA_RUNTIME
395# define IMAGE_COLOR_MODE_BW rna_enum_image_color_mode_items[0]
396# define IMAGE_COLOR_MODE_RGB rna_enum_image_color_mode_items[1]
397# define IMAGE_COLOR_MODE_RGBA rna_enum_image_color_mode_items[2]
398#endif
399
401 /* 1 (monochrome) not used */
402 {R_IMF_CHAN_DEPTH_8, "8", 0, "8", "8-bit color channels"},
403 {R_IMF_CHAN_DEPTH_10, "10", 0, "10", "10-bit color channels"},
404 {R_IMF_CHAN_DEPTH_12, "12", 0, "12", "12-bit color channels"},
405 {R_IMF_CHAN_DEPTH_16, "16", 0, "16", "16-bit color channels"},
406 /* 24 not used */
407 {R_IMF_CHAN_DEPTH_32, "32", 0, "32", "32-bit color channels"},
408 {0, nullptr, 0, nullptr, nullptr},
409};
410
412 {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", "Bake the normals in object space"},
413 {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", "Bake the normals in tangent space"},
414 {0, nullptr, 0, nullptr, nullptr},
415};
416
418 {R_BAKE_POSX, "POS_X", 0, "+X", ""},
419 {R_BAKE_POSY, "POS_Y", 0, "+Y", ""},
420 {R_BAKE_POSZ, "POS_Z", 0, "+Z", ""},
421 {R_BAKE_NEGX, "NEG_X", 0, "-X", ""},
422 {R_BAKE_NEGY, "NEG_Y", 0, "-Y", ""},
423 {R_BAKE_NEGZ, "NEG_Z", 0, "-Z", ""},
424 {0, nullptr, 0, nullptr, nullptr},
425};
426
429 "ADJACENT_FACES",
430 0,
431 "Adjacent Faces",
432 "Use pixels from adjacent faces across UV seams"},
433 {R_BAKE_EXTEND, "EXTEND", 0, "Extend", "Extend border pixels outwards"},
434 {0, nullptr, 0, nullptr, nullptr},
435};
436
439 "IMAGE_TEXTURES",
440 0,
441 "Image Textures",
442 "Bake to image data-blocks associated with active image texture nodes in materials"},
444 "VERTEX_COLORS",
445 0,
446 "Active Color Attribute",
447 "Bake to the active color attribute on meshes"},
448 {0, nullptr, 0, nullptr, nullptr},
449};
450
453 "INTERNAL",
454 0,
455 "Internal",
456 "Save the baking map in an internal image data-block"},
457 {R_BAKE_SAVE_EXTERNAL, "EXTERNAL", 0, "External", "Save the baking map in an external file"},
458 {0, nullptr, 0, nullptr, nullptr},
459};
460
463 "ABOVE_SURFACE",
464 0,
465 "Above Surface",
466 "Cast rays from above the surface"},
468 "ACTIVE_CAMERA",
469 0,
470 "Active Camera",
471 "Use the active camera's position to cast rays"},
472 {0, nullptr, 0, nullptr, nullptr},
473};
474
475#define R_IMF_VIEWS_ENUM_IND \
476 {R_IMF_VIEWS_INDIVIDUAL, \
477 "INDIVIDUAL", \
478 0, \
479 "Individual", \
480 "Individual files for each view with the prefix as defined by the scene views"},
481#define R_IMF_VIEWS_ENUM_S3D \
482 {R_IMF_VIEWS_STEREO_3D, "STEREO_3D", 0, "Stereo 3D", "Single file with an encoded stereo pair"},
483#define R_IMF_VIEWS_ENUM_MV \
484 {R_IMF_VIEWS_MULTIVIEW, "MULTIVIEW", 0, "Multi-View", "Single file with all the views"},
485
487 R_IMF_VIEWS_ENUM_IND R_IMF_VIEWS_ENUM_S3D{0, nullptr, 0, nullptr, nullptr},
488};
489
493
497
498#undef R_IMF_VIEWS_ENUM_IND
499#undef R_IMF_VIEWS_ENUM_S3D
500#undef R_IMF_VIEWS_ENUM_MV
501
504 "ANAGLYPH",
505 0,
506 "Anaglyph",
507 "Render views for left and right eyes as two differently filtered colors in a single image "
508 "(anaglyph glasses are required)"},
510 "INTERLACE",
511 0,
512 "Interlace",
513 "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
514 "required)"},
516 "TIMESEQUENTIAL",
517 0,
518 "Time Sequential",
519 "Render alternate eyes (also known as page flip, quad buffer support in the graphic card is "
520 "required)"},
522 "SIDEBYSIDE",
523 0,
524 "Side-by-Side",
525 "Render views for left and right eyes side-by-side"},
527 "TOPBOTTOM",
528 0,
529 "Top-Bottom",
530 "Render views for left and right eyes one above another"},
531 {0, nullptr, 0, nullptr, nullptr},
532};
533
535 {S3D_ANAGLYPH_REDCYAN, "RED_CYAN", 0, "Red-Cyan", ""},
536 {S3D_ANAGLYPH_GREENMAGENTA, "GREEN_MAGENTA", 0, "Green-Magenta", ""},
537 {S3D_ANAGLYPH_YELLOWBLUE, "YELLOW_BLUE", 0, "Yellow-Blue", ""},
538 {0, nullptr, 0, nullptr, nullptr},
539};
540
542 {S3D_INTERLACE_ROW, "ROW_INTERLEAVED", 0, "Row Interleaved", ""},
543 {S3D_INTERLACE_COLUMN, "COLUMN_INTERLEAVED", 0, "Column Interleaved", ""},
544 {S3D_INTERLACE_CHECKERBOARD, "CHECKERBOARD_INTERLEAVED", 0, "Checkerboard Interleaved", ""},
545 {0, nullptr, 0, nullptr, nullptr},
546};
547
549 {R_BAKE_PASS_FILTER_NONE, "NONE", 0, "None", ""},
550 {R_BAKE_PASS_FILTER_EMIT, "EMIT", 0, "Emit", ""},
551 {R_BAKE_PASS_FILTER_DIRECT, "DIRECT", 0, "Direct", ""},
552 {R_BAKE_PASS_FILTER_INDIRECT, "INDIRECT", 0, "Indirect", ""},
553 {R_BAKE_PASS_FILTER_COLOR, "COLOR", 0, "Color", ""},
554 {R_BAKE_PASS_FILTER_DIFFUSE, "DIFFUSE", 0, "Diffuse", ""},
555 {R_BAKE_PASS_FILTER_GLOSSY, "GLOSSY", 0, "Glossy", ""},
556 {R_BAKE_PASS_FILTER_TRANSM, "TRANSMISSION", 0, "Transmission", ""},
557 {0, nullptr, 0, nullptr, nullptr},
558};
559
561 {AOV_TYPE_COLOR, "COLOR", 0, "Color", ""},
562 {AOV_TYPE_VALUE, "VALUE", 0, "Value", ""},
563 {0, nullptr, 0, nullptr, nullptr},
564};
565
568 "BOUNDING_BOX_CENTER",
569 ICON_PIVOT_BOUNDBOX,
570 "Bounding Box Center",
571 "Pivot around bounding box center of selected object(s)"},
572 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
574 "INDIVIDUAL_ORIGINS",
575 ICON_PIVOT_INDIVIDUAL,
576 "Individual Origins",
577 "Pivot around each object's own origin"},
579 "MEDIAN_POINT",
580 ICON_PIVOT_MEDIAN,
581 "Median Point",
582 "Pivot around the median point of selected objects"},
584 "ACTIVE_ELEMENT",
585 ICON_PIVOT_ACTIVE,
586 "Active Element",
587 "Pivot around active object"},
588 {0, nullptr, 0, nullptr, nullptr},
589};
590
591/* Icons could be made a consistent set of images. */
594 "GLOBAL",
595 ICON_ORIENTATION_GLOBAL,
596 "Global",
597 "Align the transformation axes to world space"},
599 "LOCAL",
600 ICON_ORIENTATION_LOCAL,
601 "Local",
602 "Align the transformation axes to the selected objects' local space"},
604 "NORMAL",
605 ICON_ORIENTATION_NORMAL,
606 "Normal",
607 "Align the transformation axes to average normal of selected elements "
608 "(bone Y axis for pose mode)"},
610 "GIMBAL",
611 ICON_ORIENTATION_GIMBAL,
612 "Gimbal",
613 "Align each axis to the Euler rotation axis as used for input"},
615 "VIEW",
616 ICON_ORIENTATION_VIEW,
617 "View",
618 "Align the transformation axes to the window"},
620 "CURSOR",
621 ICON_ORIENTATION_CURSOR,
622 "Cursor",
623 "Align the transformation axes to the 3D cursor"},
625 "PARENT",
626 ICON_ORIENTATION_PARENT,
627 "Parent",
628 "Align the transformation axes to the object's parent space"},
629 // {V3D_ORIENT_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
630 {0, nullptr, 0, nullptr, nullptr},
631};
632
635 "SURFACE",
636 0,
637 "Surface",
638 "Start placing on the surface, using the 3D cursor position as a fallback"},
640 "CURSOR_PLANE",
641 0,
642 "Cursor Plane",
643 "Start placement using a point projected onto the orientation axis "
644 "at the 3D cursor position"},
646 "CURSOR_VIEW",
647 0,
648 "Cursor View",
649 "Start placement using a point projected onto the view plane at the 3D cursor position"},
650 {0, nullptr, 0, nullptr, nullptr},
651};
652
655 "SURFACE",
656 ICON_SNAP_NORMAL,
657 "Surface",
658 "Use the surface normal (using the transform orientation as a fallback)"},
660 "DEFAULT",
661 ICON_ORIENTATION_GLOBAL,
662 "Default",
663 "Use the current transform orientation"},
664 {0, nullptr, 0, nullptr, nullptr},
665};
666
668 {SCE_SNAP_TO_GEOM, "GEOMETRY", 0, "Geometry", "Snap to all geometry"},
669 {SCE_SNAP_TO_NONE, "DEFAULT", 0, "Default", "Use the current snap settings"},
670 {0, nullptr, 0, nullptr, nullptr},
671};
672
674 {GP_SELECTMODE_POINT, "POINT", ICON_GP_SELECT_POINTS, "Point", "Select only points"},
675 {GP_SELECTMODE_STROKE, "STROKE", ICON_GP_SELECT_STROKES, "Stroke", "Select all stroke points"},
677 "SEGMENT",
678 ICON_GP_SELECT_BETWEEN_STROKES,
679 "Segment",
680 "Select all stroke points between other strokes"},
681 {0, nullptr, 0, nullptr, nullptr},
682};
683
685 {1, "1", 0, "1:1", "Full resolution"},
686 {2, "2", 0, "1:2", "Render this effect at 50% render resolution"},
687 {4, "4", 0, "1:4", "Render this effect at 25% render resolution"},
688 {8, "8", 0, "1:8", "Render this effect at 12.5% render resolution"},
689 {16, "16", 0, "1:16", "Render this effect at 6.25% render resolution"},
690 {0, nullptr, 0, nullptr, nullptr},
691};
692
693#ifdef RNA_RUNTIME
694
695# include <algorithm>
696
697# include <fmt/format.h>
698
699# include "BLI_string_utils.hh"
700
701# include "DNA_anim_types.h"
702# include "DNA_cachefile_types.h"
703# include "DNA_color_types.h"
704# include "DNA_mesh_types.h"
705# include "DNA_node_types.h"
706# include "DNA_object_types.h"
707# include "DNA_text_types.h"
708# include "DNA_workspace_types.h"
709
710# include "RNA_access.hh"
711
712# include "MEM_guardedalloc.h"
713
714# include "BKE_animsys.h"
716# include "BKE_brush.hh"
717# include "BKE_collection.hh"
718# include "BKE_context.hh"
719# include "BKE_freestyle.h"
720# include "BKE_global.hh"
721# include "BKE_gpencil_legacy.h"
722# include "BKE_idprop.hh"
723# include "BKE_image.hh"
724# include "BKE_image_format.hh"
725# include "BKE_layer.hh"
726# include "BKE_main.hh"
727# include "BKE_mesh.hh"
728# include "BKE_node.hh"
729# include "BKE_pointcache.h"
730# include "BKE_scene.hh"
731# include "BKE_screen.hh"
732# include "BKE_unit.hh"
733
734# include "NOD_composite.hh"
735
736# include "ED_image.hh"
737# include "ED_info.hh"
738# include "ED_keyframing.hh"
739# include "ED_mesh.hh"
740# include "ED_node.hh"
741# include "ED_scene.hh"
742# include "ED_view3d.hh"
743
744# include "DEG_depsgraph_build.hh"
745# include "DEG_depsgraph_query.hh"
746
747# include "SEQ_relations.hh"
748# include "SEQ_sequencer.hh"
749# include "SEQ_sound.hh"
750
751# ifdef WITH_FREESTYLE
752# include "FRS_freestyle.h"
753# endif
754
755using blender::Vector;
756
757static int rna_ToolSettings_snap_mode_get(PointerRNA *ptr)
758{
759 ToolSettings *ts = (ToolSettings *)(ptr->data);
760 return ts->snap_mode;
761}
762
763static void rna_ToolSettings_snap_mode_set(PointerRNA *ptr, int value)
764{
766 if (value != 0) {
767 ts->snap_mode = value;
768 }
769}
770
771static void rna_ToolSettings_snap_uv_mode_set(PointerRNA *ptr, int value)
772{
773 ToolSettings *ts = static_cast<ToolSettings *>(ptr->data);
774 if (value != 0) {
775 ts->snap_uv_mode = value;
776 }
777}
778
779static void rna_Gpencil_mask_point_update(bContext * /*C*/, PointerRNA *ptr)
780{
782
783 ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_STROKE;
784 ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_SEGMENT;
785}
786
787static void rna_Gpencil_mask_stroke_update(bContext * /*C*/, PointerRNA *ptr)
788{
790
791 ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_POINT;
792 ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_SEGMENT;
793}
794
795static void rna_Gpencil_mask_segment_update(bContext * /*C*/, PointerRNA *ptr)
796{
798
799 ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_POINT;
800 ts->gpencil_selectmode_sculpt &= ~GP_SCULPT_MASK_SELECTMODE_STROKE;
801}
802
803static void rna_Gpencil_vertex_mask_point_update(bContext * /*C*/, PointerRNA *ptr)
804{
806
807 ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_STROKE;
808 ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_SEGMENT;
809}
810
811static void rna_Gpencil_vertex_mask_stroke_update(bContext * /*C*/, PointerRNA *ptr)
812{
814
815 ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_POINT;
816 ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_SEGMENT;
817}
818
819static void rna_Gpencil_vertex_mask_segment_update(bContext * /*C*/, PointerRNA *ptr)
820{
822
823 ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_POINT;
824 ts->gpencil_selectmode_vertex &= ~GP_VERTEX_MASK_SELECTMODE_STROKE;
825}
826
827static void rna_active_grease_pencil_update(bContext *C, PointerRNA * /*ptr*/)
828{
829 Object *active_object = CTX_data_active_object(C);
830 if (!active_object || active_object->type != OB_GREASE_PENCIL) {
831 return;
832 }
833 GreasePencil *grease_pencil = static_cast<GreasePencil *>(active_object->data);
834 DEG_id_tag_update(&grease_pencil->id, ID_RECALC_GEOMETRY);
836}
837
838/* Read-only Iterator of all the scene objects. */
839
840static void rna_Scene_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
841{
842 Scene *scene = (Scene *)ptr->data;
843 iter->internal.custom = MEM_callocN(sizeof(BLI_Iterator), __func__);
844
845 BKE_scene_objects_iterator_begin(static_cast<BLI_Iterator *>(iter->internal.custom),
846 (void *)scene);
847 iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
848}
849
850static void rna_Scene_objects_next(CollectionPropertyIterator *iter)
851{
853 iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
854}
855
856static void rna_Scene_objects_end(CollectionPropertyIterator *iter)
857{
860}
861
862static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter)
863{
864 Object *ob = static_cast<Object *>(((BLI_Iterator *)iter->internal.custom)->current);
865 return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ob);
866}
867
868/* End of read-only Iterator of all the scene objects. */
869
870static void rna_Scene_set_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
871{
872 Scene *scene = (Scene *)ptr->data;
873 Scene *set = (Scene *)value.data;
874 Scene *nested_set;
875
876 for (nested_set = set; nested_set; nested_set = nested_set->set) {
877 if (nested_set == scene) {
878 return;
879 }
880 /* prevent eternal loops, set can point to next, and next to set, without problems usually */
881 if (nested_set->set == set) {
882 return;
883 }
884 }
885
886 id_lib_extern((ID *)set);
887 scene->set = set;
888}
889
890void rna_Scene_set_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
891{
892 Scene *scene = (Scene *)ptr->owner_id;
893
895 DEG_id_tag_update_ex(bmain, &scene->id, ID_RECALC_BASE_FLAGS);
896 if (scene->set != nullptr) {
897 /* Objects which are pulled into main scene's depsgraph needs to have
898 * their base flags updated.
899 */
900 DEG_id_tag_update_ex(bmain, &scene->set->id, ID_RECALC_BASE_FLAGS);
901 }
902}
903
904static void rna_Scene_camera_update(Main *bmain, Scene * /*scene_unused*/, PointerRNA *ptr)
905{
906 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
907 Scene *scene = (Scene *)ptr->data;
908
909 WM_windows_scene_data_sync(&wm->windows, scene);
912}
913
914static void rna_Scene_fps_update(Main *bmain, Scene * /*active_scene*/, PointerRNA *ptr)
915{
916 Scene *scene = (Scene *)ptr->owner_id;
918 /* NOTE: Tag via dependency graph will take care of all the updates ion the evaluated domain,
919 * however, changes in FPS actually modifies an original skip length,
920 * so this we take care about here. */
921 SEQ_sound_update_length(bmain, scene);
922 /* Reset simulation states because new frame interval doesn't apply anymore. */
924}
925
926static void rna_Scene_listener_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
927{
929}
930
931static void rna_Scene_volume_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
932{
933 Scene *scene = (Scene *)ptr->owner_id;
935}
936
937static const char *rna_Scene_statistics_string_get(Scene *scene,
938 Main *bmain,
939 ReportList *reports,
940 ViewLayer *view_layer)
941{
942 if (!BKE_scene_has_view_layer(scene, view_layer)) {
943 BKE_reportf(reports,
944 RPT_ERROR,
945 "View Layer '%s' not found in scene '%s'",
946 view_layer->name,
947 scene->id.name + 2);
948 return "";
949 }
950
951 return ED_info_statistics_string(bmain, scene, view_layer);
952}
953
954static void rna_Scene_framelen_update(Main * /*bmain*/, Scene * /*active_scene*/, PointerRNA *ptr)
955{
956 Scene *scene = (Scene *)ptr->owner_id;
957 scene->r.framelen = float(scene->r.framapto) / float(scene->r.images);
958}
959
960static void rna_Scene_frame_current_set(PointerRNA *ptr, int value)
961{
962 Scene *data = (Scene *)ptr->data;
963
964 /* if negative frames aren't allowed, then we can't use them */
966 data->r.cfra = value;
967}
968
969static float rna_Scene_frame_float_get(PointerRNA *ptr)
970{
971 Scene *data = (Scene *)ptr->data;
972 return float(data->r.cfra) + data->r.subframe;
973}
974
975static void rna_Scene_frame_float_set(PointerRNA *ptr, float value)
976{
977 Scene *data = (Scene *)ptr->data;
978 /* if negative frames aren't allowed, then we can't use them */
980 data->r.cfra = int(value);
981 data->r.subframe = value - data->r.cfra;
982}
983
984static float rna_Scene_frame_current_final_get(PointerRNA *ptr)
985{
986 Scene *scene = (Scene *)ptr->data;
987
988 return BKE_scene_frame_to_ctime(scene, float(scene->r.cfra));
989}
990
991static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
992{
993 Scene *data = (Scene *)ptr->data;
994 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
995 CLAMP(value, MINFRAME, MAXFRAME);
996 data->r.sfra = value;
997
998 if (value > data->r.efra) {
999 data->r.efra = std::min(value, MAXFRAME);
1000 }
1001}
1002
1003static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
1004{
1005 Scene *data = (Scene *)ptr->data;
1006 CLAMP(value, MINFRAME, MAXFRAME);
1007 data->r.efra = value;
1008
1009 if (data->r.sfra > value) {
1010 data->r.sfra = std::max(value, MINFRAME);
1011 }
1012}
1013
1014static void rna_Scene_use_preview_range_set(PointerRNA *ptr, bool value)
1015{
1016 Scene *data = (Scene *)ptr->data;
1017
1018 if (value) {
1019 /* copy range from scene if not set before */
1020 if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) {
1021 data->r.psfra = data->r.sfra;
1022 data->r.pefra = data->r.efra;
1023 }
1024
1025 data->r.flag |= SCER_PRV_RANGE;
1026 }
1027 else {
1028 data->r.flag &= ~SCER_PRV_RANGE;
1029 }
1030}
1031
1032static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value)
1033{
1034 Scene *data = (Scene *)ptr->data;
1035
1036 /* check if enabled already */
1037 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
1038 /* set end of preview range to end frame, then clamp as per normal */
1039 /* TODO: or just refuse to set instead? */
1040 data->r.pefra = data->r.efra;
1041 }
1042 CLAMP(value, MINAFRAME, MAXFRAME);
1043 data->r.psfra = value;
1044
1045 if (value > data->r.pefra) {
1046 data->r.pefra = std::min(value, MAXFRAME);
1047 }
1048}
1049
1050static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value)
1051{
1052 Scene *data = (Scene *)ptr->data;
1053
1054 /* check if enabled already */
1055 if ((data->r.flag & SCER_PRV_RANGE) == 0) {
1056 /* set start of preview range to start frame, then clamp as per normal */
1057 /* TODO: or just refuse to set instead? */
1058 data->r.psfra = data->r.sfra;
1059 }
1060 CLAMP(value, MINAFRAME, MAXFRAME);
1061 data->r.pefra = value;
1062
1063 if (data->r.psfra > value) {
1064 data->r.psfra = std::max(value, MINAFRAME);
1065 }
1066}
1067
1068static void rna_Scene_show_subframe_update(Main * /*bmain*/,
1069 Scene * /*current_scene*/,
1070 PointerRNA *ptr)
1071{
1072 Scene *scene = (Scene *)ptr->owner_id;
1073 scene->r.subframe = 0.0f;
1074}
1075
1076static void rna_Scene_frame_update(Main * /*bmain*/, Scene * /*current_scene*/, PointerRNA *ptr)
1077{
1078 Scene *scene = (Scene *)ptr->owner_id;
1081}
1082
1083static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr)
1084{
1085 Scene *scene = (Scene *)ptr->data;
1086 return rna_pointer_inherit_refine(ptr, &RNA_KeyingSet, ANIM_scene_get_active_keyingset(scene));
1087}
1088
1089static void rna_Scene_active_keying_set_set(PointerRNA *ptr,
1090 PointerRNA value,
1091 ReportList * /*reports*/)
1092{
1093 Scene *scene = (Scene *)ptr->data;
1094 KeyingSet *ks = (KeyingSet *)value.data;
1095
1096 scene->active_keyingset = ANIM_scene_get_keyingset_index(scene, ks);
1097}
1098
1099/* get KeyingSet index stuff for list of Keying Sets editing UI
1100 * - active_keyingset-1 since 0 is reserved for 'none'
1101 * - don't clamp, otherwise can never set builtin's types as active...
1102 */
1103static int rna_Scene_active_keying_set_index_get(PointerRNA *ptr)
1104{
1105 Scene *scene = (Scene *)ptr->data;
1106 return scene->active_keyingset - 1;
1107}
1108
1109/* get KeyingSet index stuff for list of Keying Sets editing UI
1110 * - value+1 since 0 is reserved for 'none'
1111 */
1112static void rna_Scene_active_keying_set_index_set(PointerRNA *ptr, int value)
1113{
1114 Scene *scene = (Scene *)ptr->data;
1115 scene->active_keyingset = value + 1;
1116}
1117
1118/* XXX: evil... builtin_keyingsets is defined in `keyingsets.cc`! */
1119/* TODO: make API function to retrieve this... */
1121
1122static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1123{
1124 Scene *scene = (Scene *)ptr->data;
1125
1126 /* start going over the scene KeyingSets first, while we still have pointer to it
1127 * but only if we have any Keying Sets to use...
1128 */
1129 if (scene->keyingsets.first) {
1130 rna_iterator_listbase_begin(iter, &scene->keyingsets, nullptr);
1131 }
1132 else {
1134 }
1135}
1136
1137static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter)
1138{
1139 ListBaseIterator *internal = &iter->internal.listbase;
1140 KeyingSet *ks = (KeyingSet *)internal->link;
1141
1142 /* If we've run out of links in Scene list,
1143 * jump over to the builtins list unless we're there already. */
1144 if ((ks->next == nullptr) && (ks != builtin_keyingsets.last)) {
1145 internal->link = (Link *)builtin_keyingsets.first;
1146 }
1147 else {
1148 internal->link = (Link *)ks->next;
1149 }
1150
1151 iter->valid = (internal->link != nullptr);
1152}
1153
1154static std::optional<std::string> rna_SceneEEVEE_path(const PointerRNA * /*ptr*/)
1155{
1156 return "eevee";
1157}
1158
1159static std::optional<std::string> rna_RaytraceEEVEE_path(const PointerRNA * /*ptr*/)
1160{
1161 return "eevee.ray_tracing_options";
1162}
1163
1164static std::optional<std::string> rna_SceneGpencil_path(const PointerRNA * /*ptr*/)
1165{
1166 return "grease_pencil_settings";
1167}
1168
1169static std::optional<std::string> rna_SceneHydra_path(const PointerRNA * /*ptr*/)
1170{
1171 return "hydra";
1172}
1173
1174static bool rna_RenderSettings_stereoViews_skip(CollectionPropertyIterator *iter, void * /*data*/)
1175{
1176 ListBaseIterator *internal = &iter->internal.listbase;
1177 SceneRenderView *srv = (SceneRenderView *)internal->link;
1178
1179 if (STR_ELEM(srv->name, STEREO_LEFT_NAME, STEREO_RIGHT_NAME)) {
1180 return false;
1181 }
1182
1183 return true;
1184};
1185
1186static void rna_RenderSettings_stereoViews_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
1187{
1188 RenderData *rd = (RenderData *)ptr->data;
1189 rna_iterator_listbase_begin(iter, &rd->views, rna_RenderSettings_stereoViews_skip);
1190}
1191
1192static std::optional<std::string> rna_RenderSettings_path(const PointerRNA * /*ptr*/)
1193{
1194 return "render";
1195}
1196
1197static std::optional<std::string> rna_BakeSettings_path(const PointerRNA * /*ptr*/)
1198{
1199 return "render.bake";
1200}
1201
1202static std::optional<std::string> rna_ImageFormatSettings_path(const PointerRNA *ptr)
1203{
1205 ID *id = ptr->owner_id;
1206
1207 switch (GS(id->name)) {
1208 case ID_SCE: {
1209 Scene *scene = (Scene *)id;
1210
1211 if (&scene->r.im_format == imf) {
1212 return "render.image_settings";
1213 }
1214 else if (&scene->r.bake.im_format == imf) {
1215 return "render.bake.image_settings";
1216 }
1217 return "..";
1218 }
1219 case ID_NT: {
1220 bNodeTree *ntree = (bNodeTree *)id;
1221 bNode *node;
1222
1223 for (node = static_cast<bNode *>(ntree->nodes.first); node; node = node->next) {
1224 if (node->type == CMP_NODE_OUTPUT_FILE) {
1225 if (&((NodeImageMultiFile *)node->storage)->format == imf) {
1226 char node_name_esc[sizeof(node->name) * 2];
1227 BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
1228 return fmt::format("nodes[\"{}\"].format", node_name_esc);
1229 }
1230 else {
1231 bNodeSocket *sock;
1232
1233 for (sock = static_cast<bNodeSocket *>(node->inputs.first); sock; sock = sock->next) {
1234 NodeImageMultiFileSocket *sockdata = static_cast<NodeImageMultiFileSocket *>(
1235 sock->storage);
1236 if (&sockdata->format == imf) {
1237 char node_name_esc[sizeof(node->name) * 2];
1238 BLI_str_escape(node_name_esc, node->name, sizeof(node_name_esc));
1239
1240 char socketdata_path_esc[sizeof(sockdata->path) * 2];
1241 BLI_str_escape(socketdata_path_esc, sockdata->path, sizeof(socketdata_path_esc));
1242
1243 return fmt::format(
1244 "nodes[\"{}\"].file_slots[\"{}\"].format", node_name_esc, socketdata_path_esc);
1245 }
1246 }
1247 }
1248 }
1249 }
1250 return "..";
1251 }
1252 default:
1253 return "..";
1254 }
1255}
1256
1257static int rna_RenderSettings_threads_get(PointerRNA *ptr)
1258{
1259 RenderData *rd = (RenderData *)ptr->data;
1260 return BKE_render_num_threads(rd);
1261}
1262
1263static int rna_RenderSettings_threads_mode_get(PointerRNA *ptr)
1264{
1265 RenderData *rd = (RenderData *)ptr->data;
1266 int override = BLI_system_num_threads_override_get();
1267
1268 if (override > 0) {
1269 return R_FIXED_THREADS;
1270 }
1271 else {
1272 return (rd->mode & R_FIXED_THREADS);
1273 }
1274}
1275
1276static bool rna_RenderSettings_is_movie_format_get(PointerRNA *ptr)
1277{
1278 RenderData *rd = (RenderData *)ptr->data;
1279 return BKE_imtype_is_movie(rd->im_format.imtype);
1280}
1281
1282static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
1283{
1285 ID *id = ptr->owner_id;
1286 imf->imtype = value;
1287
1288 const bool is_render = (id && GS(id->name) == ID_SCE);
1289 /* see note below on why this is */
1290 const char chan_flag = BKE_imtype_valid_channels(imf->imtype, true) |
1291 (is_render ? IMA_CHAN_FLAG_BW : 0);
1292
1293 /* ensure depth and color settings match */
1294 if ((imf->planes == R_IMF_PLANES_BW) && !(chan_flag & IMA_CHAN_FLAG_BW)) {
1295 imf->planes = R_IMF_PLANES_RGBA;
1296 }
1297 if ((imf->planes == R_IMF_PLANES_RGBA) && !(chan_flag & IMA_CHAN_FLAG_RGBA)) {
1298 imf->planes = R_IMF_PLANES_RGB;
1299 }
1300
1301 /* ensure usable depth */
1302 {
1303 const int depth_ok = BKE_imtype_valid_depths(imf->imtype);
1304 if ((imf->depth & depth_ok) == 0) {
1305 /* set first available depth */
1306 char depth_ls[] = {
1314 0,
1315 };
1316 int i;
1317
1318 for (i = 0; depth_ls[i]; i++) {
1319 if (depth_ok & depth_ls[i]) {
1320 imf->depth = depth_ls[i];
1321 break;
1322 }
1323 }
1324 }
1325 }
1326
1327 if (id && GS(id->name) == ID_SCE) {
1328 Scene *scene = (Scene *)ptr->owner_id;
1329 RenderData *rd = &scene->r;
1330# ifdef WITH_FFMPEG
1331 BKE_ffmpeg_image_type_verify(rd, imf);
1332# endif
1333 (void)rd;
1334 }
1335
1337}
1338
1339static const EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf(bContext * /*C*/,
1340 PointerRNA *ptr,
1341 PropertyRNA * /*prop*/,
1342 bool * /*r_free*/)
1343{
1344 ID *id = ptr->owner_id;
1345 if (id && GS(id->name) == ID_SCE) {
1347 }
1348 else {
1349 return image_only_type_items;
1350 }
1351}
1352
1353static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext * /*C*/,
1354 PointerRNA *ptr,
1355 PropertyRNA * /*prop*/,
1356 bool *r_free)
1357{
1359 ID *id = ptr->owner_id;
1360 const bool is_render = (id && GS(id->name) == ID_SCE);
1361
1362 /* NOTE(@ideasman42): we need to act differently for render
1363 * where 'BW' will force grayscale even if the output format writes
1364 * as RGBA, this is age old blender convention and not sure how useful
1365 * it really is but keep it for now. */
1366 char chan_flag = BKE_imtype_valid_channels(imf->imtype, true) |
1367 (is_render ? IMA_CHAN_FLAG_BW : 0);
1368
1369# ifdef WITH_FFMPEG
1370 /* a WAY more crappy case than B&W flag: depending on codec, file format MIGHT support
1371 * alpha channel. for example MPEG format with h264 codec can't do alpha channel, but
1372 * the same MPEG format with QTRLE codec can easily handle alpha channel.
1373 * not sure how to deal with such cases in a nicer way (sergey) */
1374 if (is_render) {
1375 Scene *scene = (Scene *)ptr->owner_id;
1376 RenderData *rd = &scene->r;
1377
1378 if (BKE_ffmpeg_alpha_channel_is_supported(rd)) {
1379 chan_flag |= IMA_CHAN_FLAG_RGBA;
1380 }
1381 }
1382# endif
1383
1384 if (chan_flag == (IMA_CHAN_FLAG_BW | IMA_CHAN_FLAG_RGB | IMA_CHAN_FLAG_RGBA)) {
1386 }
1387 else {
1388 int totitem = 0;
1389 EnumPropertyItem *item = nullptr;
1390
1391 if (chan_flag & IMA_CHAN_FLAG_BW) {
1392 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_BW);
1393 }
1394 if (chan_flag & IMA_CHAN_FLAG_RGB) {
1395 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB);
1396 }
1397 if (chan_flag & IMA_CHAN_FLAG_RGBA) {
1398 RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA);
1399 }
1400
1401 RNA_enum_item_end(&item, &totitem);
1402 *r_free = true;
1403
1404 return item;
1405 }
1406}
1407
1408static const EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext * /*C*/,
1409 PointerRNA *ptr,
1410 PropertyRNA * /*prop*/,
1411 bool *r_free)
1412{
1414
1415 if (imf == nullptr) {
1417 }
1418 else {
1419 const int depth_ok = BKE_imtype_valid_depths(imf->imtype);
1420 const int is_float = ELEM(
1422
1424 const EnumPropertyItem *item_10bit = &rna_enum_image_color_depth_items[1];
1425 const EnumPropertyItem *item_12bit = &rna_enum_image_color_depth_items[2];
1426 const EnumPropertyItem *item_16bit = &rna_enum_image_color_depth_items[3];
1427 const EnumPropertyItem *item_32bit = &rna_enum_image_color_depth_items[4];
1428
1429 int totitem = 0;
1430 EnumPropertyItem *item = nullptr;
1431 EnumPropertyItem tmp = {0, "", 0, "", ""};
1432
1433 if (depth_ok & R_IMF_CHAN_DEPTH_8) {
1434 RNA_enum_item_add(&item, &totitem, item_8bit);
1435 }
1436
1437 if (depth_ok & R_IMF_CHAN_DEPTH_10) {
1438 RNA_enum_item_add(&item, &totitem, item_10bit);
1439 }
1440
1441 if (depth_ok & R_IMF_CHAN_DEPTH_12) {
1442 RNA_enum_item_add(&item, &totitem, item_12bit);
1443 }
1444
1445 if (depth_ok & R_IMF_CHAN_DEPTH_16) {
1446 if (is_float) {
1447 tmp = *item_16bit;
1448 tmp.name = "Float (Half)";
1450 tmp.description =
1451 "16-bit color channels. Data passes like Depth will still be saved using full "
1452 "32-bit precision.";
1453 }
1454 RNA_enum_item_add(&item, &totitem, &tmp);
1455 }
1456 else {
1457 RNA_enum_item_add(&item, &totitem, item_16bit);
1458 }
1459 }
1460
1461 if (depth_ok & R_IMF_CHAN_DEPTH_32) {
1462 if (is_float) {
1463 tmp = *item_32bit;
1464 tmp.name = "Float (Full)";
1465 RNA_enum_item_add(&item, &totitem, &tmp);
1466 }
1467 else {
1468 RNA_enum_item_add(&item, &totitem, item_32bit);
1469 }
1470 }
1471
1472 RNA_enum_item_end(&item, &totitem);
1473 *r_free = true;
1474
1475 return item;
1476 }
1477}
1478
1479static const EnumPropertyItem *rna_ImageFormatSettings_views_format_itemf(bContext * /*C*/,
1480 PointerRNA *ptr,
1481 PropertyRNA * /*prop*/,
1482 bool * /*r_free*/)
1483{
1485
1486 if (imf == nullptr) {
1488 }
1489 else if (imf->imtype == R_IMF_IMTYPE_OPENEXR) {
1491 }
1492 else if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) {
1494 }
1495 else {
1497 }
1498}
1499
1500# ifdef WITH_OPENEXR
1501/* OpenEXR */
1502
1503static const EnumPropertyItem *rna_ImageFormatSettings_exr_codec_itemf(bContext * /*C*/,
1504 PointerRNA *ptr,
1505 PropertyRNA * /*prop*/,
1506 bool *r_free)
1507{
1509
1510 EnumPropertyItem *item = nullptr;
1511 int i = 1, totitem = 0;
1512
1513 if (imf->depth == 16) {
1514 return rna_enum_exr_codec_items; /* All compression types are defined for half-float. */
1515 }
1516
1517 for (i = 0; i < R_IMF_EXR_CODEC_MAX; i++) {
1519 continue; /* B44 and B44A are not defined for 32 bit floats */
1520 }
1521
1522 RNA_enum_item_add(&item, &totitem, &rna_enum_exr_codec_items[i]);
1523 }
1524
1525 RNA_enum_item_end(&item, &totitem);
1526 *r_free = true;
1527
1528 return item;
1529}
1530
1531# endif
1532
1533static bool rna_ImageFormatSettings_has_linear_colorspace_get(PointerRNA *ptr)
1534{
1536 return BKE_imtype_requires_linear_float(imf->imtype);
1537}
1538
1539static void rna_ImageFormatSettings_color_management_set(PointerRNA *ptr, int value)
1540{
1542
1543 if (imf->color_management != value) {
1544 imf->color_management = value;
1545
1546 /* Copy from scene when enabling override. */
1547 if (imf->color_management == R_IMF_COLOR_MANAGEMENT_OVERRIDE) {
1548 ID *owner_id = ptr->owner_id;
1549 if (owner_id && GS(owner_id->name) == ID_NT) {
1550 /* For compositing nodes, find the corresponding scene. */
1551 owner_id = BKE_id_owner_get(owner_id);
1552 }
1553 if (owner_id && GS(owner_id->name) == ID_SCE) {
1555 }
1556 }
1557 }
1558}
1559
1560static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
1561{
1562 const RenderData *rd = (RenderData *)ptr->data;
1563 const char *ext_array[BKE_IMAGE_PATH_EXT_MAX];
1564 int ext_num = BKE_image_path_ext_from_imformat(&rd->im_format, ext_array);
1565 return ext_num ? strlen(ext_array[0]) : 0;
1566}
1567
1568static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *value)
1569{
1570 const RenderData *rd = (RenderData *)ptr->data;
1571 const char *ext_array[BKE_IMAGE_PATH_EXT_MAX];
1572 int ext_num = BKE_image_path_ext_from_imformat(&rd->im_format, ext_array);
1573 strcpy(value, ext_num ? ext_array[0] : "");
1574}
1575
1576# ifdef WITH_FFMPEG
1577static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, bool value)
1578{
1579 Scene *scene = (Scene *)ptr->owner_id;
1580 RenderData *rd = &scene->r;
1581
1582 if (value) {
1584 }
1585 else {
1586 rd->ffcodecdata.flags &= ~FFMPEG_LOSSLESS_OUTPUT;
1587 }
1588}
1589# endif
1590
1591static int rna_RenderSettings_active_view_index_get(PointerRNA *ptr)
1592{
1593 RenderData *rd = (RenderData *)ptr->data;
1594 return rd->actview;
1595}
1596
1597static void rna_RenderSettings_active_view_index_set(PointerRNA *ptr, int value)
1598{
1599 RenderData *rd = (RenderData *)ptr->data;
1600 rd->actview = value;
1601}
1602
1603static void rna_RenderSettings_active_view_index_range(
1604 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
1605{
1606 RenderData *rd = (RenderData *)ptr->data;
1607
1608 *min = 0;
1609 *max = max_ii(0, BLI_listbase_count(&rd->views) - 1);
1610}
1611
1612static PointerRNA rna_RenderSettings_active_view_get(PointerRNA *ptr)
1613{
1614 RenderData *rd = (RenderData *)ptr->data;
1615 SceneRenderView *srv = static_cast<SceneRenderView *>(BLI_findlink(&rd->views, rd->actview));
1616
1617 return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderView, srv);
1618}
1619
1620static void rna_RenderSettings_active_view_set(PointerRNA *ptr,
1621 PointerRNA value,
1622 ReportList * /*reports*/)
1623{
1624 RenderData *rd = (RenderData *)ptr->data;
1625 SceneRenderView *srv = (SceneRenderView *)value.data;
1626 const int index = BLI_findindex(&rd->views, srv);
1627 if (index != -1) {
1628 rd->actview = index;
1629 }
1630}
1631
1632static SceneRenderView *rna_RenderView_new(ID *id, RenderData * /*rd*/, const char *name)
1633{
1634 Scene *scene = (Scene *)id;
1635 SceneRenderView *srv = BKE_scene_add_render_view(scene, name);
1636
1638
1639 return srv;
1640}
1641
1642static void rna_RenderView_remove(
1643 ID *id, RenderData * /*rd*/, Main * /*bmain*/, ReportList *reports, PointerRNA *srv_ptr)
1644{
1645 SceneRenderView *srv = static_cast<SceneRenderView *>(srv_ptr->data);
1646 Scene *scene = (Scene *)id;
1647
1648 if (!BKE_scene_remove_render_view(scene, srv)) {
1649 BKE_reportf(reports,
1650 RPT_ERROR,
1651 "Render view '%s' could not be removed from scene '%s'",
1652 srv->name,
1653 scene->id.name + 2);
1654 return;
1655 }
1656
1657 RNA_POINTER_INVALIDATE(srv_ptr);
1658
1660}
1661
1662static void rna_RenderSettings_views_format_set(PointerRNA *ptr, int value)
1663{
1664 RenderData *rd = (RenderData *)ptr->data;
1665
1667 /* make sure the actview is visible */
1668 if (rd->actview > 1) {
1669 rd->actview = 1;
1670 }
1671 }
1672
1673 rd->views_format = value;
1674}
1675
1676static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
1677{
1678 RenderData *rd = (RenderData *)ptr->data;
1679 RenderEngineType *type = static_cast<RenderEngineType *>(BLI_findlink(&R_engines, value));
1680
1681 if (type) {
1682 STRNCPY_UTF8(rd->engine, type->idname);
1684 }
1685}
1686
1687static const EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext * /*C*/,
1688 PointerRNA * /*ptr*/,
1689 PropertyRNA * /*prop*/,
1690 bool *r_free)
1691{
1692 RenderEngineType *type;
1693 EnumPropertyItem *item = nullptr;
1694 EnumPropertyItem tmp = {0, "", 0, "", ""};
1695 int a = 0, totitem = 0;
1696
1697 for (type = static_cast<RenderEngineType *>(R_engines.first); type; type = type->next, a++) {
1698 tmp.value = a;
1699 tmp.identifier = type->idname;
1700 tmp.name = type->name;
1701 RNA_enum_item_add(&item, &totitem, &tmp);
1702 }
1703
1704 RNA_enum_item_end(&item, &totitem);
1705 *r_free = true;
1706
1707 return item;
1708}
1709
1710static int rna_RenderSettings_engine_get(PointerRNA *ptr)
1711{
1712 RenderData *rd = (RenderData *)ptr->data;
1713 RenderEngineType *type;
1714 int a = 0;
1715
1716 for (type = static_cast<RenderEngineType *>(R_engines.first); type; type = type->next, a++) {
1717 if (STREQ(type->idname, rd->engine)) {
1718 return a;
1719 }
1720 }
1721
1722 return 0;
1723}
1724
1725static void rna_RenderSettings_engine_update(Main *bmain, Scene * /*unused*/, PointerRNA * /*ptr*/)
1726{
1727 ED_render_engine_changed(bmain, true);
1728}
1729
1730static void rna_Scene_update_render_engine(Main *bmain)
1731{
1732 ED_render_engine_changed(bmain, true);
1733}
1734
1735static bool rna_RenderSettings_multiple_engines_get(PointerRNA * /*ptr*/)
1736{
1737 return (BLI_listbase_count(&R_engines) > 1);
1738}
1739
1740static bool rna_RenderSettings_use_spherical_stereo_get(PointerRNA *ptr)
1741{
1742 Scene *scene = (Scene *)ptr->owner_id;
1743 return BKE_scene_use_spherical_stereo(scene);
1744}
1745
1746void rna_Scene_render_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1747{
1748 Scene *scene = (Scene *)ptr->owner_id;
1749
1751}
1752
1753static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1754{
1755 Scene *screen = (Scene *)ptr->owner_id;
1756
1757 rna_Scene_render_update(bmain, scene, ptr);
1758 WM_main_add_notifier(NC_WORLD | ND_WORLD, &screen->id);
1760}
1761
1762static void rna_Scene_mesh_quality_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1763{
1764 Scene *scene = (Scene *)ptr->owner_id;
1765
1766 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1767 if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_VOLUME, OB_MBALL)) {
1769 }
1770 }
1772
1773 rna_Scene_render_update(bmain, scene, ptr);
1774}
1775
1776void rna_Scene_freestyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1777{
1778 Scene *scene = (Scene *)ptr->owner_id;
1779
1781}
1782
1783void rna_Scene_use_freestyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1784{
1785 Scene *scene = (Scene *)ptr->owner_id;
1786
1788
1789 if (scene->nodetree) {
1790 ntreeCompositUpdateRLayers(scene->nodetree);
1791 }
1792}
1793
1794void rna_Scene_compositor_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1795{
1796 Scene *scene = (Scene *)ptr->owner_id;
1797
1798 if (scene->nodetree) {
1799 bNodeTree *ntree = reinterpret_cast<bNodeTree *>(scene->nodetree);
1802 ED_node_tree_propagate_change(nullptr, bmain, ntree);
1803 }
1804}
1805
1806void rna_Scene_use_view_map_cache_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA * /*ptr*/)
1807{
1808# ifdef WITH_FREESTYLE
1810# endif
1811}
1812
1813void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value)
1814{
1815 Scene *scene = (Scene *)ptr->owner_id;
1816 ViewLayer *view_layer = (ViewLayer *)ptr->data;
1818 BKE_view_layer_rename(G_MAIN, scene, view_layer, value);
1819}
1820
1821static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value)
1822{
1823 Scene *scene = (Scene *)ptr->owner_id;
1825 STRNCPY_UTF8(rv->name, value);
1826 BLI_uniquename(&scene->r.views,
1827 rv,
1828 DATA_("RenderView"),
1829 '.',
1831 sizeof(rv->name));
1832}
1833
1834void rna_ViewLayer_override_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
1835{
1836 Scene *scene = (Scene *)ptr->owner_id;
1837 rna_Scene_render_update(bmain, scene, ptr);
1839}
1840
1841void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr)
1842{
1843 Scene *scene = (Scene *)ptr->owner_id;
1844
1845 ViewLayer *view_layer = nullptr;
1846 if (ptr->type == &RNA_ViewLayer) {
1847 view_layer = (ViewLayer *)ptr->data;
1848 }
1849 else if (ptr->type == &RNA_AOV) {
1850 ViewLayerAOV *aov = (ViewLayerAOV *)ptr->data;
1851 view_layer = BKE_view_layer_find_with_aov(scene, aov);
1852 }
1853 else if (ptr->type == &RNA_Lightgroup) {
1855 view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
1856 }
1857
1858 if (view_layer) {
1859 RenderEngineType *engine_type = RE_engines_find(scene->r.engine);
1860 if (engine_type->update_render_passes) {
1861 RenderEngine *engine = RE_engine_create(engine_type);
1862 if (engine) {
1863 BKE_view_layer_verify_aov(engine, scene, view_layer);
1864 }
1865 RE_engine_free(engine);
1866 engine = nullptr;
1867 }
1868 }
1869
1870 if (scene->nodetree) {
1871 ntreeCompositUpdateRLayers(scene->nodetree);
1872 }
1873
1874 rna_Scene_render_update(bmain, activescene, ptr);
1875}
1876
1877static std::optional<std::string> rna_ViewLayerEEVEE_path(const PointerRNA *ptr)
1878{
1879 const ViewLayerEEVEE *view_layer_eevee = (ViewLayerEEVEE *)ptr->data;
1880 const ViewLayer *view_layer = (ViewLayer *)((uint8_t *)view_layer_eevee -
1881 offsetof(ViewLayer, eevee));
1882 char rna_path[sizeof(view_layer->name) * 3];
1883
1884 const size_t view_layer_path_len = rna_ViewLayer_path_buffer_get(
1885 view_layer, rna_path, sizeof(rna_path));
1886
1887 BLI_strncpy(rna_path + view_layer_path_len, ".eevee", sizeof(rna_path) - view_layer_path_len);
1888
1889 return rna_path;
1890}
1891
1892static void rna_SceneEEVEE_gi_cubemap_resolution_update(Main * /*main*/,
1893 Scene *scene,
1894 PointerRNA * /*ptr*/)
1895{
1896 /* Tag all light probes to recalc transform. This signals EEVEE to update the light probes. */
1897 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1898 if (ob->type == OB_LIGHTPROBE) {
1900 }
1901 }
1903}
1904
1905static void rna_SceneEEVEE_clamp_surface_indirect_update(Main * /*main*/,
1906 Scene *scene,
1907 PointerRNA * /*ptr*/)
1908{
1909 /* Tag all light probes to recalc transform. This signals EEVEE to update the light probes. */
1910 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1911 if (ob->type == OB_LIGHTPROBE) {
1913 }
1914 }
1916
1917 /* Also tag the world. */
1918 DEG_id_tag_update(&scene->world->id, ID_RECALC_SHADING);
1919}
1920
1921static void rna_SceneEEVEE_shadow_resolution_update(Main * /*bmain*/,
1922 Scene *scene,
1923 PointerRNA * /*ptr*/)
1924{
1925 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1926 if (ob->type == OB_LAMP) {
1928 }
1929 }
1931
1935}
1936
1937static std::optional<std::string> rna_SceneRenderView_path(const PointerRNA *ptr)
1938{
1939 const SceneRenderView *srv = (SceneRenderView *)ptr->data;
1940 char srv_name_esc[sizeof(srv->name) * 2];
1941 BLI_str_escape(srv_name_esc, srv->name, sizeof(srv_name_esc));
1942 return fmt::format("render.views[\"{}\"]", srv_name_esc);
1943}
1944
1945static void rna_Scene_use_nodes_update(bContext *C, PointerRNA *ptr)
1946{
1947 Scene *scene = (Scene *)ptr->data;
1948 if (scene->use_nodes && scene->nodetree == nullptr) {
1949 ED_node_composit_default(C, scene);
1950 }
1952}
1953
1954static void rna_Physics_relations_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
1955{
1957}
1958
1959static void rna_Physics_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1960{
1961 Scene *scene = (Scene *)ptr->owner_id;
1962 FOREACH_SCENE_OBJECT_BEGIN (scene, ob) {
1964 }
1966
1968}
1969
1970static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const bool *value)
1971{
1973 int flag = (value[0] ? SCE_SELECT_VERTEX : 0) | (value[1] ? SCE_SELECT_EDGE : 0) |
1974 (value[2] ? SCE_SELECT_FACE : 0);
1975
1976 if (flag) {
1977 ts->selectmode = flag;
1978
1979 /* Update select mode in all the workspaces in mesh edit mode. */
1980 wmWindowManager *wm = static_cast<wmWindowManager *>(G_MAIN->wm.first);
1981 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
1982 const Scene *scene = WM_window_get_active_scene(win);
1983 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
1984 if (view_layer) {
1985 BKE_view_layer_synced_ensure(scene, view_layer);
1986 Object *object = BKE_view_layer_active_object_get(view_layer);
1987 if (object) {
1988 Mesh *mesh = BKE_mesh_from_object(object);
1989 if (mesh && mesh->runtime->edit_mesh && mesh->runtime->edit_mesh->selectmode != flag) {
1990 mesh->runtime->edit_mesh->selectmode = flag;
1991 EDBM_selectmode_set(mesh->runtime->edit_mesh.get());
1992 }
1993 }
1994 }
1995 }
1996 }
1997}
1998
1999static void rna_Scene_editmesh_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2000{
2001 const Scene *scene = CTX_data_scene(C);
2002 ViewLayer *view_layer = CTX_data_view_layer(C);
2003 Mesh *mesh = nullptr;
2004
2005 BKE_view_layer_synced_ensure(scene, view_layer);
2006 Object *object = BKE_view_layer_active_object_get(view_layer);
2007 if (object) {
2008 mesh = BKE_mesh_from_object(object);
2009 if (mesh && mesh->runtime->edit_mesh == nullptr) {
2010 mesh = nullptr;
2011 }
2012 }
2013
2014 if (mesh) {
2017 }
2018}
2019
2020static void rna_Scene_uv_select_mode_update(bContext *C, PointerRNA * /*ptr*/)
2021{
2022 /* Makes sure that the UV selection states are consistent with the current UV select mode and
2023 * sticky mode. */
2025}
2026
2027static void object_simplify_update(Scene *scene,
2028 Object *ob,
2029 bool update_normals,
2030 Depsgraph *depsgraph)
2031{
2032 ModifierData *md;
2033 ParticleSystem *psys;
2034
2035 if ((ob->id.tag & ID_TAG_DOIT) == 0) {
2036 return;
2037 }
2038
2039 ob->id.tag &= ~ID_TAG_DOIT;
2040
2041 for (md = static_cast<ModifierData *>(ob->modifiers.first); md; md = md->next) {
2042 if (md->type == eModifierType_Nodes && depsgraph != nullptr) {
2044 const blender::bke::GeometrySet *geometry_set = ob_eval->runtime->geometry_set_eval;
2045 if (geometry_set != nullptr && geometry_set->has_volume()) {
2047 }
2048 continue;
2049 }
2050 if (ELEM(
2052 {
2054 }
2055 }
2056
2057 for (psys = static_cast<ParticleSystem *>(ob->particlesystem.first); psys; psys = psys->next) {
2059 }
2060
2061 if (ob->instance_collection) {
2063 object_simplify_update(scene, ob_collection, update_normals, depsgraph);
2064 }
2066 }
2067
2068 if (ob->type == OB_VOLUME) {
2070 }
2071
2072 if (scene->r.mode & R_SIMPLIFY_NORMALS || update_normals) {
2073 if (OB_TYPE_IS_GEOMETRY(ob->type)) {
2075 }
2076 }
2077
2078 if (ob->type == OB_LAMP) {
2080 }
2081}
2082
2083static void rna_Scene_simplify_update_impl(Main *bmain,
2084 Scene *sce,
2085 bool update_normals,
2086 Depsgraph *depsgraph)
2087{
2088 Scene *sce_iter;
2089 Base *base;
2090
2092 FOREACH_SCENE_OBJECT_BEGIN (sce, ob) {
2093 object_simplify_update(sce, ob, update_normals, depsgraph);
2094 }
2096
2097 for (SETLOOPER_SET_ONLY(sce, sce_iter, base)) {
2098 object_simplify_update(sce, base->object, update_normals, depsgraph);
2099 }
2100
2104}
2105
2106static void rna_Scene_use_simplify_update(bContext *C, PointerRNA *ptr)
2107{
2108 Scene *scene = (Scene *)ptr->owner_id;
2109 Main *bmain = CTX_data_main(C);
2110 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
2111 rna_Scene_simplify_update_impl(bmain, scene, false, depsgraph);
2112}
2113
2114static void rna_Scene_simplify_volume_update(bContext *C, PointerRNA *ptr)
2115{
2116 Scene *scene = (Scene *)ptr->owner_id;
2117 Main *bmain = CTX_data_main(C);
2118 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
2119 if (scene->r.mode & R_SIMPLIFY) {
2120 rna_Scene_simplify_update_impl(bmain, scene, false, depsgraph);
2121 }
2122}
2123
2124static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
2125{
2126 if (scene->r.mode & R_SIMPLIFY) {
2127 rna_Scene_simplify_update_impl(bmain, scene, false, nullptr);
2128 }
2129}
2130
2131static void rna_Scene_use_simplify_normals_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
2132{
2133 /* NOTE: Ideally this would just force recalculation of the draw batch cache normals.
2134 * That's complicated enough to not be worth it here. */
2135 if (scene->r.mode & R_SIMPLIFY) {
2136 rna_Scene_simplify_update_impl(bmain, scene, true, nullptr);
2137 }
2138}
2139
2140static void rna_Scene_use_persistent_data_update(Main * /*bmain*/,
2141 Scene * /*scene*/,
2142 PointerRNA *ptr)
2143{
2144 Scene *scene = (Scene *)ptr->owner_id;
2145
2146 if (!(scene->r.mode & R_PERSISTENT_DATA)) {
2147 RE_FreePersistentData(scene);
2148 }
2149}
2150
2151/* Scene.transform_orientation_slots */
2152static void rna_Scene_transform_orientation_slots_begin(CollectionPropertyIterator *iter,
2153 PointerRNA *ptr)
2154{
2155 Scene *scene = (Scene *)ptr->owner_id;
2156 TransformOrientationSlot *orient_slot = &scene->orientation_slots[0];
2158 iter, orient_slot, sizeof(*orient_slot), ARRAY_SIZE(scene->orientation_slots), 0, nullptr);
2159}
2160
2161static int rna_Scene_transform_orientation_slots_length(PointerRNA * /*ptr*/)
2162{
2163 return ARRAY_SIZE(((Scene *)nullptr)->orientation_slots);
2164}
2165
2166static bool rna_Scene_use_audio_get(PointerRNA *ptr)
2167{
2168 Scene *scene = (Scene *)ptr->data;
2169 return (scene->audio.flag & AUDIO_MUTE) == 0;
2170}
2171
2172static void rna_Scene_use_audio_set(PointerRNA *ptr, bool value)
2173{
2174 Scene *scene = (Scene *)ptr->data;
2175
2176 if (!value) {
2177 scene->audio.flag |= AUDIO_MUTE;
2178 }
2179 else {
2180 scene->audio.flag &= ~AUDIO_MUTE;
2181 }
2182}
2183
2184static void rna_Scene_use_audio_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2185{
2187}
2188
2189static int rna_Scene_sync_mode_get(PointerRNA *ptr)
2190{
2191 Scene *scene = (Scene *)ptr->data;
2192 if (scene->audio.flag & AUDIO_SYNC) {
2193 return AUDIO_SYNC;
2194 }
2195 return scene->flag & SCE_FRAME_DROP;
2196}
2197
2198static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
2199{
2200 Scene *scene = (Scene *)ptr->data;
2201
2202 if (value == AUDIO_SYNC) {
2203 scene->audio.flag |= AUDIO_SYNC;
2204 }
2205 else if (value == SCE_FRAME_DROP) {
2206 scene->audio.flag &= ~AUDIO_SYNC;
2207 scene->flag |= SCE_FRAME_DROP;
2208 }
2209 else {
2210 scene->audio.flag &= ~AUDIO_SYNC;
2211 scene->flag &= ~SCE_FRAME_DROP;
2212 }
2213}
2214
2215static void rna_View3DCursor_rotation_mode_set(PointerRNA *ptr, int value)
2216{
2217 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2218
2219 /* use API Method for conversions... */
2220 BKE_rotMode_change_values(cursor->rotation_quaternion,
2221 cursor->rotation_euler,
2222 cursor->rotation_axis,
2223 &cursor->rotation_angle,
2224 cursor->rotation_mode,
2225 short(value));
2226
2227 /* finally, set the new rotation type */
2228 cursor->rotation_mode = value;
2229}
2230
2231static void rna_View3DCursor_rotation_axis_angle_get(PointerRNA *ptr, float *value)
2232{
2233 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2234 value[0] = cursor->rotation_angle;
2235 copy_v3_v3(&value[1], cursor->rotation_axis);
2236}
2237
2238static void rna_View3DCursor_rotation_axis_angle_set(PointerRNA *ptr, const float *value)
2239{
2240 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2241 cursor->rotation_angle = value[0];
2242 copy_v3_v3(cursor->rotation_axis, &value[1]);
2243}
2244
2245static void rna_View3DCursor_matrix_get(PointerRNA *ptr, float *values)
2246{
2247 const View3DCursor *cursor = static_cast<const View3DCursor *>(ptr->data);
2248 copy_m4_m4((float(*)[4])values, cursor->matrix<blender::float4x4>().ptr());
2249}
2250
2251static void rna_View3DCursor_matrix_set(PointerRNA *ptr, const float *values)
2252{
2253 View3DCursor *cursor = static_cast<View3DCursor *>(ptr->data);
2254 float unit_mat[4][4];
2255 normalize_m4_m4(unit_mat, (const float(*)[4])values);
2256 cursor->set_matrix(blender::float4x4(unit_mat), false);
2257}
2258
2259static std::optional<std::string> rna_TransformOrientationSlot_path(const PointerRNA *ptr)
2260{
2261 const Scene *scene = (Scene *)ptr->owner_id;
2262 const TransformOrientationSlot *orientation_slot = static_cast<const TransformOrientationSlot *>(
2263 ptr->data);
2264
2265 if (!ELEM(nullptr, scene, orientation_slot)) {
2266 for (int i = 0; i < ARRAY_SIZE(scene->orientation_slots); i++) {
2267 if (&scene->orientation_slots[i] == orientation_slot) {
2268 return fmt::format("transform_orientation_slots[{}]", i);
2269 }
2270 }
2271 }
2272
2273 /* Should not happen, but in case, just return default path. */
2275 return "transform_orientation_slots[0]";
2276}
2277
2278static std::optional<std::string> rna_View3DCursor_path(const PointerRNA * /*ptr*/)
2279{
2280 return "cursor";
2281}
2282
2283static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[], int frame)
2284{
2285 TimeMarker *marker = MEM_cnew<TimeMarker>("TimeMarker");
2286 marker->flag = SELECT;
2287 marker->frame = frame;
2288 STRNCPY_UTF8(marker->name, name);
2289 BLI_addtail(&scene->markers, marker);
2290
2293
2294 return marker;
2295}
2296
2297static void rna_TimeLine_remove(Scene *scene, ReportList *reports, PointerRNA *marker_ptr)
2298{
2299 TimeMarker *marker = static_cast<TimeMarker *>(marker_ptr->data);
2300 if (BLI_remlink_safe(&scene->markers, marker) == false) {
2301 BKE_reportf(reports,
2302 RPT_ERROR,
2303 "Timeline marker '%s' not found in scene '%s'",
2304 marker->name,
2305 scene->id.name + 2);
2306 return;
2307 }
2308
2309 MEM_freeN(marker);
2310 RNA_POINTER_INVALIDATE(marker_ptr);
2311
2314}
2315
2316static void rna_TimeLine_clear(Scene *scene)
2317{
2318 BLI_freelistN(&scene->markers);
2319
2322}
2323
2324static std::optional<std::string> rna_Scene_KeyingsSetsAll_path(const PointerRNA * /*ptr*/)
2325{
2326 return "keying_sets_all";
2327}
2328
2329static KeyingSet *rna_Scene_keying_set_new(Scene *sce,
2330 ReportList *reports,
2331 const char idname[],
2332 const char name[])
2333{
2334 KeyingSet *ks = nullptr;
2335
2336 /* call the API func, and set the active keyingset index */
2337 ks = BKE_keyingset_add(&sce->keyingsets, idname, name, KEYINGSET_ABSOLUTE, 0);
2338
2339 if (ks) {
2341 return ks;
2342 }
2343 else {
2344 BKE_report(reports, RPT_ERROR, "Keying set could not be added");
2345 return nullptr;
2346 }
2347}
2348
2349static void rna_UnifiedPaintSettings_update(bContext *C, PointerRNA * /*ptr*/)
2350{
2351 Scene *scene = CTX_data_scene(C);
2352 ViewLayer *view_layer = CTX_data_view_layer(C);
2353 Brush *br = BKE_paint_brush(BKE_paint_get_active(scene, view_layer));
2355}
2356
2357static void rna_UnifiedPaintSettings_size_set(PointerRNA *ptr, int value)
2358{
2359 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
2360
2361 /* scale unprojected radius so it stays consistent with brush size */
2363 ups->size = value;
2364}
2365
2366static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, float value)
2367{
2368 UnifiedPaintSettings *ups = static_cast<UnifiedPaintSettings *>(ptr->data);
2369
2370 /* scale brush size so it stays consistent with unprojected_radius */
2371 BKE_brush_scale_size(&ups->size, value, ups->unprojected_radius);
2372 ups->unprojected_radius = value;
2373}
2374
2375static void rna_UnifiedPaintSettings_radius_update(bContext *C, PointerRNA *ptr)
2376{
2377 /* changing the unified size should invalidate the overlay but also update the brush */
2379 rna_UnifiedPaintSettings_update(C, ptr);
2380}
2381
2382static std::optional<std::string> rna_UnifiedPaintSettings_path(const PointerRNA * /*ptr*/)
2383{
2384 return "tool_settings.unified_paint_settings";
2385}
2386
2387static std::optional<std::string> rna_CurvePaintSettings_path(const PointerRNA * /*ptr*/)
2388{
2389 return "tool_settings.curve_paint_settings";
2390}
2391
2392static std::optional<std::string> rna_SequencerToolSettings_path(const PointerRNA * /*ptr*/)
2393{
2394 return "tool_settings.sequencer_tool_settings";
2395}
2396
2397/* generic function to recalc geometry */
2398static void rna_EditMesh_update(bContext *C, PointerRNA * /*ptr*/)
2399{
2400 const Scene *scene = CTX_data_scene(C);
2401 ViewLayer *view_layer = CTX_data_view_layer(C);
2402 BKE_view_layer_synced_ensure(scene, view_layer);
2403
2405 scene, view_layer, CTX_wm_view3d(C));
2406 for (Object *obedit : objects) {
2407 Mesh *mesh = BKE_mesh_from_object(obedit);
2408
2411 }
2412}
2413
2414static std::optional<std::string> rna_MeshStatVis_path(const PointerRNA * /*ptr*/)
2415{
2416 return "tool_settings.statvis";
2417}
2418
2419/* NOTE: without this, when Multi-Paint is activated/deactivated, the colors
2420 * will not change right away when multiple bones are selected, this function
2421 * is not for general use and only for the few cases where changing scene
2422 * settings and NOT for general purpose updates, possibly this should be
2423 * given its own notifier. */
2424static void rna_Scene_update_active_object_data(bContext *C, PointerRNA * /*ptr*/)
2425{
2426 const Scene *scene = CTX_data_scene(C);
2427 ViewLayer *view_layer = CTX_data_view_layer(C);
2428 BKE_view_layer_synced_ensure(scene, view_layer);
2429 Object *ob = BKE_view_layer_active_object_get(view_layer);
2430
2431 if (ob) {
2434 }
2435}
2436
2437static void rna_SceneCamera_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2438{
2439 Scene *scene = (Scene *)ptr->owner_id;
2440 Object *camera = scene->camera;
2441
2442 SEQ_cache_cleanup(scene);
2443
2444 if (camera && (camera->type == OB_CAMERA)) {
2446 }
2447}
2448
2449static void rna_SceneSequencer_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2450{
2452}
2453
2454static std::optional<std::string> rna_ToolSettings_path(const PointerRNA * /*ptr*/)
2455{
2456 return "tool_settings";
2457}
2458
2460{
2462
2463 return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineStyle, lineset->linestyle);
2464}
2465
2467 PointerRNA value,
2468 ReportList * /*reports*/)
2469{
2471
2472 if (lineset->linestyle) {
2473 id_us_min(&lineset->linestyle->id);
2474 }
2475 lineset->linestyle = (FreestyleLineStyle *)value.data;
2476 id_us_plus(&lineset->linestyle->id);
2477}
2478
2480 FreestyleSettings *config,
2481 Main *bmain,
2482 const char *name)
2483{
2484 Scene *scene = (Scene *)id;
2485 FreestyleLineSet *lineset = BKE_freestyle_lineset_add(bmain, (FreestyleConfig *)config, name);
2486
2489
2490 return lineset;
2491}
2492
2494 FreestyleSettings *config,
2495 ReportList *reports,
2496 PointerRNA *lineset_ptr)
2497{
2498 FreestyleLineSet *lineset = static_cast<FreestyleLineSet *>(lineset_ptr->data);
2499 Scene *scene = (Scene *)id;
2500
2501 if (!BKE_freestyle_lineset_delete((FreestyleConfig *)config, lineset)) {
2502 BKE_reportf(reports, RPT_ERROR, "Line set '%s' could not be removed", lineset->name);
2503 return;
2504 }
2505
2506 RNA_POINTER_INVALIDATE(lineset_ptr);
2507
2510}
2511
2513{
2516 return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineSet, lineset);
2517}
2518
2520 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2521{
2523
2524 *min = 0;
2525 *max = max_ii(0, BLI_listbase_count(&config->linesets) - 1);
2526}
2527
2529{
2532}
2533
2535{
2538}
2539
2541{
2542 Scene *scene = (Scene *)id;
2544
2547
2548 return module;
2549}
2550
2552 FreestyleSettings *config,
2553 ReportList *reports,
2554 PointerRNA *module_ptr)
2555{
2556 Scene *scene = (Scene *)id;
2557 FreestyleModuleConfig *module = static_cast<FreestyleModuleConfig *>(module_ptr->data);
2558
2560 if (module->script) {
2561 BKE_reportf(reports,
2562 RPT_ERROR,
2563 "Style module '%s' could not be removed",
2564 module->script->id.name + 2);
2565 }
2566 else {
2567 BKE_report(reports, RPT_ERROR, "Style module could not be removed");
2568 }
2569 return;
2570 }
2571
2572 RNA_POINTER_INVALIDATE(module_ptr);
2573
2576}
2577
2578static void rna_Stereo3dFormat_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
2579{
2580 ID *id = ptr->owner_id;
2581
2582 if (id && GS(id->name) == ID_IM) {
2583 Image *ima = (Image *)id;
2584 ImBuf *ibuf;
2585 void *lock;
2586
2587 if (!BKE_image_is_stereo(ima)) {
2588 return;
2589 }
2590
2591 ibuf = BKE_image_acquire_ibuf(ima, nullptr, &lock);
2592
2593 if (ibuf) {
2594 BKE_image_signal(bmain, ima, nullptr, IMA_SIGNAL_FREE);
2595 }
2596 BKE_image_release_ibuf(ima, ibuf, lock);
2597 }
2598}
2599
2600static ViewLayer *rna_ViewLayer_new(ID *id, Scene * /*sce*/, Main *bmain, const char *name)
2601{
2602 Scene *scene = (Scene *)id;
2603 ViewLayer *view_layer = BKE_view_layer_add(scene, name, nullptr, VIEWLAYER_ADD_NEW);
2604
2608
2609 return view_layer;
2610}
2611
2612static void rna_ViewLayer_remove(
2613 ID *id, Scene * /*sce*/, Main *bmain, ReportList *reports, PointerRNA *sl_ptr)
2614{
2615 Scene *scene = (Scene *)id;
2616 ViewLayer *view_layer = static_cast<ViewLayer *>(sl_ptr->data);
2617
2618 if (ED_scene_view_layer_delete(bmain, scene, view_layer, reports)) {
2619 RNA_POINTER_INVALIDATE(sl_ptr);
2620 }
2621}
2622
2623static void rna_ViewLayer_move(
2624 ID *id, Scene * /*sce*/, Main *bmain, ReportList *reports, int from, int to)
2625{
2626 if (from == to) {
2627 return;
2628 }
2629
2630 Scene *scene = (Scene *)id;
2631
2632 if (!BLI_listbase_move_index(&scene->view_layers, from, to)) {
2633 BKE_reportf(reports, RPT_ERROR, "Could not move layer from index '%d' to '%d'", from, to);
2634 return;
2635 }
2636
2640}
2641
2643 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2644{
2645 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2646
2647 *min = 0;
2648 *max = max_ii(0, BLI_listbase_count(&view_layer->aovs) - 1);
2649}
2650
2652{
2653 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2654 return BLI_findindex(&view_layer->aovs, view_layer->active_aov);
2655}
2656
2658{
2659 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2660 ViewLayerAOV *aov = static_cast<ViewLayerAOV *>(BLI_findlink(&view_layer->aovs, value));
2661 view_layer->active_aov = aov;
2662}
2663
2665 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
2666{
2667 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2668
2669 *min = 0;
2670 *max = max_ii(0, BLI_listbase_count(&view_layer->lightgroups) - 1);
2671}
2672
2674{
2675 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2676 return BLI_findindex(&view_layer->lightgroups, view_layer->active_lightgroup);
2677}
2678
2680{
2681 ViewLayer *view_layer = (ViewLayer *)ptr->data;
2682 ViewLayerLightgroup *lightgroup = static_cast<ViewLayerLightgroup *>(
2683 BLI_findlink(&view_layer->lightgroups, value));
2684 view_layer->active_lightgroup = lightgroup;
2685}
2686
2687static void rna_ViewLayerLightgroup_name_get(PointerRNA *ptr, char *value)
2688{
2690 strcpy(value, lightgroup->name);
2691}
2692
2693static int rna_ViewLayerLightgroup_name_length(PointerRNA *ptr)
2694{
2696 return strlen(lightgroup->name);
2697}
2698
2699static void rna_ViewLayerLightgroup_name_set(PointerRNA *ptr, const char *value)
2700{
2702 Scene *scene = (Scene *)ptr->owner_id;
2703 ViewLayer *view_layer = BKE_view_layer_find_with_lightgroup(scene, lightgroup);
2704
2705 BKE_view_layer_rename_lightgroup(scene, view_layer, lightgroup, value);
2706}
2707
2708/* Fake value, used internally (not saved to DNA). */
2709# define V3D_ORIENT_DEFAULT -1
2710
2711static int rna_TransformOrientationSlot_type_get(PointerRNA *ptr)
2712{
2713 Scene *scene = (Scene *)ptr->owner_id;
2714 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2715 if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2716 if ((orient_slot->flag & SELECT) == 0) {
2717 return V3D_ORIENT_DEFAULT;
2718 }
2719 }
2720 return BKE_scene_orientation_slot_get_index(orient_slot);
2721}
2722
2723void rna_TransformOrientationSlot_type_set(PointerRNA *ptr, int value)
2724{
2725 Scene *scene = (Scene *)ptr->owner_id;
2726 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2727
2728 if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) {
2729 if (value == V3D_ORIENT_DEFAULT) {
2730 orient_slot->flag &= ~SELECT;
2731 return;
2732 }
2733 else {
2734 orient_slot->flag |= SELECT;
2735 }
2736 }
2737
2738 BKE_scene_orientation_slot_set_index(orient_slot, value);
2739}
2740
2741static PointerRNA rna_TransformOrientationSlot_get(PointerRNA *ptr)
2742{
2743 Scene *scene = (Scene *)ptr->owner_id;
2744 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2745 TransformOrientation *orientation;
2746 if (orient_slot->type < V3D_ORIENT_CUSTOM) {
2747 orientation = nullptr;
2748 }
2749 else {
2750 orientation = BKE_scene_transform_orientation_find(scene, orient_slot->index_custom);
2751 }
2752 return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, orientation);
2753}
2754
2755static const EnumPropertyItem *rna_TransformOrientation_impl_itemf(Scene *scene,
2756 const bool include_default,
2757 bool *r_free)
2758{
2759 EnumPropertyItem tmp = {0, "", 0, "", ""};
2760 EnumPropertyItem *item = nullptr;
2761 int i = V3D_ORIENT_CUSTOM, totitem = 0;
2762
2763 if (include_default) {
2764 tmp.identifier = "DEFAULT";
2765 tmp.name = N_("Default");
2766 tmp.description = N_("Use the scene orientation");
2767 tmp.value = V3D_ORIENT_DEFAULT;
2768 tmp.icon = ICON_OBJECT_ORIGIN;
2769 RNA_enum_item_add(&item, &totitem, &tmp);
2770 tmp.icon = 0;
2771
2772 RNA_enum_item_add_separator(&item, &totitem);
2773 }
2774
2776
2777 const ListBase *transform_orientations = scene ? &scene->transform_spaces : nullptr;
2778
2779 if (transform_orientations && (BLI_listbase_is_empty(transform_orientations) == false)) {
2780 RNA_enum_item_add_separator(&item, &totitem);
2781
2782 LISTBASE_FOREACH (TransformOrientation *, ts, transform_orientations) {
2783 tmp.identifier = ts->name;
2784 tmp.name = ts->name;
2785 tmp.value = i++;
2786 RNA_enum_item_add(&item, &totitem, &tmp);
2787 }
2788 }
2789
2790 RNA_enum_item_end(&item, &totitem);
2791 *r_free = true;
2792
2793 return item;
2794}
2796 PointerRNA *ptr,
2797 PropertyRNA * /*prop*/,
2798 bool *r_free)
2799{
2800 if (C == nullptr) {
2802 }
2803
2804 Scene *scene;
2805 if (ptr->owner_id && (GS(ptr->owner_id->name) == ID_SCE)) {
2806 scene = (Scene *)ptr->owner_id;
2807 }
2808 else {
2809 scene = CTX_data_scene(C);
2810 }
2811 return rna_TransformOrientation_impl_itemf(scene, false, r_free);
2812}
2813
2814const EnumPropertyItem *rna_TransformOrientation_with_scene_itemf(bContext *C,
2815 PointerRNA *ptr,
2816 PropertyRNA * /*prop*/,
2817 bool *r_free)
2818{
2819 if (C == nullptr) {
2821 }
2822
2823 Scene *scene = (Scene *)ptr->owner_id;
2824 TransformOrientationSlot *orient_slot = static_cast<TransformOrientationSlot *>(ptr->data);
2825 bool include_default = (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]);
2826 return rna_TransformOrientation_impl_itemf(scene, include_default, r_free);
2827}
2828
2829# undef V3D_ORIENT_DEFAULT
2830
2831static const EnumPropertyItem *rna_UnitSettings_itemf_wrapper(const int system,
2832 const int type,
2833 bool *r_free)
2834{
2835 const void *usys;
2836 int len;
2837 BKE_unit_system_get(system, type, &usys, &len);
2838
2839 EnumPropertyItem *items = nullptr;
2840 int totitem = 0;
2841
2842 EnumPropertyItem adaptive = {0};
2843 adaptive.identifier = "ADAPTIVE";
2844 adaptive.name = N_("Adaptive");
2845 adaptive.value = USER_UNIT_ADAPTIVE;
2846 RNA_enum_item_add(&items, &totitem, &adaptive);
2847
2848 for (int i = 0; i < len; i++) {
2849 if (!BKE_unit_is_suppressed(usys, i)) {
2850 EnumPropertyItem tmp = {0};
2851 tmp.identifier = BKE_unit_identifier_get(usys, i);
2852 tmp.name = BKE_unit_display_name_get(usys, i);
2853 tmp.value = i;
2854 RNA_enum_item_add(&items, &totitem, &tmp);
2855 }
2856 }
2857
2858 RNA_enum_item_end(&items, &totitem);
2859 *r_free = true;
2860
2861 return items;
2862}
2863
2864const EnumPropertyItem *rna_UnitSettings_length_unit_itemf(bContext * /*C*/,
2865 PointerRNA *ptr,
2866 PropertyRNA * /*prop*/,
2867 bool *r_free)
2868{
2869 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2870 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_LENGTH, r_free);
2871}
2872
2873const EnumPropertyItem *rna_UnitSettings_mass_unit_itemf(bContext * /*C*/,
2874 PointerRNA *ptr,
2875 PropertyRNA * /*prop*/,
2876 bool *r_free)
2877{
2878 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2879 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_MASS, r_free);
2880}
2881
2882const EnumPropertyItem *rna_UnitSettings_time_unit_itemf(bContext * /*C*/,
2883 PointerRNA *ptr,
2884 PropertyRNA * /*prop*/,
2885 bool *r_free)
2886{
2887 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2888 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TIME, r_free);
2889}
2890
2891const EnumPropertyItem *rna_UnitSettings_temperature_unit_itemf(bContext * /*C*/,
2892 PointerRNA *ptr,
2893 PropertyRNA * /*prop*/,
2894 bool *r_free)
2895{
2896 const UnitSettings *units = static_cast<const UnitSettings *>(ptr->data);
2897 return rna_UnitSettings_itemf_wrapper(units->system, B_UNIT_TEMPERATURE, r_free);
2898}
2899
2900static void rna_UnitSettings_system_update(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
2901{
2902 UnitSettings *unit = &scene->unit;
2903 if (unit->system == USER_UNIT_NONE) {
2905 unit->mass_unit = USER_UNIT_ADAPTIVE;
2906 }
2907 else {
2908 unit->length_unit = BKE_unit_base_of_type_get(unit->system, B_UNIT_LENGTH);
2909 unit->mass_unit = BKE_unit_base_of_type_get(unit->system, B_UNIT_MASS);
2910 }
2911}
2912
2913static std::optional<std::string> rna_UnitSettings_path(const PointerRNA * /*ptr*/)
2914{
2915 return "unit_settings";
2916}
2917
2918static std::optional<std::string> rna_FFmpegSettings_path(const PointerRNA * /*ptr*/)
2919{
2920 return "render.ffmpeg";
2921}
2922
2923# ifdef WITH_FFMPEG
2924/* FFMpeg Codec setting update hook. */
2925static void rna_FFmpegSettings_codec_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2926{
2927 FFMpegCodecData *codec_data = (FFMpegCodecData *)ptr->data;
2928 if (!ELEM(codec_data->codec,
2929 AV_CODEC_ID_H264,
2930 AV_CODEC_ID_MPEG4,
2931 AV_CODEC_ID_VP9,
2932 AV_CODEC_ID_DNXHD))
2933 {
2934 /* Constant Rate Factor (CRF) setting is only available for H264,
2935 * MPEG4 and WEBM/VP9 codecs. So changing encoder quality mode to
2936 * CBR as CRF is not supported.
2937 */
2938 codec_data->constant_rate_factor = FFM_CRF_NONE;
2939 }
2940}
2941# endif
2942
2943#else
2944
2945/* Grease Pencil Interpolation tool settings */
2947{
2948 StructRNA *srna;
2949 PropertyRNA *prop;
2950
2951 srna = RNA_def_struct(brna, "GPencilInterpolateSettings", nullptr);
2952 RNA_def_struct_sdna(srna, "GP_Interpolate_Settings");
2954 "Grease Pencil Interpolate Settings",
2955 "Settings for Grease Pencil interpolation tools");
2956
2957 /* Custom curve-map. */
2958 prop = RNA_def_property(srna, "interpolation_curve", PROP_POINTER, PROP_NONE);
2959 RNA_def_property_pointer_sdna(prop, nullptr, "custom_ipo");
2960 RNA_def_property_struct_type(prop, "CurveMapping");
2962 prop,
2963 "Interpolation Curve",
2964 "Custom curve to control 'sequence' interpolation between Grease Pencil frames");
2965}
2966
2968{
2969 StructRNA *srna;
2970 PropertyRNA *prop;
2971
2972 srna = RNA_def_struct(brna, "TransformOrientation", nullptr);
2973
2974 prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
2975 RNA_def_property_float_sdna(prop, nullptr, "mat");
2978
2979 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2980 RNA_def_struct_name_property(srna, prop);
2981 RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation");
2983}
2984
2986{
2987 StructRNA *srna;
2988 PropertyRNA *prop;
2989
2990 srna = RNA_def_struct(brna, "TransformOrientationSlot", nullptr);
2991 RNA_def_struct_sdna(srna, "TransformOrientationSlot");
2992 RNA_def_struct_path_func(srna, "rna_TransformOrientationSlot_path");
2993 RNA_def_struct_ui_text(srna, "Orientation Slot", "");
2994
2995 /* Orientations */
2996 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
2999 "rna_TransformOrientationSlot_type_get",
3000 "rna_TransformOrientationSlot_type_set",
3001 "rna_TransformOrientation_with_scene_itemf");
3002 RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
3004
3005 prop = RNA_def_property(srna, "custom_orientation", PROP_POINTER, PROP_NONE);
3006 RNA_def_property_struct_type(prop, "TransformOrientation");
3008 prop, "rna_TransformOrientationSlot_get", nullptr, nullptr, nullptr);
3009 RNA_def_property_ui_text(prop, "Current Transform Orientation", "");
3010
3011 /* flag */
3012 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
3013 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SELECT);
3014 RNA_def_property_ui_text(prop, "Use", "Use scene orientation instead of a custom setting");
3016}
3017
3019{
3020 StructRNA *srna;
3021 PropertyRNA *prop;
3022
3023 srna = RNA_def_struct(brna, "View3DCursor", nullptr);
3024 RNA_def_struct_sdna(srna, "View3DCursor");
3025 RNA_def_struct_path_func(srna, "rna_View3DCursor_path");
3026 RNA_def_struct_ui_text(srna, "3D Cursor", "");
3027 RNA_def_struct_ui_icon(srna, ICON_CURSOR);
3029
3030 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ_LENGTH);
3032 RNA_def_property_float_sdna(prop, nullptr, "location");
3033 RNA_def_property_ui_text(prop, "Location", "");
3034 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
3035 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3036
3037 prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
3039 RNA_def_property_float_sdna(prop, nullptr, "rotation_quaternion");
3041 prop, "Quaternion Rotation", "Rotation in quaternions (keep normalized)");
3042 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3043
3044 prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
3046 RNA_def_property_array(prop, 4);
3048 "rna_View3DCursor_rotation_axis_angle_get",
3049 "rna_View3DCursor_rotation_axis_angle_set",
3050 nullptr);
3053 prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation");
3054 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3055
3056 prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER);
3058 RNA_def_property_float_sdna(prop, nullptr, "rotation_euler");
3059 RNA_def_property_ui_text(prop, "Euler Rotation", "3D rotation");
3061 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3062
3063 prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE);
3065 RNA_def_property_enum_sdna(prop, nullptr, "rotation_mode");
3067 RNA_def_property_enum_funcs(prop, nullptr, "rna_View3DCursor_rotation_mode_set", nullptr);
3068 RNA_def_property_ui_text(prop, "Rotation Mode", "");
3069 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3070
3071 /* Matrix access to avoid having to check current rotation mode. */
3072 prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
3074 RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */
3076 prop, "Transform Matrix", "Matrix combining location and rotation of the cursor");
3078 prop, "rna_View3DCursor_matrix_get", "rna_View3DCursor_matrix_set", nullptr);
3079 RNA_def_property_update(prop, NC_WINDOW, nullptr);
3080}
3081
3083{
3084 StructRNA *srna;
3085 PropertyRNA *prop;
3086
3087 /* the construction of this enum is quite special - everything is stored as bitflags,
3088 * with 1st position only for on/off (and exposed as boolean), while others are mutually
3089 * exclusive options but which will only have any effect when autokey is enabled
3090 */
3091 static const EnumPropertyItem auto_key_items[] = {
3092 {AUTOKEY_MODE_NORMAL & ~AUTOKEY_ON, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""},
3093 {AUTOKEY_MODE_EDITKEYS & ~AUTOKEY_ON, "REPLACE_KEYS", 0, "Replace", ""},
3094 {0, nullptr, 0, nullptr, nullptr},
3095 };
3096
3097 static const EnumPropertyItem draw_groupuser_items[] = {
3098 {OB_DRAW_GROUPUSER_NONE, "NONE", 0, "None", ""},
3100 "ACTIVE",
3101 0,
3102 "Active",
3103 "Show vertices with no weights in the active group"},
3104 {OB_DRAW_GROUPUSER_ALL, "ALL", 0, "All", "Show vertices with no weights in any group"},
3105 {0, nullptr, 0, nullptr, nullptr},
3106 };
3107
3108 static const EnumPropertyItem vertex_group_select_items[] = {
3109 {WT_VGROUP_ALL, "ALL", 0, "All", "All Vertex Groups"},
3111 "BONE_DEFORM",
3112 0,
3113 "Deform",
3114 "Vertex Groups assigned to Deform Bones"},
3116 "OTHER_DEFORM",
3117 0,
3118 "Other",
3119 "Vertex Groups assigned to non Deform Bones"},
3120 {0, nullptr, 0, nullptr, nullptr},
3121 };
3122
3123 static const EnumPropertyItem gpencil_stroke_placement_items[] = {
3125 "ORIGIN",
3126 ICON_OBJECT_ORIGIN,
3127 "Origin",
3128 "Draw stroke at Object origin"},
3130 "CURSOR",
3131 ICON_PIVOT_CURSOR,
3132 "3D Cursor",
3133 "Draw stroke at 3D cursor location"},
3135 "SURFACE",
3136 ICON_SNAP_FACE,
3137 "Surface",
3138 "Stick stroke to surfaces"},
3140 "STROKE",
3141 ICON_STROKE,
3142 "Stroke",
3143 "Stick stroke to other strokes"},
3144 {0, nullptr, 0, nullptr, nullptr},
3145 };
3146
3147 static const EnumPropertyItem gpencil_stroke_snap_items[] = {
3148 {0, "NONE", 0, "All Points", "Snap to all points"},
3150 "ENDS",
3151 0,
3152 "End Points",
3153 "Snap to first and last points and interpolate"},
3154 {GP_PROJECT_DEPTH_STROKE_FIRST, "FIRST", 0, "First Point", "Snap to first point"},
3155 {0, nullptr, 0, nullptr, nullptr},
3156 };
3157
3158 static const EnumPropertyItem annotation_stroke_placement_view2d_items[] = {
3160 "IMAGE",
3161 ICON_IMAGE_DATA,
3162 "Image",
3163 "Stick stroke to the image"},
3164 /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
3165 {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
3166 {0, nullptr, 0, nullptr, nullptr},
3167 };
3168
3169 static const EnumPropertyItem annotation_stroke_placement_view3d_items[] = {
3171 "CURSOR",
3172 ICON_PIVOT_CURSOR,
3173 "3D Cursor",
3174 "Draw stroke at 3D cursor location"},
3175 /* Weird, GP_PROJECT_VIEWALIGN is inverted. */
3176 {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"},
3178 "SURFACE",
3179 ICON_FACESEL,
3180 "Surface",
3181 "Stick stroke to surfaces"},
3182 {0, nullptr, 0, nullptr, nullptr},
3183 };
3184
3185 static const EnumPropertyItem uv_sticky_mode_items[] = {
3187 "DISABLED",
3188 ICON_STICKY_UVS_DISABLE,
3189 "Disabled",
3190 "Sticky vertex selection disabled"},
3192 "SHARED_LOCATION",
3193 ICON_STICKY_UVS_LOC,
3194 "Shared Location",
3195 "Select UVs that are at the same location and share a mesh vertex"},
3197 "SHARED_VERTEX",
3198 ICON_STICKY_UVS_VERT,
3199 "Shared Vertex",
3200 "Select UVs that share a mesh vertex, whether or not they are at the same location"},
3201 {0, nullptr, 0, nullptr, nullptr},
3202 };
3203
3204 srna = RNA_def_struct(brna, "ToolSettings", nullptr);
3205 RNA_def_struct_path_func(srna, "rna_ToolSettings_path");
3206 RNA_def_struct_ui_text(srna, "Tool Settings", "");
3207
3208 prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE);
3209 RNA_def_property_struct_type(prop, "Sculpt");
3210 RNA_def_property_ui_text(prop, "Sculpt", "");
3211
3212 prop = RNA_def_property(srna, "curves_sculpt", PROP_POINTER, PROP_NONE);
3213 RNA_def_property_struct_type(prop, "CurvesSculpt");
3214 RNA_def_property_ui_text(prop, "Curves Sculpt", "");
3215
3216 prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
3218 RNA_def_property_boolean_sdna(prop, nullptr, "auto_normalize", 1);
3220 "Weight Paint Auto-Normalize",
3221 "Ensure all bone-deforming vertex groups add up "
3222 "to 1.0 while weight painting");
3223 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3224
3225 prop = RNA_def_property(srna, "use_lock_relative", PROP_BOOLEAN, PROP_NONE);
3227 RNA_def_property_boolean_sdna(prop, nullptr, "wpaint_lock_relative", 1);
3229 "Weight Paint Lock-Relative",
3230 "Display bone-deforming groups as if all locked deform groups "
3231 "were deleted, and the remaining ones were re-normalized");
3232 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3233
3234 prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
3236 RNA_def_property_boolean_sdna(prop, nullptr, "multipaint", 1);
3238 "Weight Paint Multi-Paint",
3239 "Paint across the weights of all selected bones, "
3240 "maintaining their relative influence");
3241 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3242
3243 prop = RNA_def_property(srna, "vertex_group_user", PROP_ENUM, PROP_NONE);
3245 RNA_def_property_enum_sdna(prop, nullptr, "weightuser");
3246 RNA_def_property_enum_items(prop, draw_groupuser_items);
3247 RNA_def_property_ui_text(prop, "Mask Non-Group Vertices", "Display unweighted vertices");
3248 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3249
3250 prop = RNA_def_property(srna, "vertex_group_subset", PROP_ENUM, PROP_NONE);
3252 RNA_def_property_enum_sdna(prop, nullptr, "vgroupsubset");
3253 RNA_def_property_enum_items(prop, vertex_group_select_items);
3254 RNA_def_property_ui_text(prop, "Subset", "Filter Vertex groups for Display");
3255 RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
3256
3257 prop = RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
3258 RNA_def_property_pointer_sdna(prop, nullptr, "vpaint");
3259 RNA_def_property_ui_text(prop, "Vertex Paint", "");
3260
3261 prop = RNA_def_property(srna, "weight_paint", PROP_POINTER, PROP_NONE);
3262 RNA_def_property_pointer_sdna(prop, nullptr, "wpaint");
3263 RNA_def_property_ui_text(prop, "Weight Paint", "");
3264
3265 prop = RNA_def_property(srna, "image_paint", PROP_POINTER, PROP_NONE);
3266 RNA_def_property_pointer_sdna(prop, nullptr, "imapaint");
3267 RNA_def_property_ui_text(prop, "Image Paint", "");
3268
3269 prop = RNA_def_property(srna, "paint_mode", PROP_POINTER, PROP_NONE);
3270 RNA_def_property_pointer_sdna(prop, nullptr, "paint_mode");
3271 RNA_def_property_ui_text(prop, "Paint Mode", "");
3272
3273 prop = RNA_def_property(srna, "uv_sculpt", PROP_POINTER, PROP_NONE);
3274 RNA_def_property_pointer_sdna(prop, nullptr, "uvsculpt");
3275 RNA_def_property_ui_text(prop, "UV Sculpt", "");
3276
3277 prop = RNA_def_property(srna, "gpencil_paint", PROP_POINTER, PROP_NONE);
3278 RNA_def_property_pointer_sdna(prop, nullptr, "gp_paint");
3279 RNA_def_property_ui_text(prop, "Grease Pencil Paint", "");
3280
3281 prop = RNA_def_property(srna, "gpencil_vertex_paint", PROP_POINTER, PROP_NONE);
3282 RNA_def_property_pointer_sdna(prop, nullptr, "gp_vertexpaint");
3283 RNA_def_property_ui_text(prop, "Grease Pencil Vertex Paint", "");
3284
3285 prop = RNA_def_property(srna, "gpencil_sculpt_paint", PROP_POINTER, PROP_NONE);
3286 RNA_def_property_pointer_sdna(prop, nullptr, "gp_sculptpaint");
3287 RNA_def_property_ui_text(prop, "Grease Pencil Sculpt Paint", "");
3288
3289 prop = RNA_def_property(srna, "gpencil_weight_paint", PROP_POINTER, PROP_NONE);
3290 RNA_def_property_pointer_sdna(prop, nullptr, "gp_weightpaint");
3291 RNA_def_property_ui_text(prop, "Grease Pencil Weight Paint", "");
3292
3293 prop = RNA_def_property(srna, "particle_edit", PROP_POINTER, PROP_NONE);
3294 RNA_def_property_pointer_sdna(prop, nullptr, "particle");
3295 RNA_def_property_ui_text(prop, "Particle Edit", "");
3296
3297 prop = RNA_def_property(srna, "uv_sculpt_lock_borders", PROP_BOOLEAN, PROP_NONE);
3298 RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_LOCK_BORDERS);
3300 RNA_def_property_ui_text(prop, "Lock Borders", "Disable editing of boundary edges");
3301
3302 prop = RNA_def_property(srna, "uv_sculpt_all_islands", PROP_BOOLEAN, PROP_NONE);
3303 RNA_def_property_boolean_sdna(prop, nullptr, "uv_sculpt_settings", UV_SCULPT_ALL_ISLANDS);
3305 RNA_def_property_ui_text(prop, "Sculpt All Islands", "Brush operates on all islands");
3306
3307 prop = RNA_def_property(srna, "lock_object_mode", PROP_BOOLEAN, PROP_NONE);
3308 RNA_def_property_boolean_sdna(prop, nullptr, "object_flag", SCE_OBJECT_MODE_LOCK);
3311 "Lock Object Modes",
3312 "Restrict selection to objects using the same mode as the active "
3313 "object, to prevent accidental mode switch when selecting");
3315
3316 static const EnumPropertyItem workspace_tool_items[] = {
3317 {SCE_WORKSPACE_TOOL_DEFAULT, "DEFAULT", 0, "Active Tool", ""},
3318 {SCE_WORKSPACE_TOOL_FALLBACK, "FALLBACK", 0, "Select", ""},
3319 {0, nullptr, 0, nullptr, nullptr},
3320 };
3321
3322 prop = RNA_def_property(srna, "workspace_tool_type", PROP_ENUM, PROP_NONE);
3323 RNA_def_property_enum_sdna(prop, nullptr, "workspace_tool_type");
3325 RNA_def_property_enum_items(prop, workspace_tool_items);
3327 RNA_def_property_ui_text(prop, "Drag", "Action when dragging in the viewport");
3328
3329 /* Transform */
3330 prop = RNA_def_property(srna, "use_proportional_edit", PROP_BOOLEAN, PROP_NONE);
3331 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_USE);
3333 RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional edit mode");
3334 RNA_def_property_ui_icon(prop, ICON_PROP_ON, 0);
3335 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3336
3337 prop = RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
3338 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_objects", 0);
3341 prop, "Proportional Editing Objects", "Proportional editing object mode");
3342 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3343 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3344
3345 prop = RNA_def_property(srna, "use_proportional_projected", PROP_BOOLEAN, PROP_NONE);
3346 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_PROJECTED);
3349 prop, "Projected from View", "Proportional Editing using screen space locations");
3350 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3351
3352 prop = RNA_def_property(srna, "use_proportional_connected", PROP_BOOLEAN, PROP_NONE);
3353 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_edit", PROP_EDIT_CONNECTED);
3356 prop, "Connected Only", "Proportional Editing using connected geometry only");
3357 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3358
3359 prop = RNA_def_property(srna, "use_proportional_edit_mask", PROP_BOOLEAN, PROP_NONE);
3360 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_mask", 0);
3362 RNA_def_property_ui_text(prop, "Proportional Editing Objects", "Proportional editing mask mode");
3363 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3364 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3365
3366 prop = RNA_def_property(srna, "use_proportional_action", PROP_BOOLEAN, PROP_NONE);
3367 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_action", 0);
3370 prop, "Proportional Editing Actions", "Proportional editing in action editor");
3371 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3372 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3373
3374 prop = RNA_def_property(srna, "use_proportional_fcurve", PROP_BOOLEAN, PROP_NONE);
3375 RNA_def_property_boolean_sdna(prop, nullptr, "proportional_fcurve", 0);
3378 prop, "Proportional Editing F-Curves", "Proportional editing in F-Curve editor");
3379 RNA_def_property_ui_icon(prop, ICON_PROP_OFF, 1);
3380 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3381
3382 prop = RNA_def_property(srna, "lock_markers", PROP_BOOLEAN, PROP_NONE);
3383 RNA_def_property_boolean_sdna(prop, nullptr, "lock_markers", 0);
3385 RNA_def_property_ui_text(prop, "Lock Markers", "Prevent marker editing");
3386
3387 prop = RNA_def_property(srna, "proportional_edit_falloff", PROP_ENUM, PROP_NONE);
3388 RNA_def_property_enum_sdna(prop, nullptr, "prop_mode");
3392 prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
3393 /* Abusing id_curve :/ */
3395 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3396
3397 prop = RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_NONE);
3398 RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
3401 prop, "Proportional Size", "Display size for proportional editing circle");
3402 RNA_def_property_range(prop, 0.00001, 5000.0);
3403
3404 prop = RNA_def_property(srna, "proportional_distance", PROP_FLOAT, PROP_DISTANCE);
3405 RNA_def_property_float_sdna(prop, nullptr, "proportional_size");
3408 prop, "Proportional Size", "Display size for proportional editing circle");
3409 RNA_def_property_range(prop, 0.00001, 5000.0);
3410
3411 prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE);
3412 RNA_def_property_float_sdna(prop, nullptr, "doublimit");
3414 RNA_def_property_ui_text(prop, "Merge Threshold", "Threshold distance for Auto Merge");
3415 RNA_def_property_range(prop, 0.0, 1.0);
3416 RNA_def_property_ui_range(prop, 0.0, 0.1, 0.01, 6);
3417
3418 /* Pivot Point */
3419 prop = RNA_def_property(srna, "transform_pivot_point", PROP_ENUM, PROP_NONE);
3420 RNA_def_property_enum_sdna(prop, nullptr, "transform_pivot_point");
3423 RNA_def_property_ui_text(prop, "Transform Pivot Point", "Pivot center for rotation/scaling");
3425
3426 prop = RNA_def_property(srna, "use_transform_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
3427 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_AXIS_ALIGN);
3430 prop,
3431 "Only Locations",
3432 "Only transform object locations, without affecting rotation or scaling");
3434
3435 prop = RNA_def_property(srna, "use_transform_data_origin", PROP_BOOLEAN, PROP_NONE);
3436 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_DATA_ORIGIN);
3439 prop, "Transform Origins", "Transform object origins, while leaving the shape in place");
3441
3442 prop = RNA_def_property(srna, "use_transform_skip_children", PROP_BOOLEAN, PROP_NONE);
3443 RNA_def_property_boolean_sdna(prop, nullptr, "transform_flag", SCE_XFORM_SKIP_CHILDREN);
3446 prop, "Transform Parents", "Transform the parents, leaving the children in place");
3448
3449 prop = RNA_def_property(srna, "use_transform_correct_face_attributes", PROP_BOOLEAN, PROP_NONE);
3450 RNA_def_property_boolean_sdna(prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT);
3453 "Correct Face Attributes",
3454 "Correct data such as UVs and color attributes when transforming");
3456
3457 prop = RNA_def_property(srna, "use_transform_correct_keep_connected", PROP_BOOLEAN, PROP_NONE);
3459 prop, nullptr, "uvcalc_flag", UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED);
3462 prop,
3463 "Keep Connected",
3464 "During the Face Attributes correction, merge attributes connected to the same vertex");
3466
3467 prop = RNA_def_property(srna, "use_mesh_automerge", PROP_BOOLEAN, PROP_NONE);
3468 RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE);
3471 prop, "Auto Merge Vertices", "Automatically merge vertices moved to the same location");
3472 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3473 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3474
3475 prop = RNA_def_property(srna, "use_mesh_automerge_and_split", PROP_BOOLEAN, PROP_NONE);
3476 RNA_def_property_boolean_sdna(prop, nullptr, "automerge", AUTO_MERGE_AND_SPLIT);
3478 RNA_def_property_ui_text(prop, "Split Edges & Faces", "Automatically split edges and faces");
3479 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3480 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3481
3482 prop = RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);
3483 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP);
3485 RNA_def_property_ui_text(prop, "Snap", "Snap during transform");
3486 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3487 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3488
3489 prop = RNA_def_property(srna, "use_snap_node", PROP_BOOLEAN, PROP_NONE);
3490 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_node", SCE_SNAP);
3492 RNA_def_property_ui_text(prop, "Snap", "Snap Node during transform");
3493 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3494 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3495
3496 prop = RNA_def_property(srna, "use_snap_sequencer", PROP_BOOLEAN, PROP_NONE);
3497 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_seq", SCE_SNAP);
3499 RNA_def_property_ui_text(prop, "Use Snapping", "Snap strips during transform");
3500 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3502 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* Publish message-bus. */
3503
3504 prop = RNA_def_property(srna, "use_snap_uv", PROP_BOOLEAN, PROP_NONE);
3505 RNA_def_property_boolean_sdna(prop, nullptr, "snap_uv_flag", SCE_SNAP);
3507 RNA_def_property_ui_text(prop, "Snap", "Snap UV during transform");
3508 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3509 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3510
3511 prop = RNA_def_property(srna, "use_snap_align_rotation", PROP_BOOLEAN, PROP_NONE);
3512 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ROTATE);
3515 prop, "Align Rotation to Target", "Align rotation with the snapping target");
3516 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3517
3518 prop = RNA_def_property(srna, "use_snap_grid_absolute", PROP_BOOLEAN, PROP_NONE);
3519 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_ABS_GRID);
3522 prop,
3523 "Absolute Increment Snap",
3524 "Absolute grid alignment while translating (based on the pivot center)");
3525 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3526
3527 prop = RNA_def_property(srna, "snap_angle_increment_2d", PROP_FLOAT, PROP_ANGLE);
3528 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_2d");
3530 prop, "Rotation Increment", "Angle used for rotation increments in 2D editors");
3531 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3532 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 100.0f, 2);
3533 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3534
3535 prop = RNA_def_property(srna, "snap_angle_increment_2d_precision", PROP_FLOAT, PROP_ANGLE);
3536 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_2d_precision");
3538 "Rotation Precision Increment",
3539 "Precision angle used for rotation increments in 2D editors");
3540 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3541 RNA_def_property_ui_range(prop, DEG2RADF(0.1f), DEG2RADF(180.0f), 10.0f, 3);
3542 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3543
3544 prop = RNA_def_property(srna, "snap_angle_increment_3d", PROP_FLOAT, PROP_ANGLE);
3545 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_3d");
3547 prop, "Rotation Increment", "Angle used for rotation increments in 3D editors");
3548 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3549 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 100.0f, 2);
3550 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3551
3552 prop = RNA_def_property(srna, "snap_angle_increment_3d_precision", PROP_FLOAT, PROP_ANGLE);
3553 RNA_def_property_float_sdna(prop, nullptr, "snap_angle_increment_3d_precision");
3555 "Rotation Precision Increment",
3556 "Precision angle used for rotation increments in 3D editors");
3557 RNA_def_property_range(prop, 0, DEG2RADF(180.0f));
3558 RNA_def_property_ui_range(prop, DEG2RADF(0.1f), DEG2RADF(180.0f), 10.0f, 3);
3559 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3560
3561 prop = RNA_def_property(srna, "snap_elements", PROP_ENUM, PROP_NONE);
3562 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3566 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3568 RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to");
3569 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3570
3571 prop = RNA_def_property(srna, "snap_elements_base", PROP_ENUM, PROP_NONE);
3572 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3576 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3579 prop, "Snap Element", "Type of element for the \"Snap Base\" to snap to");
3580 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3581
3582 prop = RNA_def_property(srna, "snap_elements_individual", PROP_ENUM, PROP_NONE);
3583 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_mode");
3587 prop, "rna_ToolSettings_snap_mode_get", "rna_ToolSettings_snap_mode_set", nullptr);
3590 prop, "Project Mode", "Type of element for individual transformed elements to snap to");
3591 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3592
3593 prop = RNA_def_property(srna, "snap_face_nearest_steps", PROP_INT, PROP_FACTOR);
3594 RNA_def_property_int_sdna(prop, nullptr, "snap_face_nearest_steps");
3596 RNA_def_property_range(prop, 1, 100);
3598 prop,
3599 "Face Nearest Steps",
3600 "Number of steps to break transformation into for face nearest snapping");
3601
3602 prop = RNA_def_property(srna, "use_snap_to_same_target", PROP_BOOLEAN, PROP_NONE);
3606 prop,
3607 "Snap to Same Target",
3608 "Snap only to target that source was initially near (\"Face Nearest\" only)");
3609
3610 /* node editor uses its own set of snap modes */
3611 prop = RNA_def_property(srna, "snap_node_element", PROP_ENUM, PROP_NONE);
3612 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_node_mode");
3615 RNA_def_property_ui_text(prop, "Snap Node Element", "Type of element to snap to");
3616 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3617
3618 prop = RNA_def_property(srna, "use_snap_anim", PROP_BOOLEAN, PROP_NONE);
3619 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP);
3621 RNA_def_property_ui_text(prop, "Snap", "Enable snapping when transforming keyframes");
3622 RNA_def_property_ui_icon(prop, ICON_SNAP_OFF, 1);
3623 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3624
3625 prop = RNA_def_property(srna, "use_snap_time_absolute", PROP_BOOLEAN, PROP_NONE);
3626 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag_anim", SCE_SNAP_ABS_TIME_STEP);
3629 prop, "Absolute Time Snap", "Absolute time alignment when transforming keyframes");
3630 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3631
3632 prop = RNA_def_property(srna, "snap_anim_element", PROP_ENUM, PROP_NONE);
3633 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_anim_mode");
3636 RNA_def_property_ui_text(prop, "Snap Animation Element", "Type of element to snap to");
3638 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3639
3640 /* image editor uses its own set of snap modes */
3641 prop = RNA_def_property(srna, "snap_uv_element", PROP_ENUM, PROP_NONE);
3642 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "snap_uv_mode");
3644 RNA_def_property_enum_funcs(prop, nullptr, "rna_ToolSettings_snap_uv_mode_set", nullptr);
3646 RNA_def_property_ui_text(prop, "Snap UV Element", "Type of element to snap to");
3647 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3648
3649 /* TODO(@gfxcoder): Rename `snap_target` to `snap_source` to avoid previous ambiguity of "target"
3650 * (now, "source" is geometry to be moved and "target" is geometry to which moved geometry is
3651 * snapped). */
3652 prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
3653 RNA_def_property_enum_sdna(prop, nullptr, "snap_target");
3656 RNA_def_property_ui_text(prop, "Snap Target", "Which part to snap onto the target");
3657 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3658
3659 prop = RNA_def_property(srna, "use_snap_peel_object", PROP_BOOLEAN, PROP_NONE);
3660 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_PEEL_OBJECT);
3663 prop, "Snap Peel Object", "Consider objects as whole when finding volume center");
3664 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3665
3666 prop = RNA_def_property(srna, "use_snap_backface_culling", PROP_BOOLEAN, PROP_NONE);
3667 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_BACKFACE_CULLING);
3669 RNA_def_property_ui_text(prop, "Backface Culling", "Exclude back facing geometry from snapping");
3670 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3671
3672 /* TODO(@gfxcoder): Rename `use_snap_self` to `use_snap_active`, because active is correct but
3673 * self is not (breaks API). This only makes a difference when more than one mesh is edited. */
3674 prop = RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
3678 prop, "Snap onto Active", "Snap onto itself only if enabled (edit mode only)");
3679 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3680
3681 prop = RNA_def_property(srna, "use_snap_edit", PROP_BOOLEAN, PROP_NONE);
3682 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SCE_SNAP_TO_INCLUDE_EDITED);
3685 prop, "Snap onto Edited", "Snap onto non-active objects in edit mode (edit mode only)");
3686 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3687
3688 prop = RNA_def_property(srna, "use_snap_nonedit", PROP_BOOLEAN, PROP_NONE);
3692 prop, "Snap onto Non-edited", "Snap onto objects not in edit mode (edit mode only)");
3693 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3694
3695 prop = RNA_def_property(srna, "use_snap_selectable", PROP_BOOLEAN, PROP_NONE);
3699 prop, "Snap onto Selectable Only", "Snap only onto objects that are selectable");
3700 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3701
3702 prop = RNA_def_property(srna, "use_snap_translate", PROP_BOOLEAN, PROP_NONE);
3704 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_TRANSLATE);
3707 prop, "Use Snap for Translation", "Move is affected by snapping settings");
3708 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3709
3710 prop = RNA_def_property(srna, "use_snap_rotate", PROP_BOOLEAN, PROP_NONE);
3712 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_ROTATE);
3716 prop, "Use Snap for Rotation", "Rotate is affected by the snapping settings");
3717 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3718
3719 prop = RNA_def_property(srna, "use_snap_scale", PROP_BOOLEAN, PROP_NONE);
3721 prop, nullptr, "snap_transform_mode_flag", SCE_SNAP_TRANSFORM_MODE_SCALE);
3724 RNA_def_property_ui_text(prop, "Use Snap for Scale", "Scale is affected by snapping settings");
3725 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
3726
3727 prop = RNA_def_property(srna, "plane_axis", PROP_ENUM, PROP_NONE);
3728 RNA_def_property_enum_sdna(prop, nullptr, "plane_axis");
3732 RNA_def_property_ui_text(prop, "Plane Axis", "The axis used for placing the base region");
3733
3734 prop = RNA_def_property(srna, "plane_axis_auto", PROP_BOOLEAN, PROP_NONE);
3735 RNA_def_property_boolean_sdna(prop, nullptr, "use_plane_axis_auto", 1);
3739 "Auto Axis",
3740 "Select the closest axis when placing objects "
3741 "(surface overrides)");
3742
3743 prop = RNA_def_property(srna, "plane_depth", PROP_ENUM, PROP_NONE);
3744 RNA_def_property_enum_sdna(prop, nullptr, "plane_depth");
3748 RNA_def_property_ui_text(prop, "Position", "The initial depth used when placing the cursor");
3749
3750 prop = RNA_def_property(srna, "plane_orientation", PROP_ENUM, PROP_NONE);
3751 RNA_def_property_enum_sdna(prop, nullptr, "plane_orient");
3755 RNA_def_property_ui_text(prop, "Orientation", "The initial depth used when placing the cursor");
3756
3757 prop = RNA_def_property(srna, "snap_elements_tool", PROP_ENUM, PROP_NONE);
3758 RNA_def_property_enum_sdna(prop, nullptr, "snap_mode_tools");
3762 RNA_def_property_ui_text(prop, "Snap to", "The target to use while snapping");
3763
3764 /* Grease Pencil */
3765 prop = RNA_def_property(srna, "use_gpencil_draw_additive", PROP_BOOLEAN, PROP_NONE);
3766 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_RETAIN_LAST);
3769 "Use Additive Drawing",
3770 "When creating new frames, the strokes from the previous/active frame "
3771 "are included as the basis for the new one");
3773
3774 prop = RNA_def_property(srna, "use_gpencil_draw_onback", PROP_BOOLEAN, PROP_NONE);
3775 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_PAINT_ONBACK);
3778 prop, "Draw Strokes on Back", "New strokes are drawn below of all strokes in the layer");
3780
3781 prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE);
3783 prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_THUMBNAIL_LIST);
3786 prop, "Compact List", "Show compact list of colors instead of thumbnails");
3788
3789 prop = RNA_def_property(srna, "use_gpencil_weight_data_add", PROP_BOOLEAN, PROP_NONE);
3790 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_CREATE_WEIGHTS);
3793 "Add weight data for new strokes",
3794 "Weight data for new strokes is added according to the current vertex "
3795 "group and weight. If no vertex group selected, weight is not added.");
3797
3798 prop = RNA_def_property(srna, "use_gpencil_automerge_strokes", PROP_BOOLEAN, PROP_NONE);
3799 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_TOOL_FLAG_AUTOMERGE_STROKE);
3802 RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, 1);
3804 prop,
3805 "Automerge",
3806 "Join the last drawn stroke with previous strokes in the active layer by distance");
3809
3810 prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE);
3811 RNA_def_property_pointer_sdna(prop, nullptr, "gp_sculpt");
3813 RNA_def_property_struct_type(prop, "GPencilSculptSettings");
3815 prop, "Grease Pencil Sculpt", "Settings for stroke sculpting tools and brushes");
3816
3817 prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE);
3818 RNA_def_property_pointer_sdna(prop, nullptr, "gp_interpolate");
3820 RNA_def_property_struct_type(prop, "GPencilInterpolateSettings");
3822 prop, "Grease Pencil Interpolate", "Settings for grease pencil interpolation tools");
3823
3824 /* Grease Pencil - 3D View Stroke Placement */
3825 prop = RNA_def_property(srna, "gpencil_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
3826 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
3828 RNA_def_property_enum_items(prop, gpencil_stroke_placement_items);
3829 RNA_def_property_ui_text(prop, "Stroke Placement (3D View)", "");
3830 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3831
3832 prop = RNA_def_property(srna, "gpencil_stroke_snap_mode", PROP_ENUM, PROP_NONE);
3833 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v3d_align");
3835 RNA_def_property_enum_items(prop, gpencil_stroke_snap_items);
3836 RNA_def_property_ui_text(prop, "Stroke Snap", "");
3837 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3838
3839 prop = RNA_def_property(srna, "gpencil_surface_offset", PROP_FLOAT, PROP_DISTANCE);
3840 RNA_def_property_float_sdna(prop, nullptr, "gpencil_surface_offset");
3843 prop, "Surface Offset", "Offset along the normal when drawing on surfaces");
3844 RNA_def_property_range(prop, 0.0f, 1.0f);
3845 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 3);
3846 RNA_def_property_float_default(prop, 0.150f);
3847
3848 prop = RNA_def_property(srna, "use_gpencil_project_only_selected", PROP_BOOLEAN, PROP_NONE);
3850 prop, nullptr, "gpencil_v3d_align", GP_PROJECT_DEPTH_ONLY_SELECTED);
3853 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
3854 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3855
3856 /* Grease Pencil - Select mode Edit */
3857 prop = RNA_def_property(srna, "gpencil_selectmode_edit", PROP_ENUM, PROP_NONE);
3858 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_selectmode_edit");
3861 RNA_def_property_ui_text(prop, "Select Mode", "");
3865
3866 /* Grease Pencil - Select mode Sculpt */
3867 prop = RNA_def_property(srna, "use_gpencil_select_mask_point", PROP_BOOLEAN, PROP_NONE);
3869 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_POINT);
3871 RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points");
3872 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
3875 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_point_update");
3876
3877 prop = RNA_def_property(srna, "use_gpencil_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
3879 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_STROKE);
3881 RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected strokes");
3882 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
3885 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_stroke_update");
3886
3887 prop = RNA_def_property(srna, "use_gpencil_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
3889 prop, nullptr, "gpencil_selectmode_sculpt", GP_SCULPT_MASK_SELECTMODE_SEGMENT);
3892 prop, "Selection Mask", "Only sculpt selected stroke points between other strokes");
3893 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
3896 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_mask_segment_update");
3897
3898 /* Grease Pencil - Select mode Vertex Paint */
3899 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_point", PROP_BOOLEAN, PROP_NONE);
3901 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_POINT);
3903 RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected stroke points");
3904 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_POINTS, 0);
3908 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_point_update");
3909
3910 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_stroke", PROP_BOOLEAN, PROP_NONE);
3912 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_STROKE);
3914 RNA_def_property_ui_text(prop, "Selection Mask", "Only paint selected strokes");
3915 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_STROKES, 0);
3919 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_stroke_update");
3920
3921 prop = RNA_def_property(srna, "use_gpencil_vertex_select_mask_segment", PROP_BOOLEAN, PROP_NONE);
3923 prop, nullptr, "gpencil_selectmode_vertex", GP_VERTEX_MASK_SELECTMODE_SEGMENT);
3926 prop, "Selection Mask", "Only paint selected stroke points between other strokes");
3927 RNA_def_property_ui_icon(prop, ICON_GP_SELECT_BETWEEN_STROKES, 0);
3931 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Gpencil_vertex_mask_segment_update");
3932
3933 prop = RNA_def_property(srna, "use_grease_pencil_multi_frame_editing", PROP_BOOLEAN, PROP_NONE);
3934 RNA_def_property_boolean_sdna(prop, nullptr, "gpencil_flags", GP_USE_MULTI_FRAME_EDITING);
3936 RNA_def_property_ui_text(prop, "Multi-frame Editing", "Enable multi-frame editing");
3937 RNA_def_property_ui_icon(prop, ICON_GP_MULTIFRAME_EDITING, 0);
3940 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_active_grease_pencil_update");
3941
3942 /* Annotations - 2D Views Stroke Placement */
3943 prop = RNA_def_property(srna, "annotation_stroke_placement_view2d", PROP_ENUM, PROP_NONE);
3944 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "gpencil_v2d_align");
3946 RNA_def_property_enum_items(prop, annotation_stroke_placement_view2d_items);
3947 RNA_def_property_ui_text(prop, "Stroke Placement (2D View)", "");
3948 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3949
3950 /* Annotations - 3D View Stroke Placement */
3951 /* XXX: Do we need to decouple the stroke_endpoints setting too? */
3952 prop = RNA_def_property(srna, "annotation_stroke_placement_view3d", PROP_ENUM, PROP_NONE);
3953 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "annotate_v3d_align");
3955 RNA_def_property_enum_items(prop, annotation_stroke_placement_view3d_items);
3958 "Annotation Stroke Placement (3D View)",
3959 "How annotation strokes are orientated in 3D space");
3960 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3961
3962 prop = RNA_def_property(srna, "use_annotation_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
3964 prop, nullptr, "annotate_v3d_align", GP_PROJECT_DEPTH_STROKE_ENDPOINTS);
3967 prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping");
3968 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3969
3970 prop = RNA_def_property(srna, "use_annotation_project_only_selected", PROP_BOOLEAN, PROP_NONE);
3972 prop, nullptr, "annotate_v3d_align", GP_PROJECT_DEPTH_ONLY_SELECTED);
3975 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
3976 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3977
3978 /* Annotations - Stroke Thickness */
3979 prop = RNA_def_property(srna, "annotation_thickness", PROP_INT, PROP_PIXEL);
3980 RNA_def_property_int_sdna(prop, nullptr, "annotate_thickness");
3982 RNA_def_property_range(prop, 1, 10);
3983 RNA_def_property_ui_text(prop, "Annotation Stroke Thickness", "Thickness of annotation strokes");
3984 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
3985
3986 /* Auto Keying */
3987 prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
3988 RNA_def_property_boolean_sdna(prop, nullptr, "autokey_mode", AUTOKEY_ON);
3991 prop, "Auto Keying", "Automatic keyframe insertion for objects, bones and masks");
3992 RNA_def_property_ui_icon(prop, ICON_RECORD_OFF, 1);
3993
3994 prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
3995 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "autokey_mode");
3997 RNA_def_property_enum_items(prop, auto_key_items);
3999 "Auto-Keying Mode",
4000 "Mode of automatic keyframe insertion for objects, bones and masks");
4001
4002 prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
4003 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_LAYERED_RECORD);
4006 prop,
4007 "Layered",
4008 "Add a new NLA Track + Strip for every loop/pass made over the animation "
4009 "to allow non-destructive tweaking");
4010
4011 prop = RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
4012 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
4015 "Auto Keyframe Insert Keying Set",
4016 "Automatic keyframe insertion using active Keying Set only");
4017 RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0);
4018
4019 prop = RNA_def_property(srna, "use_keyframe_cycle_aware", PROP_BOOLEAN, PROP_NONE);
4020 RNA_def_property_boolean_sdna(prop, nullptr, "keying_flag", KEYING_FLAG_CYCLEAWARE);
4023 prop,
4024 "Cycle-Aware Keying",
4025 "For channels with cyclic extrapolation, keyframe insertion is automatically "
4026 "remapped inside the cycle time range, and keeps ends in sync. Curves newly added to "
4027 "actions with a Manual Frame Range and Cyclic Animation are automatically made cyclic.");
4028
4029 /* Keyframing */
4030 prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE);
4031 RNA_def_property_enum_sdna(prop, nullptr, "keyframe_type");
4035 prop, "New Keyframe Type", "Type of keyframes to create when inserting keyframes");
4036
4037 /* UV */
4038 prop = RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
4039 RNA_def_property_enum_sdna(prop, nullptr, "uv_selectmode");
4042 RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode");
4044 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Scene_uv_select_mode_update");
4045
4046 prop = RNA_def_property(srna, "uv_sticky_select_mode", PROP_ENUM, PROP_NONE);
4047 RNA_def_property_enum_sdna(prop, nullptr, "uv_sticky");
4049 RNA_def_property_enum_items(prop, uv_sticky_mode_items);
4051 prop, "Sticky Selection Mode", "Method for extending UV vertex selection");
4053
4054 prop = RNA_def_property(srna, "use_uv_select_sync", PROP_BOOLEAN, PROP_NONE);
4055 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_SYNC_SELECTION);
4058 prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync");
4059 RNA_def_property_ui_icon(prop, ICON_UV_SYNC_SELECT, 0);
4061
4062 prop = RNA_def_property(srna, "show_uv_local_view", PROP_BOOLEAN, PROP_NONE);
4063 RNA_def_property_boolean_sdna(prop, nullptr, "uv_flag", UV_SHOW_SAME_IMAGE);
4066 prop, "UV Local View", "Display only faces with the currently displayed image assigned");
4068
4069 /* Mesh */
4070 prop = RNA_def_property(srna, "mesh_select_mode", PROP_BOOLEAN, PROP_NONE);
4071 RNA_def_property_boolean_sdna(prop, nullptr, "selectmode", 1);
4073 RNA_def_property_array(prop, 3);
4074 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Scene_editmesh_select_mode_set");
4075 RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Which mesh elements selection works on");
4077 RNA_def_property_update(prop, 0, "rna_Scene_editmesh_select_mode_update");
4078
4079 prop = RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_FACTOR);
4080 RNA_def_property_float_sdna(prop, nullptr, "vgroup_weight");
4082 RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups");
4083
4084 prop = RNA_def_property(srna, "use_edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE);
4085 RNA_def_property_boolean_sdna(prop, nullptr, "edge_mode_live_unwrap", 1);
4087 RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edge seams recalculates UV unwrap");
4088
4089 prop = RNA_def_property(srna, "normal_vector", PROP_FLOAT, PROP_XYZ);
4090 RNA_def_property_ui_text(prop, "Normal Vector", "Normal vector used to copy, add or multiply");
4091 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, 3);
4092
4093 /* Unified Paint Settings */
4094 prop = RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
4096 RNA_def_property_struct_type(prop, "UnifiedPaintSettings");
4097 RNA_def_property_ui_text(prop, "Unified Paint Settings", nullptr);
4098
4099 /* Curve Paint Settings */
4100 prop = RNA_def_property(srna, "curve_paint_settings", PROP_POINTER, PROP_NONE);
4102 RNA_def_property_struct_type(prop, "CurvePaintSettings");
4103 RNA_def_property_ui_text(prop, "Curve Paint Settings", nullptr);
4104
4105 /* Mesh Statistics */
4106 prop = RNA_def_property(srna, "statvis", PROP_POINTER, PROP_NONE);
4108 RNA_def_property_struct_type(prop, "MeshStatVis");
4109 RNA_def_property_ui_text(prop, "Mesh Statistics Visualization", nullptr);
4110
4111 /* CurveProfile */
4112 prop = RNA_def_property(srna, "custom_bevel_profile_preset", PROP_POINTER, PROP_NONE);
4113 RNA_def_property_pointer_sdna(prop, nullptr, "custom_bevel_profile_preset");
4114 RNA_def_property_struct_type(prop, "CurveProfile");
4115 RNA_def_property_ui_text(prop, "Curve Profile Widget", "Used for defining a profile's path");
4116
4117 /* Sequencer tool settings */
4118 prop = RNA_def_property(srna, "sequencer_tool_settings", PROP_POINTER, PROP_NONE);
4120 RNA_def_property_struct_type(prop, "SequencerToolSettings");
4121 RNA_def_property_ui_text(prop, "Sequencer Tool Settings", nullptr);
4122}
4123
4125{
4126 StructRNA *srna;
4127 PropertyRNA *prop;
4128
4129 static const EnumPropertyItem scale_fit_methods[] = {
4130 {SEQ_SCALE_TO_FIT, "FIT", 0, "Scale to Fit", "Scale image to fit within the canvas"},
4131 {SEQ_SCALE_TO_FILL, "FILL", 0, "Scale to Fill", "Scale image to completely fill the canvas"},
4132 {SEQ_STRETCH_TO_FILL, "STRETCH", 0, "Stretch to Fill", "Stretch image to fill the canvas"},
4134 "ORIGINAL",
4135 0,
4136 "Use Original Size",
4137 "Keep image at its original size"},
4138 {0, nullptr, 0, nullptr, nullptr},
4139 };
4140
4141 static const EnumPropertyItem scale_overlap_modes[] = {
4142 {SEQ_OVERLAP_EXPAND, "EXPAND", 0, "Expand", "Move strips so transformed strips fit"},
4144 "OVERWRITE",
4145 0,
4146 "Overwrite",
4147 "Trim or split strips to resolve overlap"},
4149 "SHUFFLE",
4150 0,
4151 "Shuffle",
4152 "Move transformed strips to nearest free space to resolve overlap"},
4153 {0, nullptr, 0, nullptr, nullptr},
4154 };
4155
4156 static const EnumPropertyItem pivot_points[] = {
4157 {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
4158 {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
4159 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
4161 "INDIVIDUAL_ORIGINS",
4162 ICON_PIVOT_INDIVIDUAL,
4163 "Individual Origins",
4164 "Pivot around each selected island's own median point"},
4165 {0, nullptr, 0, nullptr, nullptr},
4166
4167 };
4168 srna = RNA_def_struct(brna, "SequencerToolSettings", nullptr);
4169 RNA_def_struct_path_func(srna, "rna_SequencerToolSettings_path");
4170 RNA_def_struct_ui_text(srna, "Sequencer Tool Settings", "");
4171
4172 /* Add strip settings. */
4173 prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_NONE);
4175 RNA_def_property_ui_text(prop, "Fit Method", "Scale fit method");
4176
4177 /* Transform snapping. */
4178 prop = RNA_def_property(srna, "snap_to_current_frame", PROP_BOOLEAN, PROP_NONE);
4179 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_CURRENT_FRAME);
4180 RNA_def_property_ui_text(prop, "Current Frame", "Snap to current frame");
4181 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4182
4183 prop = RNA_def_property(srna, "snap_to_hold_offset", PROP_BOOLEAN, PROP_NONE);
4184 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_STRIP_HOLD);
4185 RNA_def_property_ui_text(prop, "Hold Offset", "Snap to strip hold offsets");
4186 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4187
4188 prop = RNA_def_property(srna, "snap_to_markers", PROP_BOOLEAN, PROP_NONE);
4189 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_MARKERS);
4190 RNA_def_property_ui_text(prop, "Markers", "Snap to markers");
4191 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4192
4193 prop = RNA_def_property(srna, "snap_to_borders", PROP_BOOLEAN, PROP_NONE);
4195 RNA_def_property_ui_text(prop, "Borders", "Snap to preview borders");
4196 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4197
4198 prop = RNA_def_property(srna, "snap_to_center", PROP_BOOLEAN, PROP_NONE);
4199 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_PREVIEW_CENTER);
4200 RNA_def_property_ui_text(prop, "Center", "Snap to preview center");
4201 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4202
4203 prop = RNA_def_property(srna, "snap_to_strips_preview", PROP_BOOLEAN, PROP_NONE);
4204 RNA_def_property_boolean_sdna(prop, nullptr, "snap_mode", SEQ_SNAP_TO_STRIPS_PREVIEW);
4206 prop, "Other Strips", "Snap to borders and origins of deselected, visible strips");
4207 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); /* header redraw */
4208
4209 prop = RNA_def_property(srna, "snap_ignore_muted", PROP_BOOLEAN, PROP_NONE);
4210 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SEQ_SNAP_IGNORE_MUTED);
4211 RNA_def_property_ui_text(prop, "Ignore Muted Strips", "Don't snap to hidden strips");
4212
4213 prop = RNA_def_property(srna, "snap_ignore_sound", PROP_BOOLEAN, PROP_NONE);
4214 RNA_def_property_boolean_sdna(prop, nullptr, "snap_flag", SEQ_SNAP_IGNORE_SOUND);
4215 RNA_def_property_ui_text(prop, "Ignore Sound Strips", "Don't snap to sound strips");
4216
4217 prop = RNA_def_property(srna, "use_snap_current_frame_to_strips", PROP_BOOLEAN, PROP_NONE);
4220 prop, "Snap Current Frame to Strips", "Snap current frame to strip start or end");
4221
4222 prop = RNA_def_property(srna, "snap_distance", PROP_INT, PROP_PIXEL);
4223 RNA_def_property_int_sdna(prop, nullptr, "snap_distance");
4225 RNA_def_property_ui_range(prop, 0, 50, 1, 1);
4226 RNA_def_property_ui_text(prop, "Snapping Distance", "Maximum distance for snapping in pixels");
4227
4228 /* Transform overlap handling. */
4229 prop = RNA_def_property(srna, "overlap_mode", PROP_ENUM, PROP_NONE);
4230 RNA_def_property_enum_items(prop, scale_overlap_modes);
4231 RNA_def_property_ui_text(prop, "Overlap Mode", "How to resolve overlap after transformation");
4232
4233 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
4234 RNA_def_property_enum_items(prop, pivot_points);
4235 RNA_def_property_ui_text(prop, "Pivot Point", "Rotation or scaling pivot point");
4237}
4238
4240{
4241 StructRNA *srna;
4242 PropertyRNA *prop;
4243
4244 static const EnumPropertyItem brush_size_unit_items[] = {
4245 {0, "VIEW", 0, "View", "Measure brush size relative to the view"},
4247 "SCENE",
4248 0,
4249 "Scene",
4250 "Measure brush size relative to the scene"},
4251 {0, nullptr, 0, nullptr, nullptr},
4252 };
4253
4254 srna = RNA_def_struct(brna, "UnifiedPaintSettings", nullptr);
4255 RNA_def_struct_path_func(srna, "rna_UnifiedPaintSettings_path");
4257 srna, "Unified Paint Settings", "Overrides for some of the active brush's settings");
4258
4259 /* high-level flags to enable or disable unified paint settings */
4260 prop = RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE);
4261 RNA_def_property_boolean_sdna(prop, nullptr, "flag", UNIFIED_PAINT_SIZE);
4263 "Use Unified Radius",
4264 "Instead of per-brush radius, the radius is shared across brushes");
4265
4266 prop = RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE);
4267 RNA_def_property_boolean_sdna(prop, nullptr, "flag", UNIFIED_PAINT_ALPHA);
4269 "Use Unified Strength",
4270 "Instead of per-brush strength, the strength is shared across brushes");
4271
4272 prop = RNA_def_property(srna, "use_unified_weight", PROP_BOOLEAN, PROP_NONE);
4275 "Use Unified Weight",
4276 "Instead of per-brush weight, the weight is shared across brushes");
4277
4278 prop = RNA_def_property(srna, "use_unified_color", PROP_BOOLEAN, PROP_NONE);
4279 RNA_def_property_boolean_sdna(prop, nullptr, "flag", UNIFIED_PAINT_COLOR);
4281 prop, "Use Unified Color", "Instead of per-brush color, the color is shared across brushes");
4282
4283 prop = RNA_def_property(srna, "use_unified_input_samples", PROP_BOOLEAN, PROP_NONE);
4286 prop,
4287 "Use Unified Input Samples",
4288 "Instead of per-brush input samples, the value is shared across brushes");
4289
4290 /* unified paint settings that override the equivalent settings
4291 * from the active brush */
4292 prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
4293 RNA_def_property_int_funcs(prop, nullptr, "rna_UnifiedPaintSettings_size_set", nullptr);
4297 RNA_def_property_ui_text(prop, "Radius", "Radius of the brush");
4298 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_radius_update");
4299
4300 prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
4302 prop, nullptr, "rna_UnifiedPaintSettings_unprojected_radius_set", nullptr);
4304 RNA_def_property_range(prop, 0.001, FLT_MAX);
4305 RNA_def_property_ui_range(prop, 0.001, 1, 1, -1);
4306 RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
4307 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_radius_update");
4308
4309 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
4310 RNA_def_property_float_sdna(prop, nullptr, "alpha");
4312 RNA_def_property_range(prop, 0.0f, 10.0f);
4313 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
4315 prop, "Strength", "How powerful the effect of the brush is when applied");
4316 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4317
4318 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
4319 RNA_def_property_float_sdna(prop, nullptr, "weight");
4321 RNA_def_property_range(prop, 0.0f, 1.0f);
4322 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
4323 RNA_def_property_ui_text(prop, "Weight", "Weight to assign in vertex groups");
4324 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4325
4326 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
4328 RNA_def_property_range(prop, 0.0, 1.0);
4329 RNA_def_property_float_sdna(prop, nullptr, "rgb");
4330 RNA_def_property_ui_text(prop, "Color", "");
4331 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4332
4333 prop = RNA_def_property(srna, "secondary_color", PROP_FLOAT, PROP_COLOR_GAMMA);
4335 RNA_def_property_range(prop, 0.0, 1.0);
4336 RNA_def_property_float_sdna(prop, nullptr, "secondary_rgb");
4337 RNA_def_property_ui_text(prop, "Secondary Color", "");
4338 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4339
4340 prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED);
4341 RNA_def_property_int_sdna(prop, nullptr, "input_samples");
4346 prop,
4347 "Input Samples",
4348 "Number of input samples to average together to smooth the brush stroke");
4349 RNA_def_property_update(prop, 0, "rna_UnifiedPaintSettings_update");
4350
4351 prop = RNA_def_property(srna, "use_locked_size", PROP_ENUM, PROP_NONE); /* as an enum */
4352 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
4353 RNA_def_property_enum_items(prop, brush_size_unit_items);
4355 prop, "Radius Unit", "Measure brush size relative to the view or the scene");
4356}
4357
4359{
4360 StructRNA *srna;
4361 PropertyRNA *prop;
4362
4363 srna = RNA_def_struct(brna, "CurvePaintSettings", nullptr);
4364 RNA_def_struct_path_func(srna, "rna_CurvePaintSettings_path");
4365 RNA_def_struct_ui_text(srna, "Curve Paint Settings", "");
4366
4367 static const EnumPropertyItem curve_type_items[] = {
4368 {CU_POLY, "POLY", 0, "Poly", ""},
4369 {CU_BEZIER, "BEZIER", 0, "Bézier", ""},
4370 {0, nullptr, 0, nullptr, nullptr},
4371 };
4372
4373 prop = RNA_def_property(srna, "curve_type", PROP_ENUM, PROP_NONE);
4375 RNA_def_property_enum_sdna(prop, nullptr, "curve_type");
4377 RNA_def_property_ui_text(prop, "Type", "Type of curve to use for new strokes");
4378
4379 prop = RNA_def_property(srna, "use_corners_detect", PROP_BOOLEAN, PROP_NONE);
4382 RNA_def_property_ui_text(prop, "Detect Corners", "Detect corners and use non-aligned handles");
4383
4384 prop = RNA_def_property(srna, "use_pressure_radius", PROP_BOOLEAN, PROP_NONE);
4387 RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
4388 RNA_def_property_ui_text(prop, "Use Pressure", "Map tablet pressure to curve radius");
4389
4390 prop = RNA_def_property(srna, "use_stroke_endpoints", PROP_BOOLEAN, PROP_NONE);
4393 RNA_def_property_ui_text(prop, "Only First", "Use the start of the stroke for the depth");
4394
4395 prop = RNA_def_property(srna, "use_offset_absolute", PROP_BOOLEAN, PROP_NONE);
4399 prop, "Absolute Offset", "Apply a fixed offset (don't scale by the radius)");
4400
4401 prop = RNA_def_property(srna, "use_project_only_selected", PROP_BOOLEAN, PROP_NONE);
4405 prop, "Project Onto Selected", "Project the strokes only onto selected objects");
4406
4407 prop = RNA_def_property(srna, "error_threshold", PROP_INT, PROP_PIXEL);
4409 RNA_def_property_range(prop, 1, 100);
4410 RNA_def_property_ui_text(prop, "Tolerance", "Allow deviation for a smoother, less precise line");
4411
4412 prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_PIXEL);
4414 RNA_def_property_enum_sdna(prop, nullptr, "fit_method");
4416 RNA_def_property_ui_text(prop, "Method", "Curve fitting method");
4417
4418 prop = RNA_def_property(srna, "corner_angle", PROP_FLOAT, PROP_ANGLE);
4420 RNA_def_property_range(prop, 0, M_PI);
4421 RNA_def_property_ui_text(prop, "Corner Angle", "Angles above this are considered corners");
4422
4423 prop = RNA_def_property(srna, "radius_min", PROP_FLOAT, PROP_NONE);
4425 RNA_def_property_range(prop, 0.0, 100.0);
4426 RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
4428 prop,
4429 "Radius Min",
4430 "Minimum radius when the minimum pressure is applied (also the minimum when tapering)");
4431
4432 prop = RNA_def_property(srna, "radius_max", PROP_FLOAT, PROP_NONE);
4434 RNA_def_property_range(prop, 0.0, 100.0);
4435 RNA_def_property_ui_range(prop, 0.0f, 10.0, 10, 2);
4437 prop,
4438 "Radius Max",
4439 "Radius to use when the maximum pressure is applied (or when a tablet isn't used)");
4440
4441 prop = RNA_def_property(srna, "radius_taper_start", PROP_FLOAT, PROP_NONE);
4443 RNA_def_property_range(prop, 0.0, 1.0);
4444 RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
4446 prop, "Radius Min", "Taper factor for the radius of each point along the curve");
4447
4448 prop = RNA_def_property(srna, "radius_taper_end", PROP_FLOAT, PROP_NONE);
4450 RNA_def_property_range(prop, 0.0, 10.0);
4451 RNA_def_property_ui_range(prop, 0.0f, 1.0, 1, 2);
4453 prop, "Radius Max", "Taper factor for the radius of each point along the curve");
4454
4455 prop = RNA_def_property(srna, "surface_offset", PROP_FLOAT, PROP_NONE);
4457 RNA_def_property_range(prop, -10.0, 10.0);
4458 RNA_def_property_ui_range(prop, -1.0f, 1.0, 1, 2);
4459 RNA_def_property_ui_text(prop, "Offset", "Offset the stroke from the surface");
4460
4461 static const EnumPropertyItem depth_mode_items[] = {
4462 {CURVE_PAINT_PROJECT_CURSOR, "CURSOR", 0, "Cursor", ""},
4463 {CURVE_PAINT_PROJECT_SURFACE, "SURFACE", 0, "Surface", ""},
4464 {0, nullptr, 0, nullptr, nullptr},
4465 };
4466
4467 prop = RNA_def_property(srna, "depth_mode", PROP_ENUM, PROP_NONE);
4469 RNA_def_property_enum_sdna(prop, nullptr, "depth_mode");
4470 RNA_def_property_enum_items(prop, depth_mode_items);
4471 RNA_def_property_ui_text(prop, "Depth", "Method of projecting depth");
4472
4473 static const EnumPropertyItem surface_plane_items[] = {
4475 "NORMAL_VIEW",
4476 0,
4477 "Normal to Surface",
4478 "Draw in a plane perpendicular to the surface"},
4480 "NORMAL_SURFACE",
4481 0,
4482 "Tangent to Surface",
4483 "Draw in the surface plane"},
4485 "VIEW",
4486 0,
4487 "View",
4488 "Draw in a plane aligned to the viewport"},
4489 {0, nullptr, 0, nullptr, nullptr},
4490 };
4491
4492 prop = RNA_def_property(srna, "surface_plane", PROP_ENUM, PROP_NONE);
4494 RNA_def_property_enum_sdna(prop, nullptr, "surface_plane");
4495 RNA_def_property_enum_items(prop, surface_plane_items);
4496 RNA_def_property_ui_text(prop, "Plane", "Plane for projected stroke");
4497}
4498
4499static void rna_def_statvis(BlenderRNA *brna)
4500{
4501 StructRNA *srna;
4502 PropertyRNA *prop;
4503
4504 static const EnumPropertyItem stat_type[] = {
4505 {SCE_STATVIS_OVERHANG, "OVERHANG", 0, "Overhang", ""},
4506 {SCE_STATVIS_THICKNESS, "THICKNESS", 0, "Thickness", ""},
4507 {SCE_STATVIS_INTERSECT, "INTERSECT", 0, "Intersect", ""},
4508 {SCE_STATVIS_DISTORT, "DISTORT", 0, "Distortion", ""},
4509 {SCE_STATVIS_SHARP, "SHARP", 0, "Sharp", ""},
4510 {0, nullptr, 0, nullptr, nullptr},
4511 };
4512
4513 srna = RNA_def_struct(brna, "MeshStatVis", nullptr);
4514 RNA_def_struct_path_func(srna, "rna_MeshStatVis_path");
4515 RNA_def_struct_ui_text(srna, "Mesh Visualize Statistics", "");
4516
4517 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4518 RNA_def_property_enum_items(prop, stat_type);
4519 RNA_def_property_ui_text(prop, "Type", "Type of data to visualize/check");
4521 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4522
4523 /* overhang */
4524 prop = RNA_def_property(srna, "overhang_min", PROP_FLOAT, PROP_ANGLE);
4525 RNA_def_property_float_sdna(prop, nullptr, "overhang_min");
4526 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4527 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4528 RNA_def_property_ui_text(prop, "Overhang Min", "Minimum angle to display");
4530 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4531
4532 prop = RNA_def_property(srna, "overhang_max", PROP_FLOAT, PROP_ANGLE);
4533 RNA_def_property_float_sdna(prop, nullptr, "overhang_max");
4534 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4535 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4536 RNA_def_property_ui_text(prop, "Overhang Max", "Maximum angle to display");
4538 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4539
4540 prop = RNA_def_property(srna, "overhang_axis", PROP_ENUM, PROP_NONE);
4541 RNA_def_property_enum_sdna(prop, nullptr, "overhang_axis");
4543 RNA_def_property_ui_text(prop, "Axis", "");
4545 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4546
4547 /* thickness */
4548 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_DISTANCE);
4549 RNA_def_property_float_sdna(prop, nullptr, "thickness_min");
4550 RNA_def_property_range(prop, 0.0f, 1000.0);
4551 RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4552 RNA_def_property_ui_text(prop, "Thickness Min", "Minimum for measuring thickness");
4554 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4555
4556 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_DISTANCE);
4557 RNA_def_property_float_sdna(prop, nullptr, "thickness_max");
4558 RNA_def_property_range(prop, 0.0f, 1000.0);
4559 RNA_def_property_ui_range(prop, 0.0f, 100.0, 0.001, 3);
4560 RNA_def_property_ui_text(prop, "Thickness Max", "Maximum for measuring thickness");
4562 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4563
4564 prop = RNA_def_property(srna, "thickness_samples", PROP_INT, PROP_UNSIGNED);
4565 RNA_def_property_int_sdna(prop, nullptr, "thickness_samples");
4566 RNA_def_property_range(prop, 1, 32);
4567 RNA_def_property_ui_text(prop, "Samples", "Number of samples to test per face");
4569 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4570
4571 /* distort */
4572 prop = RNA_def_property(srna, "distort_min", PROP_FLOAT, PROP_ANGLE);
4573 RNA_def_property_float_sdna(prop, nullptr, "distort_min");
4574 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4575 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4576 RNA_def_property_ui_text(prop, "Distort Min", "Minimum angle to display");
4578 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4579
4580 prop = RNA_def_property(srna, "distort_max", PROP_FLOAT, PROP_ANGLE);
4581 RNA_def_property_float_sdna(prop, nullptr, "distort_max");
4582 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4583 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 3);
4584 RNA_def_property_ui_text(prop, "Distort Max", "Maximum angle to display");
4586 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4587
4588 /* sharp */
4589 prop = RNA_def_property(srna, "sharp_min", PROP_FLOAT, PROP_ANGLE);
4590 RNA_def_property_float_sdna(prop, nullptr, "sharp_min");
4591 RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
4592 RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
4593 RNA_def_property_ui_text(prop, "Sharpness Min", "Minimum angle to display");
4595 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4596
4597 prop = RNA_def_property(srna, "sharp_max", PROP_FLOAT, PROP_ANGLE);
4598 RNA_def_property_float_sdna(prop, nullptr, "sharp_max");
4599 RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f));
4600 RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 10, 3);
4601 RNA_def_property_ui_text(prop, "Sharpness Max", "Maximum angle to display");
4603 RNA_def_property_update(prop, 0, "rna_EditMesh_update");
4604}
4605
4607{
4608 StructRNA *srna;
4609 PropertyRNA *prop;
4610
4611 static const EnumPropertyItem unit_systems[] = {
4612 {USER_UNIT_NONE, "NONE", 0, "None", ""},
4613 {USER_UNIT_METRIC, "METRIC", 0, "Metric", ""},
4614 {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""},
4615 {0, nullptr, 0, nullptr, nullptr},
4616 };
4617
4618 static const EnumPropertyItem rotation_units[] = {
4619 {0, "DEGREES", 0, "Degrees", "Use degrees for measuring angles and rotations"},
4620 {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
4621 {0, nullptr, 0, nullptr, nullptr},
4622 };
4623
4624 srna = RNA_def_struct(brna, "UnitSettings", nullptr);
4625 RNA_def_struct_ui_text(srna, "Unit Settings", "");
4626 RNA_def_struct_nested(brna, srna, "Scene");
4627 RNA_def_struct_path_func(srna, "rna_UnitSettings_path");
4628
4629 /* Units */
4630 prop = RNA_def_property(srna, "system", PROP_ENUM, PROP_NONE);
4631 RNA_def_property_enum_items(prop, unit_systems);
4633 prop, "Unit System", "The unit system to use for user interface controls");
4634 RNA_def_property_update(prop, NC_WINDOW, "rna_UnitSettings_system_update");
4635
4636 prop = RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE);
4637 RNA_def_property_enum_items(prop, rotation_units);
4639 prop, "Rotation Units", "Unit to use for displaying/editing rotation values");
4640 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4641
4642 prop = RNA_def_property(srna, "scale_length", PROP_FLOAT, PROP_UNSIGNED);
4644 prop,
4645 "Unit Scale",
4646 "Scale to use when converting between Blender units and dimensions."
4647 " When working at microscopic or astronomical scale, a small or large unit scale"
4648 " respectively can be used to avoid numerical precision problems");
4649 RNA_def_property_range(prop, 1e-9f, 1e+9f);
4650 RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 6);
4651 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4652
4653 prop = RNA_def_property(srna, "use_separate", PROP_BOOLEAN, PROP_NONE);
4654 RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_UNIT_OPT_SPLIT);
4655 RNA_def_property_ui_text(prop, "Separate Units", "Display units in pairs (e.g. 1m 0cm)");
4656 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4657
4658 prop = RNA_def_property(srna, "length_unit", PROP_ENUM, PROP_NONE);
4660 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_length_unit_itemf");
4661 RNA_def_property_ui_text(prop, "Length Unit", "Unit that will be used to display length values");
4662 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4663
4664 prop = RNA_def_property(srna, "mass_unit", PROP_ENUM, PROP_NONE);
4666 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_mass_unit_itemf");
4667 RNA_def_property_ui_text(prop, "Mass Unit", "Unit that will be used to display mass values");
4668 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4669
4670 prop = RNA_def_property(srna, "time_unit", PROP_ENUM, PROP_NONE);
4672 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_time_unit_itemf");
4673 RNA_def_property_ui_text(prop, "Time Unit", "Unit that will be used to display time values");
4674 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4675
4676 prop = RNA_def_property(srna, "temperature_unit", PROP_ENUM, PROP_NONE);
4678 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_UnitSettings_temperature_unit_itemf");
4680 prop, "Temperature Unit", "Unit that will be used to display temperature values");
4681 RNA_def_property_update(prop, NC_WINDOW, nullptr);
4682}
4683
4685{
4686 StructRNA *srna;
4687 PropertyRNA *prop;
4688 srna = RNA_def_struct(brna, "ViewLayerEEVEE", nullptr);
4689 RNA_def_struct_path_func(srna, "rna_ViewLayerEEVEE_path");
4690 RNA_def_struct_ui_text(srna, "EEVEE Settings", "View Layer settings for EEVEE");
4691
4692 prop = RNA_def_property(srna, "use_pass_volume_direct", PROP_BOOLEAN, PROP_NONE);
4693 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", EEVEE_RENDER_PASS_VOLUME_LIGHT);
4694 RNA_def_property_ui_text(prop, "Volume Light", "Deliver volume direct light pass");
4695 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4696
4697# if 1
4698 /* Bloom is deprecated since Blender 4.2, is kept for add-on compatibility reasons and needs to
4699 * be removed in a future release. */
4700 prop = RNA_def_property(srna, "use_pass_bloom", PROP_BOOLEAN, PROP_NONE);
4701 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", 0 /*EEVEE_RENDER_PASS_BLOOM*/);
4702 RNA_def_property_ui_text(prop, "Bloom", "Deliver bloom pass (deprecated)");
4703 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4704# endif
4705
4706 prop = RNA_def_property(srna, "use_pass_transparent", PROP_BOOLEAN, PROP_NONE);
4707 RNA_def_property_boolean_sdna(prop, nullptr, "render_passes", EEVEE_RENDER_PASS_TRANSPARENT);
4709 prop, "Transparent", "Deliver alpha blended surfaces in a separate pass");
4710 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4711}
4712
4714{
4715 StructRNA *srna;
4716 // PropertyRNA *prop;
4717
4718 FunctionRNA *func;
4719 PropertyRNA *parm;
4720
4721 RNA_def_property_srna(cprop, "AOVs");
4722 srna = RNA_def_struct(brna, "AOVs", nullptr);
4723 RNA_def_struct_sdna(srna, "ViewLayer");
4724 RNA_def_struct_ui_text(srna, "List of AOVs", "Collection of AOVs");
4725
4726 func = RNA_def_function(srna, "add", "BKE_view_layer_add_aov");
4727 parm = RNA_def_pointer(func, "aov", "AOV", "", "Newly created AOV");
4728 RNA_def_function_return(func, parm);
4729
4730 /* Defined in `rna_layer.cc`. */
4731 func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove_aov");
4732 parm = RNA_def_pointer(func, "aov", "AOV", "", "AOV to remove");
4733 RNA_def_function_ui_description(func, "Remove an AOV");
4737}
4738
4740{
4741 StructRNA *srna;
4742 PropertyRNA *prop;
4743 srna = RNA_def_struct(brna, "AOV", nullptr);
4744 RNA_def_struct_sdna(srna, "ViewLayerAOV");
4745 RNA_def_struct_ui_text(srna, "Shader AOV", "");
4746
4747 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4748 RNA_def_property_string_sdna(prop, nullptr, "name");
4750 RNA_def_property_ui_text(prop, "Name", "Name of the AOV");
4751 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4752 RNA_def_struct_name_property(srna, prop);
4753
4754 prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
4756 RNA_def_property_ui_text(prop, "Valid", "Is the name of the AOV conflicting");
4757
4758 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4759 RNA_def_property_enum_sdna(prop, nullptr, "type");
4762 RNA_def_property_ui_text(prop, "Type", "Data type of the AOV");
4763 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4764}
4765
4767{
4768 StructRNA *srna;
4769 // PropertyRNA *prop;
4770
4771 FunctionRNA *func;
4772 PropertyRNA *parm;
4773
4774 RNA_def_property_srna(cprop, "Lightgroups");
4775 srna = RNA_def_struct(brna, "Lightgroups", nullptr);
4776 RNA_def_struct_sdna(srna, "ViewLayer");
4777 RNA_def_struct_ui_text(srna, "List of Lightgroups", "Collection of Lightgroups");
4778
4779 func = RNA_def_function(srna, "add", "BKE_view_layer_add_lightgroup");
4780 parm = RNA_def_pointer(func, "lightgroup", "Lightgroup", "", "Newly created Lightgroup");
4781 RNA_def_function_return(func, parm);
4782 parm = RNA_def_string(func, "name", nullptr, 0, "Name", "Name of newly created lightgroup");
4783}
4784
4786{
4787 StructRNA *srna;
4788 PropertyRNA *prop;
4789 srna = RNA_def_struct(brna, "Lightgroup", nullptr);
4790 RNA_def_struct_sdna(srna, "ViewLayerLightgroup");
4791 RNA_def_struct_ui_text(srna, "Light Group", "");
4792
4793 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4796 "rna_ViewLayerLightgroup_name_get",
4797 "rna_ViewLayerLightgroup_name_length",
4798 "rna_ViewLayerLightgroup_name_set");
4799 RNA_def_property_ui_text(prop, "Name", "Name of the Lightgroup");
4800 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4801 RNA_def_struct_name_property(srna, prop);
4802}
4803
4804void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool scene)
4805{
4806 PropertyRNA *prop;
4807
4808 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
4809 if (scene) {
4810 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_ViewLayer_name_set");
4811 }
4812 else {
4813 RNA_def_property_string_sdna(prop, nullptr, "name");
4814 }
4815 RNA_def_property_ui_text(prop, "Name", "View layer name");
4816 RNA_def_struct_name_property(srna, prop);
4817 if (scene) {
4819 }
4820 else {
4822 }
4823
4824 if (scene) {
4825 prop = RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
4826 RNA_def_property_pointer_sdna(prop, nullptr, "mat_override");
4827 RNA_def_property_struct_type(prop, "Material");
4831 prop, "Material Override", "Material to override all other materials in this view layer");
4832 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_override_update");
4833
4834 prop = RNA_def_property(srna, "world_override", PROP_POINTER, PROP_NONE);
4835 RNA_def_property_pointer_sdna(prop, nullptr, "world_override");
4836 RNA_def_property_struct_type(prop, "World");
4839 RNA_def_property_ui_text(prop, "World Override", "Override world in this view layer");
4840 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_override_update");
4841
4842 prop = RNA_def_property(srna, "samples", PROP_INT, PROP_UNSIGNED);
4844 "Samples",
4845 "Override number of render samples for this view layer, "
4846 "0 will use the scene setting");
4848
4849 prop = RNA_def_property(srna, "pass_alpha_threshold", PROP_FLOAT, PROP_FACTOR);
4851 prop,
4852 "Alpha Threshold",
4853 "Z, Index, normal, UV and vector passes are only affected by surfaces with "
4854 "alpha transparency equal to or higher than this threshold");
4856
4857 prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
4859 RNA_def_property_struct_type(prop, "ViewLayerEEVEE");
4860 RNA_def_property_ui_text(prop, "EEVEE Settings", "View layer settings for EEVEE");
4861
4862 prop = RNA_def_property(srna, "aovs", PROP_COLLECTION, PROP_NONE);
4863 RNA_def_property_collection_sdna(prop, nullptr, "aovs", nullptr);
4864 RNA_def_property_struct_type(prop, "AOV");
4865 RNA_def_property_ui_text(prop, "Shader AOV", "");
4866 rna_def_view_layer_aovs(brna, prop);
4867
4868 prop = RNA_def_property(srna, "active_aov", PROP_POINTER, PROP_NONE);
4869 RNA_def_property_struct_type(prop, "AOV");
4871 RNA_def_property_ui_text(prop, "Shader AOV", "Active AOV");
4872
4873 prop = RNA_def_property(srna, "active_aov_index", PROP_INT, PROP_UNSIGNED);
4875 "rna_ViewLayer_active_aov_index_get",
4876 "rna_ViewLayer_active_aov_index_set",
4877 "rna_ViewLayer_active_aov_index_range");
4878 RNA_def_property_ui_text(prop, "Active AOV Index", "Index of active AOV");
4880
4881 prop = RNA_def_property(srna, "lightgroups", PROP_COLLECTION, PROP_NONE);
4882 RNA_def_property_collection_sdna(prop, nullptr, "lightgroups", nullptr);
4883 RNA_def_property_struct_type(prop, "Lightgroup");
4884 RNA_def_property_ui_text(prop, "Light Groups", "");
4886
4887 prop = RNA_def_property(srna, "active_lightgroup", PROP_POINTER, PROP_NONE);
4888 RNA_def_property_struct_type(prop, "Lightgroup");
4890 RNA_def_property_ui_text(prop, "Light Groups", "Active Lightgroup");
4891
4892 prop = RNA_def_property(srna, "active_lightgroup_index", PROP_INT, PROP_UNSIGNED);
4894 "rna_ViewLayer_active_lightgroup_index_get",
4895 "rna_ViewLayer_active_lightgroup_index_set",
4896 "rna_ViewLayer_active_lightgroup_index_range");
4897 RNA_def_property_ui_text(prop, "Active Lightgroup Index", "Index of active lightgroup");
4899
4900 prop = RNA_def_property(srna, "use_pass_cryptomatte_object", PROP_BOOLEAN, PROP_NONE);
4902 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_OBJECT);
4904 prop,
4905 "Cryptomatte Object",
4906 "Render cryptomatte object pass, for isolating objects in compositing");
4907 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4908
4909 prop = RNA_def_property(srna, "use_pass_cryptomatte_material", PROP_BOOLEAN, PROP_NONE);
4911 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_MATERIAL);
4913 prop,
4914 "Cryptomatte Material",
4915 "Render cryptomatte material pass, for isolating materials in compositing");
4916 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4917
4918 prop = RNA_def_property(srna, "use_pass_cryptomatte_asset", PROP_BOOLEAN, PROP_NONE);
4919 RNA_def_property_boolean_sdna(prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_ASSET);
4921 prop,
4922 "Cryptomatte Asset",
4923 "Render cryptomatte asset pass, for isolating groups of objects with the same parent");
4924 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4925
4926 prop = RNA_def_property(srna, "pass_cryptomatte_depth", PROP_INT, PROP_NONE);
4927 RNA_def_property_int_sdna(prop, nullptr, "cryptomatte_levels");
4929 RNA_def_property_range(prop, 2.0, 16.0);
4931 prop, "Cryptomatte Levels", "Sets how many unique objects can be distinguished per pixel");
4932 RNA_def_property_ui_range(prop, 2.0, 16.0, 2.0, 0.0);
4933 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4934
4935 prop = RNA_def_property(srna, "use_pass_cryptomatte_accurate", PROP_BOOLEAN, PROP_NONE);
4937 prop, nullptr, "cryptomatte_flag", VIEW_LAYER_CRYPTOMATTE_ACCURATE);
4940 prop, "Cryptomatte Accurate", "Generate a more accurate cryptomatte pass");
4941 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
4942 }
4943
4944 prop = RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
4945 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_SOLID);
4946 RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
4947 if (scene) {
4949 }
4950 else {
4952 }
4953 prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
4954 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_SKY);
4955 RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
4956 if (scene) {
4957 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
4958 }
4959 else {
4961 }
4962
4963 prop = RNA_def_property(srna, "use_ao", PROP_BOOLEAN, PROP_NONE);
4964 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_AO);
4965 RNA_def_property_ui_text(prop, "Ambient Occlusion", "Render Ambient Occlusion in this Layer");
4966 if (scene) {
4967 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
4968 }
4969 else {
4971 }
4972
4973 prop = RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
4974 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_STRAND);
4975 RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
4976 if (scene) {
4978 }
4979 else {
4981 }
4982
4983 prop = RNA_def_property(srna, "use_volumes", PROP_BOOLEAN, PROP_NONE);
4984 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_VOLUMES);
4985 RNA_def_property_ui_text(prop, "Volumes", "Render volumes in this Layer");
4986 if (scene) {
4988 }
4989 else {
4991 }
4992
4993 prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
4994 RNA_def_property_boolean_sdna(prop, nullptr, "layflag", SCE_LAY_MOTION_BLUR);
4996 prop, "Motion Blur", "Render motion blur in this Layer, if enabled in the scene");
4997 if (scene) {
4999 }
5000 else {
5002 }
5003
5004 /* passes */
5005 prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
5006 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_COMBINED);
5007 RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer");
5008 if (scene) {
5009 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5010 }
5011 else {
5013 }
5014
5015 prop = RNA_def_property(srna, "use_pass_z", PROP_BOOLEAN, PROP_NONE);
5016 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_Z);
5017 RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass");
5018 if (scene) {
5019 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5020 }
5021 else {
5023 }
5024
5025 prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE);
5026 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_VECTOR);
5027 RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass");
5028 if (scene) {
5029 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5030 }
5031 else {
5033 }
5034
5035 prop = RNA_def_property(srna, "use_pass_position", PROP_BOOLEAN, PROP_NONE);
5036 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_POSITION);
5037 RNA_def_property_ui_text(prop, "Position", "Deliver position pass");
5038 if (scene) {
5039 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5040 }
5041 else {
5043 }
5044
5045 prop = RNA_def_property(srna, "use_pass_normal", PROP_BOOLEAN, PROP_NONE);
5046 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_NORMAL);
5047 RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass");
5048 if (scene) {
5049 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5050 }
5051 else {
5053 }
5054
5055 prop = RNA_def_property(srna, "use_pass_uv", PROP_BOOLEAN, PROP_NONE);
5056 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_UV);
5057 RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass");
5058 if (scene) {
5059 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5060 }
5061 else {
5063 }
5064
5065 prop = RNA_def_property(srna, "use_pass_mist", PROP_BOOLEAN, PROP_NONE);
5066 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_MIST);
5067 RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0 to 1.0)");
5068 if (scene) {
5069 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5070 }
5071 else {
5073 }
5074
5075 prop = RNA_def_property(srna, "use_pass_object_index", PROP_BOOLEAN, PROP_NONE);
5076 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_INDEXOB);
5077 RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass");
5079 if (scene) {
5080 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5081 }
5082 else {
5084 }
5085
5086 prop = RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE);
5087 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_INDEXMA);
5088 RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass");
5089 if (scene) {
5090 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5091 }
5092 else {
5094 }
5095
5096 prop = RNA_def_property(srna, "use_pass_shadow", PROP_BOOLEAN, PROP_NONE);
5097 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_SHADOW);
5098 RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass");
5099 if (scene) {
5100 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5101 }
5102 else {
5104 }
5105
5106 prop = RNA_def_property(srna, "use_pass_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
5107 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_AO);
5108 RNA_def_property_ui_text(prop, "Ambient Occlusion", "Deliver Ambient Occlusion pass");
5109 if (scene) {
5110 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5111 }
5112 else {
5114 }
5115
5116 prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
5117 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_EMIT);
5118 RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass");
5119 if (scene) {
5120 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5121 }
5122 else {
5124 }
5125
5126 prop = RNA_def_property(srna, "use_pass_environment", PROP_BOOLEAN, PROP_NONE);
5127 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_ENVIRONMENT);
5128 RNA_def_property_ui_text(prop, "Environment", "Deliver environment lighting pass");
5129 if (scene) {
5130 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5131 }
5132 else {
5134 }
5135
5136 prop = RNA_def_property(srna, "use_pass_diffuse_direct", PROP_BOOLEAN, PROP_NONE);
5137 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_DIRECT);
5138 RNA_def_property_ui_text(prop, "Diffuse Direct", "Deliver diffuse direct pass");
5139 if (scene) {
5140 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5141 }
5142 else {
5144 }
5145
5146 prop = RNA_def_property(srna, "use_pass_diffuse_indirect", PROP_BOOLEAN, PROP_NONE);
5147 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_INDIRECT);
5148 RNA_def_property_ui_text(prop, "Diffuse Indirect", "Deliver diffuse indirect pass");
5149 if (scene) {
5150 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5151 }
5152 else {
5154 }
5155
5156 prop = RNA_def_property(srna, "use_pass_diffuse_color", PROP_BOOLEAN, PROP_NONE);
5157 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_DIFFUSE_COLOR);
5158 RNA_def_property_ui_text(prop, "Diffuse Color", "Deliver diffuse color pass");
5159 if (scene) {
5160 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5161 }
5162 else {
5164 }
5165
5166 prop = RNA_def_property(srna, "use_pass_glossy_direct", PROP_BOOLEAN, PROP_NONE);
5167 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_DIRECT);
5168 RNA_def_property_ui_text(prop, "Glossy Direct", "Deliver glossy direct pass");
5169 if (scene) {
5170 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5171 }
5172 else {
5174 }
5175
5176 prop = RNA_def_property(srna, "use_pass_glossy_indirect", PROP_BOOLEAN, PROP_NONE);
5177 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_INDIRECT);
5178 RNA_def_property_ui_text(prop, "Glossy Indirect", "Deliver glossy indirect pass");
5179 if (scene) {
5180 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5181 }
5182 else {
5184 }
5185
5186 prop = RNA_def_property(srna, "use_pass_glossy_color", PROP_BOOLEAN, PROP_NONE);
5187 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_GLOSSY_COLOR);
5188 RNA_def_property_ui_text(prop, "Glossy Color", "Deliver glossy color pass");
5189 if (scene) {
5190 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5191 }
5192 else {
5194 }
5195
5196 prop = RNA_def_property(srna, "use_pass_transmission_direct", PROP_BOOLEAN, PROP_NONE);
5197 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_DIRECT);
5198 RNA_def_property_ui_text(prop, "Transmission Direct", "Deliver transmission direct pass");
5199 if (scene) {
5200 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5201 }
5202 else {
5204 }
5205
5206 prop = RNA_def_property(srna, "use_pass_transmission_indirect", PROP_BOOLEAN, PROP_NONE);
5207 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_INDIRECT);
5208 RNA_def_property_ui_text(prop, "Transmission Indirect", "Deliver transmission indirect pass");
5209 if (scene) {
5210 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5211 }
5212 else {
5214 }
5215
5216 prop = RNA_def_property(srna, "use_pass_transmission_color", PROP_BOOLEAN, PROP_NONE);
5217 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_TRANSM_COLOR);
5218 RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass");
5219 if (scene) {
5220 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5221 }
5222 else {
5224 }
5225
5226 prop = RNA_def_property(srna, "use_pass_subsurface_direct", PROP_BOOLEAN, PROP_NONE);
5228 RNA_def_property_ui_text(prop, "Subsurface Direct", "Deliver subsurface direct pass");
5229 if (scene) {
5230 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5231 }
5232 else {
5234 }
5235
5236 prop = RNA_def_property(srna, "use_pass_subsurface_indirect", PROP_BOOLEAN, PROP_NONE);
5238 RNA_def_property_ui_text(prop, "Subsurface Indirect", "Deliver subsurface indirect pass");
5239 if (scene) {
5240 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5241 }
5242 else {
5244 }
5245
5246 prop = RNA_def_property(srna, "use_pass_subsurface_color", PROP_BOOLEAN, PROP_NONE);
5247 RNA_def_property_boolean_sdna(prop, nullptr, "passflag", SCE_PASS_SUBSURFACE_COLOR);
5248 RNA_def_property_ui_text(prop, "Subsurface Color", "Deliver subsurface color pass");
5249 if (scene) {
5250 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5251 }
5252 else {
5254 }
5255}
5256
5258{
5259 StructRNA *srna;
5260 FunctionRNA *func;
5261 PropertyRNA *parm;
5262
5263 RNA_def_property_srna(cprop, "FreestyleModules");
5264 srna = RNA_def_struct(brna, "FreestyleModules", nullptr);
5265 RNA_def_struct_sdna(srna, "FreestyleSettings");
5267 srna, "Style Modules", "A list of style modules (to be applied from top to bottom)");
5268
5269 func = RNA_def_function(srna, "new", "rna_FreestyleSettings_module_add");
5271 "Add a style module to scene render layer Freestyle settings");
5273 parm = RNA_def_pointer(
5274 func, "module", "FreestyleModuleSettings", "", "Newly created style module");
5275 RNA_def_function_return(func, parm);
5276
5277 func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_module_remove");
5279 func, "Remove a style module from scene render layer Freestyle settings");
5281 parm = RNA_def_pointer(func, "module", "FreestyleModuleSettings", "", "Style module to remove");
5284}
5285
5287{
5288 StructRNA *srna;
5289 PropertyRNA *prop;
5290 FunctionRNA *func;
5291 PropertyRNA *parm;
5292
5293 RNA_def_property_srna(cprop, "Linesets");
5294 srna = RNA_def_struct(brna, "Linesets", nullptr);
5295 RNA_def_struct_sdna(srna, "FreestyleSettings");
5297 srna, "Line Sets", "Line sets for associating lines and style parameters");
5298
5299 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
5300 RNA_def_property_struct_type(prop, "FreestyleLineSet");
5302 prop, "rna_FreestyleSettings_active_lineset_get", nullptr, nullptr, nullptr);
5303 RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed");
5305
5306 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
5308 "rna_FreestyleSettings_active_lineset_index_get",
5309 "rna_FreestyleSettings_active_lineset_index_set",
5310 "rna_FreestyleSettings_active_lineset_index_range");
5311 RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
5313
5314 func = RNA_def_function(srna, "new", "rna_FreestyleSettings_lineset_add");
5315 RNA_def_function_ui_description(func, "Add a line set to scene render layer Freestyle settings");
5317 parm = RNA_def_string(func, "name", "LineSet", 0, "", "New name for the line set (not unique)");
5319 parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Newly created line set");
5320 RNA_def_function_return(func, parm);
5321
5322 func = RNA_def_function(srna, "remove", "rna_FreestyleSettings_lineset_remove");
5324 "Remove a line set from scene render layer Freestyle settings");
5326 parm = RNA_def_pointer(func, "lineset", "FreestyleLineSet", "", "Line set to remove");
5329}
5330
5332{
5333 StructRNA *srna;
5334 PropertyRNA *prop;
5335
5336 static const EnumPropertyItem edge_type_negation_items[] = {
5337 {0,
5338 "INCLUSIVE",
5339 0,
5340 "Inclusive",
5341 "Select feature edges satisfying the given edge type conditions"},
5343 "EXCLUSIVE",
5344 0,
5345 "Exclusive",
5346 "Select feature edges not satisfying the given edge type conditions"},
5347 {0, nullptr, 0, nullptr, nullptr},
5348 };
5349
5350 static const EnumPropertyItem edge_type_combination_items[] = {
5351 {0,
5352 "OR",
5353 0,
5354 "Logical OR",
5355 "Select feature edges satisfying at least one of edge type conditions"},
5357 "AND",
5358 0,
5359 "Logical AND",
5360 "Select feature edges satisfying all edge type conditions"},
5361 {0, nullptr, 0, nullptr, nullptr},
5362 };
5363
5364 static const EnumPropertyItem collection_negation_items[] = {
5365 {0,
5366 "INCLUSIVE",
5367 0,
5368 "Inclusive",
5369 "Select feature edges belonging to some object in the group"},
5371 "EXCLUSIVE",
5372 0,
5373 "Exclusive",
5374 "Select feature edges not belonging to any object in the group"},
5375 {0, nullptr, 0, nullptr, nullptr},
5376 };
5377
5378 static const EnumPropertyItem face_mark_negation_items[] = {
5379 {0,
5380 "INCLUSIVE",
5381 0,
5382 "Inclusive",
5383 "Select feature edges satisfying the given face mark conditions"},
5385 "EXCLUSIVE",
5386 0,
5387 "Exclusive",
5388 "Select feature edges not satisfying the given face mark conditions"},
5389 {0, nullptr, 0, nullptr, nullptr},
5390 };
5391
5392 static const EnumPropertyItem face_mark_condition_items[] = {
5393 {0, "ONE", 0, "One Face", "Select a feature edge if either of its adjacent faces is marked"},
5395 "BOTH",
5396 0,
5397 "Both Faces",
5398 "Select a feature edge if both of its adjacent faces are marked"},
5399 {0, nullptr, 0, nullptr, nullptr},
5400 };
5401
5402 static const EnumPropertyItem freestyle_ui_mode_items[] = {
5404 "SCRIPT",
5405 0,
5406 "Python Scripting",
5407 "Advanced mode for using style modules written in Python"},
5409 "EDITOR",
5410 0,
5411 "Parameter Editor",
5412 "Basic mode for interactive style parameter editing"},
5413 {0, nullptr, 0, nullptr, nullptr},
5414 };
5415
5416 static const EnumPropertyItem visibility_items[] = {
5417 {FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible feature edges"},
5418 {FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden feature edges"},
5420 "RANGE",
5421 0,
5422 "Quantitative Invisibility",
5423 "Select feature edges within a range of quantitative invisibility (QI) values"},
5424 {0, nullptr, 0, nullptr, nullptr},
5425 };
5426
5427 /* FreestyleLineSet */
5428
5429 srna = RNA_def_struct(brna, "FreestyleLineSet", nullptr);
5431 srna, "Freestyle Line Set", "Line set for associating lines and style parameters");
5432
5433 /* access to line style settings is redirected through functions
5434 * to allow proper id-buttons functionality
5435 */
5436 prop = RNA_def_property(srna, "linestyle", PROP_POINTER, PROP_NONE);
5437 RNA_def_property_struct_type(prop, "FreestyleLineStyle");
5440 "rna_FreestyleLineSet_linestyle_get",
5441 "rna_FreestyleLineSet_linestyle_set",
5442 nullptr,
5443 nullptr);
5444 RNA_def_property_ui_text(prop, "Line Style", "Line style settings");
5445 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5446
5447 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
5448 RNA_def_property_string_sdna(prop, nullptr, "name");
5449 RNA_def_property_ui_text(prop, "Line Set Name", "Line set name");
5451 RNA_def_struct_name_property(srna, prop);
5452
5453 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
5456 prop, "Render", "Enable or disable this line set during stroke rendering");
5457 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5458
5459 prop = RNA_def_property(srna, "select_by_visibility", PROP_BOOLEAN, PROP_NONE);
5460 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_VISIBILITY);
5462 prop, "Selection by Visibility", "Select feature edges based on visibility");
5463 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5464
5465 prop = RNA_def_property(srna, "select_by_edge_types", PROP_BOOLEAN, PROP_NONE);
5466 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_EDGE_TYPES);
5468 prop, "Selection by Edge Types", "Select feature edges based on edge types");
5469 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5470
5471 prop = RNA_def_property(srna, "select_by_collection", PROP_BOOLEAN, PROP_NONE);
5472 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_GROUP);
5474 prop, "Selection by Collection", "Select feature edges based on a collection of objects");
5475 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5476
5477 prop = RNA_def_property(srna, "select_by_image_border", PROP_BOOLEAN, PROP_NONE);
5478 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_IMAGE_BORDER);
5480 "Selection by Image Border",
5481 "Select feature edges by image border (less memory consumption)");
5482 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5483
5484 prop = RNA_def_property(srna, "select_by_face_marks", PROP_BOOLEAN, PROP_NONE);
5485 RNA_def_property_boolean_sdna(prop, nullptr, "selection", FREESTYLE_SEL_FACE_MARK);
5486 RNA_def_property_ui_text(prop, "Selection by Face Marks", "Select feature edges by face marks");
5487 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5488
5489 prop = RNA_def_property(srna, "edge_type_negation", PROP_ENUM, PROP_NONE);
5490 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5491 RNA_def_property_enum_items(prop, edge_type_negation_items);
5493 prop,
5494 "Edge Type Negation",
5495 "Specify either inclusion or exclusion of feature edges selected by edge types");
5496 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5497
5498 prop = RNA_def_property(srna, "edge_type_combination", PROP_ENUM, PROP_NONE);
5499 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5500 RNA_def_property_enum_items(prop, edge_type_combination_items);
5502 prop,
5503 "Edge Type Combination",
5504 "Specify a logical combination of selection conditions on feature edge types");
5505 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5506
5507 prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
5508 RNA_def_property_pointer_sdna(prop, nullptr, "group");
5509 RNA_def_property_struct_type(prop, "Collection");
5512 prop, "Collection", "A collection of objects based on which feature edges are selected");
5513 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5514
5515 prop = RNA_def_property(srna, "collection_negation", PROP_ENUM, PROP_NONE);
5516 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5517 RNA_def_property_enum_items(prop, collection_negation_items);
5519 "Collection Negation",
5520 "Specify either inclusion or exclusion of feature edges belonging to a "
5521 "collection of objects");
5522 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5523
5524 prop = RNA_def_property(srna, "face_mark_negation", PROP_ENUM, PROP_NONE);
5525 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5526 RNA_def_property_enum_items(prop, face_mark_negation_items);
5528 prop,
5529 "Face Mark Negation",
5530 "Specify either inclusion or exclusion of feature edges selected by face marks");
5531 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5532
5533 prop = RNA_def_property(srna, "face_mark_condition", PROP_ENUM, PROP_NONE);
5534 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
5535 RNA_def_property_enum_items(prop, face_mark_condition_items);
5537 "Face Mark Condition",
5538 "Specify a feature edge selection condition based on face marks");
5539 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5540
5541 prop = RNA_def_property(srna, "select_silhouette", PROP_BOOLEAN, PROP_NONE);
5542 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_SILHOUETTE);
5544 prop,
5545 "Silhouette",
5546 "Select silhouettes (edges at the boundary of visible and hidden faces)");
5547 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5548
5549 prop = RNA_def_property(srna, "select_border", PROP_BOOLEAN, PROP_NONE);
5550 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_BORDER);
5551 RNA_def_property_ui_text(prop, "Border", "Select border edges (open mesh edges)");
5552 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5553
5554 prop = RNA_def_property(srna, "select_crease", PROP_BOOLEAN, PROP_NONE);
5555 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_CREASE);
5557 "Crease",
5558 "Select crease edges (those between two faces making an angle smaller "
5559 "than the Crease Angle)");
5560 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5561
5562 prop = RNA_def_property(srna, "select_ridge_valley", PROP_BOOLEAN, PROP_NONE);
5563 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_RIDGE_VALLEY);
5565 prop,
5566 "Ridge & Valley",
5567 "Select ridges and valleys (boundary lines between convex and concave areas of surface)");
5568 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5569
5570 prop = RNA_def_property(srna, "select_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
5573 prop, "Suggestive Contour", "Select suggestive contours (almost silhouette/contour edges)");
5574 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5575
5576 prop = RNA_def_property(srna, "select_material_boundary", PROP_BOOLEAN, PROP_NONE);
5578 RNA_def_property_ui_text(prop, "Material Boundary", "Select edges at material boundaries");
5579 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5580
5581 prop = RNA_def_property(srna, "select_contour", PROP_BOOLEAN, PROP_NONE);
5582 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_CONTOUR);
5583 RNA_def_property_ui_text(prop, "Contour", "Select contours (outer silhouettes of each object)");
5584 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5585
5586 prop = RNA_def_property(srna, "select_external_contour", PROP_BOOLEAN, PROP_NONE);
5589 prop,
5590 "External Contour",
5591 "Select external contours (outer silhouettes of occluding and occluded objects)");
5592 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5593
5594 prop = RNA_def_property(srna, "select_edge_mark", PROP_BOOLEAN, PROP_NONE);
5595 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", FREESTYLE_FE_EDGE_MARK);
5597 prop, "Edge Mark", "Select edge marks (edges annotated by Freestyle edge marks)");
5598 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5599
5600 prop = RNA_def_property(srna, "exclude_silhouette", PROP_BOOLEAN, PROP_NONE);
5601 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_SILHOUETTE);
5602 RNA_def_property_ui_text(prop, "Silhouette", "Exclude silhouette edges");
5603 RNA_def_property_ui_icon(prop, ICON_X, 0);
5604 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5605
5606 prop = RNA_def_property(srna, "exclude_border", PROP_BOOLEAN, PROP_NONE);
5607 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_BORDER);
5608 RNA_def_property_ui_text(prop, "Border", "Exclude border edges");
5609 RNA_def_property_ui_icon(prop, ICON_X, 0);
5610 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5611
5612 prop = RNA_def_property(srna, "exclude_crease", PROP_BOOLEAN, PROP_NONE);
5613 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_CREASE);
5614 RNA_def_property_ui_text(prop, "Crease", "Exclude crease edges");
5615 RNA_def_property_ui_icon(prop, ICON_X, 0);
5616 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5617
5618 prop = RNA_def_property(srna, "exclude_ridge_valley", PROP_BOOLEAN, PROP_NONE);
5619 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_RIDGE_VALLEY);
5620 RNA_def_property_ui_text(prop, "Ridge & Valley", "Exclude ridges and valleys");
5621 RNA_def_property_ui_icon(prop, ICON_X, 0);
5622 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5623
5624 prop = RNA_def_property(srna, "exclude_suggestive_contour", PROP_BOOLEAN, PROP_NONE);
5626 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_SUGGESTIVE_CONTOUR);
5627 RNA_def_property_ui_text(prop, "Suggestive Contour", "Exclude suggestive contours");
5628 RNA_def_property_ui_icon(prop, ICON_X, 0);
5629 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5630
5631 prop = RNA_def_property(srna, "exclude_material_boundary", PROP_BOOLEAN, PROP_NONE);
5633 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_MATERIAL_BOUNDARY);
5634 RNA_def_property_ui_text(prop, "Material Boundary", "Exclude edges at material boundaries");
5635 RNA_def_property_ui_icon(prop, ICON_X, 0);
5636 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5637
5638 prop = RNA_def_property(srna, "exclude_contour", PROP_BOOLEAN, PROP_NONE);
5639 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_CONTOUR);
5640 RNA_def_property_ui_text(prop, "Contour", "Exclude contours");
5641 RNA_def_property_ui_icon(prop, ICON_X, 0);
5642 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5643
5644 prop = RNA_def_property(srna, "exclude_external_contour", PROP_BOOLEAN, PROP_NONE);
5646 prop, nullptr, "exclude_edge_types", FREESTYLE_FE_EXTERNAL_CONTOUR);
5647 RNA_def_property_ui_text(prop, "External Contour", "Exclude external contours");
5648 RNA_def_property_ui_icon(prop, ICON_X, 0);
5649 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5650
5651 prop = RNA_def_property(srna, "exclude_edge_mark", PROP_BOOLEAN, PROP_NONE);
5652 RNA_def_property_boolean_sdna(prop, nullptr, "exclude_edge_types", FREESTYLE_FE_EDGE_MARK);
5653 RNA_def_property_ui_text(prop, "Edge Mark", "Exclude edge marks");
5654 RNA_def_property_ui_icon(prop, ICON_X, 0);
5655 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5656
5657 prop = RNA_def_property(srna, "visibility", PROP_ENUM, PROP_NONE);
5658 RNA_def_property_enum_sdna(prop, nullptr, "qi");
5659 RNA_def_property_enum_items(prop, visibility_items);
5661 prop, "Visibility", "Determine how to use visibility for feature edge selection");
5662 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5663
5664 prop = RNA_def_property(srna, "qi_start", PROP_INT, PROP_UNSIGNED);
5665 RNA_def_property_int_sdna(prop, nullptr, "qi_start");
5666 RNA_def_property_range(prop, 0, INT_MAX);
5667 RNA_def_property_ui_text(prop, "Start", "First QI value of the QI range");
5668 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5669
5670 prop = RNA_def_property(srna, "qi_end", PROP_INT, PROP_UNSIGNED);
5671 RNA_def_property_int_sdna(prop, nullptr, "qi_end");
5672 RNA_def_property_range(prop, 0, INT_MAX);
5673 RNA_def_property_ui_text(prop, "End", "Last QI value of the QI range");
5674 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5675
5676 /* FreestyleModuleSettings */
5677
5678 srna = RNA_def_struct(brna, "FreestyleModuleSettings", nullptr);
5679 RNA_def_struct_sdna(srna, "FreestyleModuleConfig");
5681 srna, "Freestyle Module", "Style module configuration for specifying a style module");
5682
5683 prop = RNA_def_property(srna, "script", PROP_POINTER, PROP_NONE);
5684 RNA_def_property_struct_type(prop, "Text");
5686 RNA_def_property_ui_text(prop, "Style Module", "Python script to define a style module");
5687 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5688
5689 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
5690 RNA_def_property_boolean_sdna(prop, nullptr, "is_displayed", 1);
5692 prop, "Use", "Enable or disable this style module during stroke rendering");
5693 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5694
5695 /* FreestyleSettings */
5696
5697 srna = RNA_def_struct(brna, "FreestyleSettings", nullptr);
5698 RNA_def_struct_sdna(srna, "FreestyleConfig");
5699 RNA_def_struct_nested(brna, srna, "ViewLayer");
5701 srna, "Freestyle Settings", "Freestyle settings for a ViewLayer data-block");
5702
5703 prop = RNA_def_property(srna, "modules", PROP_COLLECTION, PROP_NONE);
5704 RNA_def_property_collection_sdna(prop, nullptr, "modules", nullptr);
5705 RNA_def_property_struct_type(prop, "FreestyleModuleSettings");
5707 prop, "Style Modules", "A list of style modules (to be applied from top to bottom)");
5708 rna_def_freestyle_modules(brna, prop);
5709
5710 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
5711 RNA_def_property_enum_sdna(prop, nullptr, "mode");
5712 RNA_def_property_enum_items(prop, freestyle_ui_mode_items);
5713 RNA_def_property_ui_text(prop, "Control Mode", "Select the Freestyle control mode");
5714 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5715
5716 prop = RNA_def_property(srna, "use_culling", PROP_BOOLEAN, PROP_NONE);
5717 RNA_def_property_boolean_sdna(prop, nullptr, "flags", FREESTYLE_CULLING);
5718 RNA_def_property_ui_text(prop, "Culling", "If enabled, out-of-view edges are ignored");
5719 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5720
5721 prop = RNA_def_property(srna, "use_suggestive_contours", PROP_BOOLEAN, PROP_NONE);
5723 RNA_def_property_ui_text(prop, "Suggestive Contours", "Enable suggestive contours");
5724 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5725
5726 prop = RNA_def_property(srna, "use_ridges_and_valleys", PROP_BOOLEAN, PROP_NONE);
5728 RNA_def_property_ui_text(prop, "Ridges and Valleys", "Enable ridges and valleys");
5729 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5730
5731 prop = RNA_def_property(srna, "use_material_boundaries", PROP_BOOLEAN, PROP_NONE);
5733 RNA_def_property_ui_text(prop, "Material Boundaries", "Enable material boundaries");
5734 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5735
5736 prop = RNA_def_property(srna, "use_smoothness", PROP_BOOLEAN, PROP_NONE);
5739 prop, "Face Smoothness", "Take face smoothness into account in view map calculation");
5740 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5741
5742 prop = RNA_def_property(srna, "use_view_map_cache", PROP_BOOLEAN, PROP_NONE);
5745 prop,
5746 "View Map Cache",
5747 "Keep the computed view map and avoid recalculating it if mesh geometry is unchanged");
5749 prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_view_map_cache_update");
5750
5751 prop = RNA_def_property(srna, "as_render_pass", PROP_BOOLEAN, PROP_NONE);
5754 prop,
5755 "As Render Pass",
5756 "Renders Freestyle output to a separate pass instead of overlaying it on the Combined pass");
5757 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
5758
5759 prop = RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
5760 RNA_def_property_float_sdna(prop, nullptr, "sphere_radius");
5762 RNA_def_property_range(prop, 0.0, 1000.0);
5763 RNA_def_property_ui_text(prop, "Sphere Radius", "Sphere radius for computing curvatures");
5764 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5765
5766 prop = RNA_def_property(srna, "kr_derivative_epsilon", PROP_FLOAT, PROP_NONE);
5768 RNA_def_property_float_sdna(prop, nullptr, "dkr_epsilon");
5769 RNA_def_property_range(prop, -1000.0, 1000.0);
5771 prop, "Kr Derivative Epsilon", "Kr derivative epsilon for computing suggestive contours");
5772 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5773
5774 prop = RNA_def_property(srna, "crease_angle", PROP_FLOAT, PROP_ANGLE);
5775 RNA_def_property_float_sdna(prop, nullptr, "crease_angle");
5776 RNA_def_property_range(prop, 0.0, DEG2RAD(180.0));
5777 RNA_def_property_ui_text(prop, "Crease Angle", "Angular threshold for detecting crease edges");
5778 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
5779
5780 prop = RNA_def_property(srna, "linesets", PROP_COLLECTION, PROP_NONE);
5781 RNA_def_property_collection_sdna(prop, nullptr, "linesets", nullptr);
5782 RNA_def_property_struct_type(prop, "FreestyleLineSet");
5783 RNA_def_property_ui_text(prop, "Line Sets", "");
5784 rna_def_freestyle_linesets(brna, prop);
5785}
5786
5788{
5789 StructRNA *srna;
5790 PropertyRNA *prop;
5791
5792 srna = RNA_def_struct(brna, "BakeSettings", nullptr);
5793 RNA_def_struct_sdna(srna, "BakeData");
5794 RNA_def_struct_nested(brna, srna, "RenderSettings");
5795 RNA_def_struct_ui_text(srna, "Bake Data", "Bake data for a Scene data-block");
5796 RNA_def_struct_path_func(srna, "rna_BakeSettings_path");
5797
5798 prop = RNA_def_property(srna, "cage_object", PROP_POINTER, PROP_NONE);
5800 prop,
5801 "Cage Object",
5802 "Object to use as cage "
5803 "instead of calculating the cage from the active object with cage extrusion");
5806
5807 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
5808 RNA_def_property_ui_text(prop, "File Path", "Image filepath to use when saving externally");
5810
5811 prop = RNA_def_property(srna, "width", PROP_INT, PROP_PIXEL);
5812 RNA_def_property_range(prop, 4, 10000);
5813 RNA_def_property_ui_text(prop, "Width", "Horizontal dimension of the baking map");
5815
5816 prop = RNA_def_property(srna, "height", PROP_INT, PROP_PIXEL);
5817 RNA_def_property_range(prop, 4, 10000);
5818 RNA_def_property_ui_text(prop, "Height", "Vertical dimension of the baking map");
5820
5821 prop = RNA_def_property(srna, "margin", PROP_INT, PROP_PIXEL);
5822 RNA_def_property_range(prop, 0, SHRT_MAX);
5823 RNA_def_property_ui_range(prop, 0, 64, 1, 1);
5824 RNA_def_property_ui_text(prop, "Margin", "Extends the baked result as a post process filter");
5826
5827 prop = RNA_def_property(srna, "margin_type", PROP_ENUM, PROP_NONE);
5829 RNA_def_property_ui_text(prop, "Margin Type", "Algorithm to extend the baked result");
5831
5832 prop = RNA_def_property(srna, "max_ray_distance", PROP_FLOAT, PROP_DISTANCE);
5833 RNA_def_property_range(prop, 0.0, FLT_MAX);
5834 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
5836 "Max Ray Distance",
5837 "The maximum ray distance for matching points between the active and "
5838 "selected objects. If zero, there is no limit.");
5840
5841 prop = RNA_def_property(srna, "cage_extrusion", PROP_FLOAT, PROP_DISTANCE);
5842 RNA_def_property_range(prop, 0.0, FLT_MAX);
5843 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 3);
5845 prop,
5846 "Cage Extrusion",
5847 "Inflate the active object by the specified distance for baking. This helps matching to "
5848 "points nearer to the outside of the selected object meshes.");
5850
5851 prop = RNA_def_property(srna, "normal_space", PROP_ENUM, PROP_NONE);
5852 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_space");
5854 RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking");
5856
5857 prop = RNA_def_property(srna, "normal_r", PROP_ENUM, PROP_NONE);
5858 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[0]");
5860 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in red channel");
5862
5863 prop = RNA_def_property(srna, "normal_g", PROP_ENUM, PROP_NONE);
5864 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[1]");
5866 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in green channel");
5868
5869 prop = RNA_def_property(srna, "normal_b", PROP_ENUM, PROP_NONE);
5870 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "normal_swizzle[2]");
5872 RNA_def_property_ui_text(prop, "Normal Space", "Axis to bake in blue channel");
5874
5875 prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
5877 RNA_def_property_pointer_sdna(prop, nullptr, "im_format");
5878 RNA_def_property_struct_type(prop, "ImageFormatSettings");
5879 RNA_def_property_ui_text(prop, "Image Format", "");
5880
5881 prop = RNA_def_property(srna, "target", PROP_ENUM, PROP_NONE);
5883 RNA_def_property_ui_text(prop, "Target", "Where to output the baked map");
5885
5886 prop = RNA_def_property(srna, "save_mode", PROP_ENUM, PROP_NONE);
5887 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "save_mode");
5889 RNA_def_property_ui_text(prop, "Save Mode", "Where to save baked image textures");
5891
5892 prop = RNA_def_property(srna, "view_from", PROP_ENUM, PROP_NONE);
5894 RNA_def_property_ui_text(prop, "View From", "Source of reflection ray directions");
5896
5897 /* flags */
5898 prop = RNA_def_property(srna, "use_selected_to_active", PROP_BOOLEAN, PROP_NONE);
5899 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_TO_ACTIVE);
5901 "Selected to Active",
5902 "Bake shading on the surface of selected objects to the active object");
5904
5905 prop = RNA_def_property(srna, "use_clear", PROP_BOOLEAN, PROP_NONE);
5906 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_CLEAR);
5907 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking (internal only)");
5909
5910 prop = RNA_def_property(srna, "use_split_materials", PROP_BOOLEAN, PROP_NONE);
5911 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_SPLIT_MAT);
5913 prop, "Split Materials", "Split external images per material (external only)");
5915
5916 prop = RNA_def_property(srna, "use_automatic_name", PROP_BOOLEAN, PROP_NONE);
5917 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_AUTO_NAME);
5919 prop,
5920 "Automatic Name",
5921 "Automatically name the output file with the pass type (external only)");
5923
5924 prop = RNA_def_property(srna, "use_cage", PROP_BOOLEAN, PROP_NONE);
5925 RNA_def_property_boolean_sdna(prop, nullptr, "flag", R_BAKE_CAGE);
5926 RNA_def_property_ui_text(prop, "Cage", "Cast rays to active object from a cage");
5928
5929 /* custom passes flags */
5930 prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE);
5931 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_EMIT);
5932 RNA_def_property_ui_text(prop, "Emit", "Add emission contribution");
5933
5934 prop = RNA_def_property(srna, "use_pass_direct", PROP_BOOLEAN, PROP_NONE);
5935 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_DIRECT);
5936 RNA_def_property_ui_text(prop, "Direct", "Add direct lighting contribution");
5938
5939 prop = RNA_def_property(srna, "use_pass_indirect", PROP_BOOLEAN, PROP_NONE);
5940 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_INDIRECT);
5941 RNA_def_property_ui_text(prop, "Indirect", "Add indirect lighting contribution");
5943
5944 prop = RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE);
5945 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_COLOR);
5946 RNA_def_property_ui_text(prop, "Color", "Color the pass");
5948
5949 prop = RNA_def_property(srna, "use_pass_diffuse", PROP_BOOLEAN, PROP_NONE);
5950 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_DIFFUSE);
5951 RNA_def_property_ui_text(prop, "Diffuse", "Add diffuse contribution");
5953
5954 prop = RNA_def_property(srna, "use_pass_glossy", PROP_BOOLEAN, PROP_NONE);
5955 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_GLOSSY);
5956 RNA_def_property_ui_text(prop, "Glossy", "Add glossy contribution");
5958
5959 prop = RNA_def_property(srna, "use_pass_transmission", PROP_BOOLEAN, PROP_NONE);
5960 RNA_def_property_boolean_sdna(prop, nullptr, "pass_filter", R_BAKE_PASS_FILTER_TRANSM);
5961 RNA_def_property_ui_text(prop, "Transmission", "Add transmission contribution");
5963
5964 prop = RNA_def_property(srna, "pass_filter", PROP_ENUM, PROP_NONE);
5965 RNA_def_property_enum_sdna(prop, nullptr, "pass_filter");
5968 RNA_def_property_ui_text(prop, "Pass Filter", "Passes to include in the active baking pass");
5970}
5971
5973{
5974 StructRNA *srna;
5975 FunctionRNA *func;
5976 PropertyRNA *parm;
5977
5978 RNA_def_property_srna(cprop, "ViewLayers");
5979 srna = RNA_def_struct(brna, "ViewLayers", nullptr);
5980 RNA_def_struct_sdna(srna, "Scene");
5981 RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers");
5982
5983 func = RNA_def_function(srna, "new", "rna_ViewLayer_new");
5984 RNA_def_function_ui_description(func, "Add a view layer to scene");
5986 parm = RNA_def_string(
5987 func, "name", "ViewLayer", 0, "", "New name for the view layer (not unique)");
5989 parm = RNA_def_pointer(func, "result", "ViewLayer", "", "Newly created view layer");
5990 RNA_def_function_return(func, parm);
5991
5992 func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove");
5993 RNA_def_function_ui_description(func, "Remove a view layer");
5995 parm = RNA_def_pointer(func, "layer", "ViewLayer", "", "View layer to remove");
5998
5999 func = RNA_def_function(srna, "move", "rna_ViewLayer_move");
6000 RNA_def_function_ui_description(func, "Move a view layer");
6002 parm = RNA_def_int(
6003 func, "from_index", -1, INT_MIN, INT_MAX, "From Index", "Index to move", 0, 10000);
6005 parm = RNA_def_int(func, "to_index", -1, INT_MIN, INT_MAX, "To Index", "Target index", 0, 10000);
6007}
6008
6009/* Render Views - MultiView */
6011{
6012 StructRNA *srna;
6013 PropertyRNA *prop;
6014
6015 srna = RNA_def_struct(brna, "SceneRenderView", nullptr);
6017 srna, "Scene Render View", "Render viewpoint for 3D stereo and multiview rendering");
6018 RNA_def_struct_ui_icon(srna, ICON_RESTRICT_RENDER_OFF);
6019 RNA_def_struct_path_func(srna, "rna_SceneRenderView_path");
6020
6021 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
6022 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_SceneRenderView_name_set");
6023 RNA_def_property_ui_text(prop, "Name", "Render view name");
6024 RNA_def_struct_name_property(srna, prop);
6026
6027 prop = RNA_def_property(srna, "file_suffix", PROP_STRING, PROP_NONE);
6028 RNA_def_property_string_sdna(prop, nullptr, "suffix");
6029 RNA_def_property_ui_text(prop, "File Suffix", "Suffix added to the render images for this view");
6031
6032 prop = RNA_def_property(srna, "camera_suffix", PROP_STRING, PROP_NONE);
6033 RNA_def_property_string_sdna(prop, nullptr, "suffix");
6035 prop,
6036 "Camera Suffix",
6037 "Suffix to identify the cameras to use, and added to the render images for this view");
6039
6040 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
6041 RNA_def_property_boolean_negative_sdna(prop, nullptr, "viewflag", SCE_VIEW_DISABLE);
6043 RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render view");
6045 prop, NC_SCENE | ND_RENDER_OPTIONS | NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
6046}
6047
6049{
6050 StructRNA *srna;
6051 PropertyRNA *prop;
6052
6053 FunctionRNA *func;
6054 PropertyRNA *parm;
6055
6056 RNA_def_property_srna(cprop, "RenderViews");
6057 srna = RNA_def_struct(brna, "RenderViews", nullptr);
6058 RNA_def_struct_sdna(srna, "RenderData");
6059 RNA_def_struct_ui_text(srna, "Render Views", "Collection of render views");
6060
6061 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
6062 RNA_def_property_int_sdna(prop, nullptr, "actview");
6064 "rna_RenderSettings_active_view_index_get",
6065 "rna_RenderSettings_active_view_index_set",
6066 "rna_RenderSettings_active_view_index_range");
6067 RNA_def_property_ui_text(prop, "Active View Index", "Active index in render view array");
6069
6070 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
6071 RNA_def_property_struct_type(prop, "SceneRenderView");
6073 "rna_RenderSettings_active_view_get",
6074 "rna_RenderSettings_active_view_set",
6075 nullptr,
6076 nullptr);
6078 RNA_def_property_ui_text(prop, "Active Render View", "Active Render View");
6080
6081 func = RNA_def_function(srna, "new", "rna_RenderView_new");
6082 RNA_def_function_ui_description(func, "Add a render view to scene");
6084 parm = RNA_def_string(func, "name", "RenderView", 0, "", "New name for the marker (not unique)");
6086 parm = RNA_def_pointer(func, "result", "SceneRenderView", "", "Newly created render view");
6087 RNA_def_function_return(func, parm);
6088
6089 func = RNA_def_function(srna, "remove", "rna_RenderView_remove");
6090 RNA_def_function_ui_description(func, "Remove a render view");
6092 parm = RNA_def_pointer(func, "view", "SceneRenderView", "", "Render view to remove");
6095}
6096
6098{
6099 StructRNA *srna;
6100 PropertyRNA *prop;
6101
6102 /* rna_enum_stereo3d_display_items, without (S3D_DISPLAY_PAGEFLIP) */
6103 static const EnumPropertyItem stereo3d_display_items[] = {
6105 "ANAGLYPH",
6106 0,
6107 "Anaglyph",
6108 "Render views for left and right eyes as two differently filtered colors in a single image "
6109 "(anaglyph glasses are required)"},
6111 "INTERLACE",
6112 0,
6113 "Interlace",
6114 "Render views for left and right eyes interlaced in a single image (3D-ready monitor is "
6115 "required)"},
6117 "SIDEBYSIDE",
6118 0,
6119 "Side-by-Side",
6120 "Render views for left and right eyes side-by-side"},
6122 "TOPBOTTOM",
6123 0,
6124 "Top-Bottom",
6125 "Render views for left and right eyes one above another"},
6126 {0, nullptr, 0, nullptr, nullptr},
6127 };
6128
6129 srna = RNA_def_struct(brna, "Stereo3dFormat", nullptr);
6130 RNA_def_struct_sdna(srna, "Stereo3dFormat");
6131 RNA_def_struct_ui_text(srna, "Stereo Output", "Settings for stereo output");
6132
6133 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
6134 RNA_def_property_enum_sdna(prop, nullptr, "display_mode");
6135 RNA_def_property_enum_items(prop, stereo3d_display_items);
6136 RNA_def_property_ui_text(prop, "Stereo Mode", "");
6137 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6138
6139 prop = RNA_def_property(srna, "anaglyph_type", PROP_ENUM, PROP_NONE);
6141 RNA_def_property_ui_text(prop, "Anaglyph Type", "");
6142 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6143
6144 prop = RNA_def_property(srna, "interlace_type", PROP_ENUM, PROP_NONE);
6146 RNA_def_property_ui_text(prop, "Interlace Type", "");
6147 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6148
6149 prop = RNA_def_property(srna, "use_interlace_swap", PROP_BOOLEAN, PROP_BOOLEAN);
6150 RNA_def_property_boolean_sdna(prop, nullptr, "flag", S3D_INTERLACE_SWAP);
6151 RNA_def_property_ui_text(prop, "Swap Left/Right", "Swap left and right stereo channels");
6152 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6153
6154 prop = RNA_def_property(srna, "use_sidebyside_crosseyed", PROP_BOOLEAN, PROP_BOOLEAN);
6156 RNA_def_property_ui_text(prop, "Cross-Eyed", "Right eye should see left image and vice versa");
6157 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6158
6159 prop = RNA_def_property(srna, "use_squeezed_frame", PROP_BOOLEAN, PROP_BOOLEAN);
6160 RNA_def_property_boolean_sdna(prop, nullptr, "flag", S3D_SQUEEZED_FRAME);
6161 RNA_def_property_ui_text(prop, "Squeezed Frame", "Combine both views in a squeezed image");
6162 RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Stereo3dFormat_update");
6163}
6164
6165/* use for render output and image save operator,
6166 * NOTE: there are some cases where the members act differently when this is
6167 * used from a scene, video formats can only be selected for render output
6168 * for example, this is checked by seeing if the ptr->owner_id is a Scene id */
6169
6171{
6172
6173# ifdef WITH_OPENJPEG
6174 static const EnumPropertyItem jp2_codec_items[] = {
6175 {R_IMF_JP2_CODEC_JP2, "JP2", 0, "JP2", ""},
6176 {R_IMF_JP2_CODEC_J2K, "J2K", 0, "J2K", ""},
6177 {0, nullptr, 0, nullptr, nullptr},
6178 };
6179# endif
6180
6181 static const EnumPropertyItem tiff_codec_items[] = {
6182 {R_IMF_TIFF_CODEC_NONE, "NONE", 0, "None", ""},
6183 {R_IMF_TIFF_CODEC_DEFLATE, "DEFLATE", 0, "Deflate", ""},
6184 {R_IMF_TIFF_CODEC_LZW, "LZW", 0, "LZW", ""},
6185 {R_IMF_TIFF_CODEC_PACKBITS, "PACKBITS", 0, "Pack Bits", ""},
6186 {0, nullptr, 0, nullptr, nullptr},
6187 };
6188
6189 static const EnumPropertyItem color_management_items[] = {
6190 {R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE, "FOLLOW_SCENE", 0, "Follow Scene", ""},
6191 {R_IMF_COLOR_MANAGEMENT_OVERRIDE, "OVERRIDE", 0, "Override", ""},
6192 {0, nullptr, 0, nullptr, nullptr},
6193 };
6194
6195 StructRNA *srna;
6196 PropertyRNA *prop;
6197
6199
6200 srna = RNA_def_struct(brna, "ImageFormatSettings", nullptr);
6201 RNA_def_struct_sdna(srna, "ImageFormatData");
6202 RNA_def_struct_nested(brna, srna, "Scene");
6203 RNA_def_struct_path_func(srna, "rna_ImageFormatSettings_path");
6204 RNA_def_struct_ui_text(srna, "Image Format", "Settings for image formats");
6205
6206 prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
6207 RNA_def_property_enum_sdna(prop, nullptr, "imtype");
6210 nullptr,
6211 "rna_ImageFormatSettings_file_format_set",
6212 "rna_ImageFormatSettings_file_format_itemf");
6213 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
6215
6216 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
6217 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "planes");
6219 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_color_mode_itemf");
6221 prop,
6222 "Color Mode",
6223 "Choose BW for saving grayscale images, RGB for saving red, green and blue channels, "
6224 "and RGBA for saving red, green, blue and alpha channels");
6226
6227 prop = RNA_def_property(srna, "color_depth", PROP_ENUM, PROP_NONE);
6228 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "depth");
6230 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_color_depth_itemf");
6231 RNA_def_property_ui_text(prop, "Color Depth", "Bit depth per channel");
6233
6234 /* was 'file_quality' */
6235 prop = RNA_def_property(srna, "quality", PROP_INT, PROP_PERCENTAGE);
6236 RNA_def_property_int_sdna(prop, nullptr, "quality");
6237 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
6239 prop, "Quality", "Quality for image formats that support lossy compression");
6241
6242 /* was shared with file_quality */
6243 prop = RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE);
6244 RNA_def_property_int_sdna(prop, nullptr, "compress");
6245 RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
6247 "Compression",
6248 "Amount of time to determine best compression: "
6249 "0 = no compression with fast file output, "
6250 "100 = maximum lossless compression with slow file output");
6252
6253 prop = RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE);
6256 prop, "Preview", "When rendering animations, save JPG preview images in same directory");
6258
6259 /* format specific */
6260
6261# ifdef WITH_OPENEXR
6262 /* OpenEXR */
6263
6264 prop = RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
6265 RNA_def_property_enum_sdna(prop, nullptr, "exr_codec");
6266 RNA_def_property_enum_items(prop, rna_enum_exr_codec_items);
6267 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_ImageFormatSettings_exr_codec_itemf");
6268 RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
6270# endif
6271
6272# ifdef WITH_OPENJPEG
6273 /* JPEG 2000 */
6274 prop = RNA_def_property(srna, "use_jpeg2k_ycc", PROP_BOOLEAN, PROP_NONE);
6275 RNA_def_property_boolean_sdna(prop, nullptr, "jp2_flag", R_IMF_JP2_FLAG_YCC);
6277 prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors");
6279
6280 prop = RNA_def_property(srna, "use_jpeg2k_cinema_preset", PROP_BOOLEAN, PROP_NONE);
6282 RNA_def_property_ui_text(prop, "Cinema", "Use OpenJPEG Cinema Preset");
6284
6285 prop = RNA_def_property(srna, "use_jpeg2k_cinema_48", PROP_BOOLEAN, PROP_NONE);
6286 RNA_def_property_boolean_sdna(prop, nullptr, "jp2_flag", R_IMF_JP2_FLAG_CINE_48);
6287 RNA_def_property_ui_text(prop, "Cinema (48)", "Use OpenJPEG Cinema Preset (48fps)");
6289
6290 prop = RNA_def_property(srna, "jpeg2k_codec", PROP_ENUM, PROP_NONE);
6291 RNA_def_property_enum_sdna(prop, nullptr, "jp2_codec");
6292 RNA_def_property_enum_items(prop, jp2_codec_items);
6293 RNA_def_property_ui_text(prop, "Codec", "Codec settings for JPEG 2000");
6295# endif
6296
6297 /* TIFF */
6298 prop = RNA_def_property(srna, "tiff_codec", PROP_ENUM, PROP_NONE);
6299 RNA_def_property_enum_sdna(prop, nullptr, "tiff_codec");
6300 RNA_def_property_enum_items(prop, tiff_codec_items);
6301 RNA_def_property_ui_text(prop, "Compression", "Compression mode for TIFF");
6303
6304 /* Cineon and DPX */
6305
6306 prop = RNA_def_property(srna, "use_cineon_log", PROP_BOOLEAN, PROP_NONE);
6307 RNA_def_property_boolean_sdna(prop, nullptr, "cineon_flag", R_IMF_CINEON_FLAG_LOG);
6308 RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space");
6310
6311 prop = RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE);
6312 RNA_def_property_int_sdna(prop, nullptr, "cineon_black");
6313 RNA_def_property_range(prop, 0, 1024);
6314 RNA_def_property_ui_text(prop, "Black", "Log conversion reference blackpoint");
6316
6317 prop = RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE);
6318 RNA_def_property_int_sdna(prop, nullptr, "cineon_white");
6319 RNA_def_property_range(prop, 0, 1024);
6320 RNA_def_property_ui_text(prop, "White", "Log conversion reference whitepoint");
6322
6323 prop = RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE);
6324 RNA_def_property_float_sdna(prop, nullptr, "cineon_gamma");
6325 RNA_def_property_range(prop, 0.0f, 10.0f);
6326 RNA_def_property_ui_text(prop, "Gamma", "Log conversion gamma");
6328
6329 /* multiview */
6330 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
6331 RNA_def_property_enum_sdna(prop, nullptr, "views_format");
6334 prop, nullptr, nullptr, "rna_ImageFormatSettings_views_format_itemf");
6335 RNA_def_property_ui_text(prop, "Views Format", "Format of multiview media");
6337
6338 prop = RNA_def_property(srna, "stereo_3d_format", PROP_POINTER, PROP_NONE);
6339 RNA_def_property_pointer_sdna(prop, nullptr, "stereo3d_format");
6341 RNA_def_property_struct_type(prop, "Stereo3dFormat");
6342 RNA_def_property_ui_text(prop, "Stereo 3D Format", "Settings for stereo 3D");
6343
6344 /* color management */
6345 prop = RNA_def_property(srna, "color_management", PROP_ENUM, PROP_NONE);
6346 RNA_def_property_enum_items(prop, color_management_items);
6348 prop, "Color Management", "Which color management settings to use for file saving");
6350 prop, nullptr, "rna_ImageFormatSettings_color_management_set", nullptr);
6352
6353 prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
6354 RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
6356 prop, "View Settings", "Color management settings applied on image before saving");
6357
6358 prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
6359 RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
6361 prop, "Display Settings", "Settings of device saved image would be displayed on");
6362
6363 prop = RNA_def_property(srna, "linear_colorspace_settings", PROP_POINTER, PROP_NONE);
6364 RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
6365 RNA_def_property_ui_text(prop, "Color Space Settings", "Output color space settings");
6366
6367 prop = RNA_def_property(srna, "has_linear_colorspace", PROP_BOOLEAN, PROP_NONE);
6369 prop, "rna_ImageFormatSettings_has_linear_colorspace_get", nullptr);
6372 prop, "Has Linear Color Space", "File format expects linear color space");
6373}
6374
6376{
6377 StructRNA *srna;
6378 PropertyRNA *prop;
6379
6380# ifdef WITH_FFMPEG
6381 /* Container types */
6382 static const EnumPropertyItem ffmpeg_format_items[] = {
6383 {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""},
6384 {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""},
6385 {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""},
6386 {FFMPEG_AVI, "AVI", 0, "AVI", ""},
6387 {FFMPEG_MOV, "QUICKTIME", 0, "QuickTime", ""},
6388 {FFMPEG_DV, "DV", 0, "DV", ""},
6389 {FFMPEG_OGG, "OGG", 0, "Ogg", ""},
6390 {FFMPEG_MKV, "MKV", 0, "Matroska", ""},
6391 {FFMPEG_FLV, "FLASH", 0, "Flash", ""},
6392 {FFMPEG_WEBM, "WEBM", 0, "WebM", ""},
6393 {0, nullptr, 0, nullptr, nullptr},
6394 };
6395
6396 static const EnumPropertyItem ffmpeg_codec_items[] = {
6397 {AV_CODEC_ID_NONE, "NONE", 0, "No Video", "Disables video output, for audio-only renders"},
6398 {AV_CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""},
6399 {AV_CODEC_ID_DVVIDEO, "DV", 0, "DV", ""},
6400 {AV_CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
6401 {AV_CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
6402 {AV_CODEC_ID_H264, "H264", 0, "H.264", ""},
6403 {AV_CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""},
6404 {AV_CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
6405 {AV_CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
6406 {AV_CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4 (divx)", ""},
6407 {AV_CODEC_ID_PNG, "PNG", 0, "PNG", ""},
6408 {AV_CODEC_ID_QTRLE, "QTRLE", 0, "QuickTime Animation", ""},
6409 {AV_CODEC_ID_THEORA, "THEORA", 0, "Theora", ""},
6410 {AV_CODEC_ID_VP9, "WEBM", 0, "WebM / VP9", ""},
6411 {AV_CODEC_ID_AV1, "AV1", 0, "AV1", ""},
6412 {0, nullptr, 0, nullptr, nullptr},
6413 };
6414
6415 /* Recommendations come from the FFmpeg wiki, https://trac.ffmpeg.org/wiki/Encode/VP9.
6416 * The label for BEST has been changed to "Slowest" so that it fits the "Encoding Speed"
6417 * property label in the UI. */
6418 static const EnumPropertyItem ffmpeg_preset_items[] = {
6420 "BEST",
6421 0,
6422 "Slowest",
6423 "Recommended if you have lots of time and want the best compression efficiency"},
6424 {FFM_PRESET_GOOD, "GOOD", 0, "Good", "The default and recommended for most applications"},
6425 {FFM_PRESET_REALTIME, "REALTIME", 0, "Realtime", "Recommended for fast encoding"},
6426 {0, nullptr, 0, nullptr, nullptr},
6427 };
6428
6429 static const EnumPropertyItem ffmpeg_crf_items[] = {
6430 {FFM_CRF_NONE,
6431 "NONE",
6432 0,
6433 "Constant Bitrate",
6434 "Configure constant bit rate, rather than constant output quality"},
6435 {FFM_CRF_LOSSLESS, "LOSSLESS", 0, "Lossless", ""},
6436 {FFM_CRF_PERC_LOSSLESS, "PERC_LOSSLESS", 0, "Perceptually Lossless", ""},
6437 {FFM_CRF_HIGH, "HIGH", 0, "High Quality", ""},
6438 {FFM_CRF_MEDIUM, "MEDIUM", 0, "Medium Quality", ""},
6439 {FFM_CRF_LOW, "LOW", 0, "Low Quality", ""},
6440 {FFM_CRF_VERYLOW, "VERYLOW", 0, "Very Low Quality", ""},
6441 {FFM_CRF_LOWEST, "LOWEST", 0, "Lowest Quality", ""},
6442 {0, nullptr, 0, nullptr, nullptr},
6443 };
6444
6445 static const EnumPropertyItem ffmpeg_audio_codec_items[] = {
6446 {AV_CODEC_ID_NONE, "NONE", 0, "No Audio", "Disables audio output, for video-only renders"},
6447 {AV_CODEC_ID_AAC, "AAC", 0, "AAC", ""},
6448 {AV_CODEC_ID_AC3, "AC3", 0, "AC3", ""},
6449 {AV_CODEC_ID_FLAC, "FLAC", 0, "FLAC", ""},
6450 {AV_CODEC_ID_MP2, "MP2", 0, "MP2", ""},
6451 {AV_CODEC_ID_MP3, "MP3", 0, "MP3", ""},
6452 {AV_CODEC_ID_OPUS, "OPUS", 0, "Opus", ""},
6453 {AV_CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""},
6454 {AV_CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""},
6455 {0, nullptr, 0, nullptr, nullptr},
6456 };
6457# endif
6458
6459 static const EnumPropertyItem audio_channel_items[] = {
6460 {FFM_CHANNELS_MONO, "MONO", 0, "Mono", "Set audio channels to mono"},
6461 {FFM_CHANNELS_STEREO, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
6462 {FFM_CHANNELS_SURROUND4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
6464 "SURROUND51",
6465 0,
6466 "5.1 Surround",
6467 "Set audio channels to 5.1 surround sound"},
6469 "SURROUND71",
6470 0,
6471 "7.1 Surround",
6472 "Set audio channels to 7.1 surround sound"},
6473 {0, nullptr, 0, nullptr, nullptr},
6474 };
6475
6476 srna = RNA_def_struct(brna, "FFmpegSettings", nullptr);
6477 RNA_def_struct_sdna(srna, "FFMpegCodecData");
6478 RNA_def_struct_path_func(srna, "rna_FFmpegSettings_path");
6479 RNA_def_struct_ui_text(srna, "FFmpeg Settings", "FFmpeg related settings for the scene");
6480
6481# ifdef WITH_FFMPEG
6482 prop = RNA_def_property(srna, "format", PROP_ENUM, PROP_NONE);
6483 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "type");
6485 RNA_def_property_enum_items(prop, ffmpeg_format_items);
6486 RNA_def_property_enum_default(prop, FFMPEG_MKV);
6487 RNA_def_property_ui_text(prop, "Container", "Output file container");
6488
6489 prop = RNA_def_property(srna, "codec", PROP_ENUM, PROP_NONE);
6490 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "codec");
6492 RNA_def_property_enum_items(prop, ffmpeg_codec_items);
6493 RNA_def_property_enum_default(prop, AV_CODEC_ID_H264);
6494 RNA_def_property_ui_text(prop, "Video Codec", "FFmpeg codec to use for video output");
6495 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_FFmpegSettings_codec_update");
6496
6497 prop = RNA_def_property(srna, "video_bitrate", PROP_INT, PROP_NONE);
6498 RNA_def_property_int_sdna(prop, nullptr, "video_bitrate");
6500 RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kbit/s)");
6502
6503 prop = RNA_def_property(srna, "minrate", PROP_INT, PROP_NONE);
6504 RNA_def_property_int_sdna(prop, nullptr, "rc_min_rate");
6506 RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kbit/s)");
6508
6509 prop = RNA_def_property(srna, "maxrate", PROP_INT, PROP_NONE);
6510 RNA_def_property_int_sdna(prop, nullptr, "rc_max_rate");
6512 RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kbit/s)");
6514
6515 prop = RNA_def_property(srna, "muxrate", PROP_INT, PROP_NONE);
6516 RNA_def_property_int_sdna(prop, nullptr, "mux_rate");
6518 RNA_def_property_range(prop, 0, 100000000);
6519 RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/second)");
6521
6522 prop = RNA_def_property(srna, "gopsize", PROP_INT, PROP_NONE);
6523 RNA_def_property_int_sdna(prop, nullptr, "gop_size");
6525 RNA_def_property_range(prop, 0, 500);
6528 "Keyframe Interval",
6529 "Distance between key frames, also known as GOP size; "
6530 "influences file size and seekability");
6532
6533 prop = RNA_def_property(srna, "max_b_frames", PROP_INT, PROP_NONE);
6534 RNA_def_property_int_sdna(prop, nullptr, "max_b_frames");
6536 RNA_def_property_range(prop, 0, 16);
6538 prop,
6539 "Max B-Frames",
6540 "Maximum number of B-frames between non-B-frames; influences file size and seekability");
6542
6543 prop = RNA_def_property(srna, "use_max_b_frames", PROP_BOOLEAN, PROP_NONE);
6546 RNA_def_property_ui_text(prop, "Use Max B-Frames", "Set a maximum number of B-frames");
6548
6549 prop = RNA_def_property(srna, "buffersize", PROP_INT, PROP_NONE);
6550 RNA_def_property_int_sdna(prop, nullptr, "rc_buffer_size");
6552 RNA_def_property_range(prop, 0, 2000);
6553 RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)");
6555
6556 prop = RNA_def_property(srna, "packetsize", PROP_INT, PROP_NONE);
6557 RNA_def_property_int_sdna(prop, nullptr, "mux_packet_size");
6559 RNA_def_property_range(prop, 0, 16384);
6560 RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)");
6562
6563 prop = RNA_def_property(srna, "constant_rate_factor", PROP_ENUM, PROP_NONE);
6564 RNA_def_property_enum_sdna(prop, nullptr, "constant_rate_factor");
6566 RNA_def_property_enum_items(prop, ffmpeg_crf_items);
6569 prop,
6570 "Output Quality",
6571 "Constant Rate Factor (CRF); tradeoff between video quality and file size");
6573
6574 prop = RNA_def_property(srna, "ffmpeg_preset", PROP_ENUM, PROP_NONE);
6575 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "ffmpeg_preset");
6577 RNA_def_property_enum_items(prop, ffmpeg_preset_items);
6580 prop, "Encoding Speed", "Tradeoff between encoding speed and compression ratio");
6582
6583 prop = RNA_def_property(srna, "use_autosplit", PROP_BOOLEAN, PROP_NONE);
6586 RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary");
6588
6589 prop = RNA_def_property(srna, "use_lossless_output", PROP_BOOLEAN, PROP_NONE);
6592 RNA_def_property_boolean_funcs(prop, nullptr, "rna_FFmpegSettings_lossless_output_set");
6593 RNA_def_property_ui_text(prop, "Lossless Output", "Use lossless output for video streams");
6595
6596 /* FFMPEG Audio. */
6597 prop = RNA_def_property(srna, "audio_codec", PROP_ENUM, PROP_NONE);
6598 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "audio_codec");
6600 RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items);
6601 RNA_def_property_ui_text(prop, "Audio Codec", "FFmpeg audio codec to use");
6603
6604 prop = RNA_def_property(srna, "audio_bitrate", PROP_INT, PROP_NONE);
6605 RNA_def_property_int_sdna(prop, nullptr, "audio_bitrate");
6607 RNA_def_property_range(prop, 32, 384);
6608 RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)");
6610
6611 prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
6612 RNA_def_property_float_sdna(prop, nullptr, "audio_volume");
6614 RNA_def_property_range(prop, 0.0f, 1.0f);
6615 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
6618# endif
6619
6620 /* the following two "ffmpeg" settings are general audio settings */
6621 prop = RNA_def_property(srna, "audio_mixrate", PROP_INT, PROP_NONE);
6622 RNA_def_property_int_sdna(prop, nullptr, "audio_mixrate");
6624 RNA_def_property_range(prop, 8000, 192000);
6625 RNA_def_property_ui_text(prop, "Sample Rate", "Audio sample rate (samples/s)");
6627
6628 prop = RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
6629 RNA_def_property_enum_sdna(prop, nullptr, "audio_channels");
6631 RNA_def_property_enum_items(prop, audio_channel_items);
6632 RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
6633}
6634
6636{
6637 StructRNA *srna;
6638 PropertyRNA *prop;
6639
6640 /* Bake */
6641 static const EnumPropertyItem bake_mode_items[] = {
6642 //{RE_BAKE_AO, "AO", 0, "Ambient Occlusion", "Bake ambient occlusion"},
6643 {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", "Bake normals"},
6644 {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Bake displacement"},
6645 {0, nullptr, 0, nullptr, nullptr},
6646 };
6647
6648 static const EnumPropertyItem bake_margin_type_items[] = {
6650 "ADJACENT_FACES",
6651 0,
6652 "Adjacent Faces",
6653 "Use pixels from adjacent faces across UV seams"},
6654 {R_BAKE_EXTEND, "EXTEND", 0, "Extend", "Extend border pixels outwards"},
6655 {0, nullptr, 0, nullptr, nullptr},
6656 };
6657
6658 static const EnumPropertyItem pixel_size_items[] = {
6659 {0, "AUTO", 0, "Automatic", "Automatic pixel size, depends on the user interface scale"},
6660 {1, "1", 0, "1" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at full resolution"},
6661 {2, "2", 0, "2" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 50% resolution"},
6662 {4, "4", 0, "4" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 25% resolution"},
6663 {8, "8", 0, "8" BLI_STR_UTF8_MULTIPLICATION_SIGN, "Render at 12.5% resolution"},
6664 {0, nullptr, 0, nullptr, nullptr},
6665 };
6666
6667 static const EnumPropertyItem threads_mode_items[] = {
6668 {0,
6669 "AUTO",
6670 0,
6671 "Auto-Detect",
6672 "Automatically determine the number of threads, based on CPUs"},
6673 {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"},
6674 {0, nullptr, 0, nullptr, nullptr},
6675 };
6676
6677 static const EnumPropertyItem engine_items[] = {
6678 {0, "BLENDER_EEVEE_NEXT", 0, "EEVEE", ""},
6679 {0, nullptr, 0, nullptr, nullptr},
6680 };
6681
6682 static const EnumPropertyItem freestyle_thickness_items[] = {
6684 "ABSOLUTE",
6685 0,
6686 "Absolute",
6687 "Specify unit line thickness in pixels"},
6689 "RELATIVE",
6690 0,
6691 "Relative",
6692 "Unit line thickness is scaled by the proportion of the present vertical image "
6693 "resolution to 480 pixels"},
6694 {0, nullptr, 0, nullptr, nullptr},
6695 };
6696
6697 static const EnumPropertyItem views_format_items[] = {
6699 "STEREO_3D",
6700 0,
6701 "Stereo 3D",
6702 "Single stereo camera system, adjust the stereo settings in the camera panel"},
6704 "MULTIVIEW",
6705 0,
6706 "Multi-View",
6707 "Multi camera system, adjust the cameras individually"},
6708 {0, nullptr, 0, nullptr, nullptr},
6709 };
6710
6711 static const EnumPropertyItem motion_blur_position_items[] = {
6712 {SCE_MB_START, "START", 0, "Start on Frame", "The shutter opens at the current frame"},
6714 "CENTER",
6715 0,
6716 "Center on Frame",
6717 "The shutter is open during the current frame"},
6718 {SCE_MB_END, "END", 0, "End on Frame", "The shutter closes at the current frame"},
6719 {0, nullptr, 0, nullptr, nullptr},
6720 };
6721
6722 static const EnumPropertyItem hair_shape_type_items[] = {
6723 {SCE_HAIR_SHAPE_STRAND, "STRAND", 0, "Strand", ""},
6724 {SCE_HAIR_SHAPE_STRIP, "STRIP", 0, "Strip", ""},
6725 {0, nullptr, 0, nullptr, nullptr},
6726 };
6727
6728 static const EnumPropertyItem meta_input_items[] = {
6729 {0, "SCENE", 0, "Scene", "Use metadata from the current scene"},
6731 "STRIPS",
6732 0,
6733 "Sequencer Strips",
6734 "Use metadata from the strips in the sequencer"},
6735 {0, nullptr, 0, nullptr, nullptr},
6736 };
6737
6738 static const EnumPropertyItem compositor_device_items[] = {
6739 {SCE_COMPOSITOR_DEVICE_CPU, "CPU", 0, "CPU", ""},
6740 {SCE_COMPOSITOR_DEVICE_GPU, "GPU", 0, "GPU", ""},
6741 {0, nullptr, 0, nullptr, nullptr},
6742 };
6743
6744 static const EnumPropertyItem compositor_precision_items[] = {
6746 "AUTO",
6747 0,
6748 "Auto",
6749 "Full precision for final renders, half precision otherwise"},
6750 {SCE_COMPOSITOR_PRECISION_FULL, "FULL", 0, "Full", "Full precision"},
6751 {0, nullptr, 0, nullptr, nullptr},
6752 };
6753
6755
6756 srna = RNA_def_struct(brna, "RenderSettings", nullptr);
6757 RNA_def_struct_sdna(srna, "RenderData");
6758 RNA_def_struct_nested(brna, srna, "Scene");
6759 RNA_def_struct_path_func(srna, "rna_RenderSettings_path");
6760 RNA_def_struct_ui_text(srna, "Render Data", "Rendering settings for a Scene data-block");
6761
6762 /* Render Data */
6763 prop = RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE);
6765 RNA_def_property_pointer_sdna(prop, nullptr, "im_format");
6766 RNA_def_property_struct_type(prop, "ImageFormatSettings");
6767 RNA_def_property_ui_text(prop, "Image Format", "");
6768
6769 prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL);
6770 RNA_def_property_int_sdna(prop, nullptr, "xsch");
6773 RNA_def_property_range(prop, 4, 65536);
6775 prop, "Resolution X", "Number of horizontal pixels in the rendered image");
6776 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6777
6778 prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL);
6779 RNA_def_property_int_sdna(prop, nullptr, "ysch");
6782 RNA_def_property_range(prop, 4, 65536);
6784 prop, "Resolution Y", "Number of vertical pixels in the rendered image");
6785 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6786
6787 prop = RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
6788 RNA_def_property_int_sdna(prop, nullptr, "size");
6790 RNA_def_property_range(prop, 1, SHRT_MAX);
6791 RNA_def_property_ui_range(prop, 1, 100, 10, 1);
6792 RNA_def_property_ui_text(prop, "Resolution Scale", "Percentage scale for render resolution");
6793 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneSequencer_update");
6794
6795 prop = RNA_def_property(srna, "preview_pixel_size", PROP_ENUM, PROP_NONE);
6796 RNA_def_property_enum_sdna(prop, nullptr, "preview_pixel_size");
6797 RNA_def_property_enum_items(prop, pixel_size_items);
6798 RNA_def_property_ui_text(prop, "Pixel Size", "Pixel size for viewport rendering");
6800
6801 prop = RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE);
6802 RNA_def_property_float_sdna(prop, nullptr, "xasp");
6805 RNA_def_property_range(prop, 1.0f, 200.0f);
6807 "Pixel Aspect X",
6808 "Horizontal aspect ratio - for anamorphic or non-square pixel output");
6809 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6810
6811 prop = RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE);
6812 RNA_def_property_float_sdna(prop, nullptr, "yasp");
6815 RNA_def_property_range(prop, 1.0f, 200.0f);
6817 prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output");
6818 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
6819
6820 prop = RNA_def_property(srna, "ffmpeg", PROP_POINTER, PROP_NONE);
6821 RNA_def_property_struct_type(prop, "FFmpegSettings");
6822 RNA_def_property_pointer_sdna(prop, nullptr, "ffcodecdata");
6824 RNA_def_property_ui_text(prop, "FFmpeg Settings", "FFmpeg related settings for the scene");
6825
6826 prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
6827 RNA_def_property_int_sdna(prop, nullptr, "frs_sec");
6829 RNA_def_property_range(prop, 1, SHRT_MAX);
6830 RNA_def_property_ui_range(prop, 1, 240, 1, -1);
6831 RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second");
6832 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
6833
6834 prop = RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE);
6835 RNA_def_property_float_sdna(prop, nullptr, "frs_sec_base");
6837 RNA_def_property_range(prop, 1e-5f, 1e6f);
6838 /* Important to show at least 3 decimal points because multiple presets set this to 1.001. */
6839 RNA_def_property_ui_range(prop, 0.1f, 120.0f, 2, 3);
6840 RNA_def_property_ui_text(prop, "FPS Base", "Framerate base");
6841 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update");
6842
6843 /* frame mapping */
6844 prop = RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE);
6845 RNA_def_property_int_sdna(prop, nullptr, "framapto");
6847 RNA_def_property_range(prop, 1, 900);
6848 RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames");
6849 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
6850
6851 prop = RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
6852 RNA_def_property_int_sdna(prop, nullptr, "images");
6854 RNA_def_property_range(prop, 1, 900);
6855 RNA_def_property_ui_text(prop, "Frame Map New", "How many frames the Map Old will last");
6856 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update");
6857
6858 prop = RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
6859 RNA_def_property_float_sdna(prop, nullptr, "dither_intensity");
6860 RNA_def_property_range(prop, 0.0, FLT_MAX);
6861 RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 2);
6863 prop,
6864 "Dither Intensity",
6865 "Amount of dithering noise added to the rendered image to break up banding");
6867
6868 prop = RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_PIXEL);
6869 RNA_def_property_float_sdna(prop, nullptr, "gauss");
6870 RNA_def_property_range(prop, 0.0f, 500.0f);
6871 RNA_def_property_ui_range(prop, 0.01f, 10.0f, 1, 2);
6873 prop, "Filter Size", "Width over which the reconstruction filter combines samples");
6875
6876 prop = RNA_def_property(srna, "film_transparent", PROP_BOOLEAN, PROP_NONE);
6877 RNA_def_property_boolean_sdna(prop, nullptr, "alphamode", R_ALPHAPREMUL);
6879 prop,
6880 "Transparent",
6881 "World background is transparent, for compositing the render over another background");
6882 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
6883
6884 prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
6886 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_EDGE_FRS);
6887 RNA_def_property_ui_text(prop, "Use Freestyle", "Draw stylized strokes using Freestyle");
6888 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_freestyle_update");
6889
6890 /* threads */
6891 prop = RNA_def_property(srna, "threads", PROP_INT, PROP_NONE);
6892 RNA_def_property_int_sdna(prop, nullptr, "threads");
6894 RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", nullptr, nullptr);
6896 "Threads",
6897 "Maximum number of CPU cores to use simultaneously while rendering "
6898 "(for multi-core/CPU systems)");
6900
6901 prop = RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
6902 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "mode");
6903 RNA_def_property_enum_items(prop, threads_mode_items);
6904 RNA_def_property_enum_funcs(prop, "rna_RenderSettings_threads_mode_get", nullptr, nullptr);
6905 RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used");
6907
6908 /* motion blur */
6909 prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE);
6910 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_MBLUR);
6911 RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur");
6913 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
6914
6915 prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_FACTOR);
6916 RNA_def_property_range(prop, 0.0f, FLT_MAX);
6917 RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 2);
6918 RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close");
6919 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
6920
6921 prop = RNA_def_property(srna, "motion_blur_position", PROP_ENUM, PROP_NONE);
6922 RNA_def_property_enum_items(prop, motion_blur_position_items);
6924 "Motion Blur Position",
6925 "Offset for the shutter's time interval, "
6926 "allows to change the motion blur trails");
6929
6930 prop = RNA_def_property(srna, "motion_blur_shutter_curve", PROP_POINTER, PROP_NONE);
6931 RNA_def_property_pointer_sdna(prop, nullptr, "mblur_shutter_curve");
6932 RNA_def_property_struct_type(prop, "CurveMapping");
6934 prop, "Shutter Curve", "Curve defining the shutter's openness over time");
6935
6936 /* Hairs */
6937 prop = RNA_def_property(srna, "hair_type", PROP_ENUM, PROP_NONE);
6938 RNA_def_property_enum_items(prop, hair_shape_type_items);
6939 RNA_def_property_ui_text(prop, "Curves Shape Type", "Curves shape type");
6941 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
6942
6943 prop = RNA_def_property(srna, "hair_subdiv", PROP_INT, PROP_NONE);
6944 RNA_def_property_range(prop, 0, 3);
6946 prop, "Additional Subdivision", "Additional subdivision along the curves");
6947 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_render_update");
6948
6949 /* Performance */
6950 prop = RNA_def_property(srna, "use_high_quality_normals", PROP_BOOLEAN, PROP_NONE);
6951 RNA_def_property_boolean_sdna(prop, nullptr, "perf_flag", SCE_PERF_HQ_NORMALS);
6953 "High Quality Normals",
6954 "Use high quality tangent space at the cost of lower performance");
6955 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_mesh_quality_update");
6956
6957 /* border */
6958 prop = RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
6959 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_BORDER);
6962 prop, "Render Region", "Render a user-defined render region, within the frame size");
6964
6965 prop = RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
6966 RNA_def_property_float_sdna(prop, nullptr, "border.xmin");
6967 RNA_def_property_range(prop, 0.0f, 1.0f);
6969 RNA_def_property_ui_text(prop, "Region Minimum X", "Minimum X value for the render region");
6971
6972 prop = RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
6973 RNA_def_property_float_sdna(prop, nullptr, "border.ymin");
6974 RNA_def_property_range(prop, 0.0f, 1.0f);
6976 RNA_def_property_ui_text(prop, "Region Minimum Y", "Minimum Y value for the render region");
6978
6979 prop = RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
6980 RNA_def_property_float_sdna(prop, nullptr, "border.xmax");
6981 RNA_def_property_range(prop, 0.0f, 1.0f);
6983 RNA_def_property_ui_text(prop, "Region Maximum X", "Maximum X value for the render region");
6985
6986 prop = RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
6987 RNA_def_property_float_sdna(prop, nullptr, "border.ymax");
6988 RNA_def_property_range(prop, 0.0f, 1.0f);
6990 RNA_def_property_ui_text(prop, "Region Maximum Y", "Maximum Y value for the render region");
6992
6993 prop = RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
6994 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_CROP);
6997 prop, "Crop to Render Region", "Crop the rendered frame to the defined render region size");
6999
7000 prop = RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
7001 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_TOUCH);
7004 prop,
7005 "Placeholders",
7006 "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
7008
7009 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
7011 RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering");
7013
7014 prop = RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
7015 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_DOCOMP);
7018 "Compositing",
7019 "Process the render result through the compositing pipeline, "
7020 "if compositing nodes are enabled");
7022
7023 prop = RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
7024 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_DOSEQ);
7027 "Sequencer",
7028 "Process the render (and composited) result through the video sequence "
7029 "editor pipeline, if sequencer strips exist");
7031
7032 prop = RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
7033 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_EXTENSION);
7036 prop,
7037 "File Extensions",
7038 "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
7040
7041# if 0 /* moved */
7042 prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
7043 RNA_def_property_enum_sdna(prop, nullptr, "imtype");
7045 RNA_def_property_enum_funcs(prop, nullptr, "rna_RenderSettings_file_format_set", nullptr);
7046 RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as");
7048# endif
7049
7050 prop = RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
7052 prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", nullptr);
7053 RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
7055
7056 prop = RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
7057 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_format_get", nullptr);
7059 RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
7060
7061 prop = RNA_def_property(srna, "use_lock_interface", PROP_BOOLEAN, PROP_NONE);
7062 RNA_def_property_boolean_sdna(prop, nullptr, "use_lock_interface", 1);
7064 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true);
7066 prop,
7067 "Lock Interface",
7068 "Lock interface during rendering in favor of giving more memory to the renderer");
7070
7071 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
7072 RNA_def_property_string_sdna(prop, nullptr, "pic");
7074 "Output Path",
7075 "Directory/name to save animations, # characters define the position "
7076 "and padding of frame numbers");
7079
7080 /* Render result EXR cache. */
7081 prop = RNA_def_property(srna, "use_render_cache", PROP_BOOLEAN, PROP_NONE);
7082 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_EXR_CACHE_FILE);
7085 "Cache Result",
7086 "Save render cache to EXR files (useful for heavy compositing, "
7087 "Note: affects indirectly rendered scenes)");
7089
7090 /* Bake */
7091
7092 prop = RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);
7093 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "bake_mode");
7094 RNA_def_property_enum_items(prop, bake_mode_items);
7095 RNA_def_property_ui_text(prop, "Bake Type", "Choose shading information to bake into the image");
7097
7098 prop = RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
7099 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_TO_ACTIVE);
7101 "Selected to Active",
7102 "Bake shading on the surface of selected objects to the active object");
7104
7105 prop = RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
7106 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_CLEAR);
7107 RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking");
7109
7110 prop = RNA_def_property(srna, "bake_margin", PROP_INT, PROP_PIXEL);
7111 RNA_def_property_int_sdna(prop, nullptr, "bake_margin");
7112 RNA_def_property_range(prop, 0, 64);
7113 RNA_def_property_ui_text(prop, "Margin", "Extends the baked result as a post process filter");
7115
7116 prop = RNA_def_property(srna, "bake_margin_type", PROP_ENUM, PROP_NONE);
7117 RNA_def_property_enum_sdna(prop, nullptr, "bake_margin_type");
7118 RNA_def_property_enum_items(prop, bake_margin_type_items);
7119 RNA_def_property_ui_text(prop, "Margin Type", "Algorithm to generate the margin");
7121
7122 prop = RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
7123 RNA_def_property_float_sdna(prop, nullptr, "bake_biasdist");
7124 RNA_def_property_range(prop, 0.0, 1000.0);
7126 prop, "Bias", "Bias towards faces further away from the object (in Blender units)");
7128
7129 prop = RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE);
7130 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_MULTIRES);
7131 RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object");
7133
7134 prop = RNA_def_property(srna, "use_bake_lores_mesh", PROP_BOOLEAN, PROP_NONE);
7135 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_LORES_MESH);
7137 prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh");
7139
7140 prop = RNA_def_property(srna, "bake_samples", PROP_INT, PROP_NONE);
7141 RNA_def_property_int_sdna(prop, nullptr, "bake_samples");
7142 RNA_def_property_range(prop, 64, 1024);
7144 prop, "Samples", "Number of samples used for ambient occlusion baking from multires");
7146
7147 prop = RNA_def_property(srna, "use_bake_user_scale", PROP_BOOLEAN, PROP_NONE);
7148 RNA_def_property_boolean_sdna(prop, nullptr, "bake_flag", R_BAKE_USERSCALE);
7149 RNA_def_property_ui_text(prop, "User Scale", "Use a user scale for the derivative map");
7150
7151 prop = RNA_def_property(srna, "bake_user_scale", PROP_FLOAT, PROP_NONE);
7152 RNA_def_property_float_sdna(prop, nullptr, "bake_user_scale");
7153 RNA_def_property_range(prop, 0.0, 1000.0);
7155 "Scale",
7156 "Instead of automatically normalizing to the range 0 to 1, "
7157 "apply a user scale to the derivative map");
7158
7159 /* stamp */
7160
7161 prop = RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
7162 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_TIME);
7164 prop, "Stamp Time", "Include the rendered frame timecode as HH:MM:SS.FF in image metadata");
7166
7167 prop = RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
7168 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_DATE);
7169 RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image/video metadata");
7171
7172 prop = RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE);
7173 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FRAME);
7174 RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata");
7176
7177 prop = RNA_def_property(srna, "use_stamp_frame_range", PROP_BOOLEAN, PROP_NONE);
7178 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FRAME_RANGE);
7180 prop, "Stamp Frame", "Include the rendered frame range in image/video metadata");
7182
7183 prop = RNA_def_property(srna, "use_stamp_camera", PROP_BOOLEAN, PROP_NONE);
7184 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_CAMERA);
7186 prop, "Stamp Camera", "Include the name of the active camera in image metadata");
7188
7189 prop = RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
7190 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_CAMERALENS);
7192 prop, "Stamp Lens", "Include the active camera's lens in image metadata");
7194
7195 prop = RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
7196 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_SCENE);
7198 prop, "Stamp Scene", "Include the name of the active scene in image/video metadata");
7200
7201 prop = RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE);
7202 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_NOTE);
7203 RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image/video metadata");
7205
7206 prop = RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE);
7207 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_MARKER);
7209 prop, "Stamp Marker", "Include the name of the last marker in image metadata");
7211
7212 prop = RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
7213 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_FILENAME);
7215 prop, "Stamp Filename", "Include the .blend filename in image/video metadata");
7217
7218 prop = RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
7219 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_SEQSTRIP);
7221 "Stamp Sequence Strip",
7222 "Include the name of the foreground sequence strip in image metadata");
7224
7225 prop = RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
7226 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_RENDERTIME);
7227 RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in image metadata");
7229
7230 prop = RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
7231 RNA_def_property_string_sdna(prop, nullptr, "stamp_udata");
7232 RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note");
7234
7235 prop = RNA_def_property(srna, "use_stamp", PROP_BOOLEAN, PROP_NONE);
7236 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_DRAW);
7238 prop, "Stamp Output", "Render the stamp info text in the rendered image");
7240
7241 prop = RNA_def_property(srna, "use_stamp_labels", PROP_BOOLEAN, PROP_NONE);
7244 prop, "Stamp Labels", "Display stamp labels (\"Camera\" in front of camera name, etc.)");
7246
7247 prop = RNA_def_property(srna, "metadata_input", PROP_ENUM, PROP_NONE); /* as an enum */
7248 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "stamp");
7249 RNA_def_property_enum_items(prop, meta_input_items);
7250 RNA_def_property_ui_text(prop, "Metadata Input", "Where to take the metadata from");
7252
7253 prop = RNA_def_property(srna, "use_stamp_memory", PROP_BOOLEAN, PROP_NONE);
7254 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_MEMORY);
7256 prop, "Stamp Peak Memory", "Include the peak memory usage in image metadata");
7258
7259 prop = RNA_def_property(srna, "use_stamp_hostname", PROP_BOOLEAN, PROP_NONE);
7260 RNA_def_property_boolean_sdna(prop, nullptr, "stamp", R_STAMP_HOSTNAME);
7262 prop, "Stamp Hostname", "Include the hostname of the machine that rendered the frame");
7264
7265 prop = RNA_def_property(srna, "stamp_font_size", PROP_INT, PROP_PIXEL);
7266 RNA_def_property_int_sdna(prop, nullptr, "stamp_font_id");
7267 RNA_def_property_range(prop, 8, 64);
7268 RNA_def_property_ui_text(prop, "Font Size", "Size of the font used when rendering stamp text");
7270
7271 prop = RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR);
7272 RNA_def_property_float_sdna(prop, nullptr, "fg_stamp");
7273 RNA_def_property_array(prop, 4);
7274 RNA_def_property_range(prop, 0.0, 1.0);
7275 RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text");
7277
7278 prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR);
7279 RNA_def_property_float_sdna(prop, nullptr, "bg_stamp");
7280 RNA_def_property_array(prop, 4);
7281 RNA_def_property_range(prop, 0.0, 1.0);
7282 RNA_def_property_ui_text(prop, "Background", "Color to use behind stamp text");
7284
7285 /* sequencer draw options */
7286
7287 prop = RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
7288 RNA_def_property_enum_sdna(prop, nullptr, "seq_prev_type");
7291 prop, "Sequencer Preview Shading", "Display method used in the sequencer view");
7292 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
7293
7294 prop = RNA_def_property(srna, "use_sequencer_override_scene_strip", PROP_BOOLEAN, PROP_NONE);
7297 "Override Scene Settings",
7298 "Use workbench render settings from the sequencer scene, instead of "
7299 "each individual scene used in the strip");
7300 RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SceneSequencer_update");
7301
7302 prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
7303 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_SINGLE_LAYER);
7305 "Render Single Layer",
7306 "Only render the active layer. Only affects rendering from the "
7307 "interface, ignored for rendering from command line.");
7310
7311 /* views (stereoscopy et al) */
7312 prop = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE);
7313 RNA_def_property_struct_type(prop, "SceneRenderView");
7314 RNA_def_property_ui_text(prop, "Render Views", "");
7315 rna_def_render_views(brna, prop);
7316
7317 prop = RNA_def_property(srna, "stereo_views", PROP_COLLECTION, PROP_NONE);
7318 RNA_def_property_collection_sdna(prop, nullptr, "views", nullptr);
7320 "rna_RenderSettings_stereoViews_begin",
7321 "rna_iterator_listbase_next",
7322 "rna_iterator_listbase_end",
7323 "rna_iterator_listbase_get",
7324 nullptr,
7325 nullptr,
7326 nullptr,
7327 nullptr);
7328 RNA_def_property_struct_type(prop, "SceneRenderView");
7329 RNA_def_property_ui_text(prop, "Render Views", "");
7330
7331 prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE);
7332 RNA_def_property_boolean_sdna(prop, nullptr, "scemode", R_MULTIVIEW);
7333 RNA_def_property_ui_text(prop, "Multiple Views", "Use multiple views in the scene");
7334 RNA_def_property_update(prop, NC_WINDOW, nullptr);
7335
7336 prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
7337 RNA_def_property_enum_items(prop, views_format_items);
7339 RNA_def_property_ui_text(prop, "Setup Stereo Mode", "");
7340 RNA_def_property_enum_funcs(prop, nullptr, "rna_RenderSettings_views_format_set", nullptr);
7341 RNA_def_property_update(prop, NC_WINDOW, nullptr);
7342
7343 /* engine */
7344 prop = RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
7345 RNA_def_property_enum_items(prop, engine_items);
7347 "rna_RenderSettings_engine_get",
7348 "rna_RenderSettings_engine_set",
7349 "rna_RenderSettings_engine_itemf");
7351 RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
7352 RNA_def_property_update(prop, NC_WINDOW, "rna_RenderSettings_engine_update");
7353
7354 prop = RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
7355 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", nullptr);
7358 prop, "Multiple Engines", "More than one rendering engine is available");
7359
7360 prop = RNA_def_property(srna, "use_spherical_stereo", PROP_BOOLEAN, PROP_NONE);
7361 RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_spherical_stereo_get", nullptr);
7364 prop, "Use Spherical Stereo", "Active render engine supports spherical stereo rendering");
7365
7366 /* simplify */
7367 prop = RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE);
7368 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_SIMPLIFY);
7370 prop, "Use Simplify", "Enable simplification of scene for quicker preview renders");
7372 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_update");
7373
7374 prop = RNA_def_property(srna, "simplify_subdivision", PROP_INT, PROP_UNSIGNED);
7375 RNA_def_property_int_sdna(prop, nullptr, "simplify_subsurf");
7376 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
7377 RNA_def_property_ui_text(prop, "Simplify Subdivision", "Global maximum subdivision level");
7378 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7379
7380 prop = RNA_def_property(srna, "simplify_child_particles", PROP_FLOAT, PROP_FACTOR);
7381 RNA_def_property_float_sdna(prop, nullptr, "simplify_particles");
7382 RNA_def_property_ui_text(prop, "Simplify Child Particles", "Global child particles percentage");
7383 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7384
7385 prop = RNA_def_property(srna, "simplify_subdivision_render", PROP_INT, PROP_UNSIGNED);
7386 RNA_def_property_int_sdna(prop, nullptr, "simplify_subsurf_render");
7387 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
7389 prop, "Simplify Subdivision", "Global maximum subdivision level during rendering");
7390 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7391
7392 prop = RNA_def_property(srna, "simplify_child_particles_render", PROP_FLOAT, PROP_FACTOR);
7393 RNA_def_property_float_sdna(prop, nullptr, "simplify_particles_render");
7395 prop, "Simplify Child Particles", "Global child particles percentage during rendering");
7396 RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
7397
7398 prop = RNA_def_property(srna, "simplify_volumes", PROP_FLOAT, PROP_FACTOR);
7399 RNA_def_property_range(prop, 0.0, 1.0f);
7401 prop, "Simplify Volumes", "Resolution percentage of volume objects in viewport");
7403 RNA_def_property_update(prop, 0, "rna_Scene_simplify_volume_update");
7404
7405 prop = RNA_def_property(srna, "use_simplify_normals", PROP_BOOLEAN, PROP_NONE);
7406 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_SIMPLIFY_NORMALS);
7408 "Mesh Normals",
7409 "Skip computing custom normals and face corner normals for displaying "
7410 "meshes in the viewport");
7411 RNA_def_property_update(prop, 0, "rna_Scene_use_simplify_normals_update");
7412
7413 /* Grease Pencil - Simplify Options */
7414 prop = RNA_def_property(srna, "simplify_gpencil", PROP_BOOLEAN, PROP_NONE);
7415 RNA_def_property_boolean_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_ENABLE);
7416 RNA_def_property_ui_text(prop, "Simplify", "Simplify Grease Pencil drawing");
7417 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7418
7419 prop = RNA_def_property(srna, "simplify_gpencil_onplay", PROP_BOOLEAN, PROP_NONE);
7420 RNA_def_property_boolean_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_ON_PLAY);
7422 prop, "Playback Only", "Simplify Grease Pencil only during animation playback");
7423 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7424
7425 prop = RNA_def_property(srna, "simplify_gpencil_antialiasing", PROP_BOOLEAN, PROP_NONE);
7426 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_AA);
7427 RNA_def_property_ui_text(prop, "Antialiasing", "Use Antialiasing to smooth stroke edges");
7428 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7429
7430 prop = RNA_def_property(srna, "simplify_gpencil_view_fill", PROP_BOOLEAN, PROP_NONE);
7431 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_FILL);
7432 RNA_def_property_ui_text(prop, "Fill", "Display fill strokes in the viewport");
7433 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7434
7435 prop = RNA_def_property(srna, "simplify_gpencil_modifier", PROP_BOOLEAN, PROP_NONE);
7437 prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_MODIFIER);
7438 RNA_def_property_ui_text(prop, "Modifiers", "Display modifiers");
7439 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7440
7441 prop = RNA_def_property(srna, "simplify_gpencil_shader_fx", PROP_BOOLEAN, PROP_NONE);
7442 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_FX);
7443 RNA_def_property_ui_text(prop, "Shader Effects", "Display Shader Effects");
7444 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7445
7446 prop = RNA_def_property(srna, "simplify_gpencil_tint", PROP_BOOLEAN, PROP_NONE);
7447 RNA_def_property_boolean_negative_sdna(prop, nullptr, "simplify_gpencil", SIMPLIFY_GPENCIL_TINT);
7448 RNA_def_property_ui_text(prop, "Layers Tinting", "Display layer tint");
7449 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
7450
7451 /* persistent data */
7452 prop = RNA_def_property(srna, "use_persistent_data", PROP_BOOLEAN, PROP_NONE);
7453 RNA_def_property_boolean_sdna(prop, nullptr, "mode", R_PERSISTENT_DATA);
7455 "Persistent Data",
7456 "Keep render data around for faster re-renders and animation renders, "
7457 "at the cost of increased memory usage");
7458 RNA_def_property_update(prop, 0, "rna_Scene_use_persistent_data_update");
7459
7460 /* Freestyle line thickness options */
7461 prop = RNA_def_property(srna, "line_thickness_mode", PROP_ENUM, PROP_NONE);
7462 RNA_def_property_enum_sdna(prop, nullptr, "line_thickness_mode");
7463 RNA_def_property_enum_items(prop, freestyle_thickness_items);
7465 prop, "Line Thickness Mode", "Line thickness mode for Freestyle line drawing");
7466 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
7467
7468 prop = RNA_def_property(srna, "line_thickness", PROP_FLOAT, PROP_PIXEL);
7469 RNA_def_property_float_sdna(prop, nullptr, "unit_line_thickness");
7470 RNA_def_property_range(prop, 0.0f, 10000.0f);
7471 RNA_def_property_ui_text(prop, "Line Thickness", "Line thickness in pixels");
7472 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
7473
7474 /* Bake Settings */
7475 prop = RNA_def_property(srna, "bake", PROP_POINTER, PROP_NONE);
7477 RNA_def_property_pointer_sdna(prop, nullptr, "bake");
7478 RNA_def_property_struct_type(prop, "BakeSettings");
7479 RNA_def_property_ui_text(prop, "Bake Data", "");
7480
7481 /* Compositor. */
7482
7483 prop = RNA_def_property(srna, "compositor_device", PROP_ENUM, PROP_NONE);
7484 RNA_def_property_enum_items(prop, compositor_device_items);
7485 RNA_def_property_ui_text(prop, "Compositor Device", "Set how compositing is executed");
7486 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7487
7488 prop = RNA_def_property(srna, "compositor_precision", PROP_ENUM, PROP_NONE);
7489 RNA_def_property_enum_sdna(prop, nullptr, "compositor_precision");
7490 RNA_def_property_enum_items(prop, compositor_precision_items);
7492 prop, "Compositor Precision", "The precision of compositor intermediate result");
7493 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7494
7495 prop = RNA_def_property(srna, "use_new_cpu_compositor", PROP_BOOLEAN, PROP_NONE);
7496 RNA_def_property_boolean_negative_sdna(prop, nullptr, "use_old_cpu_compositor", 1);
7498 prop, "Use New CPU Compositor", "Use the new CPU compositor implementation");
7499 RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, "rna_Scene_compositor_update");
7500
7501 /* Nestled Data. */
7502 /* *** Non-Animated *** */
7504 rna_def_bake_data(brna);
7506
7507 /* *** Animated *** */
7508
7509 /* Scene API */
7511}
7512
7513/* scene.objects */
7515{
7516 StructRNA *srna;
7517
7518 RNA_def_property_srna(cprop, "SceneObjects");
7519 srna = RNA_def_struct(brna, "SceneObjects", nullptr);
7520 RNA_def_struct_sdna(srna, "Scene");
7521 RNA_def_struct_ui_text(srna, "Scene Objects", "All of the scene objects");
7522}
7523
7524/* scene.timeline_markers */
7526{
7527 StructRNA *srna;
7528
7529 FunctionRNA *func;
7530 PropertyRNA *parm;
7531
7532 RNA_def_property_srna(cprop, "TimelineMarkers");
7533 srna = RNA_def_struct(brna, "TimelineMarkers", nullptr);
7534 RNA_def_struct_sdna(srna, "Scene");
7535 RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
7536
7537 func = RNA_def_function(srna, "new", "rna_TimeLine_add");
7538 RNA_def_function_ui_description(func, "Add a keyframe to the curve");
7539 parm = RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
7541 parm = RNA_def_int(func,
7542 "frame",
7543 1,
7544 -MAXFRAME,
7545 MAXFRAME,
7546 "",
7547 "The frame for the new marker",
7548 -MAXFRAME,
7549 MAXFRAME);
7550 parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
7551 RNA_def_function_return(func, parm);
7552
7553 func = RNA_def_function(srna, "remove", "rna_TimeLine_remove");
7554 RNA_def_function_ui_description(func, "Remove a timeline marker");
7556 parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
7559
7560 func = RNA_def_function(srna, "clear", "rna_TimeLine_clear");
7561 RNA_def_function_ui_description(func, "Remove all timeline markers");
7562}
7563
7564/* scene.keying_sets */
7566{
7567 StructRNA *srna;
7568 PropertyRNA *prop;
7569
7570 FunctionRNA *func;
7571 PropertyRNA *parm;
7572
7573 RNA_def_property_srna(cprop, "KeyingSets");
7574 srna = RNA_def_struct(brna, "KeyingSets", nullptr);
7575 RNA_def_struct_sdna(srna, "Scene");
7576 RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
7577
7578 /* Add Keying Set */
7579 func = RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
7580 RNA_def_function_ui_description(func, "Add a new Keying Set to Scene");
7582 /* name */
7583 RNA_def_string(func, "idname", "KeyingSet", 64, "IDName", "Internal identifier of Keying Set");
7584 RNA_def_string(func, "name", "KeyingSet", 64, "Name", "User visible name of Keying Set");
7585 /* returns the new KeyingSet */
7586 parm = RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set");
7587 RNA_def_function_return(func, parm);
7588
7589 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
7590 RNA_def_property_struct_type(prop, "KeyingSet");
7593 "rna_Scene_active_keying_set_get",
7594 "rna_Scene_active_keying_set_set",
7595 nullptr,
7596 nullptr);
7598 prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
7600
7601 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
7602 RNA_def_property_int_sdna(prop, nullptr, "active_keyingset");
7604 "rna_Scene_active_keying_set_index_get",
7605 "rna_Scene_active_keying_set_index_set",
7606 nullptr);
7608 prop,
7609 "Active Keying Set Index",
7610 "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
7612}
7613
7615{
7616 StructRNA *srna;
7617 PropertyRNA *prop;
7618
7619 RNA_def_property_srna(cprop, "KeyingSetsAll");
7620 srna = RNA_def_struct(brna, "KeyingSetsAll", nullptr);
7621 RNA_def_struct_sdna(srna, "Scene");
7622 RNA_def_struct_path_func(srna, "rna_Scene_KeyingsSetsAll_path");
7623 RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets");
7624
7625 /* NOTE: no add/remove available here, without screwing up this amalgamated list... */
7626
7627 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
7628 RNA_def_property_struct_type(prop, "KeyingSet");
7631 "rna_Scene_active_keying_set_get",
7632 "rna_Scene_active_keying_set_set",
7633 nullptr,
7634 nullptr);
7636 prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
7638
7639 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
7640 RNA_def_property_int_sdna(prop, nullptr, "active_keyingset");
7642 "rna_Scene_active_keying_set_index_get",
7643 "rna_Scene_active_keying_set_index_set",
7644 nullptr);
7646 prop,
7647 "Active Keying Set Index",
7648 "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
7650}
7651
7652/* Runtime property, used to remember uv indices, used only in UV stitch for now.
7653 */
7655{
7656 StructRNA *srna;
7657 PropertyRNA *prop;
7658
7659 srna = RNA_def_struct(brna, "SelectedUvElement", "PropertyGroup");
7660 RNA_def_struct_ui_text(srna, "Selected UV Element", "");
7661
7662 /* store the index to the UV element selected */
7663 prop = RNA_def_property(srna, "element_index", PROP_INT, PROP_UNSIGNED);
7665 RNA_def_property_ui_text(prop, "Element Index", "");
7666
7667 prop = RNA_def_property(srna, "face_index", PROP_INT, PROP_UNSIGNED);
7669 RNA_def_property_ui_text(prop, "Face Index", "");
7670}
7671
7673{
7674 StructRNA *srna;
7675 PropertyRNA *prop;
7676
7677 srna = RNA_def_struct(brna, "DisplaySafeAreas", nullptr);
7678 RNA_def_struct_ui_text(srna, "Safe Areas", "Safe areas used in 3D view and the sequencer");
7679 RNA_def_struct_sdna(srna, "DisplaySafeAreas");
7680
7681 /* SAFE AREAS */
7682 prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_XYZ);
7683 RNA_def_property_float_sdna(prop, nullptr, "title");
7684 RNA_def_property_array(prop, 2);
7685 RNA_def_property_range(prop, 0.0f, 1.0f);
7686 RNA_def_property_ui_text(prop, "Title Safe Margins", "Safe area for text and graphics");
7688
7689 prop = RNA_def_property(srna, "action", PROP_FLOAT, PROP_XYZ);
7690 RNA_def_property_float_sdna(prop, nullptr, "action");
7691 RNA_def_property_array(prop, 2);
7692 RNA_def_property_range(prop, 0.0f, 1.0f);
7693 RNA_def_property_ui_text(prop, "Action Safe Margins", "Safe area for general elements");
7695
7696 prop = RNA_def_property(srna, "title_center", PROP_FLOAT, PROP_XYZ);
7697 RNA_def_property_float_sdna(prop, nullptr, "title_center");
7698 RNA_def_property_array(prop, 2);
7699 RNA_def_property_range(prop, 0.0f, 1.0f);
7701 "Center Title Safe Margins",
7702 "Safe area for text and graphics in a different aspect ratio");
7704
7705 prop = RNA_def_property(srna, "action_center", PROP_FLOAT, PROP_XYZ);
7706 RNA_def_property_float_sdna(prop, nullptr, "action_center");
7707 RNA_def_property_array(prop, 2);
7708 RNA_def_property_range(prop, 0.0f, 1.0f);
7710 "Center Action Safe Margins",
7711 "Safe area for general elements in a different aspect ratio");
7713}
7714
7716{
7717 StructRNA *srna;
7718 PropertyRNA *prop;
7719
7720 srna = RNA_def_struct(brna, "SceneDisplay", nullptr);
7721 RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
7722 RNA_def_struct_sdna(srna, "SceneDisplay");
7723
7724 prop = RNA_def_property(srna, "light_direction", PROP_FLOAT, PROP_DIRECTION);
7725 RNA_def_property_float_sdna(prop, nullptr, "light_direction");
7727 RNA_def_property_array(prop, 3);
7729 prop, "Light Direction", "Direction of the light for shadows and highlights");
7730 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7731
7732 prop = RNA_def_property(srna, "shadow_shift", PROP_FLOAT, PROP_ANGLE);
7733 RNA_def_property_ui_text(prop, "Shadow Shift", "Shadow termination angle");
7734 RNA_def_property_range(prop, 0.0f, 1.0f);
7735 RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 2);
7737 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7738
7739 prop = RNA_def_property(srna, "shadow_focus", PROP_FLOAT, PROP_FACTOR);
7741 RNA_def_property_ui_text(prop, "Shadow Focus", "Shadow factor hardness");
7742 RNA_def_property_range(prop, 0.0f, 1.0f);
7743 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
7745 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
7746
7747 prop = RNA_def_property(srna, "matcap_ssao_distance", PROP_FLOAT, PROP_DISTANCE);
7749 prop, "Distance", "Distance of object that contribute to the Cavity/Edge effect");
7750 RNA_def_property_range(prop, 0.0f, 100000.0f);
7751 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
7752
7753 prop = RNA_def_property(srna, "matcap_ssao_attenuation", PROP_FLOAT, PROP_NONE);
7754 RNA_def_property_ui_text(prop, "Attenuation", "Attenuation constant");
7755 RNA_def_property_range(prop, 1.0f, 100000.0f);
7756 RNA_def_property_ui_range(prop, 1.0f, 100.0f, 1, 3);
7757
7758 prop = RNA_def_property(srna, "matcap_ssao_samples", PROP_INT, PROP_NONE);
7759 RNA_def_property_ui_text(prop, "Samples", "Number of samples");
7760 RNA_def_property_range(prop, 1, 500);
7761
7762 prop = RNA_def_property(srna, "render_aa", PROP_ENUM, PROP_NONE);
7765 prop, "Render Anti-Aliasing", "Method of anti-aliasing when rendering final image");
7767
7768 prop = RNA_def_property(srna, "viewport_aa", PROP_ENUM, PROP_NONE);
7771 prop, "Viewport Anti-Aliasing", "Method of anti-aliasing when rendering 3d viewport");
7773
7774 /* OpenGL render engine settings. */
7775 prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
7776 RNA_def_property_ui_text(prop, "Shading Settings", "Shading settings for OpenGL render engine");
7777}
7778
7780{
7781 StructRNA *srna;
7782 PropertyRNA *prop;
7783
7784 srna = RNA_def_struct(brna, "RaytraceEEVEE", nullptr);
7785 RNA_def_struct_path_func(srna, "rna_RaytraceEEVEE_path");
7787 srna, "EEVEE Raytrace Options", "Quality options for the raytracing pipeline");
7788
7789 prop = RNA_def_property(srna, "resolution_scale", PROP_ENUM, PROP_NONE);
7792 "Resolution",
7793 "Determines the number of rays per pixel. "
7794 "Higher resolution uses more memory.");
7797
7798 prop = RNA_def_property(srna, "use_denoise", PROP_BOOLEAN, PROP_NONE);
7801 prop, "Denoise", "Enable noise reduction techniques for raytraced effects");
7804
7805 prop = RNA_def_property(srna, "denoise_spatial", PROP_BOOLEAN, PROP_NONE);
7806 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_SPATIAL);
7807 RNA_def_property_ui_text(prop, "Spatial Reuse", "Reuse neighbor pixels' rays");
7810
7811 prop = RNA_def_property(srna, "denoise_temporal", PROP_BOOLEAN, PROP_NONE);
7812 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_TEMPORAL);
7814 prop, "Temporal Accumulation", "Accumulate samples by reprojecting last tracing results");
7817
7818 prop = RNA_def_property(srna, "denoise_bilateral", PROP_BOOLEAN, PROP_NONE);
7819 RNA_def_property_boolean_sdna(prop, nullptr, "denoise_stages", RAYTRACE_EEVEE_DENOISE_BILATERAL);
7821 prop, "Bilateral Filter", "Blur the resolved radiance using a bilateral filter");
7824
7825 prop = RNA_def_property(srna, "screen_trace_thickness", PROP_FLOAT, PROP_DISTANCE);
7827 prop,
7828 "Screen-Trace Thickness",
7829 "Surface thickness used to detect intersection when using screen-tracing");
7830 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
7831 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3);
7834
7835 prop = RNA_def_property(srna, "trace_max_roughness", PROP_FLOAT, PROP_FACTOR);
7837 "Raytrace Max Roughness",
7838 "Maximum roughness to use the tracing pipeline for. Higher "
7839 "roughness surfaces will use fast GI approximation. A value of 1 will "
7840 "disable fast GI approximation.");
7841 RNA_def_property_range(prop, 0.0f, 1.0f);
7844
7845 prop = RNA_def_property(srna, "screen_trace_quality", PROP_FLOAT, PROP_FACTOR);
7847 prop, "Screen-Trace Precision", "Precision of the screen space ray-tracing");
7848 RNA_def_property_range(prop, 0.0f, 1.0f);
7851}
7852
7854{
7855 StructRNA *srna;
7856 PropertyRNA *prop;
7857
7858 static const EnumPropertyItem eevee_shadow_size_items[] = {
7859 {128, "128", 0, "128 px", ""},
7860 {256, "256", 0, "256 px", ""},
7861 {512, "512", 0, "512 px", ""},
7862 {1024, "1024", 0, "1024 px", ""},
7863 {2048, "2048", 0, "2048 px", ""},
7864 {4096, "4096", 0, "4096 px", ""},
7865 {0, nullptr, 0, nullptr, nullptr},
7866 };
7867
7868 static const EnumPropertyItem eevee_pool_size_items[] = {
7869 {16, "16", 0, "16 MB", ""},
7870 {32, "32", 0, "32 MB", ""},
7871 {64, "64", 0, "64 MB", ""},
7872 {128, "128", 0, "128 MB", ""},
7873 {256, "256", 0, "256 MB", ""},
7874 {512, "512", 0, "512 MB", ""},
7875 {1024, "1024", 0, "1 GB", ""},
7876 {0, nullptr, 0, nullptr, nullptr},
7877 };
7878
7879 static const EnumPropertyItem eevee_gi_visibility_size_items[] = {
7880 {8, "8", 0, "8 px", ""},
7881 {16, "16", 0, "16 px", ""},
7882 {32, "32", 0, "32 px", ""},
7883 {64, "64", 0, "64 px", ""},
7884 {0, nullptr, 0, nullptr, nullptr},
7885 };
7886
7887 static const EnumPropertyItem ray_tracing_method_items[] = {
7889 "PROBE",
7890 0,
7891 "Light Probe",
7892 "Use light probes to find scene intersection"},
7894 "SCREEN",
7895 0,
7896 "Screen-Trace",
7897 "Raytrace against the depth buffer. Fallback to light probes for invalid rays."},
7898 {0, nullptr, 0, nullptr, nullptr},
7899 };
7900
7901 static const EnumPropertyItem fast_gi_method_items[] = {
7903 "AMBIENT_OCCLUSION_ONLY",
7904 0,
7905 "Ambient Occlusion",
7906 "Use ambient occlusion instead of full global illumination"},
7907 {FAST_GI_FULL,
7908 "GLOBAL_ILLUMINATION",
7909 0,
7910 "Global Illumination",
7911 "Compute global illumination taking into account light bouncing off surrounding objects"},
7912 {0, nullptr, 0, nullptr, nullptr},
7913 };
7914
7915 srna = RNA_def_struct(brna, "SceneEEVEE", nullptr);
7916 RNA_def_struct_path_func(srna, "rna_SceneEEVEE_path");
7917 RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3D viewport");
7918
7919 /* Indirect Lighting */
7920 prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE);
7922 "Diffuse Bounces",
7923 "Number of times the light is reinjected inside light grids, "
7924 "0 disable indirect diffuse light");
7925 RNA_def_property_range(prop, 0, INT_MAX);
7927
7928 prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
7929 RNA_def_property_enum_items(prop, eevee_shadow_size_items);
7930 RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
7932 RNA_def_property_update(prop, 0, "rna_SceneEEVEE_gi_cubemap_resolution_update");
7933
7934 prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE);
7935 RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items);
7937 "Irradiance Visibility Size",
7938 "Size of the shadow map applied to each irradiance sample");
7940
7941 prop = RNA_def_property(srna, "gi_glossy_clamp", PROP_FLOAT, PROP_NONE);
7943 "Clamp Glossy",
7944 "Clamp pixel intensity to reduce noise inside glossy reflections "
7945 "from reflection cubemaps (0 to disable)");
7946 RNA_def_property_range(prop, 0.0f, FLT_MAX);
7948
7949 prop = RNA_def_property(srna, "gi_irradiance_pool_size", PROP_ENUM, PROP_NONE);
7950 RNA_def_property_enum_items(prop, eevee_pool_size_items);
7952 "Irradiance Pool Size",
7953 "Size of the irradiance pool, "
7954 "a bigger pool size allows for more irradiance grid in the scene "
7955 "but might not fit into GPU memory and decrease performance");
7958
7959 /* Temporal Anti-Aliasing (super sampling) */
7960 prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
7961 RNA_def_property_ui_text(prop, "Viewport Samples", "Number of samples, unlimited if 0");
7962 RNA_def_property_range(prop, 0, INT_MAX);
7966
7967 prop = RNA_def_property(srna, "taa_render_samples", PROP_INT, PROP_NONE);
7968 RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixel for rendering");
7969 RNA_def_property_range(prop, 1, INT_MAX);
7973
7974 prop = RNA_def_property(srna, "use_taa_reprojection", PROP_BOOLEAN, PROP_NONE);
7977 "Viewport Denoising",
7978 "Denoise image using temporal reprojection "
7979 "(can leave some ghosting)");
7983
7984 prop = RNA_def_property(srna, "ray_tracing_method", PROP_ENUM, PROP_NONE);
7985 RNA_def_property_enum_items(prop, ray_tracing_method_items);
7987 prop, "Tracing Method", "Select the tracing method used to find scene-ray intersections");
7989
7990 prop = RNA_def_property(srna, "use_shadow_jitter_viewport", PROP_BOOLEAN, PROP_NONE);
7993 "Jittered Shadows (Viewport)",
7994 "Enable jittered shadows on the viewport. (Jittered shadows are always "
7995 "enabled for final renders).");
7997
7998 /* Clamping */
7999 prop = RNA_def_property(srna, "clamp_surface_direct", PROP_FLOAT, PROP_NONE);
8001 "Clamp Surface Direct",
8002 "If non-zero, the maximum value for lights contribution on a surface. "
8003 "Higher values will be scaled down to avoid too "
8004 "much noise and slow convergence at the cost of accuracy. "
8005 "Used by light objects.");
8006 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8009
8010 prop = RNA_def_property(srna, "clamp_surface_indirect", PROP_FLOAT, PROP_NONE);
8012 "Clamp Surface Indirect",
8013 "If non-zero, the maximum value for indirect lighting on surface. "
8014 "Higher values will be scaled down to avoid too "
8015 "much noise and slow convergence at the cost of accuracy. "
8016 "Used by ray-tracing and light-probes.");
8017 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8020 prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneEEVEE_clamp_surface_indirect_update");
8021
8022 prop = RNA_def_property(srna, "clamp_volume_direct", PROP_FLOAT, PROP_NONE);
8024 "Clamp Volume Direct",
8025 "If non-zero, the maximum value for lights contribution in volumes. "
8026 "Higher values will be scaled down to avoid too "
8027 "much noise and slow convergence at the cost of accuracy. "
8028 "Used by light objects.");
8029 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8032
8033 prop = RNA_def_property(srna, "clamp_volume_indirect", PROP_FLOAT, PROP_NONE);
8035 "Clamp Volume Indirect",
8036 "If non-zero, the maximum value for indirect lighting in volumes. "
8037 "Higher values will be scaled down to avoid too "
8038 "much noise and slow convergence at the cost of accuracy. "
8039 "Used by light-probes.");
8040 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8043
8044 /* Volumetrics */
8045 prop = RNA_def_property(srna, "volumetric_start", PROP_FLOAT, PROP_DISTANCE);
8046 RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect");
8047 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8048 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
8051
8052 prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE);
8053 RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect");
8054 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8055 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
8058
8059 prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE);
8062 "Resolution",
8063 "Control the quality of the volumetric effects. "
8064 "Higher resolution uses more memory.");
8067
8068 prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE);
8070 "Steps",
8071 "Number of steps to compute volumetric effects. "
8072 "Higher step count increase VRAM usage and quality.");
8073 RNA_def_property_range(prop, 1, 256);
8076
8077 prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR);
8079 prop, "Exponential Sampling", "Distribute more samples closer to the camera");
8082
8083 prop = RNA_def_property(srna, "volumetric_ray_depth", PROP_INT, PROP_NONE);
8085 "Volume Max Ray Depth",
8086 "Maximum surface intersection count used by the accurate volume "
8087 "intersection method. Will create artifact if it is exceeded. "
8088 "Higher count increases VRAM usage.");
8089 RNA_def_property_range(prop, 1, 16);
8092
8093 prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE);
8094 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8095 RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise");
8098
8099 prop = RNA_def_property(srna, "use_volumetric_shadows", PROP_BOOLEAN, PROP_NONE);
8102 prop,
8103 "Volumetric Shadows",
8104 "Cast shadows from volumetric materials onto volumetric materials (Very expensive)");
8107
8108 prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE);
8109 RNA_def_property_range(prop, 1, 128);
8111 prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing");
8114
8115 prop = RNA_def_property(srna, "use_volume_custom_range", PROP_BOOLEAN, PROP_NONE);
8118 "Volume Custom Range",
8119 "Enable custom start and end clip distances for volume computation");
8121
8122 /* Ambient Occlusion */
8123 prop = RNA_def_property(srna, "use_gtao", PROP_BOOLEAN, PROP_NONE);
8126 "Ambient Occlusion",
8127 "Enable ambient occlusion to simulate medium scale indirect shadowing");
8130
8131 /* TODO: remove this, kept for EEVEE 4.2 compatibility,
8132 * this is a duplicate of "fast_gi_quality"). */
8133 prop = RNA_def_property(srna, "gtao_quality", PROP_FLOAT, PROP_FACTOR);
8134 RNA_def_property_float_sdna(prop, nullptr, "fast_gi_quality");
8135 RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the horizon search");
8136 RNA_def_property_range(prop, 0.0f, 1.0f);
8139
8140 prop = RNA_def_property(srna, "gtao_distance", PROP_FLOAT, PROP_DISTANCE);
8142 prop, "Distance", "Distance of object that contribute to the ambient occlusion effect");
8143 RNA_def_property_range(prop, 0.0f, 100000.0f);
8144 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
8147
8148 /* Fast GI approximation */
8149
8150 prop = RNA_def_property(srna, "use_fast_gi", PROP_BOOLEAN, PROP_NONE);
8153 "Fast GI Approximation",
8154 "Use faster global illumination technique for high roughness surfaces");
8157
8158 prop = RNA_def_property(srna, "fast_gi_thickness_near", PROP_FLOAT, PROP_DISTANCE);
8160 prop,
8161 "Near Thickness",
8162 "Geometric thickness of the surfaces when computing fast GI and ambient occlusion. "
8163 "Reduces light leaking and missing contact occlusion.");
8164 RNA_def_property_range(prop, 0.0f, 100000.0f);
8165 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1.0f, 3);
8168
8169 prop = RNA_def_property(srna, "fast_gi_thickness_far", PROP_FLOAT, PROP_ANGLE);
8171 prop,
8172 "Far Thickness",
8173 "Angular thickness of the surfaces when computing fast GI and ambient occlusion. "
8174 "Reduces energy loss and missing occlusion of far geometry.");
8175 RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f));
8176 RNA_def_property_ui_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f), 10.0f, 3);
8179
8180 prop = RNA_def_property(srna, "fast_gi_quality", PROP_FLOAT, PROP_FACTOR);
8181 RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the fast GI ray marching");
8182 RNA_def_property_range(prop, 0.0f, 1.0f);
8185
8186 prop = RNA_def_property(srna, "fast_gi_step_count", PROP_INT, PROP_UNSIGNED);
8187 RNA_def_property_range(prop, 1, 64);
8188 RNA_def_property_ui_text(prop, "Step Count", "Amount of screen sample per GI ray");
8191
8192 prop = RNA_def_property(srna, "fast_gi_ray_count", PROP_INT, PROP_UNSIGNED);
8193 RNA_def_property_range(prop, 1, 16);
8194 RNA_def_property_ui_text(prop, "Ray Count", "Amount of GI ray to trace for each pixel");
8197
8198 prop = RNA_def_property(srna, "fast_gi_method", PROP_ENUM, PROP_NONE);
8199 RNA_def_property_enum_items(prop, fast_gi_method_items);
8200 RNA_def_property_ui_text(prop, "Method", "Fast GI approximation method");
8202
8203 prop = RNA_def_property(srna, "fast_gi_distance", PROP_FLOAT, PROP_DISTANCE);
8204 RNA_def_property_range(prop, 0.0f, 100000.0f);
8205 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
8207 "Distance",
8208 "If non-zero, the maximum distance at which other surfaces will "
8209 "contribute to the fast GI approximation");
8211
8212 prop = RNA_def_property(srna, "fast_gi_bias", PROP_FLOAT, PROP_FACTOR);
8213 RNA_def_property_float_sdna(prop, nullptr, "gtao_focus");
8215 prop, "Bias", "Bias the shading normal to reduce self intersection artifacts");
8216 RNA_def_property_range(prop, 0.0f, 1.0f);
8217 RNA_def_property_ui_range(prop, 0.0f, 0.5f, 1.0f, 2);
8220
8221 prop = RNA_def_property(srna, "fast_gi_resolution", PROP_ENUM, PROP_NONE);
8222 RNA_def_property_enum_sdna(prop, nullptr, "gtao_resolution");
8225 "Resolution",
8226 "Control the quality of the fast GI lighting. "
8227 "Higher resolution uses more memory.");
8230
8231 /* Depth of Field */
8232
8233 prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_PIXEL);
8235 prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)");
8236 RNA_def_property_range(prop, 0.0f, 2000.0f);
8237 RNA_def_property_ui_range(prop, 0.0f, 200.0f, 100.0f, 1);
8239
8240 prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR);
8242 prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field");
8243 RNA_def_property_range(prop, 0.0f, 100000.0f);
8244 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 2);
8247
8248 prop = RNA_def_property(srna, "bokeh_neighbor_max", PROP_FLOAT, PROP_FACTOR);
8250 "Neighbor Rejection",
8251 "Maximum brightness to consider when rejecting bokeh sprites "
8252 "based on neighborhood (lower is faster)");
8253 RNA_def_property_range(prop, 0.0f, 100000.0f);
8254 RNA_def_property_ui_range(prop, 0.0f, 40.0f, 10, 2);
8257
8258 prop = RNA_def_property(srna, "use_bokeh_jittered", PROP_BOOLEAN, PROP_NONE);
8261 "Jitter Camera",
8262 "Jitter camera position to create accurate blurring "
8263 "using render samples (only for final render)");
8266
8267 prop = RNA_def_property(srna, "bokeh_overblur", PROP_FLOAT, PROP_PERCENTAGE);
8269 "Over-blur",
8270 "Apply blur to each jittered sample to reduce "
8271 "under-sampling artifacts");
8272 RNA_def_property_range(prop, 0, 100);
8273 RNA_def_property_ui_range(prop, 0.0f, 20.0f, 1, 1);
8275
8276 /* Motion blur */
8277 prop = RNA_def_property(srna, "motion_blur_depth_scale", PROP_FLOAT, PROP_NONE);
8279 "Bleeding Bias",
8280 "Lower values will reduce background"
8281 " bleeding onto foreground elements");
8282 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8283 RNA_def_property_ui_range(prop, 0.01f, 1000.0f, 1, 2);
8286
8287 prop = RNA_def_property(srna, "motion_blur_max", PROP_INT, PROP_PIXEL);
8288 RNA_def_property_ui_text(prop, "Max Blur", "Maximum blur distance a pixel can spread over");
8289 RNA_def_property_range(prop, 0, 2048);
8290 RNA_def_property_ui_range(prop, 0, 512, 1, -1);
8293
8294 prop = RNA_def_property(srna, "motion_blur_steps", PROP_INT, PROP_NONE);
8296 "Motion steps",
8297 "Controls accuracy of motion blur, "
8298 "more steps means longer render time");
8299 RNA_def_property_range(prop, 1, INT_MAX);
8300 RNA_def_property_ui_range(prop, 1, 64, 1, -1);
8303
8304 /* Shadows */
8305 prop = RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
8307 RNA_def_property_ui_text(prop, "Shadows", "Enable shadow casting from lights");
8310
8311 prop = RNA_def_property(srna, "shadow_pool_size", PROP_ENUM, PROP_NONE);
8312 RNA_def_property_enum_items(prop, eevee_pool_size_items);
8314 "Shadow Pool Size",
8315 "Size of the shadow pool, "
8316 "a bigger pool size allows for more shadows in the scene "
8317 "but might not fit into GPU memory");
8320
8321 prop = RNA_def_property(srna, "shadow_ray_count", PROP_INT, PROP_UNSIGNED);
8322 RNA_def_property_range(prop, 1, 4);
8324 prop, "Shadow Ray Count", "Amount of shadow ray to trace for each light");
8327
8328 prop = RNA_def_property(srna, "shadow_step_count", PROP_INT, PROP_UNSIGNED);
8329 RNA_def_property_range(prop, 1, 16);
8331 prop, "Shadow Step Count", "Amount of shadow map sample per shadow ray");
8334
8335 prop = RNA_def_property(srna, "light_threshold", PROP_FLOAT, PROP_UNSIGNED);
8337 "Light Threshold",
8338 "Minimum light intensity for a light to contribute to the lighting");
8339 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8340 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
8343
8344 /* Overscan */
8345 prop = RNA_def_property(srna, "use_overscan", PROP_BOOLEAN, PROP_NONE);
8346 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_EEVEE_OVERSCAN);
8348 "Overscan",
8349 "Internally render past the image border to avoid "
8350 "screen-space effects disappearing");
8352
8353 prop = RNA_def_property(srna, "overscan_size", PROP_FLOAT, PROP_PERCENTAGE);
8354 RNA_def_property_float_sdna(prop, nullptr, "overscan");
8356 "Overscan Size",
8357 "Percentage of render size to add as overscan to the "
8358 "internal render buffers");
8359 RNA_def_property_range(prop, 0.0f, 50.0f);
8360 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 2);
8362
8363 prop = RNA_def_property(srna, "ray_tracing_options", PROP_POINTER, PROP_NONE);
8364 RNA_def_property_struct_type(prop, "RaytraceEEVEE");
8366 prop, "Reflection Trace Options", "EEVEE settings for tracing reflections");
8367
8368 prop = RNA_def_property(srna, "use_raytracing", PROP_BOOLEAN, PROP_NONE);
8369 /* Reuse the same property as legacy EEVEE for compatibility. */
8371 RNA_def_property_ui_text(prop, "Use Ray-Tracing", "Enable the ray-tracing module");
8374
8375 prop = RNA_def_property(srna, "shadow_resolution_scale", PROP_FLOAT, PROP_FACTOR);
8376 RNA_def_property_range(prop, 0.0f, 1.0f);
8378 prop, "Shadows Resolution Scale", "Resolution percentage of shadow maps");
8380 RNA_def_property_update(prop, 0, "rna_SceneEEVEE_shadow_resolution_update");
8381}
8382
8384{
8385 StructRNA *srna;
8386 PropertyRNA *prop;
8387
8388 srna = RNA_def_struct(brna, "SceneGpencil", nullptr);
8389 RNA_def_struct_path_func(srna, "rna_SceneGpencil_path");
8390 RNA_def_struct_ui_text(srna, "Grease Pencil Render", "Render settings");
8391
8392 prop = RNA_def_property(srna, "antialias_threshold", PROP_FLOAT, PROP_NONE);
8393 RNA_def_property_float_sdna(prop, nullptr, "smaa_threshold");
8395 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8396 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
8398 "Anti-Aliasing Threshold",
8399 "Threshold for edge detection algorithm (higher values might over-blur "
8400 "some part of the image)");
8403}
8404
8406{
8407 StructRNA *srna;
8408 PropertyRNA *prop;
8409
8410 static const EnumPropertyItem hydra_export_method_items[] = {
8412 "HYDRA",
8413 0,
8414 "Hydra",
8415 "Fast interactive editing through native Hydra integration"},
8417 "USD",
8418 0,
8419 "USD",
8420 "Export scene through USD file, for accurate comparison with USD file export"},
8421 {0, nullptr, 0, nullptr, nullptr},
8422 };
8423
8424 srna = RNA_def_struct(brna, "SceneHydra", nullptr);
8425 RNA_def_struct_path_func(srna, "rna_SceneHydra_path");
8426 RNA_def_struct_ui_text(srna, "Scene Hydra", "Scene Hydra render engine settings");
8427
8428 prop = RNA_def_property(srna, "export_method", PROP_ENUM, PROP_NONE);
8429 RNA_def_property_enum_items(prop, hydra_export_method_items);
8431 prop, "Export Method", "How to export the Blender scene to the Hydra render engine");
8433}
8434
8436{
8437 StructRNA *srna;
8438 PropertyRNA *prop;
8439
8440 FunctionRNA *func;
8441 PropertyRNA *parm;
8442
8443 static const EnumPropertyItem audio_distance_model_items[] = {
8444 {0, "NONE", 0, "None", "No distance attenuation"},
8445 {1, "INVERSE", 0, "Inverse", "Inverse distance model"},
8446 {2, "INVERSE_CLAMPED", 0, "Inverse Clamped", "Inverse distance model with clamping"},
8447 {3, "LINEAR", 0, "Linear", "Linear distance model"},
8448 {4, "LINEAR_CLAMPED", 0, "Linear Clamped", "Linear distance model with clamping"},
8449 {5, "EXPONENT", 0, "Exponential", "Exponential distance model"},
8450 {6,
8451 "EXPONENT_CLAMPED",
8452 0,
8453 "Exponential Clamped",
8454 "Exponential distance model with clamping"},
8455 {0, nullptr, 0, nullptr, nullptr},
8456 };
8457
8458 static const EnumPropertyItem sync_mode_items[] = {
8459 {0, "NONE", 0, "Play Every Frame", "Do not sync, play every frame"},
8460 {SCE_FRAME_DROP, "FRAME_DROP", 0, "Frame Dropping", "Drop frames if playback is too slow"},
8461 {AUDIO_SYNC, "AUDIO_SYNC", 0, "Sync to Audio", "Sync to audio playback, dropping frames"},
8462 {0, nullptr, 0, nullptr, nullptr},
8463 };
8464
8465 /* Struct definition */
8466 srna = RNA_def_struct(brna, "Scene", "ID");
8468 "Scene",
8469 "Scene data-block, consisting in objects and "
8470 "defining time and render related settings");
8471 RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
8473
8474 /* Global Settings */
8475 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
8478 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Camera_object_poll");
8479 RNA_def_property_ui_text(prop, "Camera", "Active camera, used for rendering the scene");
8480 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_camera_update");
8481
8482 prop = RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
8483 RNA_def_property_pointer_sdna(prop, nullptr, "set");
8484 RNA_def_property_struct_type(prop, "Scene");
8487 RNA_def_property_pointer_funcs(prop, nullptr, "rna_Scene_set_set", nullptr, nullptr);
8488 RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
8489 RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_set_update");
8490
8491 prop = RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
8494 RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
8496 RNA_def_property_update(prop, NC_SCENE | ND_WORLD, "rna_Scene_world_update");
8497
8498 prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
8499 RNA_def_property_struct_type(prop, "Object");
8500 RNA_def_property_ui_text(prop, "Objects", "");
8502 "rna_Scene_objects_begin",
8503 "rna_Scene_objects_next",
8504 "rna_Scene_objects_end",
8505 "rna_Scene_objects_get",
8506 nullptr,
8507 nullptr,
8508 nullptr,
8509 nullptr);
8510 rna_def_scene_objects(brna, prop);
8511
8512 /* Frame Range Stuff */
8513 prop = RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
8515 RNA_def_property_int_sdna(prop, nullptr, "r.cfra");
8517 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_frame_current_set", nullptr);
8519 prop,
8520 "Current Frame",
8521 "Current frame, to update animation data from Python frame_set() instead");
8522 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
8523
8524 prop = RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME);
8525 RNA_def_property_float_sdna(prop, nullptr, "r.subframe");
8526 RNA_def_property_ui_text(prop, "Current Subframe", "");
8528 RNA_def_property_range(prop, 0.0f, 1.0f);
8529 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2);
8530 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
8531
8532 prop = RNA_def_property(srna, "frame_float", PROP_FLOAT, PROP_TIME);
8533 RNA_def_property_ui_text(prop, "Current Subframe", "");
8538 prop, "rna_Scene_frame_float_get", "rna_Scene_frame_float_set", nullptr);
8539 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update");
8540
8541 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
8543 RNA_def_property_int_sdna(prop, nullptr, "r.sfra");
8544 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_start_frame_set", nullptr);
8546 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range");
8548
8549 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
8551 RNA_def_property_int_sdna(prop, nullptr, "r.efra");
8552 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_end_frame_set", nullptr);
8554 RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range");
8556
8557 prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
8559 RNA_def_property_int_sdna(prop, nullptr, "r.frame_step");
8561 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
8563 prop,
8564 "Frame Step",
8565 "Number of frames to skip forward while rendering/playing back each frame");
8566 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8567
8568 prop = RNA_def_property(srna, "frame_current_final", PROP_FLOAT, PROP_TIME);
8571 RNA_def_property_float_funcs(prop, "rna_Scene_frame_current_final_get", nullptr, nullptr);
8573 prop, "Current Frame Final", "Current frame with subframe and time remapping applied");
8574
8575 prop = RNA_def_property(srna, "lock_frame_selection_to_range", PROP_BOOLEAN, PROP_NONE);
8579 "Lock Frame Selection",
8580 "Don't allow frame to be selected with mouse outside of frame range");
8581 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8582
8583 /* Preview Range (frame-range for UI playback) */
8584 prop = RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE);
8586 RNA_def_property_boolean_sdna(prop, nullptr, "r.flag", SCER_PRV_RANGE);
8587 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Scene_use_preview_range_set");
8589 prop,
8590 "Use Preview Range",
8591 "Use an alternative start/end frame range for animation playback and view renders");
8592 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8593 RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
8594
8595 prop = RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME);
8597 RNA_def_property_int_sdna(prop, nullptr, "r.psfra");
8598 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_preview_range_start_frame_set", nullptr);
8600 prop, "Preview Range Start Frame", "Alternative start frame for UI playback");
8601 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8602
8603 prop = RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME);
8605 RNA_def_property_int_sdna(prop, nullptr, "r.pefra");
8606 RNA_def_property_int_funcs(prop, nullptr, "rna_Scene_preview_range_end_frame_set", nullptr);
8608 prop, "Preview Range End Frame", "Alternative end frame for UI playback");
8609 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8610
8611 /* Sub-frame for motion-blur debug. */
8612 prop = RNA_def_property(srna, "show_subframe", PROP_BOOLEAN, PROP_NONE);
8614 RNA_def_property_boolean_sdna(prop, nullptr, "r.flag", SCER_SHOW_SUBFRAME);
8616 prop, "Show Subframe", "Show current scene subframe and allow set it using interface tools");
8617 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_show_subframe_update");
8618
8619 /* Timeline / Time Navigation settings */
8620 prop = RNA_def_property(srna, "show_keys_from_selected_only", PROP_BOOLEAN, PROP_NONE);
8623 prop, "Only Show Selected", "Only include channels relating to selected objects and data");
8624 RNA_def_property_update(prop, NC_SCENE | ND_FRAME, nullptr);
8625
8626 /* Stamp */
8627 prop = RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
8628 RNA_def_property_string_sdna(prop, nullptr, "r.stamp_udata");
8629 RNA_def_property_ui_text(prop, "Stamp Note", "User defined note for the render stamping");
8631
8632 /* Animation Data (for Scene) */
8634
8635 /* Readonly Properties */
8636 prop = RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
8637 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_NLA_EDIT_ON);
8639 PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
8641 prop,
8642 "NLA Tweak Mode",
8643 "Whether there is any action referenced by NLA being edited (strictly read-only)");
8645
8646 /* Frame dropping flag for playback and sync enum */
8647# if 0 /* XXX: Is this actually needed? */
8648 prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE);
8649 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SCE_FRAME_DROP);
8651 prop, "Frame Dropping", "Play back dropping frames if frame display is too slow");
8652 RNA_def_property_update(prop, NC_SCENE, nullptr);
8653# endif
8654
8655 prop = RNA_def_property(srna, "use_custom_simulation_range", PROP_BOOLEAN, PROP_NONE);
8658 "Custom Simulation Range",
8659 "Use a simulation range that is different from the scene range for "
8660 "simulation nodes that don't override the frame range themselves");
8662 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
8663
8664 prop = RNA_def_property(srna, "simulation_frame_start", PROP_INT, PROP_NONE);
8665 RNA_def_property_ui_text(prop, "Simulation Frame Start", "Frame at which simulations start");
8667 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
8668
8669 prop = RNA_def_property(srna, "simulation_frame_end", PROP_INT, PROP_NONE);
8670 RNA_def_property_ui_text(prop, "Simulation Frame End", "Frame at which simulations end");
8672 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_set_update");
8673
8674 prop = RNA_def_property(srna, "sync_mode", PROP_ENUM, PROP_NONE);
8675 RNA_def_property_enum_funcs(prop, "rna_Scene_sync_mode_get", "rna_Scene_sync_mode_set", nullptr);
8676 RNA_def_property_enum_items(prop, sync_mode_items);
8678 RNA_def_property_ui_text(prop, "Sync Mode", "How to sync playback");
8679 RNA_def_property_update(prop, NC_SCENE, nullptr);
8680
8681 /* Nodes (Compositing) */
8682 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
8683 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
8686 RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree");
8687
8688 prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
8689 RNA_def_property_boolean_sdna(prop, nullptr, "use_nodes", 1);
8691 RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree");
8692 RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_nodes_update");
8693
8694 /* Sequencer */
8695 prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
8696 RNA_def_property_pointer_sdna(prop, nullptr, "ed");
8697 RNA_def_property_struct_type(prop, "SequenceEditor");
8698 RNA_def_property_ui_text(prop, "Sequence Editor", "");
8699
8700 /* Keying Sets */
8701 prop = RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE);
8702 RNA_def_property_collection_sdna(prop, nullptr, "keyingsets", nullptr);
8703 RNA_def_property_struct_type(prop, "KeyingSet");
8704 RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene");
8706 rna_def_scene_keying_sets(brna, prop);
8707
8708 prop = RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
8710 "rna_Scene_all_keyingsets_begin",
8711 "rna_Scene_all_keyingsets_next",
8712 "rna_iterator_listbase_end",
8713 "rna_iterator_listbase_get",
8714 nullptr,
8715 nullptr,
8716 nullptr,
8717 nullptr);
8718 RNA_def_property_struct_type(prop, "KeyingSet");
8720 prop,
8721 "All Keying Sets",
8722 "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
8725
8726 /* Rigid Body Simulation */
8727 prop = RNA_def_property(srna, "rigidbody_world", PROP_POINTER, PROP_NONE);
8728 RNA_def_property_pointer_sdna(prop, nullptr, "rigidbody_world");
8729 RNA_def_property_struct_type(prop, "RigidBodyWorld");
8730 RNA_def_property_ui_text(prop, "Rigid Body World", "");
8731 RNA_def_property_update(prop, NC_SCENE, "rna_Physics_relations_update");
8732
8733 /* Tool Settings */
8734 prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE);
8737 RNA_def_property_pointer_sdna(prop, nullptr, "toolsettings");
8738 RNA_def_property_struct_type(prop, "ToolSettings");
8739 RNA_def_property_ui_text(prop, "Tool Settings", "");
8740
8741 /* Unit Settings */
8742 prop = RNA_def_property(srna, "unit_settings", PROP_POINTER, PROP_NONE);
8744 RNA_def_property_pointer_sdna(prop, nullptr, "unit");
8745 RNA_def_property_struct_type(prop, "UnitSettings");
8746 RNA_def_property_ui_text(prop, "Unit Settings", "Unit editing settings");
8747
8748 /* Physics Settings */
8749 prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION);
8750 RNA_def_property_float_sdna(prop, nullptr, "physics_settings.gravity");
8751 RNA_def_property_array(prop, 3);
8752 RNA_def_property_ui_range(prop, -200.0f, 200.0f, 1, 2);
8753 RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in a given direction");
8754 RNA_def_property_update(prop, 0, "rna_Physics_update");
8755
8756 prop = RNA_def_property(srna, "use_gravity", PROP_BOOLEAN, PROP_NONE);
8757 RNA_def_property_boolean_sdna(prop, nullptr, "physics_settings.flag", PHYS_GLOBAL_GRAVITY);
8758 RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics");
8759 RNA_def_property_update(prop, 0, "rna_Physics_update");
8760
8761 /* Render Data */
8762 prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
8764 RNA_def_property_pointer_sdna(prop, nullptr, "r");
8765 RNA_def_property_struct_type(prop, "RenderSettings");
8766 RNA_def_property_ui_text(prop, "Render Data", "");
8767
8768 /* Safe Areas */
8769 prop = RNA_def_property(srna, "safe_areas", PROP_POINTER, PROP_NONE);
8770 RNA_def_property_pointer_sdna(prop, nullptr, "safe_areas");
8772 RNA_def_property_struct_type(prop, "DisplaySafeAreas");
8773 RNA_def_property_ui_text(prop, "Safe Areas", "");
8774
8775 /* Markers */
8776 prop = RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
8777 RNA_def_property_collection_sdna(prop, nullptr, "markers", nullptr);
8778 RNA_def_property_struct_type(prop, "TimelineMarker");
8780 prop, "Timeline Markers", "Markers used in all timelines for the current scene");
8781 rna_def_timeline_markers(brna, prop);
8782
8783 /* Transform Orientations */
8784 prop = RNA_def_property(srna, "transform_orientation_slots", PROP_COLLECTION, PROP_NONE);
8786 "rna_Scene_transform_orientation_slots_begin",
8787 "rna_iterator_array_next",
8788 "rna_iterator_array_end",
8789 "rna_iterator_array_get",
8790 "rna_Scene_transform_orientation_slots_length",
8791 nullptr,
8792 nullptr,
8793 nullptr);
8794 RNA_def_property_struct_type(prop, "TransformOrientationSlot");
8795 RNA_def_property_ui_text(prop, "Transform Orientation Slots", "");
8796
8797 /* 3D View Cursor */
8798 prop = RNA_def_property(srna, "cursor", PROP_POINTER, PROP_NONE);
8800 RNA_def_property_pointer_sdna(prop, nullptr, "cursor");
8801 RNA_def_property_struct_type(prop, "View3DCursor");
8802 RNA_def_property_ui_text(prop, "3D Cursor", "");
8803
8804 /* Audio Settings */
8805 prop = RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE);
8806 RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set");
8808 prop, "Play Audio", "Play back of audio from Sequence Editor, otherwise mute audio");
8809 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_use_audio_update");
8810
8811# if 0 /* XXX: Is this actually needed? */
8812 prop = RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
8813 RNA_def_property_boolean_sdna(prop, nullptr, "audio.flag", AUDIO_SYNC);
8815 prop,
8816 "Audio Sync",
8817 "Play back and sync with audio clock, dropping frames if frame display is too slow");
8818 RNA_def_property_update(prop, NC_SCENE, nullptr);
8819# endif
8820
8821 prop = RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
8822 RNA_def_property_boolean_sdna(prop, nullptr, "audio.flag", AUDIO_SCRUB);
8824 prop, "Audio Scrubbing", "Play audio from Sequence Editor while scrubbing");
8825 RNA_def_property_update(prop, NC_SCENE, nullptr);
8826
8827 prop = RNA_def_property(srna, "audio_doppler_speed", PROP_FLOAT, PROP_NONE);
8828 RNA_def_property_float_sdna(prop, nullptr, "audio.speed_of_sound");
8830 RNA_def_property_range(prop, 0.01f, FLT_MAX);
8832 prop, "Speed of Sound", "Speed of sound for Doppler effect calculation");
8833 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
8834
8835 prop = RNA_def_property(srna, "audio_doppler_factor", PROP_FLOAT, PROP_NONE);
8836 RNA_def_property_float_sdna(prop, nullptr, "audio.doppler_factor");
8838 RNA_def_property_range(prop, 0.0, FLT_MAX);
8839 RNA_def_property_ui_text(prop, "Doppler Factor", "Pitch factor for Doppler effect calculation");
8840 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
8841
8842 prop = RNA_def_property(srna, "audio_distance_model", PROP_ENUM, PROP_NONE);
8843 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "audio.distance_model");
8845 RNA_def_property_enum_items(prop, audio_distance_model_items);
8847 prop, "Distance Model", "Distance model for distance attenuation calculation");
8848 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_listener_update");
8849
8850 prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
8851 RNA_def_property_float_sdna(prop, nullptr, "audio.volume");
8852 RNA_def_property_range(prop, 0.0f, 100.0f);
8853 RNA_def_property_ui_text(prop, "Volume", "Audio volume");
8855 RNA_def_property_update(prop, NC_SCENE, nullptr);
8856 RNA_def_property_update(prop, NC_SCENE, "rna_Scene_volume_update");
8857
8858 func = RNA_def_function(srna, "update_render_engine", "rna_Scene_update_render_engine");
8860 RNA_def_function_ui_description(func, "Trigger a render engine update");
8861
8862 /* Statistics */
8863 func = RNA_def_function(srna, "statistics", "rna_Scene_statistics_string_get");
8865 parm = RNA_def_pointer(func, "view_layer", "ViewLayer", "View Layer", "");
8867 parm = RNA_def_string(func, "statistics", nullptr, 0, "Statistics", "");
8868 RNA_def_function_return(func, parm);
8869
8870 /* Grease Pencil */
8871 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
8872 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
8873 RNA_def_property_struct_type(prop, "GreasePencil");
8875 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
8879 prop, "Annotations", "Grease Pencil data-block used for annotations in the 3D view");
8881
8882 /* active MovieClip */
8883 prop = RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE);
8884 RNA_def_property_pointer_sdna(prop, nullptr, "clip");
8886 RNA_def_property_struct_type(prop, "MovieClip");
8888 "Active Movie Clip",
8889 "Active Movie Clip that can be used by motion tracking constraints "
8890 "or as a camera's background image");
8892
8893 /* color management */
8894 prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
8895 RNA_def_property_pointer_sdna(prop, nullptr, "view_settings");
8896 RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
8898 prop, "View Settings", "Color management settings applied on image before saving");
8899
8900 prop = RNA_def_property(srna, "display_settings", PROP_POINTER, PROP_NONE);
8901 RNA_def_property_pointer_sdna(prop, nullptr, "display_settings");
8902 RNA_def_property_struct_type(prop, "ColorManagedDisplaySettings");
8904 prop, "Display Settings", "Settings of device saved image would be displayed on");
8905
8906 prop = RNA_def_property(srna, "sequencer_colorspace_settings", PROP_POINTER, PROP_NONE);
8907 RNA_def_property_pointer_sdna(prop, nullptr, "sequencer_colorspace_settings");
8908 RNA_def_property_struct_type(prop, "ColorManagedSequencerColorspaceSettings");
8910 prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
8911
8912 /* Layer and Collections */
8913 prop = RNA_def_property(srna, "view_layers", PROP_COLLECTION, PROP_NONE);
8914 RNA_def_property_collection_sdna(prop, nullptr, "view_layers", nullptr);
8915 RNA_def_property_struct_type(prop, "ViewLayer");
8916 RNA_def_property_ui_text(prop, "View Layers", "");
8917 rna_def_view_layers(brna, prop);
8918
8919 prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
8921 RNA_def_property_pointer_sdna(prop, nullptr, "master_collection");
8922 RNA_def_property_struct_type(prop, "Collection");
8926 "Collection",
8927 "Scene root collection that owns all the objects and other collections "
8928 "instantiated in the scene");
8929
8930 /* Scene Display */
8931 prop = RNA_def_property(srna, "display", PROP_POINTER, PROP_NONE);
8932 RNA_def_property_pointer_sdna(prop, nullptr, "display");
8933 RNA_def_property_struct_type(prop, "SceneDisplay");
8934 RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3D viewport");
8935
8936 /* EEVEE */
8937 prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE);
8938 RNA_def_property_struct_type(prop, "SceneEEVEE");
8939 RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene");
8940
8941 /* Grease Pencil */
8942 prop = RNA_def_property(srna, "grease_pencil_settings", PROP_POINTER, PROP_NONE);
8943 RNA_def_property_struct_type(prop, "SceneGpencil");
8944 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil settings for the scene");
8945
8946 /* Hydra */
8947 prop = RNA_def_property(srna, "hydra", PROP_POINTER, PROP_NONE);
8948 RNA_def_property_struct_type(prop, "SceneHydra");
8949 RNA_def_property_ui_text(prop, "Hydra", "Hydra settings for the scene");
8950
8951 /* Nestled Data. */
8952 /* *** Non-Animated *** */
8959 rna_def_statvis(brna);
8969 rna_def_scene_eevee(brna);
8970 rna_def_scene_hydra(brna);
8976 /* *** Animated *** */
8979
8980 /* Scene API */
8981 RNA_api_scene(srna);
8982}
8983
8984#endif
struct KeyingSet * BKE_keyingset_add(struct ListBase *list, const char idname[], const char name[], short flag, short keyingflag)
Definition anim_sys.cc:134
void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode)
Definition armature.cc:2383
void BKE_brush_scale_size(int *r_brush_size, float new_unprojected_radius, float old_unprojected_radius)
Definition brush.cc:1212
void BKE_brush_scale_unprojected_radius(float *unprojected_radius, int new_brush_size, int old_brush_size)
Definition brush.cc:1200
#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)
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:138
bool BKE_image_is_stereo(const Image *ima)
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
char BKE_imtype_valid_channels(char imtype, bool write_file)
#define IMA_CHAN_FLAG_RGB
int BKE_image_path_ext_from_imformat(const ImageFormatData *im_format, const char *r_ext[BKE_IMAGE_PATH_EXT_MAX])
#define IMA_CHAN_FLAG_RGBA
void BKE_image_format_update_color_space_for_type(ImageFormatData *format)
#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)
char BKE_imtype_valid_depths(char imtype)
bool BKE_imtype_is_movie(char imtype)
bool BKE_imtype_requires_linear_float(char imtype)
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:283
void id_us_plus(ID *id)
Definition lib_id.cc:351
ID * BKE_id_owner_get(ID *id, const bool debug_relationship_assert=true)
Definition lib_id.cc:2444
void id_us_min(ID *id)
Definition lib_id.cc:359
void BKE_main_id_tag_listbase(ListBase *lb, int tag, bool value)
Definition lib_id.cc:1175
bool BKE_id_is_in_global_main(ID *id)
Definition lib_id.cc:2433
Mesh * BKE_mesh_from_object(Object *ob)
Paint * BKE_paint_get_active(Scene *sce, ViewLayer *view_layer)
Definition paint.cc:438
Brush * BKE_paint_brush(Paint *paint)
Definition paint.cc:649
void BKE_paint_invalidate_overlay_all()
Definition paint.cc:286
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:125
bool BKE_scene_has_view_layer(const Scene *scene, const ViewLayer *layer)
Definition scene.cc:2152
int BKE_render_num_threads(const RenderData *r)
Definition scene.cc:2850
#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:3486
int BKE_scene_orientation_slot_get_index(const TransformOrientationSlot *orient_slot)
Definition scene.cc:2379
bool BKE_scene_use_spherical_stereo(Scene *scene)
Definition scene.cc:2765
void BKE_scene_orientation_slot_set_index(TransformOrientationSlot *orient_slot, int orientation)
Definition scene.cc:2372
bool BKE_scene_remove_render_view(Scene *scene, SceneRenderView *srv)
Definition scene.cc:2678
SceneRenderView * BKE_scene_add_render_view(Scene *sce, const char *name)
Definition scene.cc:2659
float BKE_scene_frame_to_ctime(const Scene *scene, int frame)
Definition scene.cc:2322
int BKE_unit_base_of_type_get(int system, int type)
Definition unit.cc:2495
const char * BKE_unit_identifier_get(const void *usys_pt, int index)
Definition unit.cc:2512
bool BKE_unit_is_suppressed(const void *usys_pt, int index)
Definition unit.cc:2530
void BKE_unit_system_get(int system, int type, const void **r_usys_pt, int *r_len)
Definition unit.cc:2477
const char * BKE_unit_display_name_get(const void *usys_pt, int index)
Definition unit.cc:2506
@ B_UNIT_LENGTH
Definition BKE_unit.hh:107
@ B_UNIT_TEMPERATURE
Definition BKE_unit.hh:118
@ B_UNIT_MASS
Definition BKE_unit.hh:110
@ B_UNIT_TIME
Definition BKE_unit.hh:112
Volume data-block.
#define BLI_assert_unreachable()
Definition BLI_assert.h:97
#define BLI_assert(a)
Definition BLI_assert.h:50
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
bool BLI_listbase_move_index(ListBase *listbase, int from, int to) ATTR_NONNULL()
Definition listbase.cc:466
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BLI_remlink_safe(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:153
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:496
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
#define M_PI
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])
#define DEG2RAD(_deg)
#define DEG2RADF(_deg)
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define STR_ELEM(...)
Definition BLI_string.h:653
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:20
#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_CURVES
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_ID_SOUND
#define BLT_I18NCONTEXT_UNIT
#define BLT_I18NCONTEXT_ID_SCENE
#define DATA_(msgid)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
@ ID_RECALC_AUDIO_FPS
Definition DNA_ID.h:1094
@ ID_RECALC_AUDIO_LISTENER
Definition DNA_ID.h:1097
@ ID_RECALC_TRANSFORM
Definition DNA_ID.h:1021
@ ID_RECALC_SHADING
Definition DNA_ID.h:1061
@ ID_RECALC_FRAME_CHANGE
Definition DNA_ID.h:1092
@ ID_RECALC_SELECT
Definition DNA_ID.h:1068
@ ID_RECALC_PSYS_CHILD
Definition DNA_ID.h:1052
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1085
@ ID_RECALC_AUDIO_MUTE
Definition DNA_ID.h:1096
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1089
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1041
@ ID_RECALC_AUDIO_VOLUME
Definition DNA_ID.h:1095
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1071
@ ID_TAG_DOIT
Definition DNA_ID.h:1003
@ ID_IM
@ ID_NT
@ ID_SCE
@ KEYINGSET_ABSOLUTE
#define MAX_BRUSH_PIXEL_RADIUS
Object groups, one object can be in many groups at once.
@ CU_BEZIER
@ CU_POLY
@ FREESTYLE_CONTROL_EDITOR_MODE
@ FREESTYLE_CONTROL_SCRIPT_MODE
@ 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
@ 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
@ 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
Types and defines for representing Rigid Body entities.
@ 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
@ USER_UNIT_IMPERIAL
@ USER_UNIT_METRIC
@ USER_UNIT_NONE
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE
@ CURVE_PAINT_SURFACE_PLANE_VIEW
@ CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW
@ SCE_VIEW_DISABLE
@ SCE_ORIENT_DEFAULT
@ SCE_WORKSPACE_TOOL_DEFAULT
@ SCE_WORKSPACE_TOOL_FALLBACK
@ USER_UNIT_ROT_RADIANS
@ USER_UNIT_OPT_SPLIT
#define STEREO_LEFT_NAME
#define MINFRAME
@ SCE_XFORM_SKIP_CHILDREN
@ SCE_XFORM_AXIS_ALIGN
@ SCE_XFORM_DATA_ORIGIN
@ UVCALC_TRANSFORM_CORRECT
@ UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED
@ R_MULTIVIEW
@ R_SINGLE_LAYER
@ R_DOSEQ
@ R_EXR_CACHE_FILE
@ R_DOCOMP
@ R_EXTENSION
@ SCE_COMPOSITOR_PRECISION_FULL
@ SCE_COMPOSITOR_PRECISION_AUTO
@ CURVE_PAINT_FIT_METHOD_REFIT
@ CURVE_PAINT_FIT_METHOD_SPLIT
@ 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
@ RAYTRACE_EEVEE_METHOD_SCREEN
@ RAYTRACE_EEVEE_METHOD_PROBE
@ UNIFIED_PAINT_WEIGHT
@ UNIFIED_PAINT_SIZE
@ UNIFIED_PAINT_BRUSH_LOCK_SIZE
@ UNIFIED_PAINT_ALPHA
@ UNIFIED_PAINT_COLOR
@ UNIFIED_PAINT_INPUT_SAMPLES
@ SEQ_SNAP_TO_MARKERS
@ SEQ_SNAP_TO_PREVIEW_CENTER
@ SEQ_SNAP_TO_STRIPS_PREVIEW
@ SEQ_SNAP_TO_PREVIEW_BORDERS
@ SEQ_SNAP_TO_STRIP_HOLD
@ SEQ_SNAP_TO_CURRENT_FRAME
@ SCER_SHOW_SUBFRAME
@ SCER_PRV_RANGE
@ SCER_LOCK_FRAME_SELECTION
@ SCE_PERF_HQ_NORMALS
#define MINAFRAME
@ SEQ_SNAP_IGNORE_SOUND
@ SEQ_SNAP_IGNORE_MUTED
@ SEQ_SNAP_CURRENT_FRAME_TO_STRIPS
#define SCE_SNAP_TO_GEOM
@ FFM_PRESET_GOOD
@ FFM_PRESET_REALTIME
@ FFM_PRESET_BEST
@ GP_SELECTMODE_POINT
@ GP_SELECTMODE_SEGMENT
@ GP_SELECTMODE_STROKE
@ SCE_MB_START
@ SCE_MB_END
@ SCE_MB_CENTER
@ SCE_HYDRA_EXPORT_HYDRA
@ SCE_HYDRA_EXPORT_USD
@ PROP_EDIT_PROJECTED
@ PROP_EDIT_USE
@ PROP_EDIT_CONNECTED
@ SCE_HAIR_SHAPE_STRAND
@ SCE_HAIR_SHAPE_STRIP
@ R_BAKE_TARGET_VERTEX_COLORS
@ R_BAKE_TARGET_IMAGE_TEXTURES
@ R_IMF_JP2_FLAG_CINE_48
@ R_IMF_JP2_FLAG_CINE_PRESET
@ R_IMF_JP2_FLAG_YCC
@ SI_STICKY_VERTEX
@ SI_STICKY_LOC
@ SI_STICKY_DISABLE
@ S3D_ANAGLYPH_REDCYAN
@ S3D_ANAGLYPH_YELLOWBLUE
@ S3D_ANAGLYPH_GREENMAGENTA
@ UV_SCULPT_ALL_ISLANDS
@ UV_SCULPT_LOCK_BORDERS
@ R_BAKE_POSY
@ R_BAKE_NEGX
@ R_BAKE_POSZ
@ R_BAKE_NEGY
@ R_BAKE_POSX
@ R_BAKE_NEGZ
@ R_ALPHAPREMUL
@ 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_LINE_THICKNESS_ABSOLUTE
@ R_LINE_THICKNESS_RELATIVE
@ PHYS_GLOBAL_GRAVITY
@ R_BAKE_ADJACENT_FACES
@ R_BAKE_EXTEND
@ SEQ_OVERLAP_EXPAND
@ SEQ_OVERLAP_SHUFFLE
@ SEQ_OVERLAP_OVERWRITE
@ 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
@ S3D_SQUEEZED_FRAME
@ S3D_INTERLACE_SWAP
@ S3D_SIDEBYSIDE_CROSSEYED
@ FFMPEG_LOSSLESS_OUTPUT
@ FFMPEG_AUTOSPLIT_OUTPUT
@ FFMPEG_USE_MAX_B_FRAMES
#define PAINT_MAX_INPUT_SAMPLES
@ 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
@ CURVE_PAINT_PROJECT_CURSOR
@ CURVE_PAINT_PROJECT_SURFACE
@ SCE_VIEWS_FORMAT_STEREO_3D
@ SCE_VIEWS_FORMAT_MULTIVIEW
@ 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
@ UV_SELECT_VERTEX
@ UV_SELECT_FACE
@ UV_SELECT_EDGE
@ UV_SELECT_ISLAND
@ RAYTRACE_EEVEE_USE_DENOISE
@ R_IMF_CHAN_DEPTH_24
@ R_IMF_CHAN_DEPTH_8
@ R_IMF_CHAN_DEPTH_16
@ R_IMF_CHAN_DEPTH_12
@ R_IMF_CHAN_DEPTH_1
@ R_IMF_CHAN_DEPTH_10
@ R_IMF_CHAN_DEPTH_32
@ R_BAKE_VIEW_FROM_ABOVE_SURFACE
@ R_BAKE_VIEW_FROM_ACTIVE_CAMERA
@ GP_SCULPT_MASK_SELECTMODE_POINT
@ GP_SCULPT_MASK_SELECTMODE_STROKE
@ GP_SCULPT_MASK_SELECTMODE_SEGMENT
@ R_IMF_IMTYPE_FFMPEG
@ R_IMF_IMTYPE_RADHDR
@ R_IMF_IMTYPE_OPENEXR
@ R_IMF_IMTYPE_MULTILAYER
@ 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
@ GP_VERTEX_MASK_SELECTMODE_SEGMENT
@ GP_VERTEX_MASK_SELECTMODE_STROKE
@ GP_VERTEX_MASK_SELECTMODE_POINT
#define SCE_SNAP_TO_VERTEX
@ 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
@ AUTO_MERGE
@ AUTO_MERGE_AND_SPLIT
@ SCE_CUSTOM_SIMULATION_RANGE
@ SCE_FRAME_DROP
@ SCE_KEYS_NO_SELONLY
@ SCE_NLA_EDIT_ON
@ R_SEQ_OVERRIDE_SCENE_SETTINGS
@ R_IMF_TIFF_CODEC_PACKBITS
@ R_IMF_TIFF_CODEC_DEFLATE
@ R_IMF_TIFF_CODEC_NONE
@ R_IMF_TIFF_CODEC_LZW
@ S3D_INTERLACE_ROW
@ S3D_INTERLACE_COLUMN
@ S3D_INTERLACE_CHECKERBOARD
@ OB_DRAW_GROUPUSER_ACTIVE
@ OB_DRAW_GROUPUSER_NONE
@ OB_DRAW_GROUPUSER_ALL
@ SCE_LAY_SOLID
@ SCE_LAY_STRAND
@ SCE_LAY_SKY
@ SCE_LAY_AO
@ SCE_LAY_MOTION_BLUR
@ SCE_LAY_VOLUMES
@ GP_PROJECT_VIEWSPACE
@ GP_PROJECT_DEPTH_VIEW
@ GP_PROJECT_CURSOR
@ GP_PROJECT_DEPTH_STROKE_ENDPOINTS
@ GP_PROJECT_DEPTH_STROKE
@ GP_PROJECT_DEPTH_STROKE_FIRST
@ GP_PROJECT_DEPTH_ONLY_SELECTED
@ SCE_SNAP_PEEL_OBJECT
@ SCE_SNAP_TO_INCLUDE_EDITED
@ SCE_SNAP_NOT_TO_ACTIVE
@ SCE_SNAP
@ SCE_SNAP_TO_INCLUDE_NONEDITED
@ SCE_SNAP_ROTATE
@ SCE_SNAP_ABS_GRID
@ SCE_SNAP_BACKFACE_CULLING
@ SCE_SNAP_KEEP_ON_SAME_OBJECT
@ SCE_SNAP_TO_ONLY_SELECTABLE
@ SCE_SNAP_ABS_TIME_STEP
@ PROP_SMOOTH
@ PROP_ROOT
@ PROP_SHARP
@ PROP_RANDOM
@ PROP_LIN
@ PROP_CONST
@ PROP_INVSQUARE
@ PROP_SPHERE
@ SIMPLIFY_GPENCIL_FILL
@ SIMPLIFY_GPENCIL_ON_PLAY
@ SIMPLIFY_GPENCIL_AA
@ SIMPLIFY_GPENCIL_MODIFIER
@ SIMPLIFY_GPENCIL_TINT
@ SIMPLIFY_GPENCIL_ENABLE
@ SIMPLIFY_GPENCIL_FX
@ 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
@ R_BAKE_SPACE_TANGENT
@ R_BAKE_SPACE_OBJECT
@ FAST_GI_FULL
@ FAST_GI_AO_ONLY
#define STEREO_RIGHT_NAME
@ R_IMF_PLANES_RGB
@ R_IMF_PLANES_RGBA
@ R_IMF_PLANES_BW
@ 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
@ SCE_OBJECT_MODE_LOCK
@ AUDIO_MUTE
@ AUDIO_SCRUB
@ AUDIO_SYNC
#define USER_UNIT_ADAPTIVE
@ R_IMF_FLAG_PREVIEW_JPG
@ SCE_COMPOSITOR_DEVICE_GPU
@ SCE_COMPOSITOR_DEVICE_CPU
@ SCE_SELECT_FACE
@ SCE_SELECT_VERTEX
@ SCE_SELECT_EDGE
@ SCE_SNAP_SOURCE_MEDIAN
@ SCE_SNAP_SOURCE_CLOSEST
@ SCE_SNAP_SOURCE_ACTIVE
@ SCE_SNAP_SOURCE_CENTER
@ R_IMF_JP2_CODEC_JP2
@ R_IMF_JP2_CODEC_J2K
@ R_BAKE_SAVE_EXTERNAL
@ R_BAKE_SAVE_INTERNAL
@ UV_SYNC_SELECTION
@ UV_SHOW_SAME_IMAGE
@ R_IMF_CINEON_FLAG_LOG
@ R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE
@ R_IMF_COLOR_MANAGEMENT_OVERRIDE
@ R_BAKE_PASS_FILTER_DIFFUSE
@ R_BAKE_PASS_FILTER_NONE
@ R_BAKE_PASS_FILTER_COLOR
@ R_BAKE_PASS_FILTER_INDIRECT
@ R_BAKE_PASS_FILTER_DIRECT
@ R_BAKE_PASS_FILTER_GLOSSY
@ R_BAKE_PASS_FILTER_EMIT
@ R_BAKE_PASS_FILTER_TRANSM
@ SCE_STATVIS_DISTORT
@ SCE_STATVIS_SHARP
@ SCE_STATVIS_INTERSECT
@ SCE_STATVIS_THICKNESS
@ SCE_STATVIS_OVERHANG
@ SCE_PASS_NORMAL
@ SCE_PASS_GLOSSY_DIRECT
@ SCE_PASS_AO
@ SCE_PASS_DIFFUSE_COLOR
@ SCE_PASS_POSITION
@ SCE_PASS_UV
@ SCE_PASS_SUBSURFACE_INDIRECT
@ SCE_PASS_TRANSM_DIRECT
@ SCE_PASS_SUBSURFACE_COLOR
@ SCE_PASS_GLOSSY_COLOR
@ SCE_PASS_DIFFUSE_DIRECT
@ SCE_PASS_GLOSSY_INDIRECT
@ SCE_PASS_INDEXMA
@ SCE_PASS_INDEXOB
@ SCE_PASS_TRANSM_INDIRECT
@ SCE_PASS_COMBINED
@ SCE_PASS_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
@ SCE_SNAP_INDIVIDUAL_NEAREST
@ SCE_SNAP_TO_NODE_X
@ 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_NODE_Y
@ SCE_SNAP_TO_NONE
#define MAXFRAME
#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_PLACE_DEPTH_CURSOR_VIEW
@ V3D_PLACE_DEPTH_CURSOR_PLANE
@ V3D_PLACE_DEPTH_SURFACE
@ V3D_ORIENT_NORMAL
@ V3D_ORIENT_CUSTOM
@ V3D_ORIENT_GLOBAL
@ V3D_ORIENT_PARENT
@ V3D_ORIENT_LOCAL
@ V3D_ORIENT_VIEW
@ V3D_ORIENT_CURSOR
@ V3D_ORIENT_GIMBAL
const char * ED_info_statistics_string(Main *bmain, Scene *scene, ViewLayer *view_layer)
void EDBM_selectmode_set(BMEditMesh *em)
void ED_node_tree_propagate_change(const bContext *C, Main *bmain, bNodeTree *ntree)
Definition node_edit.cc:492
void ED_node_composit_default(const bContext *C, Scene *scene)
Definition node_edit.cc:618
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 FRS_free_view_map_cache(void)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
#define RE_BAKE_NORMALS
#define RE_BAKE_DISPLACEMENT
#define RNA_POINTER_INVALIDATE(ptr)
const EnumPropertyItem * rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
ParameterFlag
Definition RNA_types.hh:396
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_REPORTS
Definition RNA_types.hh:680
@ FUNC_NO_SELF
Definition RNA_types.hh:673
@ FUNC_USE_MAIN
Definition RNA_types.hh:678
@ FUNC_USE_SELF_ID
Definition RNA_types.hh:667
@ STRUCT_ID_REFCOUNT
Definition RNA_types.hh:720
@ STRUCT_UNDO
Definition RNA_types.hh:722
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_COLLECTION
Definition RNA_types.hh:71
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:127
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:355
@ PROPOVERRIDE_NO_COMPARISON
Definition RNA_types.hh:363
PropertyFlag
Definition RNA_types.hh:201
@ PROP_THICK_WRAP
Definition RNA_types.hh:312
@ PROP_PATH_OUTPUT
Definition RNA_types.hh:340
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:296
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_PROPORTIONAL
Definition RNA_types.hh:250
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:273
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_ENUM_FLAG
Definition RNA_types.hh:293
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_PTR_NO_OWNERSHIP
Definition RNA_types.hh:284
@ PROP_DEG_SYNC_ONLY
Definition RNA_types.hh:334
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:259
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:253
@ PROP_IDPROPERTY
Definition RNA_types.hh:315
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition RNA_types.hh:522
@ PROP_TIME
Definition RNA_types.hh:156
@ PROP_MATRIX
Definition RNA_types.hh:168
@ PROP_DIRECTION
Definition RNA_types.hh:165
@ PROP_XYZ
Definition RNA_types.hh:172
@ PROP_DISTANCE
Definition RNA_types.hh:159
@ PROP_ACCELERATION
Definition RNA_types.hh:167
@ PROP_COLOR
Definition RNA_types.hh:163
@ PROP_PIXEL
Definition RNA_types.hh:151
@ PROP_ANGLE
Definition RNA_types.hh:155
@ PROP_AXISANGLE
Definition RNA_types.hh:171
@ PROP_EULER
Definition RNA_types.hh:169
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_PERCENTAGE
Definition RNA_types.hh:153
@ PROP_FACTOR
Definition RNA_types.hh:154
@ PROP_COLOR_GAMMA
Definition RNA_types.hh:175
@ PROP_XYZ_LENGTH
Definition RNA_types.hh:173
@ PROP_UNSIGNED
Definition RNA_types.hh:152
@ PROP_QUATERNION
Definition RNA_types.hh:170
@ PROP_FILEPATH
Definition RNA_types.hh:139
#define ND_SEQUENCER
Definition WM_types.hh:404
#define NC_WORLD
Definition WM_types.hh:354
#define ND_WORLD
Definition WM_types.hh:419
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:501
#define NC_WINDOW
Definition WM_types.hh:342
#define NC_NODE
Definition WM_types.hh:361
#define NC_GEOM
Definition WM_types.hh:360
#define ND_DRAW
Definition WM_types.hh:428
#define NC_BRUSH
Definition WM_types.hh:352
#define ND_DATA
Definition WM_types.hh:475
#define ND_RENDER_OPTIONS
Definition WM_types.hh:402
#define NC_ANIMATION
Definition WM_types.hh:355
#define ND_DISPLAY
Definition WM_types.hh:458
#define ND_KEYINGSET
Definition WM_types.hh:415
#define NC_SCENE
Definition WM_types.hh:345
#define ND_NODES
Definition WM_types.hh:403
#define ND_TOOLSETTINGS
Definition WM_types.hh:416
#define ND_SPACE_IMAGE
Definition WM_types.hh:488
#define NA_EDITED
Definition WM_types.hh:550
#define ND_SPACE_GRAPH
Definition WM_types.hh:498
#define ND_FRAME_RANGE
Definition WM_types.hh:418
#define NC_IMAGE
Definition WM_types.hh:351
#define ND_MARKERS
Definition WM_types.hh:400
#define ND_FRAME
Definition WM_types.hh:401
#define NC_GPENCIL
Definition WM_types.hh:366
#define ND_TRANSFORM
Definition WM_types.hh:423
#define ND_LAYER
Definition WM_types.hh:417
#define ND_SPACE_VIEW3D
Definition WM_types.hh:494
#define NC_OBJECT
Definition WM_types.hh:346
#define NC_SPACE
Definition WM_types.hh:359
#define ND_DRAW_RENDER_VIEWPORT
Definition WM_types.hh:437
ListBase builtin_keyingsets
volatile int lock
#define SELECT
OperationNode * node
const Depsgraph * depsgraph
#define offsetof(t, d)
node_ attributes set("label", ss.str())
int len
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void SEQ_cache_cleanup(Scene *scene)
RenderEngineType * RE_engines_find(const char *idname)
RenderEngine * RE_engine_create(RenderEngineType *type)
void RE_engine_free(RenderEngine *engine)
ListBase R_engines
#define GS(x)
Definition iris.cc:202
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *keyingset)
KeyingSet * ANIM_scene_get_active_keyingset(const Scene *scene)
format
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
void scene_simulation_states_reset(Scene &scene)
void ntreeCompositUpdateRLayers(bNodeTree *ntree)
static struct PyModuleDef module
Definition python.cpp:991
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
void rna_def_animdata_common(StructRNA *srna)
static const EnumPropertyItem curve_type_items[]
Definition rna_curve.cc:125
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_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
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_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)
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:86
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)
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)
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:35
const EnumPropertyItem rna_enum_mesh_select_mode_uv_items[]
Definition rna_scene.cc:133
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:400
const EnumPropertyItem rna_enum_image_type_items[]
Definition rna_scene.cc:367
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:114
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:633
static const EnumPropertyItem eevee_resolution_scale_items[]
Definition rna_scene.cc:684
static const EnumPropertyItem plane_orientation_items[]
Definition rna_scene.cc:653
const EnumPropertyItem rna_enum_views_format_multilayer_items[]
Definition rna_scene.cc:490
const EnumPropertyItem rna_enum_mesh_select_mode_items[]
Definition rna_scene.cc:126
static void rna_def_curve_paint_settings(BlenderRNA *brna)
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:502
const EnumPropertyItem rna_enum_normal_swizzle_items[]
Definition rna_scene.cc:417
static const EnumPropertyItem rna_enum_scene_display_aa_methods[]
Definition rna_scene.cc:210
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:199
#define R_IMF_VIEWS_ENUM_MV
Definition rna_scene.cc:483
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:673
const EnumPropertyItem rna_enum_proportional_falloff_items[]
Definition rna_scene.cc:97
void RNA_def_scene(BlenderRNA *brna)
const EnumPropertyItem rna_enum_snap_animation_element_items[]
Definition rna_scene.cc:191
const EnumPropertyItem rna_enum_snap_node_element_items[]
Definition rna_scene.cc:179
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:475
static const EnumPropertyItem rna_enum_snap_element_base_items[]
Definition rna_scene.cc:168
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:548
static void rna_def_statvis(BlenderRNA *brna)
const EnumPropertyItem rna_enum_snap_source_items[]
Definition rna_scene.cc:89
const EnumPropertyItem rna_enum_snap_element_items[]
Definition rna_scene.cc:153
const EnumPropertyItem rna_enum_bake_save_mode_items[]
Definition rna_scene.cc:451
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:667
static const EnumPropertyItem rna_enum_view_layer_aov_type_items[]
Definition rna_scene.cc:560
static const EnumPropertyItem rna_enum_bake_view_from_items[]
Definition rna_scene.cc:461
const EnumPropertyItem rna_enum_bake_margin_type_items[]
Definition rna_scene.cc:427
static void rna_def_view_layer_eevee(BlenderRNA *brna)
const EnumPropertyItem rna_enum_bake_target_items[]
Definition rna_scene.cc:437
static void rna_def_freestyle_modules(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_curve_fit_method_items[]
Definition rna_scene.cc:250
const EnumPropertyItem rna_enum_views_format_items[]
Definition rna_scene.cc:486
const EnumPropertyItem rna_enum_transform_pivot_full_items[]
Definition rna_scene.cc:566
static void rna_def_render_views(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_normal_space_items[]
Definition rna_scene.cc:411
static void rna_def_unified_paint_settings(BlenderRNA *brna)
const EnumPropertyItem rna_enum_views_format_multiview_items[]
Definition rna_scene.cc:494
#define IMAGE_TYPE_ITEMS_IMAGE_ONLY
Definition rna_scene.cc:346
const EnumPropertyItem rna_enum_transform_orientation_items[]
Definition rna_scene.cc:592
const EnumPropertyItem rna_enum_stereo3d_anaglyph_type_items[]
Definition rna_scene.cc:534
const EnumPropertyItem rna_enum_stereo3d_interlace_type_items[]
Definition rna_scene.cc:541
#define R_IMF_VIEWS_ENUM_S3D
Definition rna_scene.cc:481
#define RNA_SNAP_ELEMENTS_BASE
Definition rna_scene.cc:142
static const EnumPropertyItem * rna_enum_snap_element_individual_items
Definition rna_scene.cc:175
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:379
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:401
void SEQ_sound_update_length(Main *bmain, Scene *scene)
static const EnumPropertyItem scale_fit_methods[]
#define min(a, b)
Definition sort.c:32
void RE_FreePersistentData(const Scene *scene)
#define FLT_MAX
Definition stdcycles.h:14
unsigned char uint8_t
Definition stdint.h:78
struct Object * object
ListBaseIterator listbase
Definition RNA_types.hh:455
union CollectionPropertyIterator::@1329 internal
const char * identifier
Definition RNA_types.hh:506
const char * name
Definition RNA_types.hh:510
const char * description
Definition RNA_types.hh:512
Definition DNA_ID.h:413
int tag
Definition DNA_ID.h:434
char name[66]
Definition DNA_ID.h:425
void * last
void * first
ListBase wm
Definition BKE_main.hh:239
ListBase objects
Definition BKE_main.hh:212
struct ModifierData * next
ListBase particlesystem
struct Collection * instance_collection
ObjectRuntimeHandle * runtime
ListBase modifiers
struct ParticleSystem * next
ID * owner_id
Definition RNA_types.hh:40
StructRNA * type
Definition RNA_types.hh:41
void * data
Definition RNA_types.hh:42
char engine[32]
struct ImageFormatData im_format
struct FFMpegCodecData ffcodecdata
void(* update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition RE_engine.h:115
int active_keyingset
ListBase keyingsets
struct Scene * set
unsigned int flag
char gpencil_selectmode_sculpt
ListBase lightgroups
ViewLayerLightgroup * active_lightgroup
ViewLayerAOV * active_aov
ListBase aovs
char name[64]
struct bNodeSocket * next
ListBase nodes
struct bNode * next
const c_style_mat & ptr() const
#define N_(msgid)
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126
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)
uint8_t flag
Definition wm_window.cc:138