Blender V5.3
rna_space.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdlib>
10#include <cstring>
11
12#include "BLI_math_constants.hh"
13#include "BLI_string_ref.hh"
14#include "BLT_translation.hh"
15
16#include "BKE_context.hh"
17#include "BKE_geometry_set.hh"
18#include "BKE_movieclip.hh"
19#include "BKE_object_types.hh"
20
21#include "ED_asset.hh"
22#include "ED_buttons.hh"
23#include "ED_spreadsheet.hh"
24#include "ED_userpref.hh"
25
26#include "BLI_string.hh"
27#include "BLI_sys_types.hh"
28
29#include "DNA_action_types.h"
30#include "DNA_camera_types.h"
31#include "DNA_layer_types.h"
32#include "DNA_mask_types.h"
33#include "DNA_object_types.h"
34#include "DNA_space_types.h"
35#include "DNA_view3d_types.h"
36
37#include "RNA_define.hh"
38
39#include "RNA_types.hh"
40#include "rna_internal.hh"
41
42#include "SEQ_sequencer.hh"
43
44#include "WM_api.hh"
45#include "WM_types.hh"
46
47#include "RNA_enum_types.hh"
48
49namespace blender {
50
53 "MESH",
54 ICON_MESH_DATA,
55 "Mesh",
56 "Mesh component containing point, corner, edge and face data"},
58 "POINTCLOUD",
59 ICON_POINTCLOUD_DATA,
60 "Point Cloud",
61 "Point cloud component containing only point data"},
63 "CURVE",
64 ICON_CURVE_DATA,
65 "Curve",
66 "Curve component containing spline and control point data"},
68 "INSTANCES",
69 ICON_EMPTY_AXIS,
70 "Instances",
71 "Instances of objects or collections"},
73 "GREASEPENCIL",
74 ICON_GREASEPENCIL,
75 "Grease Pencil",
76 "Grease Pencil component containing layers and curves data"},
78 "VOLUME",
79 ICON_VOLUME_DATA,
80 "Volume",
81 "Volume component containing volume grids"},
82 {0, nullptr, 0, nullptr, nullptr},
83};
84
86 {SPREADSHEET_GEOMETRY_ITEM_TYPE_DOMAIN, "DOMAIN", ICON_NONE, "Domain", "Domain data"},
87 {SPREADSHEET_GEOMETRY_ITEM_TYPE_BUNDLE, "BUNDLE", ICON_NONE, "Bundle", "Bundle data"},
88 {},
89};
90
92 /* empty must be here for python, is skipped for UI */
93 {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""},
94
95 /* General. */
96 RNA_ENUM_ITEM_HEADING(N_("General"), nullptr),
98 "VIEW_3D",
99 ICON_VIEW3D,
100 "3D Viewport",
101 "Manipulate objects in a 3D environment"},
103 "IMAGE_EDITOR",
104 ICON_IMAGE,
105 "UV/Image Editor",
106 "View and edit images and UV Maps"},
107 {SPACE_NODE,
108 "NODE_EDITOR",
109 ICON_NODETREE,
110 "Node Editor",
111 "Editor for node-based shading and compositing tools"},
112 {SPACE_SEQ,
113 "SEQUENCE_EDITOR",
114 ICON_SEQUENCE,
115 "Video Sequencer",
116 "Non-linear editor for arranging and mixing scenes, video, audio, and effects"},
117 {SPACE_CLIP, "CLIP_EDITOR", ICON_TRACKER, "Movie Clip Editor", "Motion tracking tools"},
118
119 /* Animation. */
120 RNA_ENUM_ITEM_HEADING(N_("Animation"), nullptr),
121#if 0
123 "TIMELINE",
124 ICON_TIME,
125 "Timeline",
126 "Timeline and playback controls (NOTE: Switch to 'Timeline' mode)"}, /* XXX */
127#endif
128 {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", "Adjust timing of keyframes"},
130 "GRAPH_EDITOR",
131 ICON_GRAPH,
132 "Graph Editor",
133 "Edit drivers and keyframe interpolation"},
134 {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", "Combine and layer Actions"},
135
136 /* Scripting. */
137 RNA_ENUM_ITEM_HEADING(N_("Scripting"), nullptr),
138 {SPACE_TEXT,
139 "TEXT_EDITOR",
140 ICON_TEXT,
141 "Text Editor",
142 "Edit scripts and in-file documentation"},
144 "CONSOLE",
145 ICON_CONSOLE,
146 "Python Console",
147 "Interactive programmatic console for "
148 "advanced editing and script development"},
149 {SPACE_INFO, "INFO", ICON_INFO, "Info", "Log of operations, warnings and error messages"},
150 /* Special case: Top-bar and Status-bar aren't supposed to be a regular editor for the user. */
152 "TOPBAR",
153 ICON_NONE,
154 "Top Bar",
155 "Global bar at the top of the screen for "
156 "global per-window settings"},
158 "STATUSBAR",
159 ICON_NONE,
160 "Status Bar",
161 "Global bar at the bottom of the "
162 "screen for general status information"},
163
164 /* Data. */
165 RNA_ENUM_ITEM_HEADING(N_("Data"), nullptr),
167 "OUTLINER",
168 ICON_OUTLINER,
169 "Outliner",
170 "Overview of scene graph and all available data-blocks"},
172 "PROPERTIES",
173 ICON_PROPERTIES,
174 "Properties",
175 "Edit properties of active object and related data-blocks"},
176 {SPACE_FILE, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", "Browse for files and assets"},
178 "SPREADSHEET",
179 ICON_SPREADSHEET,
180 "Spreadsheet",
181 "Explore geometry data in a table"},
183 "PREFERENCES",
184 ICON_PREFERENCES,
185 "Preferences",
186 "Edit persistent configuration settings"},
188 "PROJECT",
189 ICON_PROJECT,
190 "Project Settings",
191 "Manage the current Blender project"},
192 {0, nullptr, 0, nullptr, nullptr},
193};
194
197 "FCURVES",
198 ICON_GRAPH,
199 "Graph Editor",
200 "Edit animation/keyframes displayed as 2D curves"},
202 "DRIVERS",
203 ICON_DRIVER,
204 "Drivers",
205 "Define and edit drivers that link properties to custom functions or other data"},
206 {0, nullptr, 0, nullptr, nullptr},
207};
208
210 {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
211 {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Preview", ""},
213 "SEQUENCER_PREVIEW",
214 ICON_SEQ_SPLITVIEW,
215 "Sequencer & Preview",
216 ""},
217 {0, nullptr, 0, nullptr, nullptr},
218};
219
222 "FILES",
223 ICON_FILEBROWSER,
224 "File Browser",
225 "Built-in file manager for opening, saving, and linking data"},
227 "ASSETS",
228 ICON_ASSET_MANAGER,
229 "Asset Browser",
230 "Manage assets in the current file and access linked asset libraries"},
231 {0, nullptr, 0, nullptr, nullptr},
232};
233
234#define SACT_ITEM_DOPESHEET \
235 {SACTCONT_DOPESHEET, "DOPESHEET", ICON_ACTION, "Dope Sheet", "Edit all keyframes in scene"}
236#define SACT_ITEM_ACTION \
237 {SACTCONT_ACTION, \
238 "ACTION", \
239 ICON_OBJECT_DATA, \
240 "Action Editor", \
241 "Edit keyframes in active object's Object-level action"}
242#define SACT_ITEM_SHAPEKEY \
243 {SACTCONT_SHAPEKEY, \
244 "SHAPEKEY", \
245 ICON_SHAPEKEY_DATA, \
246 "Shape Key Editor", \
247 "Edit keyframes in active object's Shape Keys action"}
248#define SACT_ITEM_GPENCIL \
249 {SACTCONT_GPENCIL, \
250 "GPENCIL", \
251 ICON_OUTLINER_OB_GREASEPENCIL, \
252 "Grease Pencil", \
253 "Edit timings for all Grease Pencil sketches in file"}
254#define SACT_ITEM_MASK \
255 {SACTCONT_MASK, "MASK", ICON_MOD_MASK, "Mask", "Edit timings for Mask Editor splines"}
256#define SACT_ITEM_CACHEFILE \
257 {SACTCONT_CACHEFILE, \
258 "CACHEFILE", \
259 ICON_FILE, \
260 "Cache File", \
261 "Edit timings for Cache File data-blocks"}
262#define SACT_ITEM_TIMELINE \
263 {SACTCONT_TIMELINE, \
264 "TIMELINE", \
265 ICON_TIME, \
266 "Timeline", \
267 "Simple timeline view with playback controls in the header, without channel list, " \
268 "side-panel, or footer"}
269
270#ifndef RNA_RUNTIME
271/* XXX: action-editor is currently for object-level only actions,
272 * so show that using object-icon hint */
292#endif
293
297 {0, nullptr, 0, nullptr, nullptr},
298};
299
300#undef SACT_ITEM_DOPESHEET
301#undef SACT_ITEM_ACTION
302#undef SACT_ITEM_SHAPEKEY
303#undef SACT_ITEM_GPENCIL
304#undef SACT_ITEM_MASK
305#undef SACT_ITEM_CACHEFILE
306#undef SACT_ITEM_TIMELINE
307
308#define SI_ITEM_VIEW(identifier, name, icon) \
309 {SI_MODE_VIEW, identifier, icon, name, "Inspect images or render results"}
310#define SI_ITEM_UV {SI_MODE_UV, "UV", ICON_UV, "UV Editor", "View and edit UVs"}
311#define SI_ITEM_PAINT {SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "Paint images in 2D"}
312#define SI_ITEM_MASK {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "View and edit masks"}
313
315 SI_ITEM_VIEW("VIEW", "View", ICON_FILE_IMAGE),
319 {0, nullptr, 0, nullptr, nullptr},
320};
321
323 SI_ITEM_VIEW("VIEW", "View", ICON_FILE_IMAGE),
326 {0, nullptr, 0, nullptr, nullptr},
327};
328
330 SI_ITEM_VIEW("IMAGE_EDITOR", "Image Editor", ICON_IMAGE),
332 {0, nullptr, 0, nullptr, nullptr},
333};
334
335#undef SI_ITEM_VIEW
336#undef SI_ITEM_UV
337#undef SI_ITEM_PAINT
338#undef SI_ITEM_MASK
339
340#define V3D_S3D_CAMERA_LEFT {STEREO_LEFT_ID, "LEFT", ICON_RESTRICT_RENDER_OFF, "Left", ""},
341#define V3D_S3D_CAMERA_RIGHT {STEREO_RIGHT_ID, "RIGHT", ICON_RESTRICT_RENDER_OFF, "Right", ""},
342#define V3D_S3D_CAMERA_S3D {STEREO_3D_ID, "S3D", ICON_CAMERA_STEREO, "3D", ""},
343#ifdef RNA_RUNTIME
344# define V3D_S3D_CAMERA_VIEWS {STEREO_MONO_ID, "MONO", ICON_RESTRICT_RENDER_OFF, "Views", ""},
345#endif
346
348 V3D_S3D_CAMERA_LEFT V3D_S3D_CAMERA_RIGHT V3D_S3D_CAMERA_S3D{0, nullptr, 0, nullptr, nullptr},
349};
350
351#ifdef RNA_RUNTIME
352static const EnumPropertyItem multiview_camera_items[] = {
353 V3D_S3D_CAMERA_VIEWS V3D_S3D_CAMERA_S3D{0, nullptr, 0, nullptr, nullptr},
354};
355#endif
356
357#undef V3D_S3D_CAMERA_LEFT
358#undef V3D_S3D_CAMERA_RIGHT
359#undef V3D_S3D_CAMERA_S3D
360#undef V3D_S3D_CAMERA_VIEWS
361
367 {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_NONE, "Name", "Sort the file list alphabetically"},
369 "FILE_SORT_EXTENSION",
370 ICON_NONE,
371 "Extension",
372 "Sort the file list by extension/type"},
374 "FILE_SORT_TIME",
375 ICON_NONE,
376 "Modified Date",
377 "Sort files by modification time"},
378 {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_NONE, "Size", "Sort files by size"},
380 "ASSET_CATALOG",
381 0,
382 "Asset Catalog",
383 "Sort the asset list so that assets in the same catalog are kept together. Within a single "
384 "catalog, assets are ordered by name. The catalogs are in order of the flattened catalog "
385 "hierarchy."},
386 {0, nullptr, 0, nullptr, nullptr},
387};
388
390 {FILE_SHOW_ASSETS_ALL_CATALOGS, "ALL", ICON_NONE, "All", "Show assets from all catalogs"},
392 "CATALOG",
393 ICON_NONE,
394 "Catalog",
395 "Show assets from the active catalog only"},
397 "UNASSIGNED",
398 ICON_NONE,
399 "Unassigned",
400 "Show assets not assigned to any catalog"},
401 {0, nullptr, 0, nullptr, nullptr},
402};
403
406 "FOLLOW_PREFS",
407 0,
408 "Follow Asset or Preferences",
409 "Use the import method set in the Preferences for this asset library, don't override it "
410 "for this Asset Browser"},
412 "LINK",
413 ICON_LINK_BLEND,
414 "Link",
415 "Import the assets as linked data-block"},
417 "APPEND",
418 ICON_APPEND_BLEND,
419 "Append",
420 "Import the asset as copied data-block, with no link to the original asset data-block"},
422 "APPEND_REUSE",
423 ICON_APPEND_BLEND,
424 "Append (Reuse Data)",
425 "Import the asset as copied data-block while avoiding multiple copies of nested, "
426 "typically heavy data. For example the textures of a material asset, or the mesh of an "
427 "object asset, don't have to be copied every time this asset is imported. The instances of "
428 "the asset share the data instead"},
430 "PACK",
431 ICON_PACKAGE,
432 "Pack",
433 "Import the asset as linked data-block, and pack it in the current file (ensures that it "
434 "remains unchanged in case the library data is modified, is not available anymore, etc.)"},
435 {0, nullptr, 0, nullptr, nullptr},
436};
437
440 "ALL",
441 0,
442 "Online and Offline",
443 "Show assets that are both hosted online (need downloading) and available on disk already"},
445 "ONLY_ONLINE",
446 0,
447 "Online Only",
448 "Show only assets that need downloading (requires internet access)"},
450 "ONLY_OFFLINE",
451 0,
452 "Offline Only",
453 "Show only assets that are available on disk already (no internet access needed)"},
454 {0, nullptr, 0, nullptr, nullptr},
455};
456
457#ifndef RNA_RUNTIME
459 {STEREO_LEFT_ID, "LEFT_EYE", ICON_NONE, "Left Eye"},
460 {STEREO_RIGHT_ID, "RIGHT_EYE", ICON_NONE, "Right Eye"},
461 {0, nullptr, 0, nullptr, nullptr},
462};
463#endif
464
467 "COLOR_ALPHA",
468 ICON_IMAGE_RGB_ALPHA,
469 "Color & Alpha",
470 "Display image with RGB colors and alpha transparency"},
471 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
472 {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Display alpha transparency channel"},
474 "Z_BUFFER",
475 ICON_IMAGE_ZDEPTH,
476 "Z-Buffer",
477 "Display Z-buffer associated with image (mapped from camera clip start to end)"},
478 {SI_SHOW_R, "RED", ICON_RGB_RED, "Red", ""},
479 {SI_SHOW_G, "GREEN", ICON_RGB_GREEN, "Green", ""},
480 {SI_SHOW_B, "BLUE", ICON_RGB_BLUE, "Blue", ""},
481 {0, nullptr, 0, nullptr, nullptr},
482};
483
485 {OB_WIRE,
486 "WIREFRAME",
487 ICON_SHADING_WIRE,
488 "Wireframe",
489 "Display only edges of geometry without surface shading"},
490 {OB_SOLID,
491 "SOLID",
492 ICON_SHADING_SOLID,
493 "Solid",
494 "Display objects with flat lighting and basic surface shading"},
496 "MATERIAL",
497 ICON_SHADING_TEXTURE,
498 "Material Preview",
499 "Preview materials using predefined environment lights"},
500 {OB_RENDER,
501 "RENDERED",
502 ICON_SHADING_RENDERED,
503 "Rendered",
504 "Preview the final scene using the active render engine"},
505 {0, nullptr, 0, nullptr, nullptr},
506};
507
509 {V3D_LIGHTING_STUDIO, "STUDIO", 0, "Studio", "Display using studio lighting"},
510 {V3D_LIGHTING_MATCAP, "MATCAP", 0, "MatCap", "Display using matcap material and lighting"},
511 {V3D_LIGHTING_FLAT, "FLAT", 0, "Flat", "Display using flat lighting"},
512 {0, nullptr, 0, nullptr, nullptr},
513};
514
516 {V3D_SHADING_MATERIAL_COLOR, "MATERIAL", 0, "Material", "Show material color"},
517 {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color"},
518 {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color"},
519 {V3D_SHADING_VERTEX_COLOR, "VERTEX", 0, "Attribute", "Show active color attribute"},
521 "TEXTURE",
522 0,
523 "Texture",
524 "Show the texture from the active image texture node using the active UV map coordinates"},
525 {V3D_SHADING_SINGLE_COLOR, "SINGLE", 0, "Custom", "Show scene in a single custom color"},
526 {0, nullptr, 0, nullptr, nullptr},
527};
528
531 "THEME",
532 0,
533 "Theme",
534 "Show scene wireframes with the theme's wire color"},
535 {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color on wireframe"},
536 {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color on wireframe"},
537 {0, nullptr, 0, nullptr, nullptr},
538};
539
541 {0, "DEFAULT", 0, "Default", ""},
542 {0, nullptr, 0, nullptr, nullptr},
543};
544
547 {EEVEE_RENDER_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
548 {EEVEE_RENDER_PASS_EMIT, "EMISSION", 0, "Emission", ""},
549 {EEVEE_RENDER_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
550 {EEVEE_RENDER_PASS_AO, "AO", 0, "Ambient Occlusion", ""},
551 {EEVEE_RENDER_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
552 {EEVEE_RENDER_PASS_TRANSPARENT, "TRANSPARENT", 0, "Transparent", ""},
553
555 {EEVEE_RENDER_PASS_DIFFUSE_LIGHT, "DIFFUSE_LIGHT", 0, "Diffuse Light", ""},
556 {EEVEE_RENDER_PASS_DIFFUSE_COLOR, "DIFFUSE_COLOR", 0, "Diffuse Color", ""},
557 {EEVEE_RENDER_PASS_SPECULAR_LIGHT, "SPECULAR_LIGHT", 0, "Specular Light", ""},
558 {EEVEE_RENDER_PASS_SPECULAR_COLOR, "SPECULAR_COLOR", 0, "Specular Color", ""},
559 {EEVEE_RENDER_PASS_VOLUME_LIGHT, "VOLUME_LIGHT", 0, "Volume Light", ""},
560
562 {EEVEE_RENDER_PASS_POSITION, "POSITION", 0, "Position", ""},
563 {EEVEE_RENDER_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
564 {EEVEE_RENDER_PASS_MIST, "MIST", 0, "Mist", ""},
565 {EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT, "CryptoObject", 0, "CryptoObject", ""},
566 {EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET, "CryptoAsset", 0, "CryptoAsset", ""},
567 {EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL, "CryptoMaterial", 0, "CryptoMaterial", ""},
568
569 RNA_ENUM_ITEM_HEADING(CTX_N_(BLT_I18NCONTEXT_RENDER_LAYER, "Denoising Data"), nullptr),
570 {EEVEE_RENDER_PASS_DENOISING_DEPTH, "DENOISING_DEPTH", 0, "Denoising Depth", ""},
571 {EEVEE_RENDER_PASS_DENOISING_NORMAL, "DENOISING_NORMAL", 0, "Denoising Normal", ""},
572 {EEVEE_RENDER_PASS_DENOISING_ROUGHNESS, "DENOISING_ROUGHNESS", 0, "Denoising Roughness", ""},
574 "DIFFUSE_ALBEDO",
575 0,
576 "Denoising Diffuse Albedo",
577 ""},
579 "SPECULAR_ALBEDO",
580 0,
581 "Denoising Specular Albedo",
582 ""},
583
585 {EEVEE_RENDER_PASS_AOV, "AOV", 0, "AOV", ""},
586
587 {0, nullptr, 0, nullptr, nullptr},
588};
589
591 {SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"},
592 {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"},
593 {0, nullptr, 0, nullptr, nullptr},
594};
595
601 {BCONTEXT_TOOL, "TOOL", ICON_TOOL_SETTINGS, "Tool", "Active Tool and Workspace settings"},
602 {BCONTEXT_RENDER, "RENDER", ICON_SCENE, "Render", "Render Properties"},
603 {BCONTEXT_OUTPUT, "OUTPUT", ICON_OUTPUT, "Output", "Output Properties"},
604 {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene Properties"},
605 {BCONTEXT_VIEW_LAYER, "VIEW_LAYER", ICON_RENDER_RESULT, "View Layer", "View Layer Properties"},
607 "COMPOSITOR",
608 ICON_NODE_COMPOSITING,
609 "Compositor & Effects",
610 "Procedural scene post-processing"},
611 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World Properties"},
612 {BCONTEXT_COLLECTION, "COLLECTION", ICON_GROUP, "Collection", "Collection Properties"},
613 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object Properties"},
615 "CONSTRAINT",
616 ICON_CONSTRAINT,
617 "Constraints",
618 "Object Constraint Properties"},
619 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifier Properties"},
620 {BCONTEXT_DATA, "DATA", ICON_NONE, "Data", "Object Data Properties"},
621 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone Properties"},
623 "BONE_CONSTRAINT",
624 ICON_CONSTRAINT_BONE,
625 "Bone Constraints",
626 "Bone Constraint Properties"},
627 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material Properties"},
628 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture Properties"},
629 {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle Properties"},
630 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics Properties"},
631 {BCONTEXT_SHADERFX, "SHADERFX", ICON_SHADERFX, "Effects", "Visual Effects Properties"},
632 {BCONTEXT_STRIP, "STRIP", ICON_SEQ_STRIP, "Strip", "Strip Properties"},
634 "STRIP_MODIFIER",
635 ICON_SEQ_STRIP_MODIFIER,
636 "Strip Modifiers",
637 "Strip Modifier Properties"},
638 {0, nullptr, 0, nullptr, nullptr},
639};
640
642 {0, "NONE", 0, "None", "Only list current directory's content, with no recursion"},
643 {1, "BLEND", 0, "Blend File", "List .blend files' content"},
644 {2, "ALL_1", 0, "One Level", "List all sub-directories' content, one level of recursion"},
645 {3, "ALL_2", 0, "Two Levels", "List all sub-directories' content, two levels of recursion"},
646 {4,
647 "ALL_3",
648 0,
649 "Three Levels",
650 "List all sub-directories' content, three levels of recursion"},
651 {0, nullptr, 0, nullptr, nullptr},
652};
653
656 "LIST_VERTICAL",
657 ICON_LONGDISPLAY,
658 "Vertical List",
659 "Display files as a vertical list"},
661 "LIST_HORIZONTAL",
662 ICON_SHORTDISPLAY,
663 "Horizontal List",
664 "Display files as a horizontal list"},
665 {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
666 {0, nullptr, 0, nullptr, nullptr},
667};
668
670 {CURVE_HANDLE_NONE, "NONE", 0, "None", ""},
671 {CURVE_HANDLE_SELECTED, "SELECTED", 0, "Selected", ""},
672 {CURVE_HANDLE_ALL, "ALL", 0, "All", ""},
673 {0, nullptr, 0, nullptr, nullptr},
674};
675
678 "EVALUATED",
679 ICON_NONE,
680 "Evaluated",
681 "Use data from fully or partially evaluated object"},
683 "ORIGINAL",
684 ICON_NONE,
685 "Original",
686 "Use data from original object without any modifiers applied"},
688 "VIEWER_NODE",
689 ICON_NONE,
690 "Viewer Node",
691 "Use intermediate data from viewer node"},
692 {0, nullptr, 0, nullptr, nullptr},
693};
694
697 "GEOMETRY",
698 ICON_NONE,
699 "Geometry",
700 "Table contains geometry data"},
701 {0, nullptr, 0, nullptr, nullptr},
702
703};
704
705} // namespace blender
706
707#ifdef RNA_RUNTIME
708
709# include <algorithm>
710# include <fmt/format.h>
711
713
714# include "DNA_anim_types.h"
715# include "DNA_asset_types.h"
716# include "DNA_key_types.h"
717# include "DNA_scene_types.h"
718# include "DNA_screen_types.h"
719# include "DNA_sequence_types.h"
720# include "DNA_userdef_types.h"
721
722# include "BLI_index_range.hh"
723# include "BLI_math_matrix_c.hh"
724# include "BLI_math_rotation_c.hh"
725# include "BLI_math_vector_c.hh"
726# include "BLI_path_utils.hh"
727# include "BLI_string.hh"
728# include "BLI_string_utf8.hh"
729
730# include "BKE_anim_data.hh"
731# include "BKE_brush.hh"
732# include "BKE_context.hh"
733# include "BKE_global.hh"
734# include "BKE_icons.hh"
735# include "BKE_idprop.hh"
736# include "BKE_image.hh"
737# include "BKE_key.hh"
738# include "BKE_layer.hh"
739# include "BKE_lib_id.hh"
740# include "BKE_main.hh"
741# include "BKE_nla.hh"
742# include "BKE_node.hh"
743# include "BKE_paint.hh"
744# include "BKE_preferences.h"
745# include "BKE_scene.hh"
746# include "BKE_scene_context.hh"
747# include "BKE_screen.hh"
748# include "BKE_studiolight.h"
749# include "BKE_workspace.hh"
750
751# include "DEG_depsgraph.hh"
752# include "DEG_depsgraph_build.hh"
753
754# include "ED_anim_api.hh"
755# include "ED_asset.hh"
756# include "ED_buttons.hh"
757# include "ED_clip.hh"
758# include "ED_fileselect.hh"
759# include "ED_image.hh"
760# include "ED_node.hh"
761# include "ED_render.hh"
762# include "ED_screen.hh"
763# include "ED_sequencer.hh"
764# include "ED_spreadsheet.hh"
765# include "ED_text.hh"
766# include "ED_transform.hh"
767# include "ED_view3d.hh"
768
769# include "GPU_material.hh"
770
771# include "IMB_imbuf_types.hh"
772
773# include "UI_interface.hh"
774# include "UI_view2d.hh"
775
776# include "SEQ_proxy.hh"
777# include "SEQ_relations.hh"
778
779# include "RE_engine.h"
780
781# include "rna_screen_utils.hh"
782
783namespace blender {
784
785/* -------------------------------------------------------------------- */
788
789static StructRNA *rna_Space_refine(PointerRNA *ptr)
790{
791 SpaceLink *space = static_cast<SpaceLink *>(ptr->data);
792
793 switch (eSpace_Type(space->spacetype)) {
794 case SPACE_VIEW3D:
795 return RNA_SpaceView3D;
796 case SPACE_GRAPH:
797 return RNA_SpaceGraphEditor;
798 case SPACE_OUTLINER:
799 return RNA_SpaceOutliner;
800 case SPACE_PROPERTIES:
801 return RNA_SpaceProperties;
802 case SPACE_FILE:
803 return RNA_SpaceFileBrowser;
804 case SPACE_IMAGE:
805 return RNA_SpaceImageEditor;
806 case SPACE_INFO:
807 return RNA_SpaceInfo;
808 case SPACE_SEQ:
809 return RNA_SpaceSequenceEditor;
810 case SPACE_TEXT:
811 return RNA_SpaceTextEditor;
812 case SPACE_ACTION:
813 return RNA_SpaceDopeSheetEditor;
814 case SPACE_NLA:
815 return RNA_SpaceNLA;
816 case SPACE_NODE:
817 return RNA_SpaceNodeEditor;
818 case SPACE_CONSOLE:
819 return RNA_SpaceConsole;
820 case SPACE_USERPREF:
821 return RNA_SpacePreferences;
822 case SPACE_CLIP:
823 return RNA_SpaceClipEditor;
825 return RNA_SpaceSpreadsheet;
826 case SPACE_PROJECT:
827 return RNA_SpaceProject;
828
829 /* Currently no type info. */
830 case SPACE_SCRIPT:
831 case SPACE_EMPTY:
832 case SPACE_TOPBAR:
833 case SPACE_STATUSBAR:
834 break;
835 }
836
837 return RNA_Space;
838}
839
840static ScrArea *rna_area_from_space(const PointerRNA *ptr)
841{
842 BLI_assert(RNA_struct_is_a(ptr->type, RNA_Space));
843 SpaceLink *link = static_cast<SpaceLink *>(ptr->data);
844
845 switch (GS(ptr->owner_id->name)) {
846 case ID_WM: {
847 const wmWindowManager *wm = id_cast<wmWindowManager *>(ptr->owner_id);
848 for (const wmWindow &win : wm->windows) {
849 for (ScrArea &area : win.global_areas.areabase) {
850 if (BLI_findindex(&area.spacedata, link) != -1) {
851 return &area;
852 }
853 }
854 }
855 break;
856 }
857 case ID_SCR: {
858 const bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
859 return BKE_screen_find_area_from_space(screen, link);
860 }
861 default:
862 break;
863 }
865 return nullptr;
866}
867
868static void area_region_from_regiondata(bScreen *screen,
869 void *regiondata,
870 ScrArea **r_area,
871 ARegion **r_region)
872{
873 *r_area = nullptr;
874 *r_region = nullptr;
875
876 for (ScrArea &area : screen->areabase) {
877 for (ARegion &region : area.regionbase) {
878 if (region.regiondata == regiondata) {
879 *r_area = &area;
880 *r_region = &region;
881 return;
882 }
883 }
884 }
885}
886
887static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_area, ARegion **r_region)
888{
889 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
890 void *regiondata = (ptr->data);
891
892 area_region_from_regiondata(screen, regiondata, r_area, r_region);
893}
894
900static void rna_space_active_tool_reset(const PointerRNA *ptr)
901{
902 if (ScrArea *area = rna_area_from_space(ptr)) {
903 area->runtime.tool = nullptr;
904 area->runtime.is_tool_set = false;
905 area->flag |= AREA_FLAG_ACTIVE_TOOL_UPDATE;
906 }
907}
908
910
911/* -------------------------------------------------------------------- */
914
915static bool rna_Space_bool_from_region_flag_get_by_type(PointerRNA *ptr,
916 const int region_type,
917 const eRegion_Flag region_flag)
918{
919 ScrArea *area = rna_area_from_space(ptr);
920 ARegion *region = BKE_area_find_region_type(area, region_type);
921 if (region) {
922 return (region->flag & region_flag);
923 }
924 return false;
925}
926
927static void rna_Space_bool_from_region_flag_set_by_type(PointerRNA *ptr,
928 const int region_type,
929 const eRegion_Flag region_flag,
930 bool value)
931{
932 ScrArea *area = rna_area_from_space(ptr);
933 ARegion *region = BKE_area_find_region_type(area, region_type);
934 if (region && (region->alignment != RGN_ALIGN_NONE)) {
935 SET_FLAG_FROM_TEST(region->flag, value, region_flag);
936 }
937 ED_region_tag_redraw(region);
938}
939
940static void rna_Space_bool_from_region_flag_update_by_type(bContext *C,
941 PointerRNA *ptr,
942 const int region_type,
943 const eRegion_Flag region_flag)
944{
945 ScrArea *area = rna_area_from_space(ptr);
946 ARegion *region = BKE_area_find_region_type(area, region_type);
947 if (region) {
948 if (region_flag == RGN_FLAG_HIDDEN) {
949 /* Only support animation when the area is in the current context. */
950 if (region->overlap && (area == CTX_wm_area(C)) && !(U.uiflag & USER_REDUCE_MOTION) &&
951 !(region->alignment & (RGN_SPLIT_SCALE_PREV | RGN_ALIGN_HIDE_WITH_PREV)))
952 {
954 }
955 else {
957 }
958 }
959 else if (region_flag == RGN_FLAG_HIDDEN_BY_USER) {
960 if (!(region->flag & RGN_FLAG_HIDDEN_BY_USER) != !(region->flag & RGN_FLAG_HIDDEN)) {
961 ED_region_toggle_hidden(C, region);
962
963 if ((region->flag & RGN_FLAG_HIDDEN_BY_USER) == 0) {
965 }
966 }
967 }
968 }
969}
970
972
973/* -------------------------------------------------------------------- */
976
977/* Header Region. */
978static bool rna_Space_show_region_header_get(PointerRNA *ptr)
979{
980 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN);
981}
982static void rna_Space_show_region_header_set(PointerRNA *ptr, bool value)
983{
984 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN, !value);
985
986 /* Special case, never show the tool properties when the header is invisible. */
987 bool value_for_tool_header = value;
988 if (value == true) {
989 ScrArea *area = rna_area_from_space(ptr);
990 ARegion *region_tool_header = BKE_area_find_region_type(area, RGN_TYPE_TOOL_HEADER);
991 if (region_tool_header != nullptr) {
992 value_for_tool_header = !(region_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER);
993 }
994 }
995 rna_Space_bool_from_region_flag_set_by_type(
996 ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN, !value_for_tool_header);
997}
998static void rna_Space_show_region_header_update(bContext *C, PointerRNA *ptr)
999{
1000 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN);
1001 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN);
1002}
1003
1004/* Footer Region. */
1005static bool rna_Space_show_region_footer_get(PointerRNA *ptr)
1006{
1007 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN);
1008}
1009static void rna_Space_show_region_footer_set(PointerRNA *ptr, bool value)
1010{
1011 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN, !value);
1012}
1013static void rna_Space_show_region_footer_update(bContext *C, PointerRNA *ptr)
1014{
1015 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN);
1016}
1017
1018/* Tool Header Region.
1019 *
1020 * This depends on the 'RGN_TYPE_TOOL_HEADER'
1021 */
1022static bool rna_Space_show_region_tool_header_get(PointerRNA *ptr)
1023{
1024 return !rna_Space_bool_from_region_flag_get_by_type(
1026}
1027static void rna_Space_show_region_tool_header_set(PointerRNA *ptr, bool value)
1028{
1029 rna_Space_bool_from_region_flag_set_by_type(
1031 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN, !value);
1032}
1033static void rna_Space_show_region_tool_header_update(bContext *C, PointerRNA *ptr)
1034{
1035 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN);
1036}
1037
1038/* Tools Region. */
1039static bool rna_Space_show_region_toolbar_get(PointerRNA *ptr)
1040{
1041 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN);
1042}
1043static void rna_Space_show_region_toolbar_set(PointerRNA *ptr, bool value)
1044{
1045 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN, !value);
1046}
1047static void rna_Space_show_region_toolbar_update(bContext *C, PointerRNA *ptr)
1048{
1049 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN);
1050}
1051
1052static bool rna_Space_show_region_tool_props_get(PointerRNA *ptr)
1053{
1054 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
1055}
1056static void rna_Space_show_region_tool_props_set(PointerRNA *ptr, bool value)
1057{
1058 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN, !value);
1059}
1060static void rna_Space_show_region_tool_props_update(bContext *C, PointerRNA *ptr)
1061{
1062 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
1063}
1064
1065/* Channels Region. */
1066static bool rna_Space_show_region_channels_get(PointerRNA *ptr)
1067{
1068 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN);
1069}
1070static void rna_Space_show_region_channels_set(PointerRNA *ptr, bool value)
1071{
1072 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN, !value);
1073}
1074static void rna_Space_show_region_channels_update(bContext *C, PointerRNA *ptr)
1075{
1076 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN);
1077}
1078
1079/* UI Region */
1080static bool rna_Space_show_region_ui_get(PointerRNA *ptr)
1081{
1082 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN);
1083}
1084static void rna_Space_show_region_ui_set(PointerRNA *ptr, bool value)
1085{
1086 if (value) {
1087 ScrArea *area = rna_area_from_space(ptr);
1089 const float aspect = (region->v2d.flag & V2D_IS_INIT) ?
1090 (BLI_rctf_size_x(&region->v2d.cur) /
1091 (BLI_rcti_size_x(&region->v2d.mask) + 1)) :
1092 1.0f;
1093 if (region->runtime->type && BKE_regiontype_uses_category_tabs(region->runtime->type) &&
1094 (float(region->sizex) <= (UI_PANEL_CATEGORY_MIN_WIDTH / aspect)))
1095 {
1096 /* If the region is showing only tabs, increase to full width. */
1097 const int new_width = region->runtime->type->prefsizex ? region->runtime->type->prefsizex :
1098 250;
1099 region->sizex = short(new_width / aspect);
1100 }
1101 }
1102 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN, !value);
1103}
1104static void rna_Space_show_region_ui_update(bContext *C, PointerRNA *ptr)
1105{
1106 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN);
1107}
1108
1109/* Redo (HUD) Region */
1110static bool rna_Space_show_region_hud_get(PointerRNA *ptr)
1111{
1112 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER);
1113}
1114static void rna_Space_show_region_hud_set(PointerRNA *ptr, bool value)
1115{
1116 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER, !value);
1117}
1118static void rna_Space_show_region_hud_update(bContext *C, PointerRNA *ptr)
1119{
1120 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER);
1121}
1122
1123/* Asset Shelf Regions */
1124static bool rna_Space_show_region_asset_shelf_get(PointerRNA *ptr)
1125{
1126 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN);
1127}
1128static void rna_Space_show_region_asset_shelf_set(PointerRNA *ptr, bool value)
1129{
1130 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN, !value);
1131}
1132static int rna_Space_show_region_asset_shelf_editable(const PointerRNA *ptr, const char **r_info)
1133{
1134 ScrArea *area = rna_area_from_space(ptr);
1136
1137 if (!region) {
1138 return 0;
1139 }
1140
1141 if (region->flag & RGN_FLAG_POLL_FAILED) {
1142 if (r_info) {
1143 *r_info = N_(
1144 "The asset shelf is not available in the current context (try changing the active mode "
1145 "or tool)");
1146 }
1147 return 0;
1148 }
1149
1150 return PROP_EDITABLE;
1151}
1152
1153static void rna_Space_show_region_asset_shelf_update(bContext *C, PointerRNA *ptr)
1154{
1155 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN);
1156 rna_Space_bool_from_region_flag_update_by_type(
1158}
1159
1161
1162static bool rna_Space_view2d_sync_get(PointerRNA *ptr)
1163{
1164 ScrArea *area;
1165 ARegion *region;
1166
1167 area = rna_area_from_space(ptr); /* can be nullptr */
1168 if (area == nullptr) {
1169 return false;
1170 }
1171
1172 if (area->spacetype == SPACE_CLIP) {
1174 }
1175 else {
1177 }
1178 if (region) {
1179 View2D *v2d = &region->v2d;
1180 return (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME) != 0;
1181 }
1182
1183 return false;
1184}
1185
1186static void rna_Space_view2d_sync_set(PointerRNA *ptr, bool value)
1187{
1188 ScrArea *area;
1189 ARegion *region;
1190
1191 area = rna_area_from_space(ptr); /* can be nullptr */
1192 if (!area) {
1193 return;
1194 }
1195
1196 if (!ui::view2d_area_supports_sync(area)) {
1197 BKE_reportf(nullptr,
1198 RPT_ERROR,
1199 "'show_locked_time' is not supported for the '%s' editor",
1200 area->type->name);
1201 return;
1202 }
1203
1204 if (area->spacetype == SPACE_CLIP) {
1206 }
1207 else {
1209 }
1210 if (region) {
1211 View2D *v2d = &region->v2d;
1212 if (value) {
1213 v2d->flag |= V2D_VIEWSYNC_SCREEN_TIME;
1214 }
1215 else {
1216 v2d->flag &= ~V2D_VIEWSYNC_SCREEN_TIME;
1217 }
1218 }
1219}
1220
1221static void rna_Space_view2d_sync_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1222{
1223 ScrArea *area;
1224 ARegion *region;
1225
1226 area = rna_area_from_space(ptr); /* can be nullptr */
1227 if (area == nullptr) {
1228 return;
1229 }
1230
1231 if (area->spacetype == SPACE_CLIP) {
1233 }
1234 else {
1236 }
1237
1238 if (region) {
1239 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
1240 View2D *v2d = &region->v2d;
1241
1242 ui::view2d_sync(screen, area, v2d, V2D_LOCK_SET);
1243 }
1244}
1245
1246/* Space 3D View */
1247static void rna_SpaceView3D_camera_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1248{
1249 View3D *v3d = static_cast<View3D *>(ptr->data);
1250 if (v3d->scenelock && scene != nullptr) {
1251 wmWindowManager *wm = bmain->wm.first();
1252
1253 scene->camera = v3d->camera;
1254 WM_windows_scene_data_sync(&wm->windows, scene);
1255 }
1256}
1257
1258static void rna_SpaceView3D_use_local_camera_set(PointerRNA *ptr, bool value)
1259{
1260 View3D *v3d = static_cast<View3D *>(ptr->data);
1261 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
1262
1263 v3d->scenelock = !value;
1264
1265 if (!value) {
1266 Scene *scene = ED_screen_scene_find(screen, G_MAIN->wm.first());
1267 /* nullptr if the screen isn't in an active window (happens when setting from Python).
1268 * This could be moved to the update function, in that case the scene won't relate to the
1269 * screen so keep it working this way. */
1270 if (scene != nullptr) {
1271 v3d->camera = scene->camera;
1272 }
1273 }
1274}
1275
1276static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr)
1277{
1278 View3D *v3d = static_cast<View3D *>(ptr->data);
1279 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
1280 Scene *scene = ED_screen_scene_find(screen, G_MAIN->wm.first());
1281 if (scene != nullptr) {
1282 return ED_view3d_grid_scale(scene, v3d, nullptr);
1283 }
1284 else {
1285 /* When accessed from non-active screen. */
1286 return 1.0f;
1287 }
1288}
1289
1290static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
1291{
1292 View3D *v3d = static_cast<View3D *>(ptr->data);
1293 ScrArea *area = rna_area_from_space(ptr);
1294 void *regiondata = nullptr;
1295 if (area) {
1296 ListBaseT<ARegion> *regionbase = (area->spacedata.first_as<View3D>() == v3d) ?
1297 &area->regionbase :
1298 &v3d->regionbase;
1299 ARegion *region = regionbase->last(); /* always last in list, weak. */
1300 regiondata = region->regiondata;
1301 }
1302
1303 return RNA_pointer_create_with_parent(*ptr, RNA_RegionView3D, regiondata);
1304}
1305
1306static void rna_SpaceView3D_object_type_visibility_update(Main * /*bmain*/,
1307 Scene *scene,
1308 PointerRNA * /*ptr*/)
1309{
1311}
1312
1313static void rna_SpaceView3D_shading_use_compositor_update(Main * /*bmain*/,
1314 Scene * /*scene*/,
1315 PointerRNA * /*ptr*/)
1316{
1317 /* Nodes may display warnings when the compositor is enabled, so we need a redraw in that case,
1318 * and even when it gets disabled in order to potentially remove the warning. */
1320}
1321
1322static void rna_SpaceView3D_retopology_update(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
1323{
1324 /* Retopology can change the visibility of active object.
1325 * There is no actual data change but we just notify the viewport engine to refresh and pickup
1326 * the new visibility. */
1328}
1329
1330static void rna_SpaceView3D_show_overlay_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1331{
1332 /* If Retopology is enabled, toggling overlays can change the visibility of active object. */
1333 const View3D *v3d = static_cast<View3D *>(ptr->data);
1334 if (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_RETOPOLOGY) {
1335 rna_SpaceView3D_retopology_update(bmain, scene, ptr);
1336 }
1337}
1338
1339static void rna_SpaceView3D_region_quadviews_begin(CollectionPropertyIterator *iter,
1340 PointerRNA *ptr)
1341{
1342 View3D *v3d = static_cast<View3D *>(ptr->data);
1343 ScrArea *area = rna_area_from_space(ptr);
1344 int i = 3;
1345
1346 ARegion *region = static_cast<ARegion *>(
1347 ((area && area->spacedata.first_as<View3D>() == v3d) ? &area->regionbase : &v3d->regionbase)
1348 ->last());
1349 ListBaseT<ARegion> lb = {nullptr, nullptr};
1350
1351 if (region && region->alignment == RGN_ALIGN_QSPLIT) {
1352 while (i-- && region) {
1353 region = region->prev;
1354 }
1355
1356 if (i < 0) {
1357 lb.first_ = region;
1358 }
1359 }
1360
1361 rna_iterator_listbase_begin(iter, ptr, &lb, nullptr);
1362}
1363
1364static PointerRNA rna_SpaceView3D_region_quadviews_get(CollectionPropertyIterator *iter)
1365{
1366 void *regiondata = (static_cast<ARegion *>(rna_iterator_listbase_get(iter)))->regiondata;
1367
1368 return RNA_pointer_create_with_parent(iter->parent, RNA_RegionView3D, regiondata);
1369}
1370
1371static void rna_RegionView3D_quadview_update(Main * /*main*/, Scene * /*scene*/, PointerRNA *ptr)
1372{
1373 ScrArea *area;
1374 ARegion *region;
1375
1376 rna_area_region_from_regiondata(ptr, &area, &region);
1377 if (area && region && region->alignment == RGN_ALIGN_QSPLIT) {
1378 ED_view3d_quadview_update(area, region, false);
1379 }
1380}
1381
1383static void rna_RegionView3D_quadview_clip_update(Main * /*main*/,
1384 Scene * /*scene*/,
1385 PointerRNA *ptr)
1386{
1387 ScrArea *area;
1388 ARegion *region;
1389
1390 rna_area_region_from_regiondata(ptr, &area, &region);
1391 if (area && region && region->alignment == RGN_ALIGN_QSPLIT) {
1392 ED_view3d_quadview_update(area, region, true);
1393 }
1394}
1395
1396static RenderEngine *rna_RegionView3D_engine_get(const PointerRNA *ptr)
1397{
1398 const RegionView3D *rv3d = static_cast<RegionView3D *>(ptr->data);
1399 return rv3d->view_render ? RE_view_engine_get(rv3d->view_render) : nullptr;
1400}
1401
1402static bool rna_RegionView3D_pause_render_get(PointerRNA *ptr)
1403{
1404 const RenderEngine *engine = rna_RegionView3D_engine_get(ptr);
1405 return engine && RE_engine_view_pause_get(engine);
1406}
1407
1408static void rna_RegionView3D_pause_render_set(PointerRNA *ptr, const bool value)
1409{
1410 ScrArea *area;
1411 ARegion *region;
1412 rna_area_region_from_regiondata(ptr, &area, &region);
1413
1414 if (area && region && region->alignment == RGN_ALIGN_QSPLIT) {
1415 /* Pause all regions in quad split. */
1416 for (ARegion &region_iter : area->regionbase) {
1417 if (region_iter.regiontype != RGN_TYPE_WINDOW) {
1418 continue;
1419 }
1420 const RegionView3D *rv3d = static_cast<RegionView3D *>(region_iter.regiondata);
1421 if (rv3d && rv3d->view_render) {
1422 if (RenderEngine *engine = RE_view_engine_get(rv3d->view_render)) {
1423 RE_engine_view_pause_set(engine, value);
1424 }
1425 }
1426 }
1427 }
1428 else {
1429 /* Pause single region. */
1430 if (RenderEngine *engine = rna_RegionView3D_engine_get(ptr)) {
1431 RE_engine_view_pause_set(engine, value);
1432 }
1433 }
1434}
1435
1436static bool rna_RegionView3D_support_pause_render_get(PointerRNA *ptr)
1437{
1438 const RenderEngine *engine = rna_RegionView3D_engine_get(ptr);
1439 return engine && engine->type->view_pause && engine->type->view_resume;
1440}
1441
1442static void rna_RegionView3D_pause_render_update(Main *bmain,
1443 Scene * /*scene*/,
1444 PointerRNA * /*ptr*/)
1445{
1447}
1448
1454static void rna_RegionView3D_view_rotation_set_validate_view_axis(RegionView3D *rv3d)
1455{
1456 /* Never rotate from a "User" view into an axis aligned view,
1457 * otherwise rotation could be aligned by accident - giving unexpected behavior. */
1458 if (!RV3D_VIEW_IS_AXIS(rv3d->view)) {
1459 return;
1460 }
1461 /* Keep this small as script authors wont expect the assigned value to change. */
1462 const float eps_quat = 1e-6f;
1464 rv3d->viewquat, eps_quat, &rv3d->view, &rv3d->view_axis_roll);
1465}
1466
1467static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
1468{
1469 RegionView3D *rv3d = static_cast<RegionView3D *>(ptr->data);
1470 negate_v3_v3(values, rv3d->ofs);
1471}
1472
1473static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
1474{
1475 RegionView3D *rv3d = static_cast<RegionView3D *>(ptr->data);
1476 negate_v3_v3(rv3d->ofs, values);
1477}
1478
1479static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
1480{
1481 RegionView3D *rv3d = static_cast<RegionView3D *>(ptr->data);
1482 invert_qt_qt(values, rv3d->viewquat);
1483}
1484
1485static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
1486{
1487 RegionView3D *rv3d = static_cast<RegionView3D *>(ptr->data);
1488 invert_qt_qt(rv3d->viewquat, values);
1489 rna_RegionView3D_view_rotation_set_validate_view_axis(rv3d);
1490}
1491
1492static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
1493{
1494 RegionView3D *rv3d = static_cast<RegionView3D *>(ptr->data);
1495 float mat[4][4];
1496 invert_m4_m4(mat, reinterpret_cast<float (*)[4]>(const_cast<float *>(values)));
1497 ED_view3d_from_m4(mat, rv3d->ofs, rv3d->viewquat, &rv3d->dist, 0.0f);
1498 rna_RegionView3D_view_rotation_set_validate_view_axis(rv3d);
1499}
1500
1501static bool rna_RegionView3D_is_orthographic_side_view_get(PointerRNA *ptr)
1502{
1503 /* NOTE: only checks axis alignment, not orthographic,
1504 * we may deprecate the current name to reflect this. */
1505 RegionView3D *rv3d = static_cast<RegionView3D *>(ptr->data);
1506 return RV3D_VIEW_IS_AXIS(rv3d->view);
1507}
1508
1509static void rna_RegionView3D_is_orthographic_side_view_set(PointerRNA *ptr, bool value)
1510{
1511 RegionView3D *rv3d = static_cast<RegionView3D *>(ptr->data);
1512 const bool was_axis_view = RV3D_VIEW_IS_AXIS(rv3d->view);
1513 if (value) {
1514 /* Already axis aligned, nothing to do. */
1515 if (was_axis_view) {
1516 return;
1517 }
1518 /* Use a large value as we always want to set this to the closest axis. */
1519 const float eps_quat = FLT_MAX;
1521 rv3d->viewquat, eps_quat, &rv3d->view, &rv3d->view_axis_roll);
1522 }
1523 else {
1524 /* Only allow changing from axis-views to user view as camera view for example
1525 * doesn't make sense to update. */
1526 if (!was_axis_view) {
1527 return;
1528 }
1529 rv3d->view = RV3D_VIEW_USER;
1530 }
1531}
1532
1533static IDProperty **rna_View3DShading_idprops(PointerRNA *ptr)
1534{
1535 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1536 return &shading->prop;
1537}
1538
1539static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1540{
1541 ID *id = ptr->owner_id;
1542 if (GS(id->name) != ID_SCR) {
1543 return;
1544 }
1545
1546 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1547 if (shading->type == OB_MATERIAL ||
1548 (shading->type == OB_RENDER && !BKE_scene_uses_blender_workbench(scene)))
1549 {
1550 /* When switching from workbench to render or material mode the geometry of any
1551 * active sculpt session needs to be recalculated. */
1552 for (Object &ob : bmain->objects) {
1553 if (ob.runtime->sculpt_session) {
1555 }
1556 }
1557 }
1558
1559 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
1560 for (ScrArea &area : screen->areabase) {
1561 for (SpaceLink &sl : area.spacedata) {
1562 if (sl.spacetype == SPACE_VIEW3D) {
1563 View3D *v3d = (View3D *)&sl;
1564 if (&v3d->shading == shading) {
1565 ED_view3d_shade_update(bmain, v3d, &area);
1566 return;
1567 }
1568 }
1569 }
1570 }
1571}
1572
1573static Scene *rna_3DViewShading_scene(PointerRNA *ptr)
1574{
1575 /* Get scene, depends if using 3D view or OpenGL render settings. */
1576 ID *id = ptr->owner_id;
1577 if (GS(id->name) == ID_SCE) {
1578 return id_cast<Scene *>(id);
1579 }
1580 else if (GS(id->name) == ID_WM) {
1581 /* For XR shading settings. */
1582 return nullptr;
1583 }
1584 else {
1585 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
1586 return WM_windows_scene_get_from_screen(G_MAIN->wm.first(), screen);
1587 }
1588}
1589
1590static ViewLayer *rna_3DViewShading_view_layer(PointerRNA *ptr)
1591{
1592 /* Get scene, depends if using 3D view or OpenGL render settings. */
1593 ID *id = ptr->owner_id;
1594 if (GS(id->name) == ID_SCE) {
1595 return nullptr;
1596 }
1597 else if (GS(id->name) == ID_WM) {
1598 /* For XR shading settings. */
1599 return nullptr;
1600 }
1601 else {
1602 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
1603 return WM_windows_view_layer_get_from_screen(G_MAIN->wm.first(), screen);
1604 }
1605}
1606
1607static int rna_3DViewShading_type_get(PointerRNA *ptr)
1608{
1609 /* Available shading types depend on render engine. */
1610 Scene *scene = rna_3DViewShading_scene(ptr);
1611 RenderEngineType *type = (scene) ? RE_engines_find(scene->r.engine) : nullptr;
1612 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1613
1614 if (scene == nullptr || BKE_scene_uses_blender_eevee(scene)) {
1615 return shading->type;
1616 }
1617 else if (BKE_scene_uses_blender_workbench(scene)) {
1618 return (shading->type == OB_MATERIAL) ? int(OB_SOLID) : shading->type;
1619 }
1620 else {
1621 if (shading->type == OB_RENDER && !(type && type->view_draw)) {
1622 return OB_MATERIAL;
1623 }
1624 else {
1625 return shading->type;
1626 }
1627 }
1628}
1629
1630static void rna_3DViewShading_type_set(PointerRNA *ptr, int value)
1631{
1632 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1633 if (value != shading->type && value == OB_RENDER) {
1634 shading->prev_type = shading->type;
1635 }
1636 shading->type = eDrawType(value);
1637}
1638
1639static const EnumPropertyItem *rna_3DViewShading_type_itemf(bContext * /*C*/,
1640 PointerRNA *ptr,
1641 PropertyRNA * /*prop*/,
1642 bool *r_free)
1643{
1644 Scene *scene = rna_3DViewShading_scene(ptr);
1645 RenderEngineType *type = (scene) ? RE_engines_find(scene->r.engine) : nullptr;
1646
1647 EnumPropertyItem *item = nullptr;
1648 int totitem = 0;
1649
1652
1653 if (scene == nullptr || BKE_scene_uses_blender_eevee(scene)) {
1656 }
1657 else if (BKE_scene_uses_blender_workbench(scene)) {
1659 }
1660 else {
1662 if (type && type->view_draw) {
1664 }
1665 }
1666
1667 RNA_enum_item_end(&item, &totitem);
1668 *r_free = true;
1669
1670 return item;
1671}
1672
1673/* Shading.selected_studio_light */
1674static PointerRNA rna_View3DShading_selected_studio_light_get(PointerRNA *ptr)
1675{
1676 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1677 StudioLight *sl;
1678 if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_MATCAP) {
1679 sl = BKE_studiolight_find(shading->matcap, STUDIOLIGHT_TYPE_MATCAP);
1680 }
1681 else if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_STUDIO) {
1682 sl = BKE_studiolight_find(shading->studio_light, STUDIOLIGHT_TYPE_STUDIO);
1683 }
1684 else {
1685 /* OB_MATERIAL and OB_RENDER */
1686 sl = BKE_studiolight_find(shading->lookdev_light, STUDIOLIGHT_TYPE_WORLD);
1687 }
1688 return RNA_pointer_create_with_parent(*ptr, RNA_StudioLight, sl);
1689}
1690
1691/* shading.light */
1692static void rna_View3DShading_studio_light_get_storage(View3DShading *shading,
1693 char **dna_storage,
1694 int *flag)
1695{
1696 *dna_storage = shading->studio_light;
1697
1699 if (shading->type == OB_SOLID) {
1700 if (shading->light == V3D_LIGHTING_MATCAP) {
1702 *dna_storage = shading->matcap;
1703 }
1704 }
1705 else {
1706 *flag = STUDIOLIGHT_TYPE_WORLD;
1707 *dna_storage = shading->lookdev_light;
1708 }
1709}
1710
1711static int rna_View3DShading_studio_light_get(PointerRNA *ptr)
1712{
1713 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1714 char *dna_storage;
1715 int flag;
1716
1717 rna_View3DShading_studio_light_get_storage(shading, &dna_storage, &flag);
1718 StudioLight *sl = BKE_studiolight_find(dna_storage, flag);
1719 if (sl) {
1720 BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE);
1721 return sl->index;
1722 }
1723 else {
1724 return 0;
1725 }
1726}
1727
1728static void rna_View3DShading_studio_light_set(PointerRNA *ptr, int value)
1729{
1730 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1731 char *dna_storage;
1732 int flag;
1733
1734 rna_View3DShading_studio_light_get_storage(shading, &dna_storage, &flag);
1735 StudioLight *sl = BKE_studiolight_findindex(value, flag);
1736 if (sl) {
1737 BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE);
1738 }
1739}
1740
1741static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(bContext * /*C*/,
1742 PointerRNA *ptr,
1743 PropertyRNA * /*prop*/,
1744 bool *r_free)
1745{
1746 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1747 EnumPropertyItem *item = nullptr;
1748 int totitem = 0;
1749
1750 if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_MATCAP) {
1752
1753 const ListBaseT<StudioLight> &studio_lights = BKE_studiolight_listbase();
1754 for (const StudioLight &sl : studio_lights) {
1755 int icon_id = (shading->flag & V3D_SHADING_MATCAP_FLIP_X) ? sl.icon_id_matcap_flipped :
1756 sl.icon_id_matcap;
1757 if ((sl.flag & flags) == flags) {
1758 EnumPropertyItem tmp = {sl.index, sl.name, icon_id, sl.name, ""};
1759 RNA_enum_item_add(&item, &totitem, &tmp);
1760 }
1761 }
1762 }
1763 else {
1764 const ListBaseT<StudioLight> &studio_lights = BKE_studiolight_listbase();
1765 for (const StudioLight &sl : studio_lights) {
1766 int icon_id = sl.icon_id_irradiance;
1767 bool show_studiolight = false;
1768
1769 if (sl.flag & STUDIOLIGHT_INTERNAL) {
1770 /* always show internal lights for solid */
1771 if (shading->type == OB_SOLID) {
1772 show_studiolight = true;
1773 }
1774 }
1775 else {
1776 switch (shading->type) {
1777 case OB_SOLID:
1778 case OB_TEXTURE:
1779 show_studiolight = ((sl.flag & STUDIOLIGHT_TYPE_STUDIO) != 0);
1780 break;
1781
1782 case OB_MATERIAL:
1783 case OB_RENDER:
1784 show_studiolight = ((sl.flag & STUDIOLIGHT_TYPE_WORLD) != 0);
1785 icon_id = sl.icon_id_radiance;
1786 break;
1787
1788 case OB_BOUNDBOX:
1789 case OB_WIRE:
1790 break;
1791 }
1792 }
1793
1794 if (show_studiolight) {
1795 EnumPropertyItem tmp = {sl.index, sl.name, icon_id, sl.name, ""};
1796 RNA_enum_item_add(&item, &totitem, &tmp);
1797 }
1798 }
1799 }
1800
1801 RNA_enum_item_end(&item, &totitem);
1802 *r_free = true;
1803 return item;
1804}
1805
1806static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C,
1807 PointerRNA * /*ptr*/,
1808 PropertyRNA * /*prop*/,
1809 bool *r_free)
1810{
1811 if (C == nullptr) {
1813 }
1814
1815 Scene *scene = CTX_data_scene(C);
1816 ViewLayer *view_layer = CTX_data_view_layer(C);
1817
1818 const bool aov_available = BKE_view_layer_has_valid_aov(view_layer);
1819 const bool eevee_active = STREQ(scene->r.engine, "BLENDER_EEVEE");
1820
1821 int totitem = 0;
1822 EnumPropertyItem *result = nullptr;
1823 EnumPropertyItem aov_template;
1824 for (int i = 0; rna_enum_view3dshading_render_pass_type_items[i].identifier != nullptr; i++) {
1826 if (item->value == EEVEE_RENDER_PASS_AOV) {
1827 aov_template.value = item->value;
1828 aov_template.icon = 0;
1829 aov_template.description = item->description;
1830 for (ViewLayerAOV &aov : view_layer->aovs) {
1831 if ((aov.flag & AOV_CONFLICT) != 0) {
1832 continue;
1833 }
1834 aov_template.name = aov.name;
1835 aov_template.identifier = aov.name;
1836 RNA_enum_item_add(&result, &totitem, &aov_template);
1837 aov_template.value++;
1838 }
1839 }
1840 else if (ELEM(item->value,
1844 !eevee_active)
1845 {
1846 }
1847 else if (!aov_available && STREQ(item->name, "Shader AOV")) {
1848 /* Don't add Shader AOV submenu when there are no AOVs defined. */
1849 }
1850 else {
1851 RNA_enum_item_add(&result, &totitem, item);
1852 }
1853 }
1854
1855 RNA_enum_item_end(&result, &totitem);
1856 *r_free = true;
1857 return result;
1858}
1859static int rna_3DViewShading_render_pass_get(PointerRNA *ptr)
1860{
1861 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1863 ViewLayer *view_layer = rna_3DViewShading_view_layer(ptr);
1864
1866 if (!view_layer) {
1868 }
1869 const int aov_index = BLI_findstringindex(
1870 &view_layer->aovs, shading->aov_name, offsetof(ViewLayerAOV, name));
1871 if (aov_index == -1) {
1873 }
1874 return result + aov_index;
1875 }
1876
1877 return result;
1878}
1879
1880static void rna_3DViewShading_render_pass_set(PointerRNA *ptr, int value)
1881{
1882 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1883 ViewLayer *view_layer = rna_3DViewShading_view_layer(ptr);
1884 shading->aov_name[0] = 0;
1885
1886 if ((value & EEVEE_RENDER_PASS_AOV) != 0) {
1887 if (!view_layer) {
1888 shading->render_pass = EEVEE_RENDER_PASS_COMBINED;
1889 return;
1890 }
1891 const int aov_index = value & ~EEVEE_RENDER_PASS_AOV;
1892 ViewLayerAOV *aov = static_cast<ViewLayerAOV *>(BLI_findlink(&view_layer->aovs, aov_index));
1893 if (!aov) {
1894 /* AOV not found, cannot select AOV. */
1895 shading->render_pass = EEVEE_RENDER_PASS_COMBINED;
1896 return;
1897 }
1898
1899 shading->render_pass = EEVEE_RENDER_PASS_AOV;
1900 STRNCPY(shading->aov_name, aov->name);
1901 }
1902 else {
1903 shading->render_pass = value;
1904 }
1905}
1906
1907static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA *ptr)
1908{
1909 Main *bmain = CTX_data_main(C);
1910 Scene *scene = CTX_data_scene(C);
1911 ViewLayer *view_layer = CTX_data_view_layer(C);
1912 View3D *v3d = static_cast<View3D *>(ptr->data);
1913
1914 if (ED_view3d_local_collections_set(bmain, v3d)) {
1915 BKE_layer_collection_local_sync(*bmain, scene, view_layer, v3d);
1917 }
1918}
1919
1920static const EnumPropertyItem *rna_SpaceView3D_stereo3d_camera_itemf(bContext *C,
1921 PointerRNA * /*ptr*/,
1922 PropertyRNA * /*prop*/,
1923 bool * /*r_free*/)
1924{
1925 Scene *scene = (C) ? CTX_data_scene(C) : nullptr;
1926
1927 if (scene && scene->r.views_format == SCE_VIEWS_FORMAT_MULTIVIEW) {
1928 return multiview_camera_items;
1929 }
1930 else {
1931 return stereo3d_camera_items;
1932 }
1933}
1934
1935static void rna_SpaceView3D_mirror_xr_session_update(Main *main,
1936 Scene * /*scene*/,
1937 PointerRNA *ptr)
1938{
1939# ifdef WITH_XR_OPENXR
1940 const wmWindowManager *wm = main->wm.first();
1941
1942 /* Handle mirror toggling while there is a session already. */
1943 if (WM_xr_session_exists(&wm->xr)) {
1944 const View3D *v3d = static_cast<const View3D *>(ptr->data);
1945 const ScrArea *area = rna_area_from_space(ptr);
1946 ED_view3d_xr_mirror_update(area, v3d, v3d->flag & V3D_XR_SESSION_MIRROR);
1947 }
1948
1949# else
1950 UNUSED_VARS(main, ptr);
1951# endif
1952}
1953
1954static int rna_SpaceView3D_icon_from_show_object_viewport_get(PointerRNA *ptr)
1955{
1956 const View3D *v3d = static_cast<View3D *>(ptr->data);
1957 return rna_object_type_visibility_icon_get_common(v3d->object_type_exclude_viewport,
1958 &v3d->object_type_exclude_select);
1959}
1960
1961static std::optional<std::string> rna_View3DShading_path(const PointerRNA *ptr)
1962{
1963 if (GS(ptr->owner_id->name) == ID_SCE) {
1964 return "display.shading";
1965 }
1966 else if (GS(ptr->owner_id->name) == ID_SCR) {
1967 const bScreen *screen = reinterpret_cast<bScreen *>(ptr->owner_id);
1968 const View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1969
1970 for (const auto [area_index, area] : screen->areabase.enumerate()) {
1971 for (const auto [space_index, sl] : area.spacedata.enumerate()) {
1972 if (sl.spacetype == SPACE_VIEW3D) {
1973 const View3D *v3d = reinterpret_cast<const View3D *>(&sl);
1974 if (&v3d->shading == shading) {
1975 return fmt::format("areas[{}].spaces[{}].shading", area_index, space_index);
1976 }
1977 }
1978 }
1979 }
1980 }
1981
1982 return "shading";
1983}
1984
1985static PointerRNA rna_SpaceView3D_overlay_get(PointerRNA *ptr)
1986{
1987 return RNA_pointer_create_with_parent(*ptr, RNA_View3DOverlay, ptr->data);
1988}
1989
1990static std::optional<std::string> rna_View3DOverlay_path(const PointerRNA *ptr)
1991{
1992 std::optional<std::string> editor_path = BKE_screen_path_to_space(ptr);
1993 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
1994}
1995
1996/* Space Image Editor */
1997
1998static PointerRNA rna_SpaceImage_overlay_get(PointerRNA *ptr)
1999{
2000 return RNA_pointer_create_with_parent(*ptr, RNA_SpaceImageOverlay, ptr->data);
2001}
2002
2003static std::optional<std::string> rna_SpaceImageOverlay_path(const PointerRNA *ptr)
2004{
2005 std::optional<std::string> editor_path = BKE_screen_path_to_space(ptr);
2006 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
2007}
2008
2009static std::optional<std::string> rna_SpaceUVEditor_path(const PointerRNA *ptr)
2010{
2011 std::optional<std::string> editor_path = BKE_screen_path_to_space(ptr);
2012 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "uv_editor");
2013}
2014
2015static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
2016{
2017 return RNA_pointer_create_with_parent(*ptr, RNA_SpaceUVEditor, ptr->data);
2018}
2019
2020static void rna_SpaceImageEditor_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
2021{
2022 if (scene != nullptr) {
2023 ED_space_image_paint_update(bmain, bmain->wm.first(), scene);
2024 }
2025
2026 /* The mode defines the tool. */
2027 rna_space_active_tool_reset(ptr);
2028}
2029
2030static void rna_SpaceImageEditor_show_stereo_set(PointerRNA *ptr, bool value)
2031{
2032 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2033
2034 if (value) {
2035 sima->iuser.flag |= IMA_SHOW_STEREO;
2036 }
2037 else {
2038 sima->iuser.flag &= ~IMA_SHOW_STEREO;
2039 }
2040}
2041
2042static bool rna_SpaceImageEditor_show_stereo_get(PointerRNA *ptr)
2043{
2044 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2045 return (sima->iuser.flag & IMA_SHOW_STEREO) != 0;
2046}
2047
2048static void rna_SpaceImageEditor_show_stereo_update(Main * /*bmain*/,
2049 Scene * /*scene*/,
2050 PointerRNA *ptr)
2051{
2052 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2053 Image *ima = sima->image;
2054
2055 if (ima) {
2056 if (ima->rr) {
2057 BKE_image_multilayer_index(ima->rr, &sima->iuser);
2058 }
2059 else {
2060 BKE_image_multiview_index(ima, &sima->iuser);
2061 }
2062 }
2063}
2064
2065static void rna_SpaceImageEditor_show_sequencer_scene_set(PointerRNA *ptr, bool value)
2066{
2067 SpaceImage *sima = ptr->data_as<SpaceImage>();
2068
2069 if (value) {
2070 sima->iuser.flag |= IMA_SHOW_SEQUENCER_SCENE;
2071 }
2072 else {
2073 sima->iuser.flag &= ~IMA_SHOW_SEQUENCER_SCENE;
2074 }
2075}
2076
2077static bool rna_SpaceImageEditor_show_sequencer_scene_get(PointerRNA *ptr)
2078{
2079 SpaceImage *sima = ptr->data_as<SpaceImage>();
2080 return (sima->iuser.flag & IMA_SHOW_SEQUENCER_SCENE) != 0;
2081}
2082
2083static bool rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
2084{
2085 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2086 return ED_space_image_show_render(sima);
2087}
2088
2089static bool rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
2090{
2091 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2092 return ED_space_image_show_paint(sima);
2093}
2094
2095static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
2096{
2097 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2098 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
2099 Object *obedit = nullptr;
2100 wmWindow *win = ED_screen_window_find(screen, G_MAIN->wm.first());
2101 if (win != nullptr) {
2102 Scene *scene = WM_window_get_active_scene(win);
2103 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
2104 /* FIXME Using G_MAIN is weak, but should work in practice given current context
2105 * (code already relies on 'G_MAIN data'). */
2106 BKE_view_layer_synced_ensure(*G_MAIN, scene, view_layer);
2107 obedit = BKE_view_layer_edit_object_get(view_layer);
2108 }
2109 return ED_space_image_show_uvedit(sima, obedit);
2110}
2111
2112static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
2113{
2114 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2115 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
2116 Object *obedit = nullptr;
2117 wmWindow *win = ED_screen_window_find(screen, G_MAIN->wm.first());
2118 if (win != nullptr) {
2119 Scene *scene = WM_window_get_active_scene(win);
2120 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
2121 /* FIXME Using G_MAIN is weak, but should work in practice given current context
2122 * (code already relies on 'G_MAIN data'). */
2123 BKE_view_layer_synced_ensure(*G_MAIN, scene, view_layer);
2124 obedit = BKE_view_layer_edit_object_get(view_layer);
2125 }
2126 return ED_space_image_check_show_maskedit(sima, obedit);
2127}
2128
2129static void rna_SpaceImageEditor_image_set(PointerRNA *ptr,
2130 PointerRNA value,
2131 ReportList * /*reports*/)
2132{
2133 BLI_assert(BKE_id_is_in_global_main(static_cast<ID *>(value.data)));
2134 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2135 ED_space_image_set(G_MAIN, sima, static_cast<Image *>(value.data), false);
2136}
2137
2138static void rna_SpaceImageEditor_mask_set(PointerRNA *ptr,
2139 PointerRNA value,
2140 ReportList * /*reports*/)
2141{
2142 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2143
2144 ED_space_image_set_mask(nullptr, sima, static_cast<Mask *>(value.data));
2145}
2146
2147static const EnumPropertyItem *rna_SpaceImageEditor_display_channels_itemf(bContext * /*C*/,
2148 PointerRNA *ptr,
2149 PropertyRNA * /*prop*/,
2150 bool *r_free)
2151{
2152 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2153 EnumPropertyItem *item = nullptr;
2154 ImBuf *ibuf;
2155 void *lock;
2156 int totitem = 0;
2157
2158 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0, false);
2161
2162 if (mask & SI_USE_ALPHA) {
2164 }
2166 if (mask & SI_SHOW_ALPHA) {
2168 }
2169 if (mask & SI_SHOW_ZBUF) {
2171 }
2172 if (mask & SI_SHOW_R) {
2174 }
2175 if (mask & SI_SHOW_G) {
2177 }
2178 if (mask & SI_SHOW_B) {
2180 }
2181
2182 RNA_enum_item_end(&item, &totitem);
2183 *r_free = true;
2184
2185 return item;
2186}
2187
2188static int rna_SpaceImageEditor_display_channels_get(PointerRNA *ptr)
2189{
2190 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2191 ImBuf *ibuf;
2192 void *lock;
2193
2194 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0, false);
2197
2198 return sima->flag & mask;
2199}
2200
2201static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
2202{
2203 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2204 ScrArea *area;
2205 ARegion *region;
2206
2207 values[0] = values[1] = 1;
2208
2209 /* Find #ARegion. */
2210 area = rna_area_from_space(ptr); /* can be nullptr */
2212 if (region) {
2213 ED_space_image_get_zoom(sima, region, &values[0], &values[1]);
2214 }
2215}
2216
2217static float rna_SpaceImageEditor_zoom_percentage_get(PointerRNA *ptr)
2218{
2219 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2220 return sima->zoom * 100.0f;
2221}
2222
2223static void rna_SpaceImageEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
2224{
2225 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2226 sima->zoom = value / 100.0f;
2227}
2228
2229static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
2230{
2231 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2232
2233 if (sima->flag & SI_COORDFLOATS) {
2234 copy_v2_v2(values, sima->cursor);
2235 }
2236 else {
2237 int w, h;
2238 ED_space_image_get_size(sima, &w, &h);
2239
2240 values[0] = sima->cursor[0] * w;
2241 values[1] = sima->cursor[1] * h;
2242 }
2243}
2244
2245static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
2246{
2247 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2248
2249 if (sima->flag & SI_COORDFLOATS) {
2250 copy_v2_v2(sima->cursor, values);
2251 }
2252 else {
2253 int w, h;
2254 ED_space_image_get_size(sima, &w, &h);
2255
2256 sima->cursor[0] = values[0] / w;
2257 sima->cursor[1] = values[1] / h;
2258 }
2259}
2260
2261static void rna_SpaceImageEditor_image_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2262{
2263 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2264 Image *ima = sima->image;
2265
2266 /* make sure all the iuser settings are valid for the sima image */
2267 if (ima) {
2268 if (ima->rr) {
2269 if (BKE_image_multilayer_index(sima->image->rr, &sima->iuser) == nullptr) {
2270 BKE_image_init_imageuser(sima->image, &sima->iuser);
2271 }
2272 }
2273 else {
2274 BKE_image_multiview_index(ima, &sima->iuser);
2275 }
2276 }
2277}
2278
2279static void rna_SpaceImageEditor_scopes_update(bContext *C, PointerRNA *ptr)
2280{
2281 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2282 ImBuf *ibuf;
2283 void *lock;
2284
2285 /* TODO(lukas): Support tiles in scopes? */
2286 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0, true);
2287 if (ibuf) {
2288 ED_space_image_scopes_update(C, sima, ibuf, true);
2289 WM_main_add_notifier(NC_IMAGE, sima->image);
2290 }
2292}
2293
2294static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext * /*C*/,
2295 PointerRNA *ptr,
2296 PropertyRNA * /*prop*/,
2297 bool * /*r_free*/)
2298{
2299 static const EnumPropertyItem pivot_items[] = {
2301 "BOUNDING_BOX_CENTER",
2302 ICON_PIVOT_BOUNDBOX,
2303 "Bounding Box Center",
2304 ""},
2305 {V3D_AROUND_CENTER_MEDIAN, "MEDIAN_POINT", ICON_PIVOT_MEDIAN, "Median Point", ""},
2306 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
2308 "INDIVIDUAL_ORIGINS",
2309 ICON_PIVOT_INDIVIDUAL,
2310 "Individual Origins",
2311 "Pivot around each selected island's own median point"},
2312 {0, nullptr, 0, nullptr, nullptr},
2313 };
2314
2315 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
2316
2317 if (sima->mode == SI_MODE_PAINT) {
2319 }
2320 else {
2321 return pivot_items;
2322 }
2323}
2324
2325static void rna_SpaceUVEditor_tile_grid_shape_set(PointerRNA *ptr, const int *values)
2326{
2327 SpaceImage *data = static_cast<SpaceImage *>(ptr->data);
2328
2329 int clamp[2] = {10, 100};
2330 for (int i = 0; i < 2; i++) {
2331 data->tile_grid_shape[i] = std::clamp(values[i], 1, clamp[i]);
2332 }
2333}
2334
2335static void rna_SpaceUVEditor_custom_grid_subdiv_set(PointerRNA *ptr, const int *values)
2336{
2337 SpaceImage *data = static_cast<SpaceImage *>(ptr->data);
2338
2339 for (int i = 0; i < 2; i++) {
2340 data->custom_grid_subdiv[i] = std::clamp(values[i], 1, 5000);
2341 }
2342}
2343
2344/* Space Text Editor */
2345
2346static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, bool value)
2347{
2348 SpaceText *st = static_cast<SpaceText *>(ptr->data);
2349
2350 st->wordwrap = value;
2351 st->left = 0;
2352}
2353
2354static void rna_SpaceTextEditor_text_set(PointerRNA *ptr,
2355 PointerRNA value,
2356 ReportList * /*reports*/)
2357{
2358 SpaceText *st = static_cast<SpaceText *>(ptr->data);
2359
2360 st->text = static_cast<Text *>(value.data);
2361 if (st->text != nullptr) {
2362 id_us_ensure_real(reinterpret_cast<ID *>(st->text));
2363 }
2364
2365 ScrArea *area = rna_area_from_space(ptr);
2366 if (area) {
2368 if (region) {
2369 ED_space_text_scroll_to_cursor(st, region, true);
2370 }
2371 }
2372}
2373
2374static bool rna_SpaceTextEditor_text_is_syntax_highlight_supported(SpaceText *space)
2375{
2376 return ED_text_is_syntax_highlight_supported(space->text);
2377}
2378
2379static void rna_SpaceTextEditor_updateEdited(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2380{
2381 SpaceText *st = static_cast<SpaceText *>(ptr->data);
2382
2383 if (st->text) {
2385 }
2386}
2387
2388static int rna_SpaceTextEditor_visible_lines_get(PointerRNA *ptr)
2389{
2390 const SpaceText *st = static_cast<SpaceText *>(ptr->data);
2392}
2393
2394/* Space Properties */
2395
2396static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
2397{
2398 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2399
2400 if (sbuts->pinid) {
2401 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
2402 }
2403
2404 return RNA_ID;
2405}
2406
2407static void rna_SpaceProperties_pin_id_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2408{
2409 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2410 ID *id = sbuts->pinid;
2411
2412 if (id == nullptr) {
2413 sbuts->flag &= ~SB_PIN_CONTEXT;
2414 return;
2415 }
2416
2417 switch (GS(id->name)) {
2418 case ID_MA:
2420 break;
2421 case ID_TE:
2423 break;
2424 case ID_WO:
2426 break;
2427 case ID_LA:
2428 WM_main_add_notifier(NC_LAMP, nullptr);
2429 break;
2430 default:
2431 break;
2432 }
2433}
2434
2435static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
2436{
2437 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2438
2439 sbuts->mainb = eSpaceButtons_Context(value);
2440 sbuts->mainbuser = eSpaceButtons_Context(value);
2441}
2442
2443static const EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext * /*C*/,
2444 PointerRNA *ptr,
2445 PropertyRNA * /*prop*/,
2446 bool *r_free)
2447{
2448 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2449 EnumPropertyItem *item = nullptr;
2450
2451 /* Although it would never reach this amount, a theoretical maximum number of tabs
2452 * is BCONTEXT_TOT * 2, with every tab displayed and a spacer in every other item. */
2453 const Vector<eSpaceButtons_Context> context_tabs_array = ED_buttons_tabs_list(sbuts);
2454
2455 int totitem_added = 0;
2456 bool add_separator = true;
2457 for (const eSpaceButtons_Context tab : context_tabs_array) {
2458 if (tab == -1) {
2459 if (add_separator) {
2460 RNA_enum_item_add_separator(&item, &totitem_added);
2461 add_separator = false;
2462 }
2463 continue;
2464 }
2465
2466 RNA_enum_items_add_value(&item, &totitem_added, buttons_context_items, tab);
2467 add_separator = true;
2468
2469 /* Add the object data icon dynamically for the data tab. */
2470 if (tab == BCONTEXT_DATA) {
2471 (item + totitem_added - 1)->icon = sbuts->dataicon;
2472 }
2473 }
2474
2475 RNA_enum_item_end(&item, &totitem_added);
2476 *r_free = true;
2477
2478 return item;
2479}
2480
2481static void rna_SpaceProperties_context_update(Main * /*bmain*/,
2482 Scene * /*scene*/,
2483 PointerRNA *ptr)
2484{
2485 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2486 /* XXX BCONTEXT_DATA is ugly, but required for lights... See #51318. */
2488 sbuts->preview = 1;
2489 }
2490}
2491
2492static int rna_SpaceProperties_tab_search_results_getlength(const PointerRNA *ptr,
2494{
2495 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2496
2497 const Vector<eSpaceButtons_Context> context_tabs_array = ED_buttons_tabs_list(sbuts);
2498
2499 length[0] = context_tabs_array.size();
2500
2501 return length[0];
2502}
2503
2504static void rna_SpaceProperties_tab_search_results_get(PointerRNA *ptr, bool *values)
2505{
2506 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2507
2508 const Vector<eSpaceButtons_Context> context_tabs_array = ED_buttons_tabs_list(sbuts);
2509
2510 for (const int i : context_tabs_array.index_range()) {
2511 values[i] = ED_buttons_tab_has_search_result(sbuts, i);
2512 }
2513}
2514
2515static void rna_SpaceProperties_search_filter_get(PointerRNA *ptr, char *value)
2516{
2517 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2518 const char *search_filter = ED_buttons_search_string_get(sbuts);
2519
2520 strcpy(value, search_filter);
2521}
2522
2523static int rna_SpaceProperties_search_filter_length(PointerRNA *ptr)
2524{
2525 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2526
2527 return ED_buttons_search_string_length(sbuts);
2528}
2529
2530static void rna_SpaceProperties_search_filter_set(PointerRNA *ptr, const char *value)
2531{
2532 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2533
2534 ED_buttons_search_string_set(sbuts, value);
2535}
2536
2537static void rna_SpaceProperties_search_filter_update(Main * /*bmain*/,
2538 Scene * /*scene*/,
2539 PointerRNA *ptr)
2540{
2541 ScrArea *area = rna_area_from_space(ptr);
2542
2543 /* Update the search filter flag for the main region with the panels. */
2545 BLI_assert(main_region != nullptr);
2546 ED_region_search_filter_update(area, main_region);
2547}
2548
2549/* Space Userpref */
2550static int rna_SpaceUserPref_tab_search_results_getlength(const PointerRNA *ptr,
2552{
2553 SpaceUserPref *sprefs = static_cast<SpaceUserPref *>(ptr->data);
2554 Vector<int> tabs = ED_userpref_tabs_list(sprefs);
2555 length[0] = tabs.size();
2556 return tabs.size();
2557}
2558static void rna_SpaceUserPref_tab_search_results_get(PointerRNA *ptr, bool *values)
2559{
2560 SpaceUserPref *sprefs = static_cast<SpaceUserPref *>(ptr->data);
2561 Vector<int> tabs = ED_userpref_tabs_list(sprefs);
2562 for (const int i : tabs.index_range()) {
2563 values[i] = ED_userpref_tab_has_search_result(sprefs, i);
2564 }
2565}
2566static void rna_SpaceUserPref_search_filter_get(PointerRNA *ptr, char *value)
2567{
2568 SpaceUserPref *sprefs = static_cast<SpaceUserPref *>(ptr->data);
2569 const char *search_filter = ED_userpref_search_string_get(sprefs);
2570 strcpy(value, search_filter);
2571}
2572static int rna_SpaceUserPref_search_filter_length(PointerRNA *ptr)
2573{
2574 SpaceUserPref *sprefs = static_cast<SpaceUserPref *>(ptr->data);
2575 return ED_userpref_search_string_length(sprefs);
2576}
2577static void rna_SpaceUserPref_search_filter_set(PointerRNA *ptr, const char *value)
2578{
2579 SpaceUserPref *sprefs = static_cast<SpaceUserPref *>(ptr->data);
2580 ED_userpref_search_string_set(sprefs, value);
2581}
2582static void rna_SpaceUserPref_search_filter_update(Main * /*bmain*/,
2583 Scene * /*scene*/,
2584 PointerRNA *ptr)
2585{
2586 ScrArea *area = rna_area_from_space(ptr);
2587 /* Update the search filter flag for the main region with the panels. */
2589 BLI_assert(main_region != nullptr);
2590 ED_region_search_filter_update(area, main_region);
2591}
2592
2593static int rna_SpaceUserPref_search_filter_editable(const PointerRNA * /*ptr*/,
2594 const char **r_info)
2595{
2596 if (U.space_data.section_active == USER_SECTION_EXTENSIONS) {
2597 *r_info = N_("Use the search in Extensions.");
2598 return 0;
2599 }
2600 if (U.space_data.section_active == USER_SECTION_ADDONS) {
2601 *r_info = N_("Use the search in Add-ons.");
2602 return 0;
2603 }
2604 return PROP_EDITABLE;
2605}
2606
2607/* Space Console */
2608static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
2609{
2610 ConsoleLine *ci = static_cast<ConsoleLine *>(ptr->data);
2611 memcpy(value, ci->line, ci->len + 1);
2612}
2613
2614static int rna_ConsoleLine_body_length(PointerRNA *ptr)
2615{
2616 ConsoleLine *ci = static_cast<ConsoleLine *>(ptr->data);
2617 return ci->len;
2618}
2619
2620static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
2621{
2622 ConsoleLine *ci = static_cast<ConsoleLine *>(ptr->data);
2623 size_t len = strlen(value);
2624
2625 if ((len >= size_t(ci->len_alloc)) ||
2626 (len * 2 < size_t(ci->len_alloc))) { /* allocate a new string */
2627 MEM_delete(ci->line);
2628 ci->line = MEM_new_array_uninitialized<char>(len + 1, "rna_consoleline");
2629 ci->len_alloc = int(len + 1);
2630 }
2631 memcpy(ci->line, value, len + 1);
2632 ci->len = int(len);
2633
2634 if (size_t(ci->cursor) > len) {
2635 /* clamp the cursor */
2636 ci->cursor = int(len);
2637 }
2638}
2639
2640static int rna_ConsoleLine_current_character_get(PointerRNA *ptr)
2641{
2642 const ConsoleLine *ci = static_cast<ConsoleLine *>(ptr->data);
2643 return BLI_str_utf8_offset_to_index(ci->line, ci->len, ci->cursor);
2644}
2645
2646static void rna_ConsoleLine_current_character_set(PointerRNA *ptr, const int index)
2647{
2648 ConsoleLine *ci = static_cast<ConsoleLine *>(ptr->data);
2649 ci->cursor = BLI_str_utf8_offset_from_index(ci->line, ci->len, index);
2650}
2651
2652/* Space Dope-sheet */
2653
2654static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr)
2655{
2656 SpaceAction *saction = static_cast<SpaceAction *>(ptr->data);
2657 ScrArea *area = CTX_wm_area(C);
2658
2659 if (area && area->spacedata.first_as<SpaceAction>() == saction) {
2660 ARegion *channels_region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS);
2661 if (channels_region) {
2662 channels_region->flag &= ~RGN_FLAG_HIDDEN;
2663 ED_region_visibility_change_update(C, area, channels_region);
2664 }
2665 }
2666
2667 /* recalculate extents of channel list */
2668 saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC;
2669
2670 /* store current mode as "old mode",
2671 * so that returning from other editors doesn't always reset to "Action Editor" */
2672 saction->mode_prev = saction->mode;
2673}
2674
2675/* Space Graph Editor */
2676
2677static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *ptr)
2678{
2679 ScrArea *area = rna_area_from_space(ptr);
2680 SpaceGraph *sipo = static_cast<SpaceGraph *>(ptr->data);
2681
2682 /* for "Drivers" mode, enable all the necessary bits and pieces */
2683 if (sipo->mode == SIPO_MODE_DRIVERS) {
2685 ED_area_tag_redraw(area);
2686 }
2687
2688 /* after changing view mode, must force recalculation of F-Curve colors
2689 * which can only be achieved using refresh as opposed to redraw
2690 */
2691 ED_area_tag_refresh(area);
2692}
2693
2694static void rna_SpaceGraphEditor_normalize_update(bContext *C, PointerRNA * /*ptr*/)
2695{
2696 bAnimContext ac;
2697
2698 if (ANIM_animdata_get_context(C, &ac) == 0) {
2699 return;
2700 }
2701
2702 ListBaseT<bAnimListElem> anim_data = {nullptr, nullptr};
2703 /* This has to use the same filters as the graph editor uses to get its FCurves. */
2707 ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, eAnimCont_Types(ac.datatype));
2708 for (bAnimListElem &ale : anim_data) {
2709 FCurve *fcu = static_cast<FCurve *>(ale.key_data);
2710 float offset;
2711 /* Calling this function updates the cached values in the `FCurve`. Doing so makes it so that
2712 * the normalization will be correct after enabling the normalization, even with auto normalize
2713 * disabled. */
2714 ANIM_unit_mapping_get_factor(ac.scene, ale.id, fcu, ANIM_UNITCONV_NORMALIZE, &offset);
2715 }
2716 ANIM_animdata_freelist(&anim_data);
2717
2719 ED_area_tag_refresh(ac.area);
2720}
2721
2722static bool rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
2723{
2724 SpaceGraph *sipo = static_cast<SpaceGraph *>(ptr->data);
2725 return (sipo->runtime.ghost_curves.is_empty() == false);
2726}
2727
2728static void rna_SpaceConsole_rect_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2729{
2730 SpaceConsole *sc = static_cast<SpaceConsole *>(ptr->data);
2732}
2733
2734static void rna_SequenceEditor_update_cache(bContext *C, PointerRNA * /*ptr*/)
2735{
2737 if (scene == nullptr) {
2738 return;
2739 }
2740
2742}
2743
2744static void seq_build_proxy(bContext *C, PointerRNA *ptr)
2745{
2746 if (U.sequencer_proxy_setup != USER_SEQ_PROXY_SETUP_AUTOMATIC) {
2747 return;
2748 }
2749
2750 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2752 ListBaseT<Strip> *seqbase = seq::active_seqbase_get(seq::editing_get(scene));
2753
2754 Set<std::string> processed_paths;
2757
2758 for (Strip &strip : *seqbase) {
2759 if (strip.type != STRIP_TYPE_MOVIE || strip.data == nullptr || strip.data->proxy == nullptr) {
2760 continue;
2761 }
2762
2763 /* Add new proxy size. */
2764 strip.data->proxy->build_size_flags |= eStripProxyBuildSize(
2766
2767 /* Build proxy. */
2768 seq::proxy_build_start(pj->main, pj->scene, &strip, &processed_paths, true, pj->queue);
2769 }
2770
2771 if (!WM_jobs_is_running(wm_job)) {
2772 G.is_break = false;
2773 WM_jobs_start(CTX_wm_manager(C), wm_job);
2774 }
2775
2777}
2778
2779static void rna_SequenceEditor_render_size_update(bContext *C, PointerRNA *ptr)
2780{
2782 if (scene == nullptr) {
2783 return;
2784 }
2785
2786 seq_build_proxy(C, ptr);
2788}
2789
2790static bool rna_SequenceEditor_clamp_view_get(PointerRNA *ptr)
2791{
2792 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2793 return (sseq->flag & SEQ_CLAMP_VIEW) != 0;
2794}
2795
2796static void rna_SequenceEditor_clamp_view_set(PointerRNA *ptr, bool value)
2797{
2798 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2799 ScrArea *area;
2800 ARegion *region;
2801
2802 area = rna_area_from_space(ptr); /* can be nullptr */
2803 if (area == nullptr) {
2804 return;
2805 }
2806
2808 if (region) {
2809 if (value) {
2810 sseq->flag |= SEQ_CLAMP_VIEW;
2811 region->v2d.align &= ~V2D_ALIGN_NO_NEG_Y;
2812 }
2813 else {
2814 sseq->flag &= ~SEQ_CLAMP_VIEW;
2815 region->v2d.align |= V2D_ALIGN_NO_NEG_Y;
2816 }
2817 }
2818}
2819
2820static void rna_Sequencer_view_type_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2821{
2822 ScrArea *area = rna_area_from_space(ptr);
2823 ED_area_tag_refresh(area);
2824}
2825
2826static PointerRNA rna_SpaceSequenceEditor_preview_overlay_get(PointerRNA *ptr)
2827{
2828 return RNA_pointer_create_with_parent(*ptr, RNA_SequencerPreviewOverlay, ptr->data);
2829}
2830
2831static std::optional<std::string> rna_SpaceSequencerPreviewOverlay_path(const PointerRNA *ptr)
2832{
2833 std::optional<std::string> editor_path = BKE_screen_path_to_space(ptr);
2834 return fmt::format(
2835 "{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "preview_overlay");
2836}
2837
2838static PointerRNA rna_SpaceSequenceEditor_timeline_overlay_get(PointerRNA *ptr)
2839{
2840 return RNA_pointer_create_with_parent(*ptr, RNA_SequencerTimelineOverlay, ptr->data);
2841}
2842
2843static std::optional<std::string> rna_SpaceSequencerTimelineOverlay_path(const PointerRNA *ptr)
2844{
2845 std::optional<std::string> editor_path = BKE_screen_path_to_space(ptr);
2846 return fmt::format(
2847 "{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "timeline_overlay");
2848}
2849
2850static PointerRNA rna_SpaceSequenceEditor_cache_overlay_get(PointerRNA *ptr)
2851{
2852 return RNA_pointer_create_with_parent(*ptr, RNA_SequencerCacheOverlay, ptr->data);
2853}
2854
2855static std::optional<std::string> rna_SpaceSequencerCacheOverlay_path(const PointerRNA *ptr)
2856{
2857 std::optional<std::string> editor_path = BKE_screen_path_to_space(ptr);
2858 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "cache_overlay");
2859}
2860
2861static float rna_SpaceSequenceEditor_zoom_percentage_get(PointerRNA *ptr)
2862{
2863 ScrArea *area = rna_area_from_space(ptr);
2864 if (area == nullptr) {
2865 return 100.0f;
2866 }
2868 if (region == nullptr) {
2869 return 100.0f;
2870 }
2871
2872 View2D *v2d = &region->v2d;
2873 const float zoom = 1.0f / (BLI_rctf_size_x(&v2d->cur) / float(BLI_rcti_size_x(&v2d->mask))) *
2874 +100.0f;
2875 return zoom;
2876}
2877
2878static void rna_SpaceSequenceEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
2879{
2880 ScrArea *area = rna_area_from_space(ptr);
2881 if (area == nullptr) {
2882 return;
2883 }
2885 if (region == nullptr) {
2886 return;
2887 }
2888
2889 View2D *v2d = &region->v2d;
2890 BLI_rctf_resize(&v2d->cur,
2891 float(BLI_rcti_size_x(&v2d->mask)) / (value / 100.0f),
2892 float(BLI_rcti_size_y(&v2d->mask)) / (value / 100.0f));
2893 ED_region_tag_redraw(region);
2894}
2895
2896static PointerRNA rna_SpaceDopeSheet_overlay_get(PointerRNA *ptr)
2897{
2898 return RNA_pointer_create_with_parent(*ptr, RNA_SpaceDopeSheetOverlay, ptr->data);
2899}
2900
2901static std::optional<std::string> rna_SpaceDopeSheetOverlay_path(const PointerRNA *ptr)
2902{
2903 std::optional<std::string> editor_path = BKE_screen_path_to_space(ptr);
2904 if (!editor_path) {
2905 return std::nullopt;
2906 }
2907 return editor_path.value() + ".overlays";
2908}
2909
2910/* Space Node Editor */
2911static PointerRNA rna_SpaceNode_overlay_get(PointerRNA *ptr)
2912{
2913 return RNA_pointer_create_with_parent(*ptr, RNA_SpaceNodeOverlay, ptr->data);
2914}
2915
2916static bool rna_SpaceNode_supports_previews(PointerRNA *ptr)
2917{
2918 return ED_node_supports_preview(static_cast<SpaceNode *>(ptr->data));
2919}
2920
2921static std::optional<std::string> rna_SpaceNodeOverlay_path(const PointerRNA *ptr)
2922{
2923 std::optional<std::string> editor_path = BKE_screen_path_to_space(ptr);
2924 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
2925}
2926
2927static void rna_SpaceNodeEditor_node_tree_set(PointerRNA *ptr,
2928 const PointerRNA value,
2929 ReportList * /*reports*/)
2930{
2931 SpaceNode *snode = ptr->data_as<SpaceNode>();
2932 ScrArea *area = BKE_screen_find_area_from_space(reinterpret_cast<const bScreen *>(ptr->owner_id),
2933 reinterpret_cast<const SpaceLink *>(snode));
2935 ED_node_tree_start(region, snode, static_cast<bNodeTree *>(value.data), nullptr, nullptr);
2936}
2937
2938static bool rna_SpaceNodeEditor_selected_node_group_poll(PointerRNA *space_node_pointer,
2939 const PointerRNA value)
2940{
2941 SpaceNode *space_node = space_node_pointer->data_as<SpaceNode>();
2942 const bNodeTree &ntree = *static_cast<const bNodeTree *>(value.data);
2943 if (ED_node_is_compositor(space_node)) {
2944 return ntree.type == NTREE_COMPOSIT;
2945 }
2946
2947 if (ntree.type != NTREE_GEOMETRY) {
2948 return false;
2949 }
2950 if (!ntree.geometry_node_asset_traits) {
2951 return false;
2952 }
2953 if ((ntree.geometry_node_asset_traits->flag & GEO_NODE_ASSET_TOOL) == 0) {
2954 return false;
2955 }
2956 return true;
2957}
2958
2959static bool space_node_node_geometry_nodes_poll(const SpaceNode &snode, const bNodeTree &ntree)
2960{
2961 switch (SpaceNodeGeometryNodesType(snode.node_tree_sub_type)) {
2963 if (!ntree.geometry_node_asset_traits) {
2964 return false;
2965 }
2966 if ((ntree.geometry_node_asset_traits->flag & GEO_NODE_ASSET_MODIFIER) == 0) {
2967 return false;
2968 }
2969 return true;
2971 if (!ntree.geometry_node_asset_traits) {
2972 return false;
2973 }
2974 if ((ntree.geometry_node_asset_traits->flag & GEO_NODE_ASSET_TOOL) == 0) {
2975 return false;
2976 }
2977 return true;
2978 }
2979 return false;
2980}
2981
2982static bool rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, const PointerRNA value)
2983{
2984 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
2985 bNodeTree *ntree = static_cast<bNodeTree *>(value.data);
2986
2987 /* node tree type must match the selected type in node editor */
2988 if (!STREQ(snode->tree_idname, ntree->idname)) {
2989 return false;
2990 }
2991 if (ntree->type == NTREE_GEOMETRY) {
2992 if (!space_node_node_geometry_nodes_poll(*snode, *ntree)) {
2993 return false;
2994 }
2995 }
2996 return true;
2997}
2998
2999static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA * /*ptr*/)
3000{
3002}
3003
3004static const EnumPropertyItem *rna_SpaceNodeEditor_node_tree_sub_type_itemf(
3005 bContext * /*context*/,
3006 PointerRNA *space_node_pointer,
3007 PropertyRNA * /*property*/,
3008 bool * /*r_free*/)
3009{
3010 static const EnumPropertyItem geometry_nodes_sub_type_items[] = {
3012 "MODIFIER",
3013 ICON_MODIFIER_DATA,
3014 N_("Modifier"),
3015 N_("Edit node group from active object's active modifier")},
3017 "TOOL",
3018 ICON_TOOL_SETTINGS,
3019 N_("Tool"),
3020 N_("Edit any geometry node group for use as an operator")},
3021 {0, nullptr, 0, nullptr, nullptr},
3022 };
3023
3024 static const EnumPropertyItem compositor_sub_type_items[] = {
3026 "SCENE",
3027 ICON_SCENE_DATA,
3028 N_("Scene"),
3029 N_("Edit compositor node group for the active scene compositor effect")},
3031 "SEQUENCER",
3032 ICON_SEQUENCE,
3033 N_("Sequencer"),
3034 N_("Edit compositing node group for Sequencer strip modifiers")},
3035 {0, nullptr, 0, nullptr, nullptr},
3036 };
3037
3038 SpaceNode *space_node = space_node_pointer->data_as<SpaceNode>();
3039 if (ED_node_is_geometry(space_node)) {
3040 return geometry_nodes_sub_type_items;
3041 }
3042 else {
3043 return compositor_sub_type_items;
3044 }
3045}
3046
3047static void rna_SpaceNodeEditor_node_tree_sub_type_update(Main * /*main*/,
3048 Scene * /*scene*/,
3049 PointerRNA *space_node_pointer)
3050{
3051 SpaceNode *space_node = space_node_pointer->data_as<SpaceNode>();
3052 if (ED_node_is_geometry(space_node)) {
3053 if (space_node->node_tree_sub_type == SNODE_GEOMETRY_TOOL) {
3054 space_node->flag &= ~SNODE_PIN;
3055 }
3056 }
3057 else {
3058 if (space_node->node_tree_sub_type == SNODE_COMPOSITOR_SEQUENCER) {
3059 space_node->flag &= ~SNODE_PIN;
3060 }
3061 }
3062}
3063
3064static int rna_SpaceNodeEditor_tree_type_get(PointerRNA *ptr)
3065{
3066 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
3067 return rna_node_tree_idname_to_enum(snode->tree_idname);
3068}
3069static void rna_SpaceNodeEditor_tree_type_set(PointerRNA *ptr, int value)
3070{
3071 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
3073}
3074static bool rna_SpaceNodeEditor_tree_type_poll(void *Cv, bke::bNodeTreeType *type)
3075{
3076 bContext *C = static_cast<bContext *>(Cv);
3077 if (type->poll) {
3078 return type->poll(C, type);
3079 }
3080 else {
3081 return true;
3082 }
3083}
3084
3085static void rna_SpaceNodeEditor_cursor_location_get(PointerRNA *ptr, float value[2])
3086{
3087 const SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
3088
3089 ED_node_cursor_location_get(snode, value);
3090}
3091
3092static void rna_SpaceNodeEditor_cursor_location_set(PointerRNA *ptr, const float value[2])
3093{
3094 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
3095
3096 ED_node_cursor_location_set(snode, value);
3097}
3098
3100{
3101 return rna_node_tree_type_itemf(C, C ? rna_SpaceNodeEditor_tree_type_poll : nullptr, r_free);
3102}
3103
3104static const EnumPropertyItem *rna_SpaceNodeEditor_tree_type_itemf(bContext *C,
3105 PointerRNA * /*ptr*/,
3106 PropertyRNA * /*prop*/,
3107 bool *r_free)
3108{
3109 return RNA_enum_node_tree_types_itemf_impl(C, r_free);
3110}
3111
3112static void rna_SpaceNodeEditor_path_get(PointerRNA *ptr, char *value)
3113{
3114 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
3115 ED_node_tree_path_get(snode, value);
3116}
3117
3118static int rna_SpaceNodeEditor_path_length(PointerRNA *ptr)
3119{
3120 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
3121 return ED_node_tree_path_length(snode);
3122}
3123
3124static void rna_SpaceNodeEditor_path_clear(SpaceNode *snode, bContext *C)
3125{
3126 ED_node_tree_start(nullptr, snode, nullptr, nullptr, nullptr);
3128}
3129
3130static ARegion *find_snode_region(SpaceNode *snode, bContext *C)
3131{
3133 for (wmWindow &win : wm->windows) {
3134 bScreen *screen = WM_window_get_active_screen(&win);
3136 reinterpret_cast<const SpaceLink *>(snode));
3137 if (ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW)) {
3138 return region;
3139 }
3140 }
3141 }
3142 return nullptr;
3143}
3144
3145static void rna_SpaceNodeEditor_path_start(SpaceNode *snode, bContext *C, PointerRNA *node_tree)
3146{
3147 ARegion *region = find_snode_region(snode, C);
3148 ED_node_tree_start(region, snode, static_cast<bNodeTree *>(node_tree->data), nullptr, nullptr);
3150}
3151
3152static void rna_SpaceNodeEditor_path_append(SpaceNode *snode,
3153 bContext *C,
3154 PointerRNA *node_tree,
3156{
3157 ARegion *region = find_snode_region(snode, C);
3159 region, snode, static_cast<bNodeTree *>(node_tree->data), static_cast<bNode *>(node->data));
3161}
3162
3163static void rna_SpaceNodeEditor_path_pop(SpaceNode *snode, bContext *C)
3164{
3165 ARegion *region = find_snode_region(snode, C);
3166 ED_node_tree_pop(region, snode);
3168}
3169
3170static void rna_SpaceNodeEditor_show_backdrop_update(Main * /*bmain*/,
3171 Scene *scene,
3172 PointerRNA * /*space_node_ptr*/)
3173{
3177}
3178
3179static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode,
3180 bContext *C,
3181 int x,
3182 int y)
3183{
3184 ARegion *region = CTX_wm_region(C);
3185
3186 float cursor_location[2];
3187
3188 ui::view2d_region_to_view(&region->v2d, x, y, &cursor_location[0], &cursor_location[1]);
3189 cursor_location[0] /= UI_SCALE_FAC;
3190 cursor_location[1] /= UI_SCALE_FAC;
3191
3192 ED_node_cursor_location_set(snode, cursor_location);
3193}
3194
3195static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr,
3196 PointerRNA value,
3197 ReportList * /*reports*/)
3198{
3199 SpaceClip *sc = static_cast<SpaceClip *>(ptr->data);
3200 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
3201
3202 ED_space_clip_set_clip(nullptr, screen, sc, static_cast<MovieClip *>(value.data));
3203}
3204
3205static void rna_SpaceClipEditor_mask_set(PointerRNA *ptr,
3206 PointerRNA value,
3207 ReportList * /*reports*/)
3208{
3209 SpaceClip *sc = static_cast<SpaceClip *>(ptr->data);
3210
3211 ED_space_clip_set_mask(nullptr, sc, static_cast<Mask *>(value.data));
3212}
3213
3214static void rna_SpaceClipEditor_clip_mode_update(Main * /*bmain*/,
3215 Scene * /*scene*/,
3216 PointerRNA *ptr)
3217{
3218 SpaceClip *sc = static_cast<SpaceClip *>(ptr->data);
3219
3220 if (sc->mode == SC_MODE_MASKEDIT && sc->view != SC_VIEW_CLIP) {
3221 /* Make sure we are in the right view for mask editing */
3222 sc->view = SC_VIEW_CLIP;
3223 ScrArea *area = rna_area_from_space(ptr);
3224 ED_area_tag_refresh(area);
3225 }
3226
3227 sc->scopes.ok = 0;
3228}
3229
3230static void rna_SpaceClipEditor_lock_selection_update(Main * /*bmain*/,
3231 Scene * /*scene*/,
3232 PointerRNA *ptr)
3233{
3234 SpaceClip *sc = static_cast<SpaceClip *>(ptr->data);
3235
3236 sc->xlockof = 0.0f;
3237 sc->ylockof = 0.0f;
3238}
3239
3240static void rna_SpaceClipEditor_view_type_update(Main * /*bmain*/,
3241 Scene * /*scene*/,
3242 PointerRNA *ptr)
3243{
3244 ScrArea *area = rna_area_from_space(ptr);
3245 ED_area_tag_refresh(area);
3246}
3247
3248static float rna_SpaceClipEditor_zoom_percentage_get(PointerRNA *ptr)
3249{
3250 SpaceClip *sc = static_cast<SpaceClip *>(ptr->data);
3251 return sc->zoom * 100.0f;
3252}
3253
3254static void rna_SpaceClipEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
3255{
3256 SpaceClip *sc = static_cast<SpaceClip *>(ptr->data);
3257 sc->zoom = value / 100.0f;
3258}
3259
3260static PointerRNA rna_SpaceClip_overlay_get(PointerRNA *ptr)
3261{
3262 return RNA_pointer_create_with_parent(*ptr, RNA_SpaceClipOverlay, ptr->data);
3263}
3264
3265static std::optional<std::string> rna_SpaceClipOverlay_path(const PointerRNA *ptr)
3266{
3267 std::optional<std::string> editor_path = BKE_screen_path_to_space(ptr);
3268 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
3269}
3270
3271/* File browser. */
3272
3273static std::optional<std::string> rna_FileSelectParams_path(const PointerRNA *ptr)
3274{
3275 const PointerRNA space_ptr = ptr->parent();
3276 if (!space_ptr.owner_id) {
3277 return std::nullopt;
3278 }
3279
3280 std::optional<std::string> editor_path = BKE_screen_path_to_space(&space_ptr);
3281 if (!editor_path) {
3282 return std::nullopt;
3283 }
3284 return fmt::format("{}.params", *editor_path);
3285}
3286
3287int rna_FileSelectParams_filename_editable(const PointerRNA *ptr, const char **r_info)
3288{
3289 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
3290
3291 if (params && (params->flag & FILE_DIRSEL_ONLY)) {
3292 *r_info = N_("Only directories can be chosen for the current operation.");
3293 return 0;
3294 }
3295
3296 return params ? int(PROP_EDITABLE) : 0;
3297}
3298
3299static bool rna_FileSelectParams_use_lib_get(PointerRNA *ptr)
3300{
3301 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
3302
3303 return params && (params->type == FILE_LOADLIB);
3304}
3305
3306static const EnumPropertyItem *rna_FileSelectParams_display_type_itemf(bContext * /*C*/,
3307 PointerRNA *ptr,
3308 PropertyRNA * /*prop*/,
3309 bool *r_free)
3310{
3311 if (RNA_struct_is_a(ptr->type, RNA_FileAssetSelectParams)) {
3312 EnumPropertyItem *items = nullptr;
3313 int totitem = 0;
3314
3315 /* Only expose preview and column view for asset browsing. */
3320
3321 RNA_enum_item_end(&items, &totitem);
3322 *r_free = true;
3323
3324 return items;
3325 }
3326
3327 *r_free = false;
3329}
3330
3331static int rna_FileSelectParams_display_type_default(PointerRNA *ptr, PropertyRNA *prop)
3332{
3333 if (RNA_struct_is_a(ptr->type, RNA_FileAssetSelectParams)) {
3334 return FILE_IMGDISPLAY;
3335 }
3336
3337 EnumPropertyRNA *eprop = reinterpret_cast<EnumPropertyRNA *>(prop);
3338 return eprop->defaultvalue;
3339}
3340
3341static const EnumPropertyItem *rna_FileSelectParams_recursion_level_itemf(bContext * /*C*/,
3342 PointerRNA *ptr,
3343 PropertyRNA * /*prop*/,
3344 bool *r_free)
3345{
3346 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
3347
3348 if (params && params->type != FILE_LOADLIB) {
3349 EnumPropertyItem *item = nullptr;
3350 int totitem = 0;
3351
3356
3357 RNA_enum_item_end(&item, &totitem);
3358 *r_free = true;
3359
3360 return item;
3361 }
3362
3363 *r_free = false;
3365}
3366
3367static const EnumPropertyItem *rna_FileSelectParams_sort_method_itemf(bContext * /*C*/,
3368 PointerRNA *ptr,
3369 PropertyRNA * /*prop*/,
3370 bool *r_free)
3371{
3372 EnumPropertyItem *items = nullptr;
3373 int totitem = 0;
3374
3375 if (RNA_struct_is_a(ptr->type, RNA_FileAssetSelectParams)) {
3376 /* Only expose sorting by name and asset catalog for asset browsing. */
3377
3380 /* Address small annoyance: Tooltip talks about "file list", override to be "asset list"
3381 * instead. */
3382 items[0].description = N_("Sort the asset list alphabetically");
3383
3386 }
3387 else {
3388 /* Remove asset catalog from the items. */
3390 item++)
3391 {
3392 if (item->value != FILE_SORT_ASSET_CATALOG) {
3393 RNA_enum_item_add(&items, &totitem, item);
3394 }
3395 }
3396 }
3397
3398 RNA_enum_item_end(&items, &totitem);
3399
3400 *r_free = true;
3401 return items;
3402}
3403
3404static void rna_FileSelectParams_filter_glob_set(PointerRNA *ptr, const char *value)
3405{
3406 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
3407
3408 STRNCPY(params->filter_glob, value);
3409
3410 /* Remove stupid things like last group being a wildcard-only one. */
3411 BLI_path_extension_glob_validate(params->filter_glob);
3412}
3413
3414static PointerRNA rna_FileSelectParams_filter_id_get(PointerRNA *ptr)
3415{
3416 return RNA_pointer_create_with_parent(*ptr, RNA_FileSelectIDFilter, ptr->data);
3417}
3418
3419static int rna_FileAssetSelectParams_asset_library_get(PointerRNA *ptr)
3420{
3421 FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3422 /* Just an extra sanity check to ensure this isn't somehow called for RNA_FileSelectParams. */
3423 BLI_assert(ptr->type == RNA_FileAssetSelectParams);
3424
3425 return ed::asset::library_reference_to_enum_value(&params->asset_library_ref);
3426}
3427
3428static void rna_FileAssetSelectParams_asset_library_set(PointerRNA *ptr, int value)
3429{
3430 FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3432}
3433
3434static PointerRNA rna_FileAssetSelectParams_filter_id_get(PointerRNA *ptr)
3435{
3436 return RNA_pointer_create_with_parent(*ptr, RNA_FileAssetSelectIDFilter, ptr->data);
3437}
3438
3439static PointerRNA rna_FileBrowser_FileSelectEntry_asset_data_get_impl(const PointerRNA *ptr)
3440{
3441 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3442
3443 if (!entry->asset) {
3444 return {};
3445 }
3446
3447 AssetMetaData *asset_data = &entry->asset->get_metadata();
3448
3449 /* Note that the owning ID of the RNA pointer (`ptr->owner_id`) has to be set carefully:
3450 * Local IDs (`entry->id`) own their asset metadata themselves. Asset metadata from other blend
3451 * files are owned by the file browser (`entry`). Only if this is set correctly, we can tell from
3452 * the metadata RNA pointer if the metadata is stored locally and can thus be edited or not. */
3453
3454 if (entry->asset->is_local_id()) {
3455 PointerRNA id_ptr = RNA_id_pointer_create(entry->id);
3456 return RNA_pointer_create_with_parent(id_ptr, RNA_AssetMetaData, asset_data);
3457 }
3458
3459 return RNA_pointer_create_with_parent(*ptr, RNA_AssetMetaData, asset_data);
3460}
3461
3462static int rna_FileBrowser_FileSelectEntry_name_editable(const PointerRNA *ptr,
3463 const char **r_info)
3464{
3465 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3466
3467 /* This actually always returns 0 (the name is never editable) but we want to get a disabled
3468 * message returned to `r_info` in some cases. */
3469
3470 if (entry->asset) {
3471 PointerRNA asset_data_ptr = rna_FileBrowser_FileSelectEntry_asset_data_get_impl(ptr);
3472 /* Get disabled hint from asset metadata polling. */
3473 rna_AssetMetaData_editable(&asset_data_ptr, r_info);
3474 }
3475
3476 return 0;
3477}
3478
3479static PointerRNA rna_FileBrowser_FileSelectEntry_asset_data_get(PointerRNA *ptr)
3480{
3481 return rna_FileBrowser_FileSelectEntry_asset_data_get_impl(ptr);
3482}
3483
3484static void rna_FileBrowser_FileSelectEntry_name_get(PointerRNA *ptr, char *value)
3485{
3486 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3487 strcpy(value, entry->name);
3488}
3489
3490static int rna_FileBrowser_FileSelectEntry_name_length(PointerRNA *ptr)
3491{
3492 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3493 return int(strlen(entry->name));
3494}
3495
3496static void rna_FileBrowser_FileSelectEntry_relative_path_get(PointerRNA *ptr, char *value)
3497{
3498 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3499 strcpy(value, entry->relpath);
3500}
3501
3502static int rna_FileBrowser_FileSelectEntry_relative_path_length(PointerRNA *ptr)
3503{
3504 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3505 return int(strlen(entry->relpath));
3506}
3507
3508static int rna_FileBrowser_FileSelectEntry_preview_icon_id_get(PointerRNA *ptr)
3509{
3510 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3511 return ED_file_icon(entry);
3512}
3513
3514static StructRNA *rna_FileBrowser_params_typef(PointerRNA *ptr)
3515{
3516 SpaceFile *sfile = static_cast<SpaceFile *>(ptr->data);
3518
3519 if (params == ED_fileselect_get_file_params(sfile)) {
3520 return RNA_FileSelectParams;
3521 }
3522 if (params == static_cast<void *>(ED_fileselect_get_asset_params(sfile))) {
3523 return RNA_FileAssetSelectParams;
3524 }
3525
3526 BLI_assert_msg(0, "Could not identify file select parameters");
3527 return nullptr;
3528}
3529
3530static PointerRNA rna_FileBrowser_params_get(PointerRNA *ptr)
3531{
3532 SpaceFile *sfile = static_cast<SpaceFile *>(ptr->data);
3534 StructRNA *params_struct = rna_FileBrowser_params_typef(ptr);
3535
3536 if (params && params_struct) {
3537 return RNA_pointer_create_with_parent(*ptr, params_struct, params);
3538 }
3539
3540 return {};
3541}
3542
3543static void rna_FileBrowser_FSMenuEntry_path_get(PointerRNA *ptr, char *value)
3544{
3545 char *path = ED_fsmenu_entry_get_path(static_cast<FSMenuEntry *>(ptr->data));
3546
3547 strcpy(value, path ? path : "");
3548}
3549
3550static int rna_FileBrowser_FSMenuEntry_path_length(PointerRNA *ptr)
3551{
3552 char *path = ED_fsmenu_entry_get_path(static_cast<FSMenuEntry *>(ptr->data));
3553
3554 return int(path ? strlen(path) : 0);
3555}
3556
3557static void rna_FileBrowser_FSMenuEntry_path_set(PointerRNA *ptr, const char *value)
3558{
3559 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3560
3561 /* NOTE: this will write to file immediately.
3562 * Not nice (and to be fixed ultimately), but acceptable in this case for now. */
3563 ED_fsmenu_entry_set_path(fsm, value);
3564}
3565
3566static void rna_FileBrowser_FSMenuEntry_name_get(PointerRNA *ptr, char *value)
3567{
3568 strcpy(value, ED_fsmenu_entry_get_name(static_cast<FSMenuEntry *>(ptr->data)));
3569}
3570
3571static int rna_FileBrowser_FSMenuEntry_name_length(PointerRNA *ptr)
3572{
3573 return int(strlen(ED_fsmenu_entry_get_name(static_cast<FSMenuEntry *>(ptr->data))));
3574}
3575
3576static void rna_FileBrowser_FSMenuEntry_name_set(PointerRNA *ptr, const char *value)
3577{
3578 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3579
3580 /* NOTE: this will write to file immediately.
3581 * Not nice (and to be fixed ultimately), but acceptable in this case for now. */
3582 ED_fsmenu_entry_set_name(fsm, value);
3583}
3584
3585static int rna_FileBrowser_FSMenuEntry_name_get_editable(const PointerRNA *ptr,
3586 const char ** /*r_info*/)
3587{
3588 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3589
3590 return fsm->save ? int(PROP_EDITABLE) : 0;
3591}
3592
3593static int rna_FileBrowser_FSMenuEntry_icon_get(PointerRNA *ptr)
3594{
3595 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3596 return ED_fsmenu_entry_get_icon(fsm);
3597}
3598
3599static void rna_FileBrowser_FSMenuEntry_icon_set(PointerRNA *ptr, int value)
3600{
3601 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3602 ED_fsmenu_entry_set_icon(fsm, value);
3603}
3604
3605static bool rna_FileBrowser_FSMenuEntry_use_save_get(PointerRNA *ptr)
3606{
3607 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3608 return fsm->save;
3609}
3610
3611static void rna_FileBrowser_FSMenu_next(CollectionPropertyIterator *iter)
3612{
3613 ListBaseIterator *internal = &iter->internal.listbase;
3614
3615 if (internal->skip) {
3616 do {
3617 internal->link = reinterpret_cast<Link *>(
3618 (reinterpret_cast<FSMenuEntry *>(internal->link))->next);
3619 iter->valid = (internal->link != nullptr);
3620 } while (iter->valid && internal->skip(iter, internal->link));
3621 }
3622 else {
3623 internal->link = reinterpret_cast<Link *>(
3624 (reinterpret_cast<FSMenuEntry *>(internal->link))->next);
3625 iter->valid = (internal->link != nullptr);
3626 }
3627}
3628
3629static void rna_FileBrowser_FSMenu_begin(CollectionPropertyIterator *iter, FSMenuCategory category)
3630{
3631 ListBaseIterator *internal = &iter->internal.listbase;
3632
3633 FSMenu *fsmenu = ED_fsmenu_get();
3634 FSMenuEntry *fsmentry = ED_fsmenu_get_category(fsmenu, category);
3635
3636 internal->link = (fsmentry) ? reinterpret_cast<Link *>(fsmentry) : nullptr;
3637 internal->skip = nullptr;
3638
3639 iter->valid = (internal->link != nullptr);
3640}
3641
3642static PointerRNA rna_FileBrowser_FSMenu_get(CollectionPropertyIterator *iter)
3643{
3644 ListBaseIterator *internal = &iter->internal.listbase;
3646 iter->parent, RNA_FileBrowserFSMenuEntry, internal->link);
3647 return ptr_result;
3648}
3649
3650static void rna_FileBrowser_FSMenu_end(CollectionPropertyIterator * /*iter*/) {}
3651
3652static void rna_FileBrowser_FSMenuSystem_data_begin(CollectionPropertyIterator *iter,
3653 PointerRNA * /*ptr*/)
3654{
3655 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_SYSTEM);
3656}
3657
3658static int rna_FileBrowser_FSMenuSystem_data_length(PointerRNA * /*ptr*/)
3659{
3660 FSMenu *fsmenu = ED_fsmenu_get();
3661
3663}
3664
3665static void rna_FileBrowser_FSMenuSystemBookmark_data_begin(CollectionPropertyIterator *iter,
3666 PointerRNA * /*ptr*/)
3667{
3668 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_SYSTEM_BOOKMARKS);
3669}
3670
3671static int rna_FileBrowser_FSMenuSystemBookmark_data_length(PointerRNA * /*ptr*/)
3672{
3673 FSMenu *fsmenu = ED_fsmenu_get();
3674
3676}
3677
3678static void rna_FileBrowser_FSMenuBookmark_data_begin(CollectionPropertyIterator *iter,
3679 PointerRNA * /*ptr*/)
3680{
3681 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_BOOKMARKS);
3682}
3683
3684static int rna_FileBrowser_FSMenuBookmark_data_length(PointerRNA * /*ptr*/)
3685{
3686 FSMenu *fsmenu = ED_fsmenu_get();
3687
3689}
3690
3691static void rna_FileBrowser_FSMenuRecent_data_begin(CollectionPropertyIterator *iter,
3692 PointerRNA * /*ptr*/)
3693{
3694 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_RECENT);
3695}
3696
3697static int rna_FileBrowser_FSMenuRecent_data_length(PointerRNA * /*ptr*/)
3698{
3699 FSMenu *fsmenu = ED_fsmenu_get();
3700
3702}
3703
3704static int rna_FileBrowser_FSMenu_active_get(PointerRNA *ptr, const FSMenuCategory category)
3705{
3706 SpaceFile *sf = static_cast<SpaceFile *>(ptr->data);
3707 int actnr = -1;
3708
3709 switch (category) {
3710 case FS_CATEGORY_SYSTEM:
3711 actnr = sf->systemnr;
3712 break;
3714 actnr = sf->system_bookmarknr;
3715 break;
3717 actnr = sf->bookmarknr;
3718 break;
3719 case FS_CATEGORY_RECENT:
3720 actnr = sf->recentnr;
3721 break;
3722 case FS_CATEGORY_OTHER:
3723 /* pass. */
3724 break;
3725 }
3726
3727 return actnr;
3728}
3729
3730static void rna_FileBrowser_FSMenu_active_set(PointerRNA *ptr,
3731 int value,
3732 const FSMenuCategory category)
3733{
3734 SpaceFile *sf = static_cast<SpaceFile *>(ptr->data);
3735 FSMenu *fsmenu = ED_fsmenu_get();
3736 FSMenuEntry *fsm = ED_fsmenu_get_entry(fsmenu, category, value);
3737
3738 if (fsm && sf->params) {
3739 switch (category) {
3740 case FS_CATEGORY_SYSTEM:
3741 sf->systemnr = value;
3742 break;
3744 sf->system_bookmarknr = value;
3745 break;
3747 sf->bookmarknr = value;
3748 break;
3749 case FS_CATEGORY_RECENT:
3750 sf->recentnr = value;
3751 break;
3752 case FS_CATEGORY_OTHER:
3753 /* pass. */
3754 break;
3755 }
3756
3757 STRNCPY(sf->params->dir, fsm->path);
3758 }
3759}
3760
3761static void rna_FileBrowser_FSMenu_active_range(PointerRNA * /*ptr*/,
3762 int *min,
3763 int *max,
3764 int *softmin,
3765 int *softmax,
3766 const FSMenuCategory category)
3767{
3768 FSMenu *fsmenu = ED_fsmenu_get();
3769
3770 *min = *softmin = -1;
3771 *max = *softmax = ED_fsmenu_get_nentries(fsmenu, category) - 1;
3772}
3773
3774static void rna_FileBrowser_FSMenu_active_update(bContext *C, PointerRNA *ptr)
3775{
3776 ScrArea *area = rna_area_from_space(ptr);
3777 ED_file_change_dir_ex(C, area);
3778}
3779
3780static int rna_FileBrowser_FSMenuSystem_active_get(PointerRNA *ptr)
3781{
3782 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_SYSTEM);
3783}
3784
3785static void rna_FileBrowser_FSMenuSystem_active_set(PointerRNA *ptr, int value)
3786{
3787 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_SYSTEM);
3788}
3789
3790static void rna_FileBrowser_FSMenuSystem_active_range(
3791 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3792{
3793 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_SYSTEM);
3794}
3795
3796static int rna_FileBrowser_FSMenuSystemBookmark_active_get(PointerRNA *ptr)
3797{
3798 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_SYSTEM_BOOKMARKS);
3799}
3800
3801static void rna_FileBrowser_FSMenuSystemBookmark_active_set(PointerRNA *ptr, int value)
3802{
3803 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_SYSTEM_BOOKMARKS);
3804}
3805
3806static void rna_FileBrowser_FSMenuSystemBookmark_active_range(
3807 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3808{
3809 rna_FileBrowser_FSMenu_active_range(
3810 ptr, min, max, softmin, softmax, FS_CATEGORY_SYSTEM_BOOKMARKS);
3811}
3812
3813static int rna_FileBrowser_FSMenuBookmark_active_get(PointerRNA *ptr)
3814{
3815 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_BOOKMARKS);
3816}
3817
3818static void rna_FileBrowser_FSMenuBookmark_active_set(PointerRNA *ptr, int value)
3819{
3820 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_BOOKMARKS);
3821}
3822
3823static void rna_FileBrowser_FSMenuBookmark_active_range(
3824 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3825{
3826 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_BOOKMARKS);
3827}
3828
3829static int rna_FileBrowser_FSMenuRecent_active_get(PointerRNA *ptr)
3830{
3831 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_RECENT);
3832}
3833
3834static void rna_FileBrowser_FSMenuRecent_active_set(PointerRNA *ptr, int value)
3835{
3836 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_RECENT);
3837}
3838
3839static void rna_FileBrowser_FSMenuRecent_active_range(
3840 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3841{
3842 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_RECENT);
3843}
3844
3845static void rna_SpaceFileBrowser_browse_mode_update(Main * /*bmain*/,
3846 Scene * /*scene*/,
3847 PointerRNA *ptr)
3848{
3849 ScrArea *area = rna_area_from_space(ptr);
3850 ED_area_tag_refresh(area);
3851}
3852
3853static void rna_SpaceSpreadsheet_geometry_component_type_update(Main * /*bmain*/,
3854 Scene * /*scene*/,
3855 PointerRNA *ptr)
3856{
3857 SpaceSpreadsheet *sspreadsheet = static_cast<SpaceSpreadsheet *>(ptr->data);
3858 switch (sspreadsheet->geometry_id.geometry_component_type) {
3860 if (!ELEM(bke::AttrDomain(sspreadsheet->geometry_id.attribute_domain),
3865 {
3866 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Point);
3867 }
3868 break;
3869 }
3871 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Point);
3872 break;
3873 }
3875 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Instance);
3876 break;
3877 }
3879 break;
3880 }
3882 if (!ELEM(bke::AttrDomain(sspreadsheet->geometry_id.attribute_domain),
3885 {
3886 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Point);
3887 }
3888 break;
3889 }
3890 }
3891}
3892
3893const EnumPropertyItem *rna_SpaceSpreadsheet_attribute_domain_itemf(bContext * /*C*/,
3894 PointerRNA *ptr,
3895 PropertyRNA * /*prop*/,
3896 bool *r_free)
3897{
3898 SpaceSpreadsheet *sspreadsheet = static_cast<SpaceSpreadsheet *>(ptr->data);
3899 auto component_type = bke::GeometryComponent::Type(
3900 sspreadsheet->geometry_id.geometry_component_type);
3901 if (sspreadsheet->geometry_id.object_eval_state == SPREADSHEET_OBJECT_EVAL_STATE_ORIGINAL) {
3902 ID *used_id = ed::spreadsheet::get_current_id(sspreadsheet);
3903 if (used_id != nullptr) {
3904 if (GS(used_id->name) == ID_OB) {
3905 Object *used_object = id_cast<Object *>(used_id);
3906 if (used_object->type == OB_POINTCLOUD) {
3908 }
3909 else {
3910 component_type = bke::GeometryComponent::Type::Mesh;
3911 }
3912 }
3913 }
3914 }
3915
3916 static EnumPropertyItem mesh_vertex_domain_item = {
3917 int(bke::AttrDomain::Point), "POINT", 0, "Vertex", "Attribute per point/vertex"};
3918
3919 EnumPropertyItem *item_array = nullptr;
3920 int items_len = 0;
3921 for (const EnumPropertyItem *item = rna_enum_attribute_domain_items; item->identifier != nullptr;
3922 item++)
3923 {
3924 if (component_type == bke::GeometryComponent::Type::Mesh) {
3925 if (!ELEM(bke::AttrDomain(item->value),
3930 {
3931 continue;
3932 }
3933 }
3934 if (component_type == bke::GeometryComponent::Type::PointCloud) {
3935 if (bke::AttrDomain(item->value) != bke::AttrDomain::Point) {
3936 continue;
3937 }
3938 }
3939 if (component_type == bke::GeometryComponent::Type::Curve) {
3941 continue;
3942 }
3943 }
3944 if (bke::AttrDomain(item->value) == bke::AttrDomain::Point &&
3945 component_type == bke::GeometryComponent::Type::Mesh)
3946 {
3947 RNA_enum_item_add(&item_array, &items_len, &mesh_vertex_domain_item);
3948 }
3949 else {
3950 RNA_enum_item_add(&item_array, &items_len, item);
3951 }
3952 }
3953 RNA_enum_item_end(&item_array, &items_len);
3954
3955 *r_free = true;
3956 return item_array;
3957}
3958
3959static StructRNA *rna_SpreadsheetTableID_refine(PointerRNA *ptr)
3960{
3961 SpreadsheetTableID *table_id = ptr->data_as<SpreadsheetTableID>();
3962 switch (eSpreadsheetTableIDType(table_id->type)) {
3964 return RNA_SpreadsheetTableIDGeometry;
3965 }
3966 return RNA_SpreadsheetTableID;
3967}
3968
3969static void rna_iterator_SpreadsheetTable_columns_begin(CollectionPropertyIterator *iter,
3970 PointerRNA *ptr)
3971{
3972 SpreadsheetTable *table = ptr->data_as<SpreadsheetTable>();
3974 iter, ptr, table->columns, sizeof(SpreadsheetTable *), table->num_columns, 0, nullptr);
3975}
3976
3977static int rna_iterator_SpreadsheetTable_columns_length(PointerRNA *ptr)
3978{
3979 SpreadsheetTable *table = ptr->data_as<SpreadsheetTable>();
3980 return table->num_columns;
3981}
3982
3983static void rna_iterator_SpaceSpreadsheet_tables_begin(CollectionPropertyIterator *iter,
3984 PointerRNA *ptr)
3985{
3986 SpaceSpreadsheet *sspreadsheet = ptr->data_as<SpaceSpreadsheet>();
3988 ptr,
3989 sspreadsheet->tables,
3990 sizeof(SpaceSpreadsheet *),
3991 sspreadsheet->num_tables,
3992 0,
3993 nullptr);
3994}
3995
3996static int rna_iterator_SpaceSpreadsheet_tables_length(PointerRNA *ptr)
3997{
3998 SpaceSpreadsheet *sspreadsheet = ptr->data_as<SpaceSpreadsheet>();
3999 return sspreadsheet->num_tables;
4000}
4001
4002static PointerRNA rna_SpreadsheetTables_active_get(PointerRNA *ptr)
4003{
4004 SpaceSpreadsheet *sspreadsheet = ptr->data_as<SpaceSpreadsheet>();
4006 return RNA_pointer_create_discrete(ptr->owner_id, RNA_SpreadsheetTable, table);
4007}
4008
4009static StructRNA *rna_viewer_path_elem_refine(PointerRNA *ptr)
4010{
4011 ViewerPathElem *elem = static_cast<ViewerPathElem *>(ptr->data);
4012 switch (ViewerPathElemType(elem->type)) {
4014 return RNA_IDViewerPathElem;
4016 return RNA_ModifierViewerPathElem;
4018 return RNA_GroupNodeViewerPathElem;
4020 return RNA_SimulationZoneViewerPathElem;
4022 return RNA_ViewerNodeViewerPathElem;
4024 return RNA_RepeatZoneViewerPathElem;
4026 return RNA_ForeachGeometryElementZoneViewerPathElem;
4028 return RNA_EvaluateClosureNodeViewerPathElem;
4029 }
4031 return nullptr;
4032}
4033
4034static void rna_FileAssetSelectParams_catalog_id_get(PointerRNA *ptr, char *value)
4035{
4036 const FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
4037 BLI_uuid_format(value, params->catalog_id);
4038}
4039
4040static int rna_FileAssetSelectParams_catalog_id_length(PointerRNA * /*ptr*/)
4041{
4042 return UUID_STRING_SIZE - 1;
4043}
4044
4045static void rna_FileAssetSelectParams_catalog_id_set(PointerRNA *ptr, const char *value)
4046{
4047 FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
4048
4049 if (value[0] == '\0') {
4050 params->catalog_id = BLI_uuid_nil();
4051 params->asset_catalog_visibility = FILE_SHOW_ASSETS_ALL_CATALOGS;
4052 return;
4053 }
4054
4055 bUUID new_uuid;
4056 if (!BLI_uuid_parse_string(&new_uuid, value)) {
4057 printf("UUID %s not formatted correctly, ignoring new value\n", value);
4058 return;
4059 }
4060
4061 params->catalog_id = new_uuid;
4062 params->asset_catalog_visibility = FILE_SHOW_ASSETS_FROM_CATALOG;
4063}
4064
4065static const EnumPropertyItem *rna_FileAssetSelectParams_import_method_itemf(
4066 bContext * /*C*/, PointerRNA *ptr, PropertyRNA * /*prop*/, bool *r_free)
4067{
4068 const FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
4069
4070 EnumPropertyItem *items = nullptr;
4071 int items_num = 0;
4073 item->identifier;
4074 item++)
4075 {
4076 if ((item->value == FILE_ASSET_IMPORT_LINK) &&
4077 (params->asset_library_ref.type == ASSET_LIBRARY_CUSTOM))
4078 {
4080 &U, params->asset_library_ref.custom_library_index);
4081 if (user_library && user_library->flag & ASSET_LIBRARY_USE_REMOTE_URL) {
4082 /* Don't allow linking with remote libraries. */
4083 continue;
4084 }
4085 }
4086
4087 switch (eFileAssetImportMethod(item->value)) {
4089 if (U.experimental.no_data_block_packing) {
4090 RNA_enum_item_add(&items, &items_num, item);
4091 }
4092 break;
4093 }
4095 if (!U.experimental.no_data_block_packing) {
4096 RNA_enum_item_add(&items, &items_num, item);
4097 }
4098 break;
4099 }
4100 default: {
4101 RNA_enum_item_add(&items, &items_num, item);
4102 break;
4103 }
4104 }
4105 }
4106 RNA_enum_item_end(&items, &items_num);
4107 *r_free = true;
4108 return items;
4109}
4110
4111static ARegion *rna_SpaceProject_main_region_get(PointerRNA *ptr)
4112{
4113 if (!ptr->owner_id || (GS(ptr->owner_id->name) != ID_SCR)) {
4114 return nullptr;
4115 }
4116
4117 const bScreen *screen = blender::id_cast<bScreen *>(ptr->owner_id);
4118 const SpaceProject *space_project = static_cast<SpaceProject *>(ptr->data);
4119
4121 screen, reinterpret_cast<const SpaceLink *>(space_project), RGN_TYPE_WINDOW);
4122}
4123
4124static int rna_SpaceProject_active_section_get(PointerRNA *ptr)
4125{
4126 ARegion *main_region = rna_SpaceProject_main_region_get(ptr);
4127 return rna_region_active_panel_category_get(main_region);
4128}
4129static void rna_SpaceProject_active_section_set(PointerRNA *ptr, int value)
4130{
4131 ARegion *main_region = rna_SpaceProject_main_region_get(ptr);
4132 rna_region_active_panel_category_set(main_region, value);
4133}
4134const EnumPropertyItem *rna_SpaceProject_active_section_itemf(bContext * /*C*/,
4135 PointerRNA *ptr,
4136 PropertyRNA * /*prop*/,
4137 bool *r_free)
4138{
4139 ARegion *main_region = rna_SpaceProject_main_region_get(ptr);
4140 return rna_region_active_panel_category_itemf(main_region, r_free);
4141}
4142
4143} // namespace blender
4144
4145#else
4146
4147namespace blender {
4148
4150 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Display white edges with black outline"},
4151 {SI_UVDT_DASH, "DASH", 0, "Dash", "Display dashed black-white edges"},
4152 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Display black edges"},
4153 {SI_UVDT_WHITE, "WHITE", 0, "White", "Display white edges"},
4154 {0, nullptr, 0, nullptr, nullptr},
4155};
4156
4158 /* Categories */
4159 {FILTER_ID_SCE, "category_scene", ICON_SCENE_DATA, "Scenes", "Show scenes"},
4160 {FILTER_ID_AC, "category_animation", ICON_ANIM_DATA, "Animations", "Show animation data"},
4162 "category_object",
4163 ICON_GROUP,
4164 "Objects & Collections",
4165 "Show objects and collections"},
4168 "category_geometry",
4169 ICON_GEOMETRY_NODES,
4170 "Geometry",
4171 "Show meshes, curves, lattice, armatures and metaballs data"},
4173 "category_shading",
4174 ICON_MATERIAL_DATA,
4175 "Shading",
4176 "Show materials, node-trees, textures and Freestyle's line-styles"},
4178 "category_image",
4179 ICON_IMAGE_DATA,
4180 "Images & Sounds",
4181 "Show images, movie clips, sounds and masks"},
4183 "category_environment",
4184 ICON_WORLD_DATA,
4185 "Environment",
4186 "Show worlds, lights, cameras and speakers"},
4189 "category_misc",
4190 ICON_GREASEPENCIL,
4191 "Miscellaneous",
4192 "Show other data types"},
4193 {0, nullptr, 0, nullptr, nullptr},
4194};
4195
4196static void rna_def_space_generic_show_region_toggles(StructRNA *srna, int region_type_mask)
4197{
4198 PropertyRNA *prop;
4199
4200# define DEF_SHOW_REGION_PROPERTY(identifier, label, description) \
4201 { \
4202 prop = RNA_def_property(srna, STRINGIFY(identifier), PROP_BOOLEAN, PROP_NONE); \
4203 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); \
4204 RNA_def_property_boolean_funcs(prop, \
4205 STRINGIFY(rna_Space_##identifier##_get), \
4206 STRINGIFY(rna_Space_##identifier##_set)); \
4207 RNA_def_property_ui_text(prop, label, description); \
4208 RNA_def_property_update(prop, 0, STRINGIFY(rna_Space_##identifier##_update)); \
4209 } \
4210 ((void)0)
4211
4212 if (region_type_mask & (1 << RGN_TYPE_TOOL_HEADER)) {
4213 region_type_mask &= ~(1 << RGN_TYPE_TOOL_HEADER);
4214 DEF_SHOW_REGION_PROPERTY(show_region_tool_header, "Tool Settings", "");
4215 }
4216 if (region_type_mask & (1 << RGN_TYPE_HEADER)) {
4217 region_type_mask &= ~(1 << RGN_TYPE_HEADER);
4218 DEF_SHOW_REGION_PROPERTY(show_region_header, "Header", "");
4219 }
4220 if (region_type_mask & (1 << RGN_TYPE_FOOTER)) {
4221 region_type_mask &= ~(1 << RGN_TYPE_FOOTER);
4222 DEF_SHOW_REGION_PROPERTY(show_region_footer, "Footer", "");
4223 }
4224 if (region_type_mask & (1 << RGN_TYPE_TOOLS)) {
4225 region_type_mask &= ~(1 << RGN_TYPE_TOOLS);
4226 DEF_SHOW_REGION_PROPERTY(show_region_toolbar, "Toolbar", "");
4227 }
4228 if (region_type_mask & (1 << RGN_TYPE_TOOL_PROPS)) {
4229 region_type_mask &= ~(1 << RGN_TYPE_TOOL_PROPS);
4230 DEF_SHOW_REGION_PROPERTY(show_region_tool_props, "Toolbar", "");
4231 }
4232 if (region_type_mask & (1 << RGN_TYPE_CHANNELS)) {
4233 region_type_mask &= ~(1 << RGN_TYPE_CHANNELS);
4234 DEF_SHOW_REGION_PROPERTY(show_region_channels, "Channels", "");
4235 }
4236 if (region_type_mask & (1 << RGN_TYPE_UI)) {
4237 region_type_mask &= ~(1 << RGN_TYPE_UI);
4238 DEF_SHOW_REGION_PROPERTY(show_region_ui, "Sidebar", "");
4239 }
4240 if (region_type_mask & (1 << RGN_TYPE_HUD)) {
4241 region_type_mask &= ~(1 << RGN_TYPE_HUD);
4242 DEF_SHOW_REGION_PROPERTY(show_region_hud, "Adjust Last Operation", "");
4243 }
4244 if (region_type_mask & ((1 << RGN_TYPE_ASSET_SHELF) | (1 << RGN_TYPE_ASSET_SHELF_HEADER))) {
4245 region_type_mask &= ~((1 << RGN_TYPE_ASSET_SHELF) | (1 << RGN_TYPE_ASSET_SHELF_HEADER));
4246
4247 prop = RNA_def_property(srna, "show_region_asset_shelf", PROP_BOOLEAN, PROP_NONE);
4250 prop, "rna_Space_show_region_asset_shelf_get", "rna_Space_show_region_asset_shelf_set");
4251 RNA_def_property_editable_func(prop, "rna_Space_show_region_asset_shelf_editable");
4253 prop,
4254 "Asset Shelf",
4255 "Display a region with assets that may currently be relevant (such as "
4256 "brushes in paint modes, or poses in Pose Mode)");
4257 RNA_def_property_update(prop, 0, "rna_Space_show_region_asset_shelf_update");
4258 }
4259 BLI_assert(region_type_mask == 0);
4260}
4261
4262static void rna_def_space(BlenderRNA *brna)
4263{
4264 StructRNA *srna;
4265 PropertyRNA *prop;
4266
4267 srna = RNA_def_struct(brna, "Space", nullptr);
4268 RNA_def_struct_sdna(srna, "SpaceLink");
4269 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
4270 RNA_def_struct_path_func(srna, "BKE_screen_path_to_space");
4271 RNA_def_struct_refine_func(srna, "rna_Space_refine");
4272
4273 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4274 RNA_def_property_enum_sdna(prop, nullptr, "spacetype");
4276 /* When making this editable, take care for the special case of global areas
4277 * (see rna_Area_type_set). */
4279 RNA_def_property_ui_text(prop, "Type", "Space data type");
4280
4281 /* Access to #V2D_VIEWSYNC_SCREEN_TIME. */
4282 prop = RNA_def_property(srna, "show_locked_time", PROP_BOOLEAN, PROP_NONE);
4283 RNA_def_property_boolean_funcs(prop, "rna_Space_view2d_sync_get", "rna_Space_view2d_sync_set");
4285 "Sync Visible Range",
4286 "Synchronize the visible timeline range with other time-based editors");
4287 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Space_view2d_sync_update");
4288
4290}
4291
4292/* for all spaces that use a mask */
4293static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *mask_set_func)
4294{
4295 PropertyRNA *prop;
4296
4297 static const EnumPropertyItem overlay_mode_items[] = {
4299 "ALPHACHANNEL",
4300 ICON_NONE,
4301 "Alpha Channel",
4302 "Show alpha channel of the mask"},
4304 "COMBINED",
4305 ICON_NONE,
4306 "Combined",
4307 "Combine space background image with the mask"},
4308 {0, nullptr, 0, nullptr, nullptr},
4309 };
4310
4311 prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
4312 RNA_def_property_pointer_sdna(prop, nullptr, "mask_info.mask");
4315 RNA_def_property_ui_text(prop, "Mask", "Mask displayed and edited in this space");
4316 RNA_def_property_pointer_funcs(prop, nullptr, mask_set_func, nullptr, nullptr);
4317 RNA_def_property_update(prop, noteflag, nullptr);
4318
4319 /* mask drawing */
4320 prop = RNA_def_property(srna, "mask_display_type", PROP_ENUM, PROP_NONE);
4321 RNA_def_property_enum_sdna(prop, nullptr, "mask_info.draw_type");
4323 RNA_def_property_ui_text(prop, "Edge Display Type", "Display type for mask splines");
4324 RNA_def_property_update(prop, noteflag, nullptr);
4325
4326 prop = RNA_def_property(srna, "show_mask_spline", PROP_BOOLEAN, PROP_NONE);
4327 RNA_def_property_boolean_sdna(prop, nullptr, "mask_info.draw_flag", MASK_DRAWFLAG_SPLINE);
4328 RNA_def_property_ui_text(prop, "Show Mask Spline", "");
4329 RNA_def_property_update(prop, noteflag, nullptr);
4330
4331 prop = RNA_def_property(srna, "show_mask_overlay", PROP_BOOLEAN, PROP_NONE);
4332 RNA_def_property_boolean_sdna(prop, nullptr, "mask_info.draw_flag", MASK_DRAWFLAG_OVERLAY);
4333 RNA_def_property_ui_text(prop, "Show Mask Overlay", "");
4334 RNA_def_property_update(prop, noteflag, nullptr);
4335
4336 prop = RNA_def_property(srna, "mask_overlay_mode", PROP_ENUM, PROP_NONE);
4337 RNA_def_property_enum_sdna(prop, nullptr, "mask_info.overlay_mode");
4338 RNA_def_property_enum_items(prop, overlay_mode_items);
4339 RNA_def_property_ui_text(prop, "Overlay Mode", "Overlay mode of rasterized mask");
4340 RNA_def_property_update(prop, noteflag, nullptr);
4341
4342 prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_FACTOR);
4343 RNA_def_property_float_sdna(prop, nullptr, "mask_info.blend_factor");
4344 RNA_def_property_range(prop, 0.0f, 1.0f);
4345 RNA_def_property_ui_range(prop, 0, 1., 0.1, 1);
4346 RNA_def_property_ui_text(prop, "Blending Factor", "Overlay blending factor of rasterized mask");
4347 RNA_def_property_update(prop, noteflag, nullptr);
4348}
4349
4351{
4352 StructRNA *srna;
4353 PropertyRNA *prop;
4354
4355 static const EnumPropertyItem dt_uvstretch_items[] = {
4356 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
4357 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
4358 {0, nullptr, 0, nullptr, nullptr},
4359 };
4360
4361 static const EnumPropertyItem pixel_round_mode_items[] = {
4362 {SI_PIXEL_ROUND_DISABLED, "DISABLED", 0, "Disabled", "Don't round to pixels"},
4363 {SI_PIXEL_ROUND_CORNER, "CORNER", 0, "Corner", "Round to pixel corners"},
4364 {SI_PIXEL_ROUND_CENTER, "CENTER", 0, "Center", "Round to pixel centers"},
4365 {0, nullptr, 0, nullptr, nullptr},
4366 };
4367
4368 static const EnumPropertyItem grid_shape_source_items[] = {
4369 {SI_GRID_SHAPE_DYNAMIC, "DYNAMIC", 0, "Dynamic", "Dynamic grid"},
4370 {SI_GRID_SHAPE_FIXED, "FIXED", 0, "Fixed", "Manually set grid divisions"},
4371 {SI_GRID_SHAPE_PIXEL, "PIXEL", 0, "Pixel", "Grid aligns with pixels from image"},
4372 {0, nullptr, 0, nullptr, nullptr},
4373 };
4374
4375 srna = RNA_def_struct(brna, "SpaceUVEditor", nullptr);
4376 RNA_def_struct_sdna(srna, "SpaceImage");
4377 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
4378 RNA_def_struct_path_func(srna, "rna_SpaceUVEditor_path");
4379 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
4380
4381 /* drawing */
4382 prop = RNA_def_property(srna, "edge_display_type", PROP_ENUM, PROP_NONE);
4383 RNA_def_property_enum_sdna(prop, nullptr, "dt_uv");
4385 RNA_def_property_ui_text(prop, "Display As", "Display style for UV edges");
4387
4388 prop = RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
4389 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_STRETCH);
4391 prop,
4392 "Display Stretch",
4393 "Display faces colored according to the difference in shape between UVs and "
4394 "their 3D coordinates (blue for low distortion, red for high distortion)");
4396
4397 prop = RNA_def_property(srna, "display_stretch_type", PROP_ENUM, PROP_NONE);
4398 RNA_def_property_enum_sdna(prop, nullptr, "dt_uvstretch");
4399 RNA_def_property_enum_items(prop, dt_uvstretch_items);
4400 RNA_def_property_ui_text(prop, "Display Stretch Type", "Type of stretch to display");
4403
4404 prop = RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
4405 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAWSHADOW);
4407 prop, "Display Modified Edges", "Display edges after modifiers are applied");
4409
4410 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
4411 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_METADATA);
4412 RNA_def_property_ui_text(prop, "Show Metadata", "Display metadata properties of the image");
4414
4415 prop = RNA_def_property(srna, "show_uv", PROP_BOOLEAN, PROP_NONE);
4417 RNA_def_property_ui_text(prop, "Display UVs", "Display overlay of UV layer");
4419
4420 prop = RNA_def_property(srna, "show_pixel_coords", PROP_BOOLEAN, PROP_NONE);
4423 prop, "Pixel Coordinates", "Display UV coordinates in pixels rather than from 0.0 to 1.0");
4425
4426 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
4428 RNA_def_property_ui_text(prop, "Display Faces", "Display faces over the image");
4430
4431 prop = RNA_def_property(srna, "tile_grid_shape", PROP_INT, PROP_XYZ);
4432 RNA_def_property_int_sdna(prop, nullptr, "tile_grid_shape");
4433 RNA_def_property_array(prop, 2);
4435 RNA_def_property_range(prop, 1, 100);
4436 RNA_def_property_int_funcs(prop, nullptr, "rna_SpaceUVEditor_tile_grid_shape_set", nullptr);
4438 prop, "Tile Grid Shape", "How many tiles will be shown in the background");
4440
4441 prop = RNA_def_property(srna, "show_grid_over_image", PROP_BOOLEAN, PROP_NONE);
4442 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_GRID_OVER_IMAGE);
4444 RNA_def_property_ui_text(prop, "Grid Over Image", "Show the grid over the image");
4446
4447 prop = RNA_def_property(srna, "grid_shape_source", PROP_ENUM, PROP_NONE);
4448 RNA_def_property_enum_items(prop, grid_shape_source_items);
4449 RNA_def_property_ui_text(prop, "Grid Shape Source", "Specify source for the grid shape");
4451
4452 prop = RNA_def_property(srna, "custom_grid_subdivisions", PROP_INT, PROP_XYZ);
4453 RNA_def_property_int_sdna(prop, nullptr, "custom_grid_subdiv");
4454 RNA_def_property_array(prop, 2);
4456 RNA_def_property_range(prop, 1, 5000);
4457 RNA_def_property_int_funcs(prop, nullptr, "rna_SpaceUVEditor_custom_grid_subdiv_set", nullptr);
4459 prop, "Dynamic Grid Size", "Number of grid units in UV space that make one UV Unit");
4461
4462 prop = RNA_def_property(srna, "uv_opacity", PROP_FLOAT, PROP_FACTOR);
4463 RNA_def_property_float_sdna(prop, nullptr, "uv_opacity");
4464 RNA_def_property_range(prop, 0.0f, 1.0f);
4465 RNA_def_property_ui_text(prop, "UV Opacity", "Opacity of UV overlays");
4467
4468 prop = RNA_def_property(srna, "uv_face_opacity", PROP_FLOAT, PROP_FACTOR);
4469 RNA_def_property_float_sdna(prop, nullptr, "uv_face_opacity");
4470 RNA_def_property_range(prop, 0.0f, 1.0f);
4471 RNA_def_property_ui_text(prop, "UV Face Opacity", "Opacity of faces in UV overlays");
4473
4474 prop = RNA_def_property(srna, "uv_edge_opacity", PROP_FLOAT, PROP_FACTOR);
4475 RNA_def_property_float_sdna(prop, nullptr, "uv_edge_opacity");
4476 RNA_def_property_range(prop, 0.0f, 1.0f);
4477 RNA_def_property_ui_text(prop, "UV Edge Opacity", "Opacity of edges in UV overlays");
4479
4480 prop = RNA_def_property(srna, "stretch_opacity", PROP_FLOAT, PROP_FACTOR);
4481 RNA_def_property_float_sdna(prop, nullptr, "stretch_opacity");
4482 RNA_def_property_range(prop, 0.0f, 1.0f);
4483 RNA_def_property_ui_text(prop, "Stretch Opacity", "Opacity of the UV Stretch overlay");
4485
4486 prop = RNA_def_property(srna, "pixel_round_mode", PROP_ENUM, PROP_NONE);
4487 RNA_def_property_enum_items(prop, pixel_round_mode_items);
4488 RNA_def_property_ui_text(prop, "Round to Pixels", "Round UVs to pixels while editing");
4490
4491 prop = RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
4492 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_CLIP_UV);
4494 "Constrain to Image Bounds",
4495 "Constraint to stay within the image bounds while editing");
4497
4498 prop = RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
4499 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_LIVE_UNWRAP);
4501 prop,
4502 "Live Unwrap",
4503 "Continuously unwrap the selected UV island while transforming pinned vertices");
4505}
4506
4508{
4509 StructRNA *srna;
4510 PropertyRNA *prop;
4511
4512 static const EnumPropertyItem display_mode_items[] = {
4513 {SO_SCENES,
4514 "SCENES",
4515 ICON_SCENE_DATA,
4516 "Scenes",
4517 "Display scenes and their view layers, collections and objects"},
4519 "VIEW_LAYER",
4520 ICON_RENDER_RESULT,
4521 "View Layer",
4522 "Display collections and objects in the view layer"},
4523 {SO_SEQUENCE,
4524 "SEQUENCE",
4525 ICON_SEQUENCE,
4526 "Video Sequencer",
4527 "Display data belonging to the Video Sequencer"},
4528 {SO_LIBRARIES,
4529 "LIBRARIES",
4530 ICON_FILE_BLEND,
4531 "Blender File",
4532 "Display data of current file and linked libraries"},
4533 {SO_DATA_API,
4534 "DATA_API",
4535 ICON_RNA,
4536 "Data API",
4537 "Display low level Blender data and its properties"},
4539 "LIBRARY_OVERRIDES",
4540 ICON_LIBRARY_DATA_OVERRIDE,
4541 "Library Overrides",
4542 "Display data-blocks with library overrides and list their overridden properties"},
4544 "ORPHAN_DATA",
4545 ICON_ORPHAN_DATA,
4546 "Unused Data",
4547 "Display data that is unused and/or will be lost when the file is reloaded"},
4548 {0, nullptr, 0, nullptr, nullptr},
4549 };
4550
4551 static const EnumPropertyItem rna_enum_space_outliner_sort_method_items[] = {
4552 {SO_SORT_ALPHA, "ALPHA", 0, "Alphabetical", "Order items alphabetically"},
4553 {SO_SORT_CUSTOM, "CUSTOM", 0, "Custom", "Order items manually"},
4554 {SO_SORT_NONE,
4555 "NONE",
4556 0,
4557 "No Sorting",
4558 "Order items according to the actual internal data (matches the order in which "
4559 "operators will typically process them when working on collections/objects "
4560 "hierarchies)"},
4561 {0, nullptr, 0, nullptr, nullptr},
4562 };
4563
4564 static const EnumPropertyItem lib_override_view_mode[] = {
4566 "PROPERTIES",
4567 ICON_NONE,
4568 "Properties",
4569 "Display all local override data-blocks with their overridden properties and buttons to "
4570 "edit them"},
4572 "HIERARCHIES",
4573 ICON_NONE,
4574 "Hierarchies",
4575 "Display library override relationships"},
4576 {0, nullptr, 0, nullptr, nullptr},
4577 };
4578
4579 static const EnumPropertyItem filter_state_items[] = {
4580 {SO_FILTER_OB_ALL, "ALL", 0, "All", "Show all objects in the view layer"},
4581 {SO_FILTER_OB_VISIBLE, "VISIBLE", 0, "Visible", "Show visible objects"},
4582 {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected", "Show selected objects"},
4583 {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active object"},
4584 {SO_FILTER_OB_SELECTABLE, "SELECTABLE", 0, "Selectable", "Show only selectable objects"},
4585 {0, nullptr, 0, nullptr, nullptr},
4586 };
4587
4588 srna = RNA_def_struct(brna, "SpaceOutliner", "Space");
4589 RNA_def_struct_sdna(srna, "SpaceOutliner");
4590 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
4591
4592 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
4593 RNA_def_property_enum_sdna(prop, nullptr, "outlinevis");
4594 RNA_def_property_enum_items(prop, display_mode_items);
4595 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
4597
4598 prop = RNA_def_property(srna, "lib_override_view_mode", PROP_ENUM, PROP_NONE);
4599 RNA_def_property_enum_items(prop, lib_override_view_mode);
4601 "Library Override View Mode",
4602 "Choose different visualizations of library override data");
4604
4605 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
4606 RNA_def_property_string_sdna(prop, nullptr, "search_string");
4607 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
4610
4611 prop = RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
4612 RNA_def_property_boolean_sdna(prop, nullptr, "search_flags", SO_FIND_CASE_SENSITIVE);
4614 prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
4616
4617 prop = RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
4618 RNA_def_property_boolean_sdna(prop, nullptr, "search_flags", SO_FIND_COMPLETE);
4620 prop, "Complete Matches Only", "Only use complete matches of search string");
4622
4623 prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
4624 RNA_def_property_enum_items(prop, rna_enum_space_outliner_sort_method_items);
4625 RNA_def_property_ui_text(prop, "Sort Method", "Sorting method for Outliner elements");
4627
4628 prop = RNA_def_property(srna, "use_sync_select", PROP_BOOLEAN, PROP_NONE);
4629 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_SYNC_SELECT);
4631 prop, "Sync Outliner Selection", "Sync outliner selection with other editors");
4633
4634 prop = RNA_def_property(srna, "show_mode_column", PROP_BOOLEAN, PROP_NONE);
4635 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_MODE_COLUMN);
4637 prop, "Show Mode Column", "Show the mode column for mode toggle and activation");
4639
4640 prop = RNA_def_property(srna, "scroll_to_active", PROP_BOOLEAN, PROP_NONE);
4641 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_SCROLL_TO_ACTIVE);
4643 prop,
4644 "Scroll to Active",
4645 "Scroll the active item into view when it changes outside of the outliner");
4647
4648 prop = RNA_def_property(srna, "expand_on_focus", PROP_BOOLEAN, PROP_NONE);
4649 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_EXPAND_ON_FOCUS);
4651 prop, "Expand on Focus", "Uncollapse the active item when scrolling it into view");
4653
4654 prop = RNA_def_property(srna, "show_users_column", PROP_BOOLEAN, PROP_NONE);
4655 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_USERS_COLUMN);
4657 "Show Users Column",
4658 "Display a column showing the number of users for each data-block");
4660
4661 /* Granular restriction column option. */
4662 prop = RNA_def_property(srna, "show_restrict_column_enable", PROP_BOOLEAN, PROP_NONE);
4663 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_ENABLE);
4664 RNA_def_property_ui_text(prop, "Exclude from View Layer", "Exclude from view layer");
4665 RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, 0);
4667
4668 prop = RNA_def_property(srna, "show_restrict_column_select", PROP_BOOLEAN, PROP_NONE);
4669 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_SELECT);
4670 RNA_def_property_ui_text(prop, "Selectable", "Selectable");
4671 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
4673
4674 prop = RNA_def_property(srna, "show_restrict_column_hide", PROP_BOOLEAN, PROP_NONE);
4675 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_HIDE);
4676 RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
4677 RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 0);
4679
4680 prop = RNA_def_property(srna, "show_restrict_column_viewport", PROP_BOOLEAN, PROP_NONE);
4681 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_VIEWPORT);
4682 RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
4683 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
4685
4686 prop = RNA_def_property(srna, "show_restrict_column_render", PROP_BOOLEAN, PROP_NONE);
4687 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_RENDER);
4688 RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");
4689 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 0);
4691
4692 prop = RNA_def_property(srna, "show_restrict_column_holdout", PROP_BOOLEAN, PROP_NONE);
4693 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_HOLDOUT);
4694 RNA_def_property_ui_text(prop, "Holdout", "Holdout");
4695 RNA_def_property_ui_icon(prop, ICON_HOLDOUT_ON, 0);
4697
4698 prop = RNA_def_property(srna, "show_restrict_column_indirect_only", PROP_BOOLEAN, PROP_NONE);
4699 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_INDIRECT_ONLY);
4700 RNA_def_property_ui_text(prop, "Indirect Only", "Indirect only");
4701 RNA_def_property_ui_icon(prop, ICON_INDIRECT_ONLY_ON, 0);
4703
4704 /* Filters. */
4705 prop = RNA_def_property(srna, "use_filter_object", PROP_BOOLEAN, PROP_NONE);
4707 RNA_def_property_ui_text(prop, "Filter Objects", "Show objects");
4709
4710 prop = RNA_def_property(srna, "use_filter_object_content", PROP_BOOLEAN, PROP_NONE);
4713 prop, "Show Object Contents", "Show what is inside the objects elements");
4715
4716 prop = RNA_def_property(srna, "use_filter_children", PROP_BOOLEAN, PROP_NONE);
4718 RNA_def_property_ui_text(prop, "Show Object Children", "Show children");
4720
4721 prop = RNA_def_property(srna, "use_filter_collection", PROP_BOOLEAN, PROP_NONE);
4723 RNA_def_property_ui_text(prop, "Show Collections", "Show collections");
4725
4726 prop = RNA_def_property(srna, "use_filter_view_layers", PROP_BOOLEAN, PROP_NONE);
4728 RNA_def_property_ui_text(prop, "Show All View Layers", "Show all the view layers");
4730
4731 /* Filters object state. */
4732 prop = RNA_def_property(srna, "filter_state", PROP_ENUM, PROP_NONE);
4733 RNA_def_property_enum_sdna(prop, nullptr, "filter_state");
4734 RNA_def_property_enum_items(prop, filter_state_items);
4735 RNA_def_property_ui_text(prop, "Object State Filter", "");
4737
4738 prop = RNA_def_property(srna, "filter_invert", PROP_BOOLEAN, PROP_NONE);
4740 RNA_def_property_ui_text(prop, "Invert", "Invert the object state filter");
4742
4743 /* Filters object type. */
4744 prop = RNA_def_property(srna, "use_filter_object_mesh", PROP_BOOLEAN, PROP_NONE);
4746 RNA_def_property_ui_text(prop, "Show Meshes", "Show mesh objects");
4748
4749 prop = RNA_def_property(srna, "use_filter_object_armature", PROP_BOOLEAN, PROP_NONE);
4751 RNA_def_property_ui_text(prop, "Show Armatures", "Show armature objects");
4753
4754 prop = RNA_def_property(srna, "use_filter_object_empty", PROP_BOOLEAN, PROP_NONE);
4756 RNA_def_property_ui_text(prop, "Show Empties", "Show empty objects");
4758
4759 prop = RNA_def_property(srna, "use_filter_object_light", PROP_BOOLEAN, PROP_NONE);
4761 RNA_def_property_ui_text(prop, "Show Lights", "Show light objects");
4763
4764 prop = RNA_def_property(srna, "use_filter_object_camera", PROP_BOOLEAN, PROP_NONE);
4766 RNA_def_property_ui_text(prop, "Show Cameras", "Show camera objects");
4768
4769 prop = RNA_def_property(srna, "use_filter_object_grease_pencil", PROP_BOOLEAN, PROP_NONE);
4771 RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show Grease Pencil objects");
4773
4774 prop = RNA_def_property(srna, "use_filter_object_others", PROP_BOOLEAN, PROP_NONE);
4777 prop, "Show Other Objects", "Show curves, lattices, light probes, fonts, ...");
4779
4780 /* Libraries filter. */
4781 prop = RNA_def_property(srna, "use_filter_id_type", PROP_BOOLEAN, PROP_NONE);
4782 RNA_def_property_boolean_sdna(prop, nullptr, "filter", SO_FILTER_ID_TYPE);
4783 RNA_def_property_ui_text(prop, "Filter by Type", "Show only data-blocks of one type");
4785
4786 prop = RNA_def_property(srna, "filter_id_type", PROP_ENUM, PROP_NONE);
4787 RNA_def_property_enum_sdna(prop, nullptr, "filter_id_type");
4789 RNA_def_property_ui_text(prop, "Filter by Type", "Data-block type to show");
4791
4792 prop = RNA_def_property(srna, "use_filter_lib_override_system", PROP_BOOLEAN, PROP_NONE);
4795 prop,
4796 "Show System Overrides",
4797 "For libraries with overrides created, show the overridden values that are "
4798 "defined/controlled automatically (e.g. to make users of an overridden data-block point to "
4799 "the override data, not the original linked data)");
4801
4802 /* Object data filters. */
4803 prop = RNA_def_property(srna, "use_filter_object_data", PROP_BOOLEAN, PROP_NONE);
4805 RNA_def_property_ui_text(prop, "Show Object Data", "Show object data");
4807
4808 prop = RNA_def_property(srna, "use_filter_object_animation", PROP_BOOLEAN, PROP_NONE);
4810 RNA_def_property_ui_text(prop, "Show Animation Data", "Show animation data");
4812
4813 prop = RNA_def_property(srna, "use_filter_object_constraints", PROP_BOOLEAN, PROP_NONE);
4815 RNA_def_property_ui_text(prop, "Show Object Constraints", "Show object constraints");
4817
4818 prop = RNA_def_property(srna, "use_filter_object_shape_keys", PROP_BOOLEAN, PROP_NONE);
4820 RNA_def_property_ui_text(prop, "Show Object Shape Keys", "Show object shape keys");
4822
4823 prop = RNA_def_property(srna, "use_filter_object_materials", PROP_BOOLEAN, PROP_NONE);
4825 RNA_def_property_ui_text(prop, "Show Object Materials", "Show object materials");
4827
4828 prop = RNA_def_property(srna, "use_filter_object_vertex_groups", PROP_BOOLEAN, PROP_NONE);
4830 RNA_def_property_ui_text(prop, "Show Object Vertex Groups", "Show object vertex groups");
4832
4833 prop = RNA_def_property(srna, "use_filter_object_modifiers", PROP_BOOLEAN, PROP_NONE);
4835 RNA_def_property_ui_text(prop, "Show Object Modifiers", "Show object modifiers");
4837
4838 prop = RNA_def_property(srna, "use_filter_bone_collections", PROP_BOOLEAN, PROP_NONE);
4840 prop, nullptr, "filter", SO_FILTER_NO_ARMATURE_BONE_COLLECTION);
4841 RNA_def_property_ui_text(prop, "Show Bone Collections", "Show armature bone collections");
4843
4844 prop = RNA_def_property(srna, "use_filter_grease_pencil_effects", PROP_BOOLEAN, PROP_NONE);
4846 prop, nullptr, "filter", SO_FILTER_NO_GREASE_PENCIL_EFFECTS);
4847 RNA_def_property_ui_text(prop, "Show Grease Pencil Effects", "Show grease pencil effects");
4849
4850 prop = RNA_def_property(srna, "use_filter_pose_bones", PROP_BOOLEAN, PROP_NONE);
4852 RNA_def_property_ui_text(prop, "Show Pose Bones", "Show pose bones of armatures");
4854}
4855
4857{
4858 StructRNA *srna;
4859 PropertyRNA *prop;
4860
4861 static const EnumPropertyItem background_type_items[] = {
4862 {V3D_SHADING_BACKGROUND_THEME, "THEME", 0, "Theme", "Use the theme for background color"},
4863 {V3D_SHADING_BACKGROUND_WORLD, "WORLD", 0, "World", "Use the world for background color"},
4865 "VIEWPORT",
4866 0,
4867 "Custom",
4868 "Use a custom color limited to this viewport only"},
4869 {0, nullptr, 0, nullptr, nullptr},
4870 };
4871
4872 static const EnumPropertyItem cavity_type_items[] = {
4874 "WORLD",
4875 0,
4876 "World",
4877 "Cavity shading computed in world space, useful for larger-scale occlusion"},
4879 "SCREEN",
4880 0,
4881 "Screen",
4882 "Curvature-based shading, useful for making fine details more visible"},
4883 {V3D_SHADING_CAVITY_BOTH, "BOTH", 0, "Both", "Use both effects simultaneously"},
4884 {0, nullptr, 0, nullptr, nullptr},
4885 };
4886
4887 static const EnumPropertyItem use_compositor_items[] = {
4889 "DISABLED",
4890 0,
4891 "Disabled",
4892 "The compositor is disabled"},
4894 "CAMERA",
4895 0,
4896 "Camera",
4897 "The compositor is enabled only in camera view"},
4899 "ALWAYS",
4900 0,
4901 "Always",
4902 "The compositor is always enabled regardless of the view"},
4903 {0, nullptr, 0, nullptr, nullptr},
4904 };
4905
4906 /* Note these settings are used for both 3D viewport and the OpenGL render
4907 * engine in the scene, so can't assume to always be part of a screen. */
4908 srna = RNA_def_struct(brna, "View3DShading", nullptr);
4909 RNA_def_struct_path_func(srna, "rna_View3DShading_path");
4911 srna, "3D View Shading Settings", "Settings for shading in the 3D viewport");
4912 RNA_def_struct_system_idprops_func(srna, "rna_View3DShading_idprops");
4913
4914 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4917 "rna_3DViewShading_type_get",
4918 "rna_3DViewShading_type_set",
4919 "rna_3DViewShading_type_itemf");
4921 prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
4923 prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, "rna_3DViewShading_type_update");
4924
4925 prop = RNA_def_property(srna, "light", PROP_ENUM, PROP_NONE);
4926 RNA_def_property_enum_sdna(prop, nullptr, "light");
4928 RNA_def_property_ui_text(prop, "Lighting", "Lighting Method for Solid/Texture Viewport Shading");
4930
4931 prop = RNA_def_property(srna, "show_object_outline", PROP_BOOLEAN, PROP_NONE);
4934 RNA_def_property_ui_text(prop, "Outline", "Show Object Outline");
4936
4937 prop = RNA_def_property(srna, "studio_light", PROP_ENUM, PROP_NONE);
4941 "rna_View3DShading_studio_light_get",
4942 "rna_View3DShading_studio_light_set",
4943 "rna_View3DShading_studio_light_itemf");
4944 RNA_def_property_ui_text(prop, "Studiolight", "Studio lighting setup");
4946
4947 prop = RNA_def_property(srna, "use_world_space_lighting", PROP_BOOLEAN, PROP_NONE);
4951 prop, "World Space Lighting", "Make the lighting fixed and not follow the camera");
4953
4954 prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE);
4957 prop, "Backface Culling", "Use back face culling to hide the back side of faces");
4959
4960 prop = RNA_def_property(srna, "show_cavity", PROP_BOOLEAN, PROP_NONE);
4961 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_CAVITY);
4963 RNA_def_property_ui_text(prop, "Cavity", "Show Cavity");
4965
4966 prop = RNA_def_property(srna, "cavity_type", PROP_ENUM, PROP_NONE);
4967 RNA_def_property_enum_items(prop, cavity_type_items);
4968 RNA_def_property_ui_text(prop, "Cavity Type", "Way to display the cavity shading");
4971
4972 prop = RNA_def_property(srna, "curvature_ridge_factor", PROP_FLOAT, PROP_FACTOR);
4973 RNA_def_property_float_sdna(prop, nullptr, "curvature_ridge_factor");
4974 RNA_def_property_ui_text(prop, "Curvature Ridge", "Factor for the curvature ridges");
4975 RNA_def_property_range(prop, 0.0f, 2.0f);
4978
4979 prop = RNA_def_property(srna, "curvature_valley_factor", PROP_FLOAT, PROP_FACTOR);
4980 RNA_def_property_float_sdna(prop, nullptr, "curvature_valley_factor");
4981 RNA_def_property_ui_text(prop, "Curvature Valley", "Factor for the curvature valleys");
4982 RNA_def_property_range(prop, 0.0f, 2.0f);
4985
4986 prop = RNA_def_property(srna, "cavity_ridge_factor", PROP_FLOAT, PROP_FACTOR);
4987 RNA_def_property_float_sdna(prop, nullptr, "cavity_ridge_factor");
4988 RNA_def_property_ui_text(prop, "Cavity Ridge", "Factor for the cavity ridges");
4989 RNA_def_property_range(prop, 0.0f, 250.0f);
4990 RNA_def_property_ui_range(prop, 0.00f, 2.5f, 1, 3);
4993
4994 prop = RNA_def_property(srna, "cavity_valley_factor", PROP_FLOAT, PROP_FACTOR);
4995 RNA_def_property_float_sdna(prop, nullptr, "cavity_valley_factor");
4996 RNA_def_property_ui_text(prop, "Cavity Valley", "Factor for the cavity valleys");
4997 RNA_def_property_range(prop, 0.0f, 250.0f);
4998 RNA_def_property_ui_range(prop, 0.00f, 2.5f, 1, 3);
5001
5002 prop = RNA_def_property(srna, "selected_studio_light", PROP_POINTER, PROP_NONE);
5003 RNA_def_property_struct_type(prop, "StudioLight");
5005 RNA_def_property_ui_text(prop, "Studio Light", "Selected StudioLight");
5007 prop, "rna_View3DShading_selected_studio_light_get", nullptr, nullptr, nullptr);
5010
5011 prop = RNA_def_property(srna, "studiolight_rotate_z", PROP_FLOAT, PROP_ANGLE);
5012 RNA_def_property_float_sdna(prop, nullptr, "studiolight_rot_z");
5014 prop, "Studiolight Rotation", "Rotation of the studiolight around the Z-Axis");
5018
5019 prop = RNA_def_property(srna, "studiolight_intensity", PROP_FLOAT, PROP_FACTOR);
5020 RNA_def_property_float_sdna(prop, nullptr, "studiolight_intensity");
5022 RNA_def_property_ui_text(prop, "Strength", "Strength of the studiolight");
5024 RNA_def_property_range(prop, 0.0f, FLT_MAX);
5025 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
5027
5028 prop = RNA_def_property(srna, "studiolight_background_alpha", PROP_FLOAT, PROP_FACTOR);
5029 RNA_def_property_float_sdna(prop, nullptr, "studiolight_background");
5030 RNA_def_property_ui_text(prop, "World Opacity", "Show the studiolight in the background");
5031 RNA_def_property_range(prop, 0.0f, 1.0f);
5032 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
5035
5036 prop = RNA_def_property(srna, "studiolight_background_blur", PROP_FLOAT, PROP_FACTOR);
5037 RNA_def_property_float_sdna(prop, nullptr, "studiolight_blur");
5038 RNA_def_property_ui_text(prop, "Blur", "Blur the studiolight in the background");
5040 RNA_def_property_range(prop, 0.0f, 1.0f);
5041 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
5044
5045 prop = RNA_def_property(srna, "use_studiolight_view_rotation", PROP_BOOLEAN, PROP_NONE);
5047 prop, nullptr, "flag", V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION);
5050 prop, "World Space Lighting", "Make the HDR rotation fixed and not follow the camera");
5052
5053 prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE);
5054 RNA_def_property_enum_sdna(prop, nullptr, "color_type");
5056 RNA_def_property_ui_text(prop, "Color", "Color Type");
5059
5060 prop = RNA_def_property(srna, "wireframe_color_type", PROP_ENUM, PROP_NONE);
5061 RNA_def_property_enum_sdna(prop, nullptr, "wire_color_type");
5063 RNA_def_property_ui_text(prop, "Wire Color", "Wire Color Type");
5065
5066 prop = RNA_def_property(srna, "single_color", PROP_FLOAT, PROP_COLOR);
5067 RNA_def_property_float_sdna(prop, nullptr, "single_color");
5068 RNA_def_property_array(prop, 3);
5069 RNA_def_property_ui_text(prop, "Color", "Color for single color mode");
5070 RNA_def_property_range(prop, 0.0f, 1.0f);
5072
5073 prop = RNA_def_property(srna, "background_type", PROP_ENUM, PROP_NONE);
5074 RNA_def_property_enum_items(prop, background_type_items);
5075 RNA_def_property_ui_text(prop, "Background", "Way to display the background");
5078
5079 prop = RNA_def_property(srna, "background_color", PROP_FLOAT, PROP_COLOR);
5080 RNA_def_property_array(prop, 3);
5081 RNA_def_property_ui_text(prop, "Background Color", "Color for custom background color");
5082 RNA_def_property_range(prop, 0.0f, 1.0f);
5084
5085 prop = RNA_def_property(srna, "show_shadows", PROP_BOOLEAN, PROP_NONE);
5086 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_SHADOW);
5088 RNA_def_property_ui_text(prop, "Shadow", "Show Shadow");
5090
5091 prop = RNA_def_property(srna, "show_xray", PROP_BOOLEAN, PROP_NONE);
5092 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_XRAY);
5094 RNA_def_property_ui_text(prop, "Show X-Ray", "Show whole scene transparent");
5096
5097 prop = RNA_def_property(srna, "show_xray_wireframe", PROP_BOOLEAN, PROP_NONE);
5100 RNA_def_property_ui_text(prop, "Show X-Ray", "Show whole scene transparent");
5102
5103 prop = RNA_def_property(srna, "xray_alpha", PROP_FLOAT, PROP_FACTOR);
5104 RNA_def_property_float_sdna(prop, nullptr, "xray_alpha");
5105 RNA_def_property_ui_text(prop, "X-Ray Opacity", "Amount of opacity to use");
5106 RNA_def_property_range(prop, 0.0f, 1.0f);
5109
5110 prop = RNA_def_property(srna, "xray_alpha_wireframe", PROP_FLOAT, PROP_FACTOR);
5111 RNA_def_property_float_sdna(prop, nullptr, "xray_alpha_wire");
5112 RNA_def_property_ui_text(prop, "X-Ray Opacity", "Amount of opacity to use");
5113 RNA_def_property_range(prop, 0.0f, 1.0f);
5116
5117 prop = RNA_def_property(srna, "use_dof", PROP_BOOLEAN, PROP_NONE);
5121 prop,
5122 "Depth Of Field",
5123 "Use depth of field on viewport using the values from the active camera");
5125
5126 prop = RNA_def_property(srna, "use_scene_lights", PROP_BOOLEAN, PROP_NONE);
5130 RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene");
5132
5133 prop = RNA_def_property(srna, "use_scene_world", PROP_BOOLEAN, PROP_NONE);
5137 RNA_def_property_ui_text(prop, "Scene World", "Use scene world for lighting");
5139
5140 prop = RNA_def_property(srna, "use_scene_lights_render", PROP_BOOLEAN, PROP_NONE);
5143 RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene");
5145
5146 prop = RNA_def_property(srna, "use_scene_world_render", PROP_BOOLEAN, PROP_NONE);
5149 RNA_def_property_ui_text(prop, "Scene World", "Use scene world for lighting");
5151
5152 prop = RNA_def_property(srna, "show_specular_highlight", PROP_BOOLEAN, PROP_NONE);
5155 RNA_def_property_ui_text(prop, "Specular Highlights", "Render specular highlights");
5157
5158 prop = RNA_def_property(srna, "object_outline_color", PROP_FLOAT, PROP_COLOR);
5159 RNA_def_property_float_sdna(prop, nullptr, "object_outline_color");
5160 RNA_def_property_array(prop, 3);
5161 RNA_def_property_ui_text(prop, "Outline Color", "Color for object outline");
5162 RNA_def_property_range(prop, 0.0f, 1.0f);
5164
5165 prop = RNA_def_property(srna, "shadow_intensity", PROP_FLOAT, PROP_FACTOR);
5166 RNA_def_property_float_sdna(prop, nullptr, "shadow_intensity");
5167 RNA_def_property_ui_text(prop, "Shadow Intensity", "Darkness of shadows");
5168 RNA_def_property_range(prop, 0.0f, 1.0f);
5169 RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 3);
5172
5173 prop = RNA_def_property(srna, "render_pass", PROP_ENUM, PROP_NONE);
5174 RNA_def_property_enum_sdna(prop, nullptr, "render_pass");
5176 RNA_def_property_ui_text(prop, "Render Pass", "Render Pass to show in the viewport");
5179 "rna_3DViewShading_render_pass_get",
5180 "rna_3DViewShading_render_pass_set",
5181 "rna_3DViewShading_render_pass_itemf");
5183
5184 prop = RNA_def_property(srna, "aov_name", PROP_STRING, PROP_NONE);
5185 RNA_def_property_string_sdna(prop, nullptr, "aov_name");
5186 RNA_def_property_ui_text(prop, "Shader AOV Name", "Name of the active Shader AOV");
5189
5190 prop = RNA_def_property(srna, "use_compositor", PROP_ENUM, PROP_NONE);
5191 RNA_def_property_enum_sdna(prop, nullptr, "use_compositor");
5192 RNA_def_property_enum_items(prop, use_compositor_items);
5195 prop, "Compositor", "When to preview the compositor output inside the viewport");
5198 "rna_SpaceView3D_shading_use_compositor_update");
5199}
5200
5202{
5203 StructRNA *srna;
5204 PropertyRNA *prop;
5205
5206 srna = RNA_def_struct(brna, "View3DOverlay", nullptr);
5207 RNA_def_struct_sdna(srna, "View3D");
5208 RNA_def_struct_nested(brna, srna, "SpaceView3D");
5209 RNA_def_struct_path_func(srna, "rna_View3DOverlay_path");
5211 srna, "3D View Overlay Settings", "Settings for display of overlays in the 3D viewport");
5212
5213 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
5215 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like gizmos and outlines");
5216 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_show_overlay_update");
5217
5218 prop = RNA_def_property(srna, "show_ortho_grid", PROP_BOOLEAN, PROP_NONE);
5219 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_ORTHO_GRID);
5220 RNA_def_property_ui_text(prop, "Display Grid", "Show grid in orthographic side view");
5222
5223 prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
5224 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_FLOOR);
5225 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid");
5227
5228 prop = RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
5229 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_X);
5230 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line");
5232
5233 prop = RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
5234 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_Y);
5235 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line");
5237
5238 prop = RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
5239 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_Z);
5240 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line");
5242
5243 prop = RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
5244 RNA_def_property_float_sdna(prop, nullptr, "grid");
5246 prop, "Grid Scale", "Multiplier for the distance between 3D View grid lines");
5247 RNA_def_property_range(prop, 0.0f, FLT_MAX);
5248 RNA_def_property_ui_range(prop, 0.001f, 1000.0f, 0.1f, 3);
5250
5251 prop = RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
5252 RNA_def_property_int_sdna(prop, nullptr, "gridlines");
5254 prop, "Grid Lines", "Number of grid lines to display in perspective view");
5255 RNA_def_property_range(prop, 0, 1024);
5257
5258 prop = RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
5259 RNA_def_property_int_sdna(prop, nullptr, "gridsubdiv");
5260 RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions between grid lines");
5261 RNA_def_property_range(prop, 1, 1024);
5263
5264 prop = RNA_def_property(srna, "grid_scale_unit", PROP_FLOAT, PROP_NONE);
5266 RNA_def_property_float_funcs(prop, "rna_View3DOverlay_GridScaleUnit_get", nullptr, nullptr);
5268 prop, "Grid Scale Unit", "Grid cell size scaled by scene unit system settings");
5269
5270 prop = RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
5271 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SELECT_OUTLINE);
5273 prop, "Outline Selected", "Show an outline highlight around selected objects");
5275
5276 prop = RNA_def_property(srna, "show_object_origins", PROP_BOOLEAN, PROP_NONE);
5278 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_OBJECT_ORIGINS);
5279 RNA_def_property_ui_text(prop, "Object Origins", "Show object center dots");
5281
5282 prop = RNA_def_property(srna, "show_object_origins_all", PROP_BOOLEAN, PROP_NONE);
5283 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_DRAW_CENTERS);
5285 prop,
5286 "All Object Origins",
5287 "Show the object origin center dot for all (selected and unselected) objects");
5289
5290 prop = RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
5293 "Relationship Lines",
5294 "Show dashed lines indicating parent or constraint relationships");
5296
5297 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
5299 RNA_def_property_ui_text(prop, "Show 3D Cursor", "Display 3D Cursor Overlay");
5301
5302 prop = RNA_def_property(srna, "show_text", PROP_BOOLEAN, PROP_NONE);
5303 RNA_def_property_boolean_negative_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_TEXT);
5304 RNA_def_property_ui_text(prop, "Show Text", "Display overlay text");
5306
5307 prop = RNA_def_property(srna, "show_stats", PROP_BOOLEAN, PROP_NONE);
5308 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_STATS);
5309 RNA_def_property_ui_text(prop, "Show Statistics", "Display scene statistics overlay text");
5311
5312 prop = RNA_def_property(srna, "show_performance", PROP_BOOLEAN, PROP_NONE);
5313 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_PERFORMANCE);
5315 "Show Performance",
5316 "Display viewport performance timings:\n"
5317 " \u2022 Evaluation: Time to evaluate the dependency graph.\n"
5318 " \u2022 Synchronization: Time to build the GPU buffers.");
5320
5321 /* show camera composition guides */
5322 prop = RNA_def_property(srna, "show_camera_guides", PROP_BOOLEAN, PROP_NONE);
5324 RNA_def_property_ui_text(prop, "Show Camera Guides", "Show camera composition guides");
5326
5327 prop = RNA_def_property(srna, "show_camera_passepartout", PROP_BOOLEAN, PROP_NONE);
5329 RNA_def_property_ui_text(prop, "Show Passepartout", "Show camera passepartout");
5331
5332 prop = RNA_def_property(srna, "show_extras", PROP_BOOLEAN, PROP_NONE);
5334 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_OBJECT_XTRAS);
5336 prop, "Extras", "Object details, including empty wire, cameras and other visual guides");
5338
5339 prop = RNA_def_property(srna, "show_light_colors", PROP_BOOLEAN, PROP_NONE);
5340 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SHOW_LIGHT_COLORS);
5341 RNA_def_property_ui_text(prop, "Light Colors", "Show light colors");
5343
5344 prop = RNA_def_property(srna, "show_bones", PROP_BOOLEAN, PROP_NONE);
5345 RNA_def_property_boolean_negative_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_BONES);
5347 prop, "Show Bones", "Display bones (disable to show motion paths only)");
5349
5350 prop = RNA_def_property(srna, "show_face_orientation", PROP_BOOLEAN, PROP_NONE);
5351 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_FACE_ORIENTATION);
5353 RNA_def_property_ui_text(prop, "Face Orientation", "Show the Face Orientation Overlay");
5355
5356 prop = RNA_def_property(srna, "show_fade_inactive", PROP_BOOLEAN, PROP_NONE);
5357 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_FADE_INACTIVE);
5360 prop, "Fade Inactive Objects", "Fade inactive geometry using the viewport background color");
5362
5363 prop = RNA_def_property(srna, "fade_inactive_alpha", PROP_FLOAT, PROP_FACTOR);
5364 RNA_def_property_float_sdna(prop, nullptr, "overlay.fade_alpha");
5365 RNA_def_property_ui_text(prop, "Opacity", "Strength of the fade effect");
5366 RNA_def_property_range(prop, 0.0f, 1.0f);
5369
5370 prop = RNA_def_property(srna, "show_xray_bone", PROP_BOOLEAN, PROP_NONE);
5371 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_BONE_SELECT);
5373 RNA_def_property_ui_text(prop, "Show Bone X-Ray", "Show the bone selection overlay");
5375
5376 prop = RNA_def_property(srna, "xray_alpha_bone", PROP_FLOAT, PROP_FACTOR);
5377 RNA_def_property_float_sdna(prop, nullptr, "overlay.xray_alpha_bone");
5378 RNA_def_property_ui_text(prop, "Opacity", "Opacity to use for bone selection");
5379 RNA_def_property_range(prop, 0.0f, 1.0f);
5382
5383 prop = RNA_def_property(srna, "bone_wire_alpha", PROP_FLOAT, PROP_FACTOR);
5384 RNA_def_property_float_sdna(prop, nullptr, "overlay.bone_wire_alpha");
5386 prop, "Bone Wireframe Opacity", "Maximum opacity of bones in wireframe display mode");
5387 RNA_def_property_range(prop, 0.0f, FLT_MAX);
5388 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
5391
5392 prop = RNA_def_property(srna, "show_motion_paths", PROP_BOOLEAN, PROP_NONE);
5394 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_MOTION_PATHS);
5396 RNA_def_property_ui_text(prop, "Motion Paths", "Show the Motion Paths Overlay");
5398
5399 prop = RNA_def_property(srna, "show_onion_skins", PROP_BOOLEAN, PROP_NONE);
5400 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_ONION_SKINS);
5402 RNA_def_property_ui_text(prop, "Onion Skins", "Show the Onion Skinning Overlay");
5404
5405 prop = RNA_def_property(srna, "show_look_dev", PROP_BOOLEAN, PROP_NONE);
5406 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_LOOK_DEV);
5409 "Reference Spheres",
5410 "Show reference spheres with neutral shading that react to lighting to "
5411 "assist in look development");
5413
5414 prop = RNA_def_property(srna, "show_wireframes", PROP_BOOLEAN, PROP_NONE);
5415 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_WIREFRAMES);
5417 RNA_def_property_ui_text(prop, "Wireframe", "Show face edges wires");
5419
5420 prop = RNA_def_property(srna, "wireframe_threshold", PROP_FLOAT, PROP_FACTOR);
5421 RNA_def_property_float_sdna(prop, nullptr, "overlay.wireframe_threshold");
5423 "Wireframe Threshold",
5424 "Adjust the angle threshold for displaying edges "
5425 "(1.0 for all)");
5426 RNA_def_property_range(prop, 0.0f, 1.0f);
5429
5430 prop = RNA_def_property(srna, "wireframe_opacity", PROP_FLOAT, PROP_FACTOR);
5431 RNA_def_property_float_sdna(prop, nullptr, "overlay.wireframe_opacity");
5433 "Wireframe Opacity",
5434 "Opacity of the displayed edges "
5435 "(1.0 for opaque)");
5436 RNA_def_property_range(prop, 0.0f, 1.0f);
5439
5440 prop = RNA_def_property(srna, "show_viewer_attribute", PROP_BOOLEAN, PROP_NONE);
5441 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_VIEWER_ATTRIBUTE);
5443 RNA_def_property_ui_text(prop, "Viewer Node", "Show attribute overlay for active viewer node");
5445
5446 prop = RNA_def_property(srna, "viewer_attribute_opacity", PROP_FLOAT, PROP_FACTOR);
5447 RNA_def_property_float_sdna(prop, nullptr, "overlay.viewer_attribute_opacity");
5449 prop, "Viewer Attribute Opacity", "Opacity of the attribute that is currently visualized");
5450 RNA_def_property_range(prop, 0.0f, 1.0f);
5453
5454 prop = RNA_def_property(srna, "show_viewer_text", PROP_BOOLEAN, PROP_NONE);
5458 prop, "View Attribute Text", "Show attribute values as text in viewport");
5460
5461 prop = RNA_def_property(srna, "show_paint_wire", PROP_BOOLEAN, PROP_NONE);
5462 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.paint_flag", V3D_OVERLAY_PAINT_WIRE);
5463 RNA_def_property_ui_text(prop, "Show Wire", "Use wireframe display in painting modes");
5465
5466 prop = RNA_def_property(srna, "show_wpaint_contours", PROP_BOOLEAN, PROP_NONE);
5467 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.wpaint_flag", V3D_OVERLAY_WPAINT_CONTOURS);
5469 prop,
5470 "Show Weight Contours",
5471 "Show contour lines formed by points with the same interpolated weight");
5473
5474 prop = RNA_def_property(srna, "show_weight", PROP_BOOLEAN, PROP_NONE);
5475 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_WEIGHT);
5476 RNA_def_property_ui_text(prop, "Show Weights", "Display weights in editmode");
5478
5479 prop = RNA_def_property(srna, "show_retopology", PROP_BOOLEAN, PROP_NONE);
5480 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_RETOPOLOGY);
5482 "Retopology",
5483 "Hide the solid mesh and offset the overlay towards the view. "
5484 "Selection is occluded by inactive geometry, unless X-Ray is enabled");
5486 prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, "rna_SpaceView3D_retopology_update");
5487
5488 prop = RNA_def_property(srna, "retopology_offset", PROP_FLOAT, PROP_DISTANCE);
5489 RNA_def_property_float_sdna(prop, nullptr, "overlay.retopology_offset");
5491 prop, "Retopology Offset", "Offset used to draw edit mesh in front of other geometry");
5492 RNA_def_property_range(prop, 0.0f, FLT_MAX);
5493 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1f, 3);
5496
5497 prop = RNA_def_property(srna, "show_face_normals", PROP_BOOLEAN, PROP_NONE);
5498 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_NORMALS);
5499 RNA_def_property_ui_text(prop, "Display Normals", "Display face normals as lines");
5501
5502 prop = RNA_def_property(srna, "show_vertex_normals", PROP_BOOLEAN, PROP_NONE);
5503 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_VERT_NORMALS);
5504 RNA_def_property_ui_text(prop, "Display Vertex Normals", "Display vertex normals as lines");
5506
5507 prop = RNA_def_property(srna, "show_split_normals", PROP_BOOLEAN, PROP_NONE);
5508 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_LOOP_NORMALS);
5510 prop, "Display Custom Normals", "Display vertex-per-face normals as lines");
5512
5513 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
5514 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACES);
5515 RNA_def_property_ui_text(prop, "Display Faces", "Display a face selection overlay");
5517
5518 prop = RNA_def_property(srna, "show_face_center", PROP_BOOLEAN, PROP_NONE);
5519 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_DOT);
5521 prop,
5522 "Display Face Center",
5523 "Display face center when face selection is enabled in solid shading modes");
5525
5526 prop = RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
5527 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CREASES);
5529 prop, "Display Creases", "Display creases created for Subdivision Surface modifier");
5531
5532 prop = RNA_def_property(srna, "show_edge_bevel_weight", PROP_BOOLEAN, PROP_NONE);
5533 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_BWEIGHTS);
5535 prop, "Display Bevel Weights", "Display weights created for the Bevel modifier");
5537
5538 prop = RNA_def_property(srna, "show_edge_seams", PROP_BOOLEAN, PROP_NONE);
5539 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_SEAMS);
5540 RNA_def_property_ui_text(prop, "Display Seams", "Display UV unwrapping seams");
5542
5543 prop = RNA_def_property(srna, "show_edge_sharp", PROP_BOOLEAN, PROP_NONE);
5544 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_SHARP);
5546 prop, "Display Sharp", "Display sharp edges, used with the Edge Split modifier");
5548
5549 prop = RNA_def_property(srna, "show_freestyle_edge_marks", PROP_BOOLEAN, PROP_NONE);
5551 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FREESTYLE_EDGE);
5553 "Display Freestyle Edge Marks",
5554 "Display Freestyle edge marks, used with the Freestyle renderer");
5556
5557 prop = RNA_def_property(srna, "show_freestyle_face_marks", PROP_BOOLEAN, PROP_NONE);
5559 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FREESTYLE_FACE);
5561 "Display Freestyle Face Marks",
5562 "Display Freestyle face marks, used with the Freestyle renderer");
5564
5565 prop = RNA_def_property(srna, "show_statvis", PROP_BOOLEAN, PROP_NONE);
5566 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_STATVIS);
5568 prop, "Mesh Analysis", "Display statistical information about the mesh");
5570
5571 prop = RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
5572 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_EDGE_LEN);
5574 prop,
5575 "Edge Length",
5576 "Display selected edge lengths, using global values when set in the transform panel");
5578
5579 prop = RNA_def_property(srna, "show_extra_edge_angle", PROP_BOOLEAN, PROP_NONE);
5580 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_EDGE_ANG);
5582 prop,
5583 "Edge Angle",
5584 "Display selected edge angle, using global values when set in the transform panel");
5586
5587 prop = RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
5588 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_ANG);
5590 "Face Angles",
5591 "Display the angles in the selected edges, "
5592 "using global values when set in the transform panel");
5594
5595 prop = RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
5596 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_AREA);
5598 "Face Area",
5599 "Display the area of selected faces, "
5600 "using global values when set in the transform panel");
5602
5603 prop = RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
5604 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_INDICES);
5606 prop, "Indices", "Display the index numbers of selected vertices, edges, and faces");
5608
5609 prop = RNA_def_property(srna, "display_handle", PROP_ENUM, PROP_NONE);
5610 RNA_def_property_enum_sdna(prop, nullptr, "overlay.handle_display");
5613 prop, "Display Handles", "Limit the display of curve handles in Edit Mode");
5615
5616 prop = RNA_def_property(srna, "show_curve_normals", PROP_BOOLEAN, PROP_NONE);
5617 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CU_NORMALS);
5618 RNA_def_property_ui_text(prop, "Draw Normals", "Display 3D curve normals in Edit Mode");
5620
5621 prop = RNA_def_property(srna, "normals_length", PROP_FLOAT, PROP_FACTOR);
5622 RNA_def_property_float_sdna(prop, nullptr, "overlay.normals_length");
5623 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
5624 RNA_def_property_range(prop, 0.00001, 100000.0);
5625 RNA_def_property_ui_range(prop, 0.01, 2.0, 1, 2);
5627
5628 prop = RNA_def_property(srna, "normals_constant_screen_size", PROP_FLOAT, PROP_PIXEL);
5629 RNA_def_property_float_sdna(prop, nullptr, "overlay.normals_constant_screen_size");
5630 RNA_def_property_ui_text(prop, "Normal Screen Size", "Screen size for normals in the 3D view");
5631 RNA_def_property_range(prop, 0.0, 100000.0);
5632 RNA_def_property_ui_range(prop, 1.0, 100.0, 50, 0);
5634
5635 prop = RNA_def_property(srna, "use_normals_constant_screen_size", PROP_BOOLEAN, PROP_NONE);
5637 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS);
5639 "Constant Screen Size Normals",
5640 "Keep size of normals constant in relation to 3D view");
5642
5643 prop = RNA_def_property(srna, "texture_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
5644 RNA_def_property_float_sdna(prop, nullptr, "overlay.texture_paint_mode_opacity");
5646 prop, "Stencil Mask Opacity", "Opacity of the texture paint mode stencil mask overlay");
5647 RNA_def_property_range(prop, 0.0f, 1.0f);
5649
5650 prop = RNA_def_property(srna, "vertex_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
5651 RNA_def_property_float_sdna(prop, nullptr, "overlay.vertex_paint_mode_opacity");
5653 prop, "Stencil Mask Opacity", "Opacity of the texture paint mode stencil mask overlay");
5654 RNA_def_property_range(prop, 0.0f, 1.0f);
5656
5657 prop = RNA_def_property(srna, "weight_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
5658 RNA_def_property_float_sdna(prop, nullptr, "overlay.weight_paint_mode_opacity");
5660 prop, "Weight Paint Opacity", "Opacity of the weight paint mode overlay");
5661 RNA_def_property_range(prop, 0.0f, 1.0f);
5663
5664 prop = RNA_def_property(srna, "sculpt_mode_mask_opacity", PROP_FLOAT, PROP_FACTOR);
5665 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_mode_mask_opacity");
5666 RNA_def_property_ui_text(prop, "Sculpt Mask Opacity", "");
5667 RNA_def_property_range(prop, 0.0f, 1.0f);
5669
5670 prop = RNA_def_property(srna, "show_sculpt_curves_cage", PROP_BOOLEAN, PROP_NONE);
5671 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SCULPT_CURVES_CAGE);
5673 prop, "Sculpt Curves Cage", "Show original curves that are currently being edited");
5675
5676 prop = RNA_def_property(srna, "sculpt_curves_cage_opacity", PROP_FLOAT, PROP_FACTOR);
5677 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_curves_cage_opacity");
5679 prop, "Curves Sculpt Cage Opacity", "Opacity of the cage overlay in curves sculpt mode");
5680 RNA_def_property_range(prop, 0.0f, 1.0f);
5682
5683 prop = RNA_def_property(srna, "sculpt_mode_face_sets_opacity", PROP_FLOAT, PROP_FACTOR);
5684 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_mode_face_sets_opacity");
5685 RNA_def_property_ui_text(prop, "Sculpt Face Sets Opacity", "");
5686 RNA_def_property_range(prop, 0.0f, 1.0f);
5688
5689 prop = RNA_def_property(srna, "show_sculpt_mask", PROP_BOOLEAN, PROP_NONE);
5690 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SCULPT_SHOW_MASK);
5691 RNA_def_property_ui_text(prop, "Sculpt Show Mask", "");
5693
5694 prop = RNA_def_property(srna, "show_sculpt_face_sets", PROP_BOOLEAN, PROP_NONE);
5696 RNA_def_property_ui_text(prop, "Sculpt Show Face Sets", "");
5698
5699 /* grease pencil paper settings */
5700 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
5701 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_ANNOTATION);
5702 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
5704
5705 prop = RNA_def_property(srna, "use_gpencil_fade_objects", PROP_BOOLEAN, PROP_NONE);
5706 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_FADE_OBJECTS);
5708 prop,
5709 "Fade Objects",
5710 "Fade all viewport objects with a full color layer to improve visibility");
5712
5713 prop = RNA_def_property(srna, "use_gpencil_grid", PROP_BOOLEAN, PROP_NONE);
5714 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_GRID);
5715 RNA_def_property_ui_text(prop, "Use Grid", "Display a grid over Grease Pencil paper");
5717
5718 prop = RNA_def_property(srna, "use_gpencil_fade_layers", PROP_BOOLEAN, PROP_NONE);
5721 prop, "Fade Layers", "Toggle fading of Grease Pencil layers except the active one");
5723
5724 prop = RNA_def_property(srna, "use_gpencil_fade_gp_objects", PROP_BOOLEAN, PROP_NONE);
5727 prop, "Fade Grease Pencil Objects", "Fade Grease Pencil Objects, except the active one");
5729
5730 prop = RNA_def_property(srna, "use_gpencil_canvas_xray", PROP_BOOLEAN, PROP_NONE);
5731 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_GRID_XRAY);
5732 RNA_def_property_ui_text(prop, "Canvas X-Ray", "Show Canvas grid in front");
5734
5735 prop = RNA_def_property(srna, "use_gpencil_show_directions", PROP_BOOLEAN, PROP_NONE);
5738 "Stroke Direction",
5739 "Show stroke drawing direction with a bigger green dot (start) "
5740 "and smaller red dot (end) points");
5742
5743 prop = RNA_def_property(srna, "use_gpencil_show_material_name", PROP_BOOLEAN, PROP_NONE);
5746 prop, "Stroke Material Name", "Show material name assigned to each stroke");
5748
5749 prop = RNA_def_property(srna, "gpencil_grid_opacity", PROP_FLOAT, PROP_NONE);
5750 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_opacity");
5751 RNA_def_property_range(prop, 0.1f, 1.0f);
5752 RNA_def_property_ui_text(prop, "Opacity", "Canvas grid opacity");
5754
5755 prop = RNA_def_property(srna, "gpencil_grid_color", PROP_FLOAT, PROP_COLOR);
5756 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_color");
5757 RNA_def_property_array(prop, 3);
5758 RNA_def_property_ui_text(prop, "Grid Color", "Canvas grid color");
5759 RNA_def_property_range(prop, 0.0f, 1.0f);
5761
5762 prop = RNA_def_property(srna, "gpencil_grid_scale", PROP_FLOAT, PROP_XYZ);
5763 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_scale");
5764 RNA_def_property_array(prop, 2);
5765 RNA_def_property_ui_text(prop, "Scale", "Canvas grid scale");
5766 RNA_def_property_range(prop, 0.0f, FLT_MAX);
5768
5769 prop = RNA_def_property(srna, "gpencil_grid_offset", PROP_FLOAT, PROP_DISTANCE);
5770 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_offset");
5771 RNA_def_property_array(prop, 2);
5772 RNA_def_property_ui_text(prop, "Offset", "Canvas grid offset");
5774
5775 prop = RNA_def_property(srna, "gpencil_grid_subdivisions", PROP_INT, PROP_NONE);
5776 RNA_def_property_int_sdna(prop, nullptr, "overlay.gpencil_grid_subdivisions");
5777 RNA_def_property_range(prop, 1, 100);
5778 RNA_def_property_ui_text(prop, "Subdivisions", "Canvas grid subdivisions");
5780
5781 /* Paper opacity factor */
5782 prop = RNA_def_property(srna, "gpencil_fade_objects", PROP_FLOAT, PROP_NONE);
5783 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_paper_opacity");
5784 RNA_def_property_range(prop, 0.0f, 1.0f);
5785 RNA_def_property_ui_text(prop, "Opacity", "Fade factor");
5787
5788 /* Paper opacity factor */
5789 prop = RNA_def_property(srna, "gpencil_fade_layer", PROP_FLOAT, PROP_NONE);
5790 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_fade_layer");
5791 RNA_def_property_range(prop, 0.0f, 1.0f);
5794 prop, "Opacity", "Fade layer opacity for Grease Pencil layers except the active one");
5796
5797 /* show edit lines */
5798 prop = RNA_def_property(srna, "use_gpencil_edit_lines", PROP_BOOLEAN, PROP_NONE);
5799 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_EDIT_LINES);
5800 RNA_def_property_ui_text(prop, "Show Edit Lines", "Show Edit Lines when editing strokes");
5802
5803 prop = RNA_def_property(srna, "use_gpencil_multiedit_line_only", PROP_BOOLEAN, PROP_NONE);
5805 RNA_def_property_ui_text(prop, "Lines Only", "Show Edit Lines only in multiframe");
5807
5808 /* main grease pencil onion switch */
5809 prop = RNA_def_property(srna, "use_gpencil_onion_skin", PROP_BOOLEAN, PROP_NONE);
5810 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_ONION_SKIN);
5812 prop, "Onion Skins", "Show ghosts of the keyframes before and after the current frame");
5814
5815 /* Show onion skin for active object only. */
5816 prop = RNA_def_property(srna, "use_gpencil_onion_skin_active_object", PROP_BOOLEAN, PROP_NONE);
5819 prop, "Active Object Only", "Show only the onion skins of the active object");
5821
5822 /* vertex opacity */
5823 prop = RNA_def_property(srna, "vertex_opacity", PROP_FLOAT, PROP_FACTOR);
5824 RNA_def_property_float_sdna(prop, nullptr, "vertex_opacity");
5825 RNA_def_property_range(prop, 0.0f, 1.0f);
5826 RNA_def_property_ui_text(prop, "Vertex Opacity", "Opacity for edit vertices");
5829
5830 /* Vertex Paint opacity factor */
5831 prop = RNA_def_property(srna, "gpencil_vertex_paint_opacity", PROP_FLOAT, PROP_FACTOR);
5832 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_vertex_paint_opacity");
5833 RNA_def_property_range(prop, 0.0f, 1.0f);
5834 RNA_def_property_ui_text(prop, "Opacity", "Vertex Paint mix factor");
5836
5837 /* Developer Debug overlay */
5838
5839 prop = RNA_def_property(srna, "use_debug_freeze_view_culling", PROP_BOOLEAN, PROP_NONE);
5840 RNA_def_property_boolean_sdna(prop, nullptr, "debug_flag", V3D_DEBUG_FREEZE_CULLING);
5841 RNA_def_property_ui_text(prop, "Freeze Culling", "Freeze view culling bounds");
5843}
5844
5846{
5847 StructRNA *srna;
5848 PropertyRNA *prop;
5849
5850 static const EnumPropertyItem rv3d_persp_items[] = {
5851 {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
5852 {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
5853 {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
5854 {0, nullptr, 0, nullptr, nullptr},
5855 };
5856
5857 static const EnumPropertyItem bundle_drawtype_items[] = {
5858 {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
5859 {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
5860 {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
5861 {OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
5862 {OB_CUBE, "CUBE", 0, "Cube", ""},
5863 {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
5864 {OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
5865 {0, nullptr, 0, nullptr, nullptr},
5866 };
5867
5868 srna = RNA_def_struct(brna, "SpaceView3D", "Space");
5869 RNA_def_struct_sdna(srna, "View3D");
5870 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
5871
5873 ((1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_TOOLS) |
5874 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) |
5875 (1 << RGN_TYPE_ASSET_SHELF)));
5876
5877 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
5879 RNA_def_property_pointer_sdna(prop, nullptr, "camera");
5881 prop,
5882 "Camera",
5883 "Active camera used in this view (when unlocked from the scene's active camera)");
5884 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_camera_update");
5885
5886 /* render border */
5887 prop = RNA_def_property(srna, "use_render_border", PROP_BOOLEAN, PROP_NONE);
5888 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_RENDER_BORDER);
5891 "Render Region",
5892 "Use a region within the frame size for rendered viewport "
5893 "(when not viewing through the camera)");
5895
5896 prop = RNA_def_property(srna, "render_border_min_x", PROP_FLOAT, PROP_NONE);
5897 RNA_def_property_float_sdna(prop, nullptr, "render_border.xmin");
5898 RNA_def_property_range(prop, 0.0f, 1.0f);
5899 RNA_def_property_ui_text(prop, "Region Minimum X", "Minimum X value for the render region");
5901
5902 prop = RNA_def_property(srna, "render_border_min_y", PROP_FLOAT, PROP_NONE);
5903 RNA_def_property_float_sdna(prop, nullptr, "render_border.ymin");
5904 RNA_def_property_range(prop, 0.0f, 1.0f);
5905 RNA_def_property_ui_text(prop, "Region Minimum Y", "Minimum Y value for the render region");
5907
5908 prop = RNA_def_property(srna, "render_border_max_x", PROP_FLOAT, PROP_NONE);
5909 RNA_def_property_float_sdna(prop, nullptr, "render_border.xmax");
5910 RNA_def_property_range(prop, 0.0f, 1.0f);
5911 RNA_def_property_ui_text(prop, "Region Maximum X", "Maximum X value for the render region");
5913
5914 prop = RNA_def_property(srna, "render_border_max_y", PROP_FLOAT, PROP_NONE);
5915 RNA_def_property_float_sdna(prop, nullptr, "render_border.ymax");
5916 RNA_def_property_range(prop, 0.0f, 1.0f);
5917 RNA_def_property_ui_text(prop, "Region Maximum Y", "Maximum Y value for the render region");
5919
5920 prop = RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
5922 RNA_def_property_pointer_sdna(prop, nullptr, "ob_center");
5924 prop, "Lock to Object", "3D View center is locked to this object's position");
5926
5927 prop = RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
5928 RNA_def_property_string_sdna(prop, nullptr, "ob_center_bone");
5930 prop, "Lock to Bone", "3D View center is locked to this bone's position");
5932
5933 prop = RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
5934 RNA_def_property_boolean_sdna(prop, nullptr, "ob_center_cursor", 1);
5936 prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
5938
5939 prop = RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
5940 RNA_def_property_pointer_sdna(prop, nullptr, "localvd");
5942 prop,
5943 "Local View",
5944 "Display an isolated subset of objects, apart from the scene visibility");
5945
5946 prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_UNIT_CAMERA);
5947 RNA_def_property_float_sdna(prop, nullptr, "lens");
5948 RNA_def_property_ui_text(prop, "Lens", "Viewport lens angle");
5949 RNA_def_property_range(prop, 1.0f, 250.0f);
5951
5952 prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
5953 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
5954 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
5956 prop, "Clip Start", "3D View near clipping distance (perspective view only)");
5958
5959 prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
5960 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
5961 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
5962 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
5964
5965 prop = RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
5966 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_LOCK_CAMERA);
5968 prop, "Lock Camera to View", "Enable view navigation within the camera view");
5970
5971 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
5972 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", V3D_GIZMO_HIDE);
5973 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
5975
5976 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
5978 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
5980
5981 prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE);
5983 RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item");
5985
5986 prop = RNA_def_property(srna, "show_gizmo_modifier", PROP_BOOLEAN, PROP_NONE);
5988 RNA_def_property_ui_text(prop, "Modifier Gizmo", "Gizmos for the active modifier");
5990
5991 prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE);
5992 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", V3D_GIZMO_HIDE_TOOL);
5993 RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo");
5995
5996 /* Per object type gizmo display flags. */
5997
5998 prop = RNA_def_property(srna, "show_gizmo_object_translate", PROP_BOOLEAN, PROP_NONE);
6000 prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_TRANSLATE);
6001 RNA_def_property_ui_text(prop, "Show Object Location", "Gizmo to adjust location");
6003
6004 prop = RNA_def_property(srna, "show_gizmo_object_rotate", PROP_BOOLEAN, PROP_NONE);
6005 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_ROTATE);
6006 RNA_def_property_ui_text(prop, "Show Object Rotation", "Gizmo to adjust rotation");
6008
6009 prop = RNA_def_property(srna, "show_gizmo_object_scale", PROP_BOOLEAN, PROP_NONE);
6010 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_SCALE);
6011 RNA_def_property_ui_text(prop, "Show Object Scale", "Gizmo to adjust scale");
6013
6014 /* Empty Object Data. */
6015 prop = RNA_def_property(srna, "show_gizmo_empty_image", PROP_BOOLEAN, PROP_NONE);
6016 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_empty", V3D_GIZMO_SHOW_EMPTY_IMAGE);
6017 RNA_def_property_ui_text(prop, "Show Empty Image", "Gizmo to adjust image size and position");
6019
6020 prop = RNA_def_property(srna, "show_gizmo_empty_force_field", PROP_BOOLEAN, PROP_NONE);
6022 prop, nullptr, "gizmo_show_empty", V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD);
6023 RNA_def_property_ui_text(prop, "Show Empty Force Field", "Gizmo to adjust the force field");
6025
6026 /* Light Object Data. */
6027 prop = RNA_def_property(srna, "show_gizmo_light_size", PROP_BOOLEAN, PROP_NONE);
6028 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_light", V3D_GIZMO_SHOW_LIGHT_SIZE);
6029 RNA_def_property_ui_text(prop, "Show Light Size", "Gizmo to adjust spot and area size");
6031
6032 prop = RNA_def_property(srna, "show_gizmo_light_look_at", PROP_BOOLEAN, PROP_NONE);
6033 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_light", V3D_GIZMO_SHOW_LIGHT_LOOK_AT);
6035 prop, "Show Light Look-At", "Gizmo to adjust the direction of the light");
6037
6038 /* Camera Object Data. */
6039 prop = RNA_def_property(srna, "show_gizmo_camera_lens", PROP_BOOLEAN, PROP_NONE);
6040 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_camera", V3D_GIZMO_SHOW_CAMERA_LENS);
6042 prop, "Show Camera Lens", "Gizmo to adjust camera focal length or orthographic scale");
6044
6045 prop = RNA_def_property(srna, "show_gizmo_camera_dof_distance", PROP_BOOLEAN, PROP_NONE);
6047 prop, nullptr, "gizmo_show_camera", V3D_GIZMO_SHOW_CAMERA_DOF_DIST);
6049 "Show Camera Focus Distance",
6050 "Gizmo to adjust camera focus distance "
6051 "(depends on limits display)");
6053
6054 prop = RNA_def_property(srna, "use_local_camera", PROP_BOOLEAN, PROP_NONE);
6055 RNA_def_property_boolean_negative_sdna(prop, nullptr, "scenelock", 1);
6056 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SpaceView3D_use_local_camera_set");
6058 "Use Local Camera",
6059 "Use a local camera in this view, rather than scene's active camera");
6061
6062 prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
6063 RNA_def_property_struct_type(prop, "RegionView3D");
6064 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", nullptr, nullptr, nullptr);
6066 prop,
6067 "3D Region",
6068 "3D region for this space. When the space is in quad view, the camera region");
6069
6070 prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE);
6071 RNA_def_property_struct_type(prop, "RegionView3D");
6073 "rna_SpaceView3D_region_quadviews_begin",
6074 "rna_iterator_listbase_next",
6075 "rna_iterator_listbase_end",
6076 "rna_SpaceView3D_region_quadviews_get",
6077 nullptr,
6078 nullptr,
6079 nullptr,
6080 nullptr);
6082 "Quad View Regions",
6083 "3D regions (the third one defines quad view settings, "
6084 "the fourth one is same as 'region_3d')");
6085
6086 prop = RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
6089 prop, "Show Reconstruction", "Display reconstruction data from active movie clip");
6091
6092 prop = RNA_def_property(srna, "tracks_display_size", PROP_FLOAT, PROP_NONE);
6093 RNA_def_property_range(prop, 0.0, FLT_MAX);
6094 RNA_def_property_ui_range(prop, 0, 5, 1, 3);
6095 RNA_def_property_float_sdna(prop, nullptr, "bundle_size");
6096 RNA_def_property_ui_text(prop, "Tracks Size", "Display size of tracks from reconstructed data");
6098
6099 prop = RNA_def_property(srna, "tracks_display_type", PROP_ENUM, PROP_NONE);
6100 RNA_def_property_enum_sdna(prop, nullptr, "bundle_drawtype");
6101 RNA_def_property_enum_items(prop, bundle_drawtype_items);
6102 RNA_def_property_ui_text(prop, "Tracks Display Type", "Viewport display style for tracks");
6104
6105 prop = RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE);
6106 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_CAMERAPATH);
6107 RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed camera path");
6109
6110 prop = RNA_def_property(srna, "show_bundle_names", PROP_BOOLEAN, PROP_NONE);
6111 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_BUNDLENAME);
6113 prop, "Show 3D Marker Names", "Show names for reconstructed tracks objects");
6115
6116 prop = RNA_def_property(srna, "use_local_collections", PROP_BOOLEAN, PROP_NONE);
6119 prop, "Local Collections", "Display a different set of collections in this viewport");
6122 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_use_local_collections_update");
6123
6124 /* Stereo Settings */
6125 prop = RNA_def_property(srna, "stereo_3d_eye", PROP_ENUM, PROP_NONE);
6126 RNA_def_property_enum_sdna(prop, nullptr, "multiview_eye");
6128 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceView3D_stereo3d_camera_itemf");
6129 RNA_def_property_ui_text(prop, "Stereo Eye", "Current stereo eye being displayed");
6131
6132 prop = RNA_def_property(srna, "stereo_3d_camera", PROP_ENUM, PROP_NONE);
6133 RNA_def_property_enum_sdna(prop, nullptr, "stereo3d_camera");
6135 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceView3D_stereo3d_camera_itemf");
6136 RNA_def_property_ui_text(prop, "Camera", "");
6138
6139 prop = RNA_def_property(srna, "show_stereo_3d_cameras", PROP_BOOLEAN, PROP_NONE);
6140 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPCAMERAS);
6141 RNA_def_property_ui_text(prop, "Cameras", "Show the left and right cameras");
6143
6144 prop = RNA_def_property(srna, "show_stereo_3d_convergence_plane", PROP_BOOLEAN, PROP_NONE);
6145 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPPLANE);
6146 RNA_def_property_ui_text(prop, "Plane", "Show the stereo 3D convergence plane");
6148
6149 prop = RNA_def_property(srna, "stereo_3d_convergence_plane_alpha", PROP_FLOAT, PROP_FACTOR);
6150 RNA_def_property_float_sdna(prop, nullptr, "stereo3d_convergence_alpha");
6151 RNA_def_property_ui_text(prop, "Plane Alpha", "Opacity (alpha) of the convergence plane");
6153
6154 prop = RNA_def_property(srna, "show_stereo_3d_volume", PROP_BOOLEAN, PROP_NONE);
6155 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPVOLUME);
6156 RNA_def_property_ui_text(prop, "Volume", "Show the stereo 3D frustum volume");
6158
6159 prop = RNA_def_property(srna, "stereo_3d_volume_alpha", PROP_FLOAT, PROP_FACTOR);
6160 RNA_def_property_float_sdna(prop, nullptr, "stereo3d_volume_alpha");
6161 RNA_def_property_ui_text(prop, "Volume Alpha", "Opacity (alpha) of the cameras' frustum volume");
6163
6164 prop = RNA_def_property(srna, "mirror_xr_session", PROP_BOOLEAN, PROP_NONE);
6167 prop,
6168 "Mirror VR Session",
6169 "Synchronize the viewer perspective of virtual reality sessions with this 3D viewport");
6171 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_mirror_xr_session_update");
6172
6175 "rna_SpaceView3D_object_type_visibility_update");
6176
6177 /* Helper for drawing the icon. */
6178 prop = RNA_def_property(srna, "icon_from_show_object_viewport", PROP_INT, PROP_NONE);
6180 prop, "rna_SpaceView3D_icon_from_show_object_viewport_get", nullptr, nullptr);
6182 RNA_def_property_ui_text(prop, "Visibility Icon", "");
6183
6184 prop = RNA_def_property(srna, "show_viewer", PROP_BOOLEAN, PROP_NONE);
6185 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_VIEWER);
6186 RNA_def_property_ui_text(prop, "Show Viewer", "Display non-final geometry from viewer nodes");
6188
6189 /* Nested Structs */
6190 prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
6192 RNA_def_property_struct_type(prop, "View3DShading");
6193 RNA_def_property_ui_text(prop, "Shading Settings", "Settings for shading in the 3D viewport");
6194
6195 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
6197 RNA_def_property_struct_type(prop, "View3DOverlay");
6198 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_overlay_get", nullptr, nullptr, nullptr);
6200 prop, "Overlay Settings", "Settings for display of overlays in the 3D viewport");
6201
6204
6205 /* *** Animated *** */
6207 /* region */
6208
6209 srna = RNA_def_struct(brna, "RegionView3D", nullptr);
6210 RNA_def_struct_sdna(srna, "RegionView3D");
6211 RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
6212
6213 prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
6214 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_LOCK_ROTATION);
6216 prop, "Lock Rotation", "Lock view rotation of side views to Top/Front/Right");
6217 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
6218
6219 prop = RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
6220 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_BOXVIEW);
6221 RNA_def_property_ui_text(prop, "Sync Zoom/Pan", "Sync view position between side views");
6222 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
6223
6224 prop = RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
6225 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_BOXCLIP);
6227 prop, "Clip Contents", "Clip view contents based on what is visible in other side views");
6229 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
6230
6231 prop = RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
6232 RNA_def_property_float_sdna(prop, nullptr, "persmat");
6234 prop, PROP_EDITABLE); /* XXX: for now, it's too risky for users to do this */
6237 prop, "Perspective Matrix", "Current perspective matrix (``window_matrix * view_matrix``)");
6238
6239 prop = RNA_def_property(srna, "window_matrix", PROP_FLOAT, PROP_MATRIX);
6240 RNA_def_property_float_sdna(prop, nullptr, "winmat");
6243 RNA_def_property_ui_text(prop, "Window Matrix", "Current window matrix");
6244
6245 prop = RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
6246 RNA_def_property_float_sdna(prop, nullptr, "viewmat");
6248 RNA_def_property_float_funcs(prop, nullptr, "rna_RegionView3D_view_matrix_set", nullptr);
6249 RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix");
6251
6252 prop = RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
6253 RNA_def_property_enum_sdna(prop, nullptr, "persp");
6254 RNA_def_property_enum_items(prop, rv3d_persp_items);
6255 RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
6257
6258 prop = RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
6259 RNA_def_property_boolean_sdna(prop, nullptr, "is_persp", 1);
6260 RNA_def_property_ui_text(prop, "Is Perspective", "");
6262
6263 /* WARNING: Using "orthographic" in this name isn't correct and could be changed. */
6264 prop = RNA_def_property(srna, "is_orthographic_side_view", PROP_BOOLEAN, PROP_NONE);
6265 RNA_def_property_boolean_sdna(prop, nullptr, "view", 0);
6267 "rna_RegionView3D_is_orthographic_side_view_get",
6268 "rna_RegionView3D_is_orthographic_side_view_set");
6270 prop,
6271 "Is Axis Aligned",
6272 "Whether the current view is aligned to an axis "
6273 "(does not check whether the view is orthographic, use \"is_perspective\" for that). "
6274 "Setting this will rotate the view to the closest axis");
6275
6276 /* This isn't directly accessible from the UI, only an operator. */
6277 prop = RNA_def_property(srna, "use_clip_planes", PROP_BOOLEAN, PROP_NONE);
6278 RNA_def_property_boolean_sdna(prop, nullptr, "rflag", RV3D_CLIPPING);
6279 RNA_def_property_ui_text(prop, "Use Clip Planes", "");
6280
6281 prop = RNA_def_property(srna, "use_view_flip_x", PROP_BOOLEAN, PROP_NONE);
6282 RNA_def_property_boolean_sdna(prop, nullptr, "rflag", RV3D_FLIP_X);
6283 RNA_def_property_ui_text(prop, "Flip", "Flip view horizontally");
6285
6286 const int default_value[] = {6, 4};
6287 prop = RNA_def_property(srna, "clip_planes", PROP_FLOAT, PROP_NONE);
6288 RNA_def_property_float_sdna(prop, nullptr, "clip");
6289 RNA_def_property_multi_array(prop, 2, default_value);
6290 RNA_def_property_ui_text(prop, "Clip Planes", "");
6291
6292 prop = RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
6293# if 0
6294 RNA_def_property_float_sdna(prop, nullptr, "ofs"); /* can't use because it's negated */
6295# else
6296 RNA_def_property_array(prop, 3);
6298 prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", nullptr);
6299# endif
6300 RNA_def_property_ui_text(prop, "View Location", "View pivot location");
6301 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT);
6302 RNA_def_property_update(prop, NC_WINDOW, nullptr);
6303
6304 prop = RNA_def_property(
6305 srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); /* can't use because it's inverted */
6306# if 0
6307 RNA_def_property_float_sdna(prop, nullptr, "viewquat");
6308# else
6309 RNA_def_property_array(prop, 4);
6311 prop, "rna_RegionView3D_view_rotation_get", "rna_RegionView3D_view_rotation_set", nullptr);
6312# endif
6313 RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
6315
6316 /* not sure we need rna access to these but adding anyway */
6317 prop = RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
6318 RNA_def_property_float_sdna(prop, nullptr, "dist");
6319 RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
6321
6322 prop = RNA_def_property(srna, "view_camera_zoom", PROP_FLOAT, PROP_UNSIGNED);
6323 RNA_def_property_float_sdna(prop, nullptr, "camzoom");
6324 RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view");
6327
6328 prop = RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE);
6329 RNA_def_property_float_sdna(prop, nullptr, "camdx");
6330 RNA_def_property_array(prop, 2);
6331 RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view");
6333
6334 prop = RNA_def_property(srna, "view_camera_roll", PROP_FLOAT, PROP_ANGLE);
6335 RNA_def_property_float_sdna(prop, nullptr, "camroll");
6336 RNA_def_property_ui_text(prop, "Camera Roll", "Roll angle in camera view");
6339
6340 prop = RNA_def_property(srna, "pause_render", PROP_BOOLEAN, PROP_NONE);
6342 prop, "rna_RegionView3D_pause_render_get", "rna_RegionView3D_pause_render_set");
6344 RNA_def_property_ui_text(prop, "Pause Render", "Pause the rendered viewport");
6346 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_pause_render_update");
6347
6348 prop = RNA_def_property(srna, "support_pause_render", PROP_BOOLEAN, PROP_NONE);
6351 prop,
6352 "Support Pause Render",
6353 "The render engine currently rendering this viewport can be paused and resumed");
6354 RNA_def_property_boolean_funcs(prop, "rna_RegionView3D_support_pause_render_get", nullptr);
6355
6357}
6358
6360{
6361 /* Order must follow `buttons_context_items`. */
6362 constexpr std::array<StringRefNull, BCONTEXT_TOT> filter_items = {
6363 "show_properties_tool", "show_properties_render",
6364 "show_properties_output", "show_properties_scene",
6365 "show_properties_view_layer", "show_properties_compositor",
6366 "show_properties_world", "show_properties_collection",
6367 "show_properties_object", "show_properties_constraints",
6368 "show_properties_modifiers", "show_properties_data",
6369 "show_properties_bone", "show_properties_bone_constraints",
6370 "show_properties_material", "show_properties_texture",
6371 "show_properties_particles", "show_properties_physics",
6372 "show_properties_effects", "show_properties_strip",
6373 "show_properties_strip_modifier",
6374 };
6375
6376 for (const int i : IndexRange(BCONTEXT_TOT)) {
6378 const int value = (1 << item.value);
6379 StringRefNull prop_name = filter_items[i];
6380
6381 PropertyRNA *prop = RNA_def_property(srna, prop_name.c_str(), PROP_BOOLEAN, PROP_NONE);
6382 RNA_def_property_boolean_sdna(prop, nullptr, "visible_tabs", value);
6383 RNA_def_property_ui_text(prop, item.name, "");
6385 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update");
6386 }
6387}
6388
6390{
6391 StructRNA *srna;
6392 PropertyRNA *prop;
6393
6394 static const EnumPropertyItem tab_sync_items[] = {
6396 "ALWAYS",
6397 0,
6398 "Always",
6399 "Always change tabs when clicking an icon in an outliner"},
6401 "NEVER",
6402 0,
6403 "Never",
6404 "Never change tabs when clicking an icon in an outliner"},
6406 "AUTO",
6407 0,
6408 "Auto",
6409 "Change tabs only when this editor shares a border with an outliner"},
6410 {0, nullptr, 0, nullptr, nullptr},
6411 };
6412
6413 srna = RNA_def_struct(brna, "SpaceProperties", "Space");
6414 RNA_def_struct_sdna(srna, "SpaceProperties");
6415 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
6416
6417 prop = RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
6418 RNA_def_property_enum_sdna(prop, nullptr, "mainb");
6421 prop, nullptr, "rna_SpaceProperties_context_set", "rna_SpaceProperties_context_itemf");
6422 RNA_def_property_ui_text(prop, "", "");
6425 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update");
6426
6428
6429 /* pinned data */
6430 prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
6431 RNA_def_property_pointer_sdna(prop, nullptr, "pinid");
6432 RNA_def_property_struct_type(prop, "ID");
6434 prop, nullptr, nullptr, "rna_SpaceProperties_pin_id_typef", nullptr);
6438 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
6439
6440 prop = RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
6441 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SB_PIN_CONTEXT);
6442 RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
6443
6444 /* Property search. */
6445
6446 prop = RNA_def_property(srna, "tab_search_results", PROP_BOOLEAN, PROP_NONE);
6447 RNA_def_property_array(prop, 0); /* Dynamic length, see next line. */
6450 RNA_def_property_boolean_funcs(prop, "rna_SpaceProperties_tab_search_results_get", nullptr);
6451 RNA_def_property_dynamic_array_funcs(prop, "rna_SpaceProperties_tab_search_results_getlength");
6453 prop, "Tab Search Results", "Whether or not each visible tab has a search result");
6454
6455 prop = RNA_def_property(srna, "search_filter", PROP_STRING, PROP_NONE);
6456 /* The search filter is stored in the property editor's runtime which
6457 * is only defined in an internal header, so use the getter / setter here. */
6459 "rna_SpaceProperties_search_filter_get",
6460 "rna_SpaceProperties_search_filter_length",
6461 "rna_SpaceProperties_search_filter_set");
6462 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
6465 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_search_filter_update");
6466
6467 /* Outliner sync. */
6468 prop = RNA_def_property(srna, "outliner_sync", PROP_ENUM, PROP_NONE);
6469 RNA_def_property_enum_sdna(prop, nullptr, "outliner_sync");
6470 RNA_def_property_enum_items(prop, tab_sync_items);
6472 "Outliner Sync",
6473 "Change to the corresponding tab when outliner data icons are clicked");
6475}
6476
6478{
6479 StructRNA *srna;
6480 PropertyRNA *prop;
6481
6482 srna = RNA_def_struct(brna, "SpaceImageOverlay", nullptr);
6483 RNA_def_struct_sdna(srna, "SpaceImage");
6484 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
6485 RNA_def_struct_path_func(srna, "rna_SpaceImageOverlay_path");
6487 srna, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
6488
6489 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
6490 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_SHOW_OVERLAYS);
6491 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like UV Maps and Metadata");
6493
6494 prop = RNA_def_property(srna, "show_grid_background", PROP_BOOLEAN, PROP_NONE);
6495 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_SHOW_GRID_BACKGROUND);
6496 RNA_def_property_ui_text(prop, "Display Background", "Show the grid background and borders");
6498
6499 prop = RNA_def_property(srna, "show_render_size", PROP_BOOLEAN, PROP_NONE);
6500 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_DRAW_RENDER_REGION);
6501 RNA_def_property_ui_text(prop, "Render Region", "Display the region of the final render");
6503
6504 prop = RNA_def_property(srna, "show_text_info", PROP_BOOLEAN, PROP_NONE);
6505 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_DRAW_TEXT_INFO);
6506 RNA_def_property_ui_text(prop, "Text Info", "Display overlay text");
6508
6509 prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
6510 RNA_def_property_float_sdna(prop, nullptr, "overlay.passepartout_alpha");
6513 prop, "Passepartout Alpha", "Opacity of the darkened overlay outside the render region");
6515}
6516
6518{
6519 StructRNA *srna;
6520 PropertyRNA *prop;
6521
6522 srna = RNA_def_struct(brna, "SpaceImageEditor", "Space");
6523 RNA_def_struct_sdna(srna, "SpaceImage");
6524 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
6525
6527 ((1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_TOOLS) |
6528 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) |
6529 (1 << RGN_TYPE_ASSET_SHELF)));
6530
6531 /* image */
6532 prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
6534 prop, nullptr, "rna_SpaceImageEditor_image_set", nullptr, nullptr);
6535 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
6539 prop,
6540 NC_GEOM | ND_DATA,
6541 "rna_SpaceImageEditor_image_update"); /* is handled in image editor too */
6542
6543 prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
6545 RNA_def_property_pointer_sdna(prop, nullptr, "iuser");
6547 prop,
6548 "Image User",
6549 "Parameters defining which layer, pass and frame of the image is displayed");
6551
6552 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
6553 RNA_def_property_pointer_sdna(prop, nullptr, "scopes");
6554 RNA_def_property_struct_type(prop, "Scopes");
6555 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics");
6557 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
6558
6559 prop = RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
6560 RNA_def_property_boolean_sdna(prop, nullptr, "pin", 0);
6562 prop, "Image Pin", "Display current image regardless of object selection");
6563 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
6565
6566 prop = RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
6567 RNA_def_property_pointer_sdna(prop, nullptr, "sample_line_hist");
6568 RNA_def_property_struct_type(prop, "Histogram");
6569 RNA_def_property_ui_text(prop, "Line Sample", "Sampled colors along line");
6570
6571 prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
6572 RNA_def_property_array(prop, 2);
6574 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", nullptr, nullptr);
6575 RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
6576
6577 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
6579 "rna_SpaceImageEditor_zoom_percentage_get",
6580 "rna_SpaceImageEditor_zoom_percentage_set",
6581 nullptr);
6582 RNA_def_property_float_default(prop, 100.0);
6583 RNA_def_property_range(prop, .4, 80000);
6584 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
6585 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
6586
6587 /* image draw */
6588 prop = RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
6589 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_TILE);
6591 prop, "Display Repeated", "Display the image repeated outside of the main view");
6593
6594 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
6595 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_SHOW_GPENCIL);
6596 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
6598
6599 prop = RNA_def_property(srna, "display_channels", PROP_ENUM, PROP_NONE);
6600 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
6603 "rna_SpaceImageEditor_display_channels_get",
6604 nullptr,
6605 "rna_SpaceImageEditor_display_channels_itemf");
6606 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to display");
6608
6609 prop = RNA_def_property(srna, "show_stereo_3d", PROP_BOOLEAN, PROP_NONE);
6611 prop, "rna_SpaceImageEditor_show_stereo_get", "rna_SpaceImageEditor_show_stereo_set");
6612 RNA_def_property_ui_text(prop, "Show Stereo", "Display the image in Stereo 3D");
6613 RNA_def_property_ui_icon(prop, ICON_CAMERA_STEREO, 0);
6615 prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_show_stereo_update");
6616
6617 prop = RNA_def_property(srna, "show_sequencer_scene", PROP_BOOLEAN, PROP_NONE);
6619 "rna_SpaceImageEditor_show_sequencer_scene_get",
6620 "rna_SpaceImageEditor_show_sequencer_scene_set");
6622 prop,
6623 "Show Sequencer Scene",
6624 "Display the render result for the sequencer scene instead of the active scene");
6625 RNA_def_property_ui_icon(prop, ICON_SEQ_SEQUENCER, 0);
6627
6628 /* uv */
6629 prop = RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
6631 RNA_def_property_struct_type(prop, "SpaceUVEditor");
6633 prop, "rna_SpaceImageEditor_uvedit_get", nullptr, nullptr, nullptr);
6634 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
6635
6636 /* mode (hidden in the UI, see 'ui_mode') */
6637 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6638 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6640 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6641 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
6642
6643 prop = RNA_def_property(srna, "ui_mode", PROP_ENUM, PROP_NONE);
6644 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6646 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6647 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
6648
6649 /* transform */
6650 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
6651 RNA_def_property_array(prop, 2);
6653 "rna_SpaceImageEditor_cursor_location_get",
6654 "rna_SpaceImageEditor_cursor_location_set",
6655 nullptr);
6656 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
6658
6659 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
6660 RNA_def_property_enum_sdna(prop, nullptr, "around");
6662 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceImageEditor_pivot_itemf");
6663 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
6665
6666 /* Annotations */
6667 prop = RNA_def_property(srna, "annotation", PROP_POINTER, PROP_NONE);
6668 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
6669 RNA_def_property_struct_type(prop, "Annotation");
6671 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
6673 RNA_def_property_ui_text(prop, "Annotation", "Annotation data for this space");
6675
6676 /* update */
6677 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
6678 RNA_def_property_boolean_sdna(prop, nullptr, "lock", 0);
6680 "Update Automatically",
6681 "Update other affected window spaces automatically to reflect changes "
6682 "during interactive operations such as transform");
6683
6684 /* state */
6685 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
6686 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", nullptr);
6688 RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
6689
6690 prop = RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
6691 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", nullptr);
6693 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
6694
6695 prop = RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
6696 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", nullptr);
6698 RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
6699
6700 prop = RNA_def_property(srna, "show_maskedit", PROP_BOOLEAN, PROP_NONE);
6701 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_maskedit_get", nullptr);
6703 RNA_def_property_ui_text(prop, "Show Mask Editor", "Show Mask editing related properties");
6704
6705 /* Gizmo Toggles. */
6706 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
6707 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SI_GIZMO_HIDE);
6708 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
6710
6711 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
6713 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
6715
6716 prop = RNA_def_property(srna, "show_gizmo_active_node", PROP_BOOLEAN, PROP_NONE);
6718 RNA_def_property_ui_text(prop, "Active Node", "Context sensitive gizmo for the active node");
6720
6721 /* Overlays */
6722 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
6724 RNA_def_property_struct_type(prop, "SpaceImageOverlay");
6725 RNA_def_property_pointer_funcs(prop, "rna_SpaceImage_overlay_get", nullptr, nullptr, nullptr);
6727 prop, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
6728
6731
6732 /* mask */
6733 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mask_set");
6734}
6735
6737{
6738 StructRNA *srna;
6739 PropertyRNA *prop;
6740
6741 srna = RNA_def_struct(brna, "SequencerPreviewOverlay", nullptr);
6742 RNA_def_struct_sdna(srna, "SpaceSeq");
6743 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6744 RNA_def_struct_path_func(srna, "rna_SpaceSequencerPreviewOverlay_path");
6745 RNA_def_struct_ui_text(srna, "Preview Overlay Settings", "");
6746
6747 prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE);
6749 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_SAFE_MARGINS);
6751 prop, "Safe Areas", "Show TV title safe and action safe areas in preview");
6753
6754 prop = RNA_def_property(srna, "show_safe_center", PROP_BOOLEAN, PROP_NONE);
6756 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_SAFE_CENTER);
6758 prop, "Center-Cut Safe Areas", "Show safe areas to fit content in a different aspect ratio");
6760
6761 /* Composition Guides */
6762 prop = RNA_def_property(srna, "show_composition_center", PROP_BOOLEAN, PROP_NONE);
6764 prop, nullptr, "preview_overlay.composition_guide_flags", COMPOSITION_GUIDES_CENTER);
6765 RNA_def_property_ui_text(prop, "Center", "Display center composition guide");
6767
6768 prop = RNA_def_property(srna, "show_composition_center_diagonal", PROP_BOOLEAN, PROP_NONE);
6770 prop, nullptr, "preview_overlay.composition_guide_flags", COMPOSITION_GUIDES_CENTER_DIAG);
6771 RNA_def_property_ui_text(prop, "Center Diagonal", "Display diagonal center composition guide");
6773
6774 prop = RNA_def_property(srna, "show_composition_thirds", PROP_BOOLEAN, PROP_NONE);
6776 prop, nullptr, "preview_overlay.composition_guide_flags", COMPOSITION_GUIDES_THIRDS);
6777 RNA_def_property_ui_text(prop, "Thirds", "Display rule of thirds composition guide");
6779
6780 prop = RNA_def_property(srna, "show_composition_golden", PROP_BOOLEAN, PROP_NONE);
6782 prop, nullptr, "preview_overlay.composition_guide_flags", COMPOSITION_GUIDES_GOLDEN);
6783 RNA_def_property_ui_text(prop, "Golden Ratio", "Display golden ratio composition guide");
6785
6786 prop = RNA_def_property(srna, "show_composition_golden_tria_a", PROP_BOOLEAN, PROP_NONE);
6788 prop, nullptr, "preview_overlay.composition_guide_flags", COMPOSITION_GUIDES_GOLDEN_TRI_A);
6790 prop, "Golden Triangle A", "Display golden triangle A composition guide");
6792
6793 prop = RNA_def_property(srna, "show_composition_golden_tria_b", PROP_BOOLEAN, PROP_NONE);
6795 prop, nullptr, "preview_overlay.composition_guide_flags", COMPOSITION_GUIDES_GOLDEN_TRI_B);
6797 prop, "Golden Triangle B", "Display golden triangle B composition guide");
6799
6800 prop = RNA_def_property(srna, "show_composition_harmony_tri_a", PROP_BOOLEAN, PROP_NONE);
6802 prop, nullptr, "preview_overlay.composition_guide_flags", COMPOSITION_GUIDES_HARMONY_TRI_A);
6803 RNA_def_property_ui_text(prop, "Harmonious Triangle A", "Display harmony A composition guide");
6805
6806 prop = RNA_def_property(srna, "show_composition_harmony_tri_b", PROP_BOOLEAN, PROP_NONE);
6808 prop, nullptr, "preview_overlay.composition_guide_flags", COMPOSITION_GUIDES_HARMONY_TRI_B);
6809 RNA_def_property_ui_text(prop, "Harmonious Triangle B", "Display harmony B composition guide");
6811
6812 prop = RNA_def_property(srna, "composition_guide_color", PROP_FLOAT, PROP_COLOR);
6813 RNA_def_property_float_sdna(prop, nullptr, "preview_overlay.composition_guide_color");
6815 prop, "Composition Guide Color", "Color and alpha for compositional guide overlays");
6817
6818 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
6819 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_METADATA);
6820 RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of first visible strip");
6822
6823 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
6824 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_GPENCIL);
6825 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
6827
6828 prop = RNA_def_property(srna, "show_image_outline", PROP_BOOLEAN, PROP_NONE);
6830 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_OUTLINE_SELECTED);
6831 RNA_def_property_ui_text(prop, "Image Outline", "");
6833
6834 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
6835 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_2D_CURSOR);
6836 RNA_def_property_ui_text(prop, "2D Cursor", "");
6838
6839 prop = RNA_def_property(srna, "show_composition_guides", PROP_BOOLEAN, PROP_NONE);
6841 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_COMPOSITION_GUIDES);
6843 prop, "Composition Guides", "Display composition guides over the preview");
6845}
6846
6848{
6849 StructRNA *srna;
6850 PropertyRNA *prop;
6851
6852 srna = RNA_def_struct(brna, "SequencerTimelineOverlay", nullptr);
6853 RNA_def_struct_sdna(srna, "SpaceSeq");
6854 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6855 RNA_def_struct_path_func(srna, "rna_SpaceSequencerTimelineOverlay_path");
6856 RNA_def_struct_ui_text(srna, "Timeline Overlay Settings", "");
6857
6858 static const EnumPropertyItem waveform_type_display_items[] = {
6860 "ALL_WAVEFORMS",
6861 0,
6862 "On",
6863 "Display waveforms for all sound strips"},
6864 {0, "DEFAULT_WAVEFORMS", 0, "Strip", "Display waveforms depending on strip setting"},
6866 "NO_WAVEFORMS",
6867 0,
6868 "Off",
6869 "Don't display waveforms for any sound strips"},
6870 {0, nullptr, 0, nullptr, nullptr},
6871 };
6872
6873 prop = RNA_def_property(srna, "waveform_display_type", PROP_ENUM, PROP_NONE);
6874 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "timeline_overlay.flag");
6875 RNA_def_property_enum_items(prop, waveform_type_display_items);
6876 RNA_def_property_ui_text(prop, "Waveform Display", "How Waveforms are displayed");
6878
6879 static const EnumPropertyItem waveform_style_display_items[] = {
6880 {0, "FULL_WAVEFORMS", 0, "Full", "Display full waveform"},
6882 "HALF_WAVEFORMS",
6883 0,
6884 "Half",
6885 "Display upper half of the absolute value waveform"},
6886 {0, nullptr, 0, nullptr, nullptr},
6887 };
6888
6889 prop = RNA_def_property(srna, "waveform_display_style", PROP_ENUM, PROP_NONE);
6890 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "timeline_overlay.flag");
6891 RNA_def_property_enum_items(prop, waveform_style_display_items);
6892 RNA_def_property_ui_text(prop, "Waveform Style", "How Waveforms are displayed");
6894
6895 static const EnumPropertyItem thumbnail_style_items[] = {
6897 "MIDDLE",
6898 0,
6899 "Middle",
6900 "Show single thumbnail in the middle of each strip"},
6902 "STRIP_ENDS",
6903 0,
6904 "Strip Ends",
6905 "Show thumbnails only at the beginning and end of the strip"},
6907 "CONTINUOUS",
6908 0,
6909 "Continuous",
6910 "Display thumbnails as a filmstrip"},
6911 {0, nullptr, 0, nullptr, nullptr}};
6912
6913 prop = RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
6915 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_THUMBNAILS);
6916 RNA_def_property_ui_text(prop, "Show Thumbnails", "Display strip thumbnails");
6919
6920 prop = RNA_def_property(srna, "thumbnail_display_style", PROP_ENUM, PROP_NONE);
6921 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "timeline_overlay.flag");
6922 RNA_def_property_enum_items(prop, thumbnail_style_items);
6923 RNA_def_property_ui_text(prop, "Thumbnail style", "How thumbnails are displayed");
6925
6926 prop = RNA_def_property(srna, "show_fcurves", PROP_BOOLEAN, PROP_NONE);
6927 RNA_def_property_boolean_sdna(prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_FCURVES);
6928 RNA_def_property_ui_text(prop, "Show F-Curves", "Display strip opacity/volume curve");
6930
6931 prop = RNA_def_property(srna, "show_strip_name", PROP_BOOLEAN, PROP_NONE);
6933 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_NAME);
6934 RNA_def_property_ui_text(prop, "Show Name", "");
6936
6937 prop = RNA_def_property(srna, "show_strip_source", PROP_BOOLEAN, PROP_NONE);
6939 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_SOURCE);
6941 prop, "Show Source", "Display path to source file, or name of source data-block");
6943
6944 prop = RNA_def_property(srna, "show_strip_duration", PROP_BOOLEAN, PROP_NONE);
6946 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_DURATION);
6947 RNA_def_property_ui_text(prop, "Show Duration", "");
6949
6950 prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
6951 RNA_def_property_boolean_sdna(prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_GRID);
6952 RNA_def_property_ui_text(prop, "Show Grid", "Show vertical grid lines");
6954
6955 prop = RNA_def_property(srna, "show_strip_offset", PROP_BOOLEAN, PROP_NONE);
6957 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_OFFSETS);
6958 RNA_def_property_ui_text(prop, "Show Offsets", "Display strip in/out offsets");
6960
6961 prop = RNA_def_property(srna, "show_strip_tag_color", PROP_BOOLEAN, PROP_NONE);
6963 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG);
6965 prop, "Show Color Tags", "Display the strip color tags in the sequencer");
6967
6968 prop = RNA_def_property(srna, "show_strip_retiming", PROP_BOOLEAN, PROP_NONE);
6970 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_RETIMING);
6971 RNA_def_property_ui_text(prop, "Show Retiming Keys", "Display retiming keys on top of strips");
6973}
6974
6976{
6977 StructRNA *srna;
6978 PropertyRNA *prop;
6979
6980 srna = RNA_def_struct(brna, "SequencerCacheOverlay", nullptr);
6981 RNA_def_struct_sdna(srna, "SpaceSeq");
6982 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6983 RNA_def_struct_path_func(srna, "rna_SpaceSequencerCacheOverlay_path");
6984 RNA_def_struct_ui_text(srna, "Cache Overlay Settings", "");
6985
6986 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
6987 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW);
6988 RNA_def_property_ui_text(prop, "Show Cache", "Visualize cached images on the timeline");
6990
6991 prop = RNA_def_property(srna, "show_cache_final_out", PROP_BOOLEAN, PROP_NONE);
6992 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_FINAL_OUT);
6993 RNA_def_property_ui_text(prop, "Final Images", "Visualize cached complete frames");
6995
6996 prop = RNA_def_property(srna, "show_cache_raw", PROP_BOOLEAN, PROP_NONE);
6997 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_RAW);
6998 RNA_def_property_ui_text(prop, "Raw Images", "Visualize cached raw images");
7000}
7001
7003{
7004 StructRNA *srna;
7005 PropertyRNA *prop;
7006
7007 static const EnumPropertyItem display_mode_items[] = {
7008 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
7009 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
7010 {SEQ_DRAW_IMG_RGBPARADE, "RGB_PARADE", ICON_RENDERLAYERS, "RGB Parade", ""},
7011 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
7012 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
7013 {0, nullptr, 0, nullptr, nullptr},
7014 };
7015
7016 static const EnumPropertyItem proxy_render_size_items[] = {
7017 {SEQ_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
7018 {SEQ_RENDER_SIZE_SCENE, "SCENE", 0, "Scene size", ""},
7019 {SEQ_RENDER_SIZE_PROXY_25, "PROXY_25", 0, "25%", ""},
7020 {SEQ_RENDER_SIZE_PROXY_50, "PROXY_50", 0, "50%", ""},
7021 {SEQ_RENDER_SIZE_PROXY_75, "PROXY_75", 0, "75%", ""},
7022 {SEQ_RENDER_SIZE_PROXY_100, "PROXY_100", 0, "100%", ""},
7023 {0, nullptr, 0, nullptr, nullptr},
7024 };
7025
7026 static const EnumPropertyItem overlay_frame_type_items[] = {
7027 {SEQ_OVERLAY_FRAME_TYPE_RECT, "RECTANGLE", 0, "Rectangle", "Show rectangle area overlay"},
7028 {SEQ_OVERLAY_FRAME_TYPE_REFERENCE, "REFERENCE", 0, "Reference", "Show reference frame only"},
7029 {SEQ_OVERLAY_FRAME_TYPE_CURRENT, "CURRENT", 0, "Current", "Show current frame only"},
7030 {0, nullptr, 0, nullptr, nullptr},
7031 };
7032
7033 static const EnumPropertyItem preview_channels_items[] = {
7035 "COLOR_ALPHA",
7036 ICON_IMAGE_RGB_ALPHA,
7037 "Color & Alpha",
7038 "Display image with RGB colors and alpha transparency"},
7039 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
7040 {0, nullptr, 0, nullptr, nullptr},
7041 };
7042
7043 srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
7044 RNA_def_struct_sdna(srna, "SpaceSeq");
7045 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
7046
7048 (1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_FOOTER) |
7049 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_TOOLS) |
7050 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
7051
7052 /* view type, fairly important */
7053 prop = RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
7054 RNA_def_property_enum_sdna(prop, nullptr, "view");
7057 prop, "View Type", "Type of the Sequencer view (sequencer, preview or both)");
7058 RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
7059
7060 /* display type, fairly important */
7061 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
7062 RNA_def_property_enum_sdna(prop, nullptr, "mainb");
7063 RNA_def_property_enum_items(prop, display_mode_items);
7065 prop, "Display Mode", "View mode to use for displaying sequencer output");
7067
7068 /* flags */
7069 prop = RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
7070 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_DRAWFRAMES);
7071 RNA_def_property_ui_text(prop, "Display Frames", "Display frames rather than seconds");
7073
7074 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
7075 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_MARKER_TRANS);
7076 RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips");
7078
7079 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
7081 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
7083
7084 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
7085 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_SHOW_MARKERS);
7087 prop,
7088 "Show Markers",
7089 "If any exists, show markers in a separate row at the bottom of the editor");
7091
7092 prop = RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
7093 RNA_def_property_int_sdna(prop, nullptr, "chanshown");
7095 prop,
7096 "Display Channel",
7097 "Preview all channels less than or equal to this value. 0 shows every channel, and negative "
7098 "values climb that many meta-strip levels if applicable, showing every channel there.");
7101 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
7102
7103 prop = RNA_def_property(srna, "preview_channels", PROP_ENUM, PROP_NONE);
7104 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
7105 RNA_def_property_enum_items(prop, preview_channels_items);
7106 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the preview to display");
7108 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
7109
7110 prop = RNA_def_property(srna, "use_zoom_to_fit", PROP_BOOLEAN, PROP_NONE);
7111 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_ZOOM_TO_FIT);
7113 prop, "Zoom to Fit", "Automatically zoom preview image to make it fully fit the region");
7115
7116 prop = RNA_def_property(srna, "show_overexposed", PROP_INT, PROP_NONE);
7117 RNA_def_property_int_sdna(prop, nullptr, "zebra");
7118 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
7119 RNA_def_property_range(prop, 0, 110);
7121
7122 prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
7123 RNA_def_property_enum_sdna(prop, nullptr, "render_size");
7124 RNA_def_property_enum_items(prop, proxy_render_size_items);
7126 "Proxy Render Size",
7127 "Display preview using full resolution or different proxy resolutions");
7130 prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_render_size_update");
7131
7132 prop = RNA_def_property(srna, "use_proxies", PROP_BOOLEAN, PROP_NONE);
7133 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_USE_PROXIES);
7135 prop, "Use Proxies", "Use optimized files for faster scrubbing when available");
7137 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
7138
7139 prop = RNA_def_property(srna, "use_clamp_view", PROP_BOOLEAN, PROP_NONE);
7140 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_CLAMP_VIEW);
7142 prop, "rna_SequenceEditor_clamp_view_get", "rna_SequenceEditor_clamp_view_set");
7144 prop, "Limit View to Contents", "Limit timeline height to maximum used channel slot");
7146
7147 prop = RNA_def_property(srna, "show_scrubbing_region", PROP_BOOLEAN, PROP_NONE);
7150 "Show Scrubbing Region",
7151 "Region with full playback range for scrubbing in the sequencer");
7153
7154 /* Annotations */
7155 prop = RNA_def_property(srna, "annotation", PROP_POINTER, PROP_NONE);
7156 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
7157 RNA_def_property_struct_type(prop, "Annotation");
7159 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
7161 RNA_def_property_ui_text(prop, "Annotation", "Annotation data for this Preview region");
7163
7164 prop = RNA_def_property(srna, "overlay_frame_type", PROP_ENUM, PROP_NONE);
7165 RNA_def_property_enum_sdna(prop, nullptr, "overlay_frame_type");
7166 RNA_def_property_enum_items(prop, overlay_frame_type_items);
7167 RNA_def_property_ui_text(prop, "Overlay Type", "Overlay display method");
7169
7170 prop = RNA_def_property(srna, "show_transform_preview", PROP_BOOLEAN, PROP_NONE);
7173 prop,
7174 "Preview Edit Point",
7175 "While editing in the timeline, show the affected frame instead of "
7176 "the current frame, such as in the blade tool, or when tweaking handles");
7178
7179 /* Gizmo toggles. */
7180 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
7181 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SEQ_GIZMO_HIDE);
7182 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
7184
7185 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
7187 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
7189
7190 prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE);
7192 RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item");
7194
7195 prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE);
7196 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SEQ_GIZMO_HIDE_TOOL);
7197 RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo");
7199
7200 /* Overlay settings. */
7201 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
7202 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_SHOW_OVERLAY);
7203 RNA_def_property_ui_text(prop, "Show Overlays", "");
7205
7206 prop = RNA_def_property(srna, "preview_overlay", PROP_POINTER, PROP_NONE);
7208 RNA_def_property_struct_type(prop, "SequencerPreviewOverlay");
7210 prop, "rna_SpaceSequenceEditor_preview_overlay_get", nullptr, nullptr, nullptr);
7211 RNA_def_property_ui_text(prop, "Preview Overlay Settings", "Settings for display of overlays");
7212
7213 prop = RNA_def_property(srna, "timeline_overlay", PROP_POINTER, PROP_NONE);
7215 RNA_def_property_struct_type(prop, "SequencerTimelineOverlay");
7217 prop, "rna_SpaceSequenceEditor_timeline_overlay_get", nullptr, nullptr, nullptr);
7218 RNA_def_property_ui_text(prop, "Timeline Overlay Settings", "Settings for display of overlays");
7219
7220 prop = RNA_def_property(srna, "cache_overlay", PROP_POINTER, PROP_NONE);
7222 RNA_def_property_struct_type(prop, "SequencerCacheOverlay");
7224 prop, "rna_SpaceSequenceEditor_cache_overlay_get", nullptr, nullptr, nullptr);
7225 RNA_def_property_ui_text(prop, "Cache Overlay Settings", "Settings for display of overlays");
7229
7230 /* transform */
7231 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
7232 RNA_def_property_float_sdna(prop, nullptr, "cursor");
7233 RNA_def_property_array(prop, 2);
7234 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
7236
7237 /* Zoom. */
7238 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
7240 "rna_SpaceSequenceEditor_zoom_percentage_get",
7241 "rna_SpaceSequenceEditor_zoom_percentage_set",
7242 nullptr);
7243 RNA_def_property_float_default(prop, 100.0);
7244 RNA_def_property_range(prop, .4, 80000);
7245 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
7246 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
7247}
7248
7250{
7251 StructRNA *srna;
7252 PropertyRNA *prop;
7253 FunctionRNA *func;
7254
7255 srna = RNA_def_struct(brna, "SpaceTextEditor", "Space");
7256 RNA_def_struct_sdna(srna, "SpaceText");
7257 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
7258
7260
7261 /* text */
7262 prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
7264 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
7265 RNA_def_property_pointer_funcs(prop, nullptr, "rna_SpaceTextEditor_text_set", nullptr, nullptr);
7267
7268 /* display */
7269 prop = RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
7270 RNA_def_property_boolean_sdna(prop, nullptr, "wordwrap", 0);
7271 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SpaceTextEditor_word_wrap_set");
7273 prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
7274 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_ON, 0);
7276
7277 prop = RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
7278 RNA_def_property_boolean_sdna(prop, nullptr, "showlinenrs", 0);
7279 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
7280 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_ON, 0);
7282
7283 func = RNA_def_function(srna,
7284 "is_syntax_highlight_supported",
7285 "rna_SpaceTextEditor_text_is_syntax_highlight_supported");
7287 RNA_def_boolean(func, "is_syntax_highlight_supported", false, "", ""));
7289 "Returns True if the editor supports syntax highlighting "
7290 "for the current text data-block");
7291
7292 prop = RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
7293 RNA_def_property_boolean_sdna(prop, nullptr, "showsyntax", 0);
7294 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
7295 RNA_def_property_ui_icon(prop, ICON_SYNTAX_ON, 0);
7297
7298 prop = RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
7299 RNA_def_property_boolean_sdna(prop, nullptr, "line_hlight", 0);
7300 RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
7302
7303 prop = RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
7304 RNA_def_property_int_sdna(prop, nullptr, "tabnumber");
7305 RNA_def_property_range(prop, 2, 8);
7306 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
7307 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
7308
7309 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
7310 RNA_def_property_int_sdna(prop, nullptr, "line_height");
7311 RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */
7312 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
7314
7315 prop = RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
7316 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_SHOW_MARGIN);
7317 RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
7319
7320 prop = RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
7321 RNA_def_property_int_sdna(prop, nullptr, "margin_column");
7322 RNA_def_property_range(prop, 0, 1024);
7323 RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
7325
7326 prop = RNA_def_property(srna, "top", PROP_INT, PROP_NONE);
7327 RNA_def_property_int_sdna(prop, nullptr, "top");
7329 RNA_def_property_ui_text(prop, "Top Line", "Top line visible");
7331
7332 prop = RNA_def_property(srna, "visible_lines", PROP_INT, PROP_NONE);
7334 RNA_def_property_int_funcs(prop, "rna_SpaceTextEditor_visible_lines_get", nullptr, nullptr);
7336 prop, "Visible Lines", "Amount of lines that can be visible in current editor");
7337
7338 /* functionality options */
7339 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
7340 RNA_def_property_boolean_sdna(prop, nullptr, "overwrite", 1);
7342 prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
7344
7345 prop = RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
7346 RNA_def_property_boolean_sdna(prop, nullptr, "live_edit", 1);
7347 RNA_def_property_ui_text(prop, "Live Edit", "Run Python while editing");
7349
7350 /* find */
7351 prop = RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
7352 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_FIND_ALL);
7354 prop, "Find All", "Search in all text data-blocks, instead of only the active one");
7356
7357 prop = RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
7358 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_FIND_WRAP);
7360 prop, "Find Wrap", "Search again from the start of the file when reaching the end");
7362
7363 prop = RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
7364 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_MATCH_CASE);
7366 prop, "Match Case", "Search string is sensitive to uppercase and lowercase letters");
7368
7369 prop = RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
7370 RNA_def_property_string_sdna(prop, nullptr, "findstr");
7371 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
7373
7374 prop = RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
7375 RNA_def_property_string_sdna(prop, nullptr, "replacestr");
7377 prop, "Replace Text", "Text to replace selected text with using the replace tool");
7379
7380 RNA_api_space_text(srna);
7381}
7382
7384{
7385 StructRNA *srna;
7386 PropertyRNA *prop;
7387
7388 srna = RNA_def_struct(brna, "SpaceDopeSheetOverlay", nullptr);
7389 RNA_def_struct_sdna(srna, "SpaceAction");
7390 RNA_def_struct_nested(brna, srna, "SpaceDopeSheetEditor");
7391 RNA_def_struct_path_func(srna, "rna_SpaceDopeSheetOverlay_path");
7392 RNA_def_struct_ui_text(srna, "Overlay Settings", "");
7393
7394 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
7395 RNA_def_property_boolean_sdna(prop, nullptr, "overlays.flag", ADS_OVERLAY_SHOW_OVERLAYS);
7397 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays");
7399
7400 prop = RNA_def_property(srna, "show_scene_strip_range", PROP_BOOLEAN, PROP_NONE);
7401 RNA_def_property_boolean_sdna(prop, nullptr, "overlays.flag", ADS_SHOW_SCENE_STRIP_FRAME_RANGE);
7403 "Show Scene Strip Range",
7404 "When using scene time synchronization in the sequence editor, display "
7405 "the range of the current scene strip");
7407}
7408
7410{
7411 StructRNA *srna;
7412 PropertyRNA *prop;
7413
7414 srna = RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
7415 RNA_def_struct_sdna(srna, "SpaceAction");
7416 RNA_def_struct_ui_text(srna, "Space Dope Sheet Editor", "Dope Sheet space data");
7417
7419 (1 << RGN_TYPE_FOOTER) | (1 << RGN_TYPE_UI) |
7420 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
7421
7422 /* mode (hidden in the UI, see 'ui_mode') */
7423 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
7424 RNA_def_property_enum_sdna(prop, nullptr, "mode");
7426 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
7429 prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
7430
7431 prop = RNA_def_property(srna, "ui_mode", PROP_ENUM, PROP_NONE);
7432 RNA_def_property_enum_sdna(prop, nullptr, "mode");
7434 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
7437 prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
7438
7439 /* display */
7440 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
7441 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SACTION_DRAWTIME);
7442 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
7444
7445 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
7446 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SACTION_SLIDERS);
7447 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
7449
7450 prop = RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
7453 "Show Pose Markers",
7454 "Show markers belonging to the active action instead of Scene markers "
7455 "(Action and Shape Key Editors only)");
7457
7458 prop = RNA_def_property(srna, "show_interpolation", PROP_BOOLEAN, PROP_NONE);
7461 "Show Handles and Interpolation",
7462 "Display keyframe handle types and non-Bézier interpolation modes");
7464
7465 prop = RNA_def_property(srna, "show_extremes", PROP_BOOLEAN, PROP_NONE);
7468 "Show Curve Extremes",
7469 "Mark keyframes where the key value flow changes direction, based on "
7470 "comparison with adjacent keys");
7472
7473 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
7476 prop,
7477 "Show Markers",
7478 "If any exists, show markers in a separate row at the bottom of the editor");
7480
7481 /* editing */
7482 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
7484 RNA_def_property_ui_text(prop, "Auto-Merge Keyframes", "Automatically merge nearby keyframes");
7486
7487 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
7490 prop,
7491 "Realtime Updates",
7492 "When transforming keyframes, changes to the animation data are flushed to other views");
7494
7495 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
7497 RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
7498
7499 /* dopesheet */
7500 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
7501 RNA_def_property_struct_type(prop, "DopeSheet");
7502 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
7503 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
7504
7505 /* displaying cache status */
7506 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
7507 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_DISPLAY);
7508 RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");
7510
7511 prop = RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
7512 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SOFTBODY);
7513 RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
7515
7516 prop = RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
7517 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_PARTICLES);
7518 RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");
7520
7521 prop = RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
7522 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_CLOTH);
7523 RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");
7525
7526 prop = RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
7527 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SMOKE);
7528 RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");
7530
7531 prop = RNA_def_property(srna, "cache_compositor", PROP_BOOLEAN, PROP_NONE);
7532 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_COMPOSITOR);
7533 RNA_def_property_ui_text(prop, "Compositor", "Show the interactive compositor playback cache");
7535
7536 prop = RNA_def_property(srna, "cache_simulation_nodes", PROP_BOOLEAN, PROP_NONE);
7537 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SIMULATION_NODES);
7539 prop, "Simulation Nodes", "Show the active object's simulation nodes cache and bake data");
7541
7542 prop = RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE);
7543 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_DYNAMICPAINT);
7544 RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");
7546
7547 prop = RNA_def_property(srna, "cache_rigidbody", PROP_BOOLEAN, PROP_NONE);
7548 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_RIGIDBODY);
7549 RNA_def_property_ui_text(prop, "Rigid Body", "Show the active object's Rigid Body cache");
7551
7552 prop = RNA_def_property(srna, "overlays", PROP_POINTER, PROP_NONE);
7554 RNA_def_property_struct_type(prop, "SpaceDopeSheetOverlay");
7556 prop, "rna_SpaceDopeSheet_overlay_get", nullptr, nullptr, nullptr);
7557 RNA_def_property_ui_text(prop, "Overlay Settings", "Settings for display of overlays");
7558
7560}
7561
7563{
7564 StructRNA *srna;
7565 PropertyRNA *prop;
7566
7567 /* this is basically the same as the one for the 3D-View, but with some entries omitted */
7568 static const EnumPropertyItem gpivot_items[] = {
7570 "BOUNDING_BOX_CENTER",
7571 ICON_PIVOT_BOUNDBOX,
7572 "Bounding Box Center",
7573 ""},
7574 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
7576 "INDIVIDUAL_ORIGINS",
7577 ICON_PIVOT_INDIVIDUAL,
7578 "Individual Centers",
7579 ""},
7580 // {V3D_AROUND_CENTER_MEDIAN, "MEDIAN_POINT", 0, "Median Point", ""},
7581 // {V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
7582 {0, nullptr, 0, nullptr, nullptr},
7583 };
7584
7585 srna = RNA_def_struct(brna, "SpaceGraphEditor", "Space");
7586 RNA_def_struct_sdna(srna, "SpaceGraph");
7587 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
7588
7590 (1 << RGN_TYPE_FOOTER) | (1 << RGN_TYPE_UI) |
7591 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
7592
7593 /* mode */
7594 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
7595 RNA_def_property_enum_sdna(prop, nullptr, "mode");
7597 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
7600 prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
7601
7602 /* display */
7603 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
7604 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_DRAWTIME);
7605 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
7607
7608 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
7609 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_SLIDERS);
7610 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
7612
7613 prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
7615 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bézier control points");
7617
7618 prop = RNA_def_property(srna, "use_auto_lock_translation_axis", PROP_BOOLEAN, PROP_NONE);
7619 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_AUTOLOCK_AXIS);
7621 "Auto-Lock Key Axis",
7622 "Automatically locks the movement of keyframes to the dominant axis");
7624
7625 prop = RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
7628 prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
7630
7631 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
7632 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_SHOW_MARKERS);
7634 prop,
7635 "Show Markers",
7636 "If any exists, show markers in a separate row at the bottom of the editor");
7638
7639 prop = RNA_def_property(srna, "show_extrapolation", PROP_BOOLEAN, PROP_NONE);
7641 RNA_def_property_ui_text(prop, "Show Extrapolation", "");
7643
7644 /* editing */
7645 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
7647 RNA_def_property_ui_text(prop, "Auto-Merge Keyframes", "Automatically merge nearby keyframes");
7649
7650 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
7653 prop,
7654 "Realtime Updates",
7655 "When transforming keyframes, changes to the animation data are flushed to other views");
7657
7658 /* cursor */
7659 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
7661 RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
7663
7664 prop = RNA_def_property(srna, "cursor_position_x", PROP_FLOAT, PROP_NONE);
7665 RNA_def_property_float_sdna(prop, nullptr, "cursorTime");
7667 prop, "Cursor X-Value", "Graph Editor 2D-Value cursor - X-Value component");
7669
7670 prop = RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
7671 RNA_def_property_float_sdna(prop, nullptr, "cursorVal");
7673 prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
7675
7676 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
7677 RNA_def_property_enum_sdna(prop, nullptr, "around");
7678 RNA_def_property_enum_items(prop, gpivot_items);
7679 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
7681
7682 /* Dope-sheet. */
7683 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
7684 RNA_def_property_struct_type(prop, "DopeSheet");
7685 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
7686 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
7687
7688 /* Read-only state info. */
7689 prop = RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
7690 RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", nullptr);
7693 prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
7694
7695 /* Normalize curves. */
7696 prop = RNA_def_property(srna, "use_normalization", PROP_BOOLEAN, PROP_NONE);
7697 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_NORMALIZE);
7699 "Use Normalization",
7700 "Display curves in normalized range from -1 to 1, "
7701 "for easier editing of multiple curves with different ranges");
7704 prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_normalize_update");
7705
7706 prop = RNA_def_property(srna, "use_auto_normalization", PROP_BOOLEAN, PROP_NONE);
7709 "Auto Normalization",
7710 "Automatically recalculate curve normalization on every curve edit");
7712}
7713
7715{
7716 StructRNA *srna;
7717 PropertyRNA *prop;
7718
7719 srna = RNA_def_struct(brna, "SpaceNLA", "Space");
7720 RNA_def_struct_sdna(srna, "SpaceNla");
7721 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
7722
7724 (1 << RGN_TYPE_FOOTER) | (1 << RGN_TYPE_UI) |
7725 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
7726
7727 /* display */
7728 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
7729 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNLA_DRAWTIME);
7730 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
7732
7733 prop = RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
7735 RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips");
7737
7738 prop = RNA_def_property(srna, "show_local_markers", PROP_BOOLEAN, PROP_NONE);
7741 prop,
7742 "Show Local Markers",
7743 "Show action-local markers on the strips, useful when synchronizing timing across strips");
7745
7746 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
7747 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNLA_SHOW_MARKERS);
7749 prop,
7750 "Show Markers",
7751 "If any exists, show markers in a separate row at the bottom of the editor");
7753
7754 /* editing */
7755 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
7758 prop,
7759 "Realtime Updates",
7760 "When transforming strips, changes to the animation data are flushed to other views");
7762
7763 /* dopesheet */
7764 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
7765 RNA_def_property_struct_type(prop, "DopeSheet");
7766 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
7767 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
7768}
7769
7771{
7772 static const EnumPropertyItem console_line_type_items[] = {
7773 {CONSOLE_LINE_OUTPUT, "OUTPUT", 0, "Output", ""},
7774 {CONSOLE_LINE_INPUT, "INPUT", 0, "Input", ""},
7775 {CONSOLE_LINE_INFO, "INFO", 0, "Info", ""},
7776 {CONSOLE_LINE_ERROR, "ERROR", 0, "Error", ""},
7777 {0, nullptr, 0, nullptr, nullptr},
7778 };
7779
7780 StructRNA *srna;
7781 PropertyRNA *prop;
7782
7783 srna = RNA_def_struct(brna, "ConsoleLine", nullptr);
7784 RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
7785
7786 prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
7788 prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
7789 RNA_def_property_ui_text(prop, "Line", "Text in the line");
7792
7793 prop = RNA_def_property(
7794 srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
7796 "rna_ConsoleLine_current_character_get",
7797 "rna_ConsoleLine_current_character_set",
7798 nullptr);
7800
7801 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
7802 RNA_def_property_enum_sdna(prop, nullptr, "type");
7803 RNA_def_property_enum_items(prop, console_line_type_items);
7804 RNA_def_property_ui_text(prop, "Type", "Console line type when used in scrollback");
7805}
7806
7808{
7809 StructRNA *srna;
7810 PropertyRNA *prop;
7811
7812 srna = RNA_def_struct(brna, "SpaceConsole", "Space");
7813 RNA_def_struct_sdna(srna, "SpaceConsole");
7814 RNA_def_struct_ui_text(srna, "Space Console", "Interactive Python console");
7815
7816 /* display */
7817 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
7818 RNA_def_property_int_sdna(prop, nullptr, "line_height");
7819 RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */
7820 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
7821 RNA_def_property_update(prop, 0, "rna_SpaceConsole_rect_update");
7822
7823 prop = RNA_def_property(
7824 srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
7825 RNA_def_property_int_sdna(prop, nullptr, "sel_start");
7827
7828 prop = RNA_def_property(
7829 srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
7830 RNA_def_property_int_sdna(prop, nullptr, "sel_end");
7832
7833 prop = RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
7834 RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
7835
7836 prop = RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
7837 RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
7839
7840 prop = RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
7841 RNA_def_property_collection_sdna(prop, nullptr, "history", nullptr);
7842 RNA_def_property_struct_type(prop, "ConsoleLine");
7843 RNA_def_property_ui_text(prop, "History", "Command history");
7844
7845 prop = RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
7846 RNA_def_property_collection_sdna(prop, nullptr, "scrollback", nullptr);
7847 RNA_def_property_struct_type(prop, "ConsoleLine");
7848 RNA_def_property_ui_text(prop, "Output", "Command output");
7849}
7850
7851/* Filter for datablock types in link/append. */
7853{
7854
7855 StructRNA *srna = RNA_def_struct(brna, "FileSelectIDFilter", nullptr);
7856 RNA_def_struct_sdna(srna, "FileSelectParams");
7857 RNA_def_struct_nested(brna, srna, "FileSelectParams");
7859 srna, "File Select ID Filter", "Which ID types to show/hide, when browsing a library");
7860
7861 const IDFilterEnumPropertyItem *individual_ids_and_categories[] = {
7864 nullptr,
7865 };
7866 for (uint i = 0; individual_ids_and_categories[i]; i++) {
7867 for (int j = 0; individual_ids_and_categories[i][j].identifier; j++) {
7869 srna, individual_ids_and_categories[i][j].identifier, PROP_BOOLEAN, PROP_NONE);
7871 prop, nullptr, "filter_id", individual_ids_and_categories[i][j].flag);
7873 individual_ids_and_categories[i][j].name,
7874 individual_ids_and_categories[i][j].description);
7875 RNA_def_property_ui_icon(prop, individual_ids_and_categories[i][j].icon, 0);
7877 }
7878 }
7879}
7880
7881/* Filter for datablock types in the Asset Browser. */
7883{
7884 StructRNA *srna = RNA_def_struct(brna, "FileAssetSelectIDFilter", nullptr);
7885 RNA_def_struct_sdna(srna, "FileSelectParams");
7886 RNA_def_struct_nested(brna, srna, "FileSelectParams");
7888 "File Select Asset Filter",
7889 "Which asset types to show/hide, when browsing an asset library");
7890
7891 static char experimental_prop_names[INDEX_ID_MAX][MAX_NAME];
7892
7893 for (uint i = 0; rna_enum_id_type_filter_items[i].identifier; i++) {
7895 const bool is_experimental = (ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS & item->flag) == 0;
7896
7897 const char *identifier = rna_enum_id_type_filter_items[i].identifier;
7898 if (is_experimental) {
7899 /* Create name for experimental property and store in static buffer. */
7900 SNPRINTF(experimental_prop_names[i], "experimental_%s", identifier);
7901 identifier = experimental_prop_names[i];
7902 }
7903
7904 PropertyRNA *prop = RNA_def_property(srna, identifier, PROP_BOOLEAN, PROP_NONE);
7905 RNA_def_property_boolean_sdna(prop, nullptr, "filter_id", item->flag);
7906 RNA_def_property_ui_text(prop, item->name, item->description);
7907 RNA_def_property_ui_icon(prop, item->icon, 0);
7909 }
7910}
7911
7913{
7914 PropertyRNA *prop;
7915 StructRNA *srna = RNA_def_struct(brna, "FileSelectEntry", nullptr);
7916 RNA_def_struct_sdna(srna, "FileDirEntry");
7917 RNA_def_struct_ui_text(srna, "File Select Entry", "A file viewable in the File Browser");
7918
7919 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
7920 RNA_def_property_editable_func(prop, "rna_FileBrowser_FileSelectEntry_name_editable");
7923 "rna_FileBrowser_FileSelectEntry_name_get",
7924 "rna_FileBrowser_FileSelectEntry_name_length",
7925 nullptr);
7926 RNA_def_property_ui_text(prop, "Name", "");
7927 RNA_def_struct_name_property(srna, prop);
7928
7929 prop = RNA_def_property(srna, "relative_path", PROP_STRING, PROP_FILEPATH);
7931 "rna_FileBrowser_FileSelectEntry_relative_path_get",
7932 "rna_FileBrowser_FileSelectEntry_relative_path_length",
7933 nullptr);
7935 "Relative Path",
7936 "Path relative to the directory currently displayed in the File "
7937 "Browser (includes the file name)");
7939
7940 prop = RNA_def_int(
7941 srna,
7942 "preview_icon_id",
7943 0,
7944 INT_MIN,
7945 INT_MAX,
7946 "Icon ID",
7947 "Unique integer identifying the preview of this file as an icon (zero means invalid)",
7948 INT_MIN,
7949 INT_MAX);
7952 prop, "rna_FileBrowser_FileSelectEntry_preview_icon_id_get", nullptr, nullptr);
7953
7954 prop = RNA_def_property(srna, "asset_data", PROP_POINTER, PROP_NONE);
7955 RNA_def_property_struct_type(prop, "AssetMetaData");
7957 prop, "rna_FileBrowser_FileSelectEntry_asset_data_get", nullptr, nullptr, nullptr);
7959 prop, "Asset Data", "Asset data, valid if the file represents an asset");
7960}
7961
7963{
7964 StructRNA *srna;
7965 PropertyRNA *prop;
7966
7967 static const EnumPropertyItem display_size_items[] = {
7968 {32, "TINY", 0, "Tiny", ""},
7969 {64, "SMALL", 0, "Small", ""},
7970 {96, "NORMAL", 0, "Medium", ""},
7971 {128, "BIG", 0, "Big", ""},
7972 {192, "LARGE", 0, "Large", ""},
7973 {0, nullptr, 0, nullptr, nullptr},
7974 };
7975
7976 srna = RNA_def_struct(brna, "FileSelectParams", nullptr);
7977 RNA_def_struct_path_func(srna, "rna_FileSelectParams_path");
7978 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
7979
7980 prop = RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
7981 RNA_def_property_string_sdna(prop, nullptr, "title");
7982 RNA_def_property_ui_text(prop, "Title", "Title for the file browser");
7984
7985 /* Use BYTESTRING rather than DIRPATH as sub-type so UI code doesn't add OT_directory_browse
7986 * button when displaying this prop in the file browser (it would just open a file browser). That
7987 * should be the only effective difference between the two. */
7988 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_BYTESTRING);
7989 RNA_def_property_string_sdna(prop, nullptr, "dir");
7990 RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
7992
7993 prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
7994 RNA_def_property_string_sdna(prop, nullptr, "file");
7995 RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
7996 RNA_def_property_editable_func(prop, "rna_FileSelectParams_filename_editable");
7998
7999 prop = RNA_def_property(srna, "use_library_browsing", PROP_BOOLEAN, PROP_NONE);
8001 prop, "Library Browser", "Whether we may browse Blender files' content or not");
8003 RNA_def_property_boolean_funcs(prop, "rna_FileSelectParams_use_lib_get", nullptr);
8004
8005 prop = RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
8006 RNA_def_property_enum_sdna(prop, nullptr, "display");
8008 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_FileSelectParams_display_type_itemf");
8009 RNA_def_property_enum_default_func(prop, "rna_FileSelectParams_display_type_default");
8010 RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
8012
8013 prop = RNA_def_property(srna, "recursion_level", PROP_ENUM, PROP_NONE);
8016 prop, nullptr, nullptr, "rna_FileSelectParams_recursion_level_itemf");
8017 RNA_def_property_ui_text(prop, "Recursion", "Numbers of dirtree levels to show simultaneously");
8019
8020 prop = RNA_def_property(srna, "show_details_size", PROP_BOOLEAN, PROP_NONE);
8021 RNA_def_property_boolean_sdna(prop, nullptr, "details_flags", FILE_DETAILS_SIZE);
8022 RNA_def_property_ui_text(prop, "File Size", "Show a column listing the size of each file");
8024
8025 prop = RNA_def_property(srna, "show_details_datetime", PROP_BOOLEAN, PROP_NONE);
8026 RNA_def_property_boolean_sdna(prop, nullptr, "details_flags", FILE_DETAILS_DATETIME);
8028 prop,
8029 "File Modification Date",
8030 "Show a column listing the date and time of modification for each file");
8032
8033 prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
8034 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_FILTER);
8035 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
8037
8038 prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
8040 RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
8042
8043 prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
8044 RNA_def_property_enum_sdna(prop, nullptr, "sort");
8046 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_FileSelectParams_sort_method_itemf");
8047 RNA_def_property_ui_text(prop, "Sort", "");
8049
8050 prop = RNA_def_property(srna, "use_sort_invert", PROP_BOOLEAN, PROP_NONE);
8051 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_SORT_INVERT);
8053 prop, "Reverse Sorting", "Sort items descending, from highest value to lowest");
8055
8056 prop = RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
8057 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_IMAGE);
8058 RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
8059 RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
8061
8062 prop = RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
8063 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_BLENDER);
8064 RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
8065 RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
8067
8068 prop = RNA_def_property(srna, "use_filter_backup", PROP_BOOLEAN, PROP_NONE);
8071 prop, "Filter Blender Backup Files", "Show .blend1, .blend2, etc. files");
8072 RNA_def_property_ui_icon(prop, ICON_FILE_BACKUP, 0);
8074
8075 prop = RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
8076 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_MOVIE);
8077 RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
8078 RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
8080
8081 prop = RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
8082 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_PYSCRIPT);
8083 RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
8084 RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
8086
8087 prop = RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
8088 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_FTFONT);
8089 RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
8090 RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
8092
8093 prop = RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
8094 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_SOUND);
8095 RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
8096 RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
8098
8099 prop = RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
8100 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_TEXT);
8101 RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
8102 RNA_def_property_ui_icon(prop, ICON_FILE_TEXT, 0);
8104
8105 prop = RNA_def_property(srna, "use_filter_volume", PROP_BOOLEAN, PROP_NONE);
8106 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_VOLUME);
8107 RNA_def_property_ui_text(prop, "Filter Volume", "Show 3D volume files");
8108 RNA_def_property_ui_icon(prop, ICON_FILE_VOLUME, 0);
8110
8111 prop = RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
8112 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_FOLDER);
8113 RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
8114 RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
8116
8117 prop = RNA_def_property(srna, "use_filter_blendid", PROP_BOOLEAN, PROP_NONE);
8118 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_BLENDERLIB);
8120 prop, "Filter Blender IDs", "Show .blend files items (objects, materials, etc.)");
8121 RNA_def_property_ui_icon(prop, ICON_BLENDER, 0);
8123
8124 prop = RNA_def_property(srna, "use_filter_asset_only", PROP_BOOLEAN, PROP_NONE);
8125 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_ASSETS_ONLY);
8127 prop, "Only Assets", "Hide .blend files items that are not data-blocks with asset metadata");
8129
8130 prop = RNA_def_property(srna, "filter_id", PROP_POINTER, PROP_NONE);
8132 RNA_def_property_struct_type(prop, "FileSelectIDFilter");
8134 prop, "rna_FileSelectParams_filter_id_get", nullptr, nullptr, nullptr);
8136 prop, "Filter ID Types", "Which ID types to show/hide, when browsing a library");
8137
8138 prop = RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
8139 RNA_def_property_string_sdna(prop, nullptr, "filter_glob");
8141 "Extension Filter",
8142 "UNIX shell-like filename patterns matching, supports wildcards ('*') "
8143 "and list of patterns separated by ';'");
8144 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_FileSelectParams_filter_glob_set");
8146
8147 prop = RNA_def_property(srna, "filter_search", PROP_STRING, PROP_NONE);
8148 RNA_def_property_string_sdna(prop, nullptr, "filter_search");
8150 prop, "Name or Tag Filter", "Filter by name or tag, supports '*' wildcard");
8153
8154 prop = RNA_def_property(srna, "display_size", PROP_INT, PROP_NONE);
8155 RNA_def_property_int_sdna(prop, nullptr, "thumbnail_size");
8156 RNA_def_property_ui_text(prop, "Display Size", "Change the size of thumbnails");
8159 RNA_def_property_range(prop, 16, 256);
8160 RNA_def_property_ui_range(prop, 24, 256, 1, 0);
8161
8162 prop = RNA_def_property(srna, "display_size_discrete", PROP_ENUM, PROP_NONE);
8163 RNA_def_property_enum_sdna(prop, nullptr, "thumbnail_size");
8164 RNA_def_property_enum_items(prop, display_size_items);
8166 prop, "Display Size", "Change the size of thumbnails in discrete steps");
8168
8169 prop = RNA_def_property(srna, "list_display_size", PROP_INT, PROP_NONE);
8170 RNA_def_property_int_sdna(prop, nullptr, "list_thumbnail_size");
8171 RNA_def_property_ui_text(prop, "Display Size", "Change the size of thumbnails in list views");
8174 RNA_def_property_range(prop, 16, 128);
8175 RNA_def_property_ui_range(prop, 16, 128, 1, 0);
8176
8177 prop = RNA_def_property(srna, "list_column_size", PROP_INT, PROP_NONE);
8178 RNA_def_property_ui_text(prop, "Columns Size", "The width of columns in horizontal list views");
8181 RNA_def_property_range(prop, 32, 750);
8182 RNA_def_property_ui_range(prop, 32, 750, 1, 0);
8183}
8184
8186{
8187 StructRNA *srna;
8188 PropertyRNA *prop;
8189
8190 srna = RNA_def_struct(brna, "FileAssetSelectParams", "FileSelectParams");
8192 srna, "Asset Select Parameters", "Settings for the file selection in Asset Browser mode");
8193
8195 "rna_FileAssetSelectParams_asset_library_get",
8196 "rna_FileAssetSelectParams_asset_library_set");
8197 RNA_def_property_ui_text(prop, "Asset Library", "");
8199
8200 prop = RNA_def_property(srna, "catalog_id", PROP_STRING, PROP_NONE);
8202 "rna_FileAssetSelectParams_catalog_id_get",
8203 "rna_FileAssetSelectParams_catalog_id_length",
8204 "rna_FileAssetSelectParams_catalog_id_set");
8205 RNA_def_property_ui_text(prop, "Catalog UUID", "The UUID of the catalog shown in the browser");
8207
8208 prop = RNA_def_property(srna, "asset_catalog_visibility", PROP_ENUM, PROP_NONE);
8209 RNA_def_property_enum_sdna(prop, nullptr, "asset_catalog_visibility");
8212 prop, "Catalog Visibility", "Which assets to show based on catalog filter");
8214
8215 prop = RNA_def_property(srna, "filter_asset_id", PROP_POINTER, PROP_NONE);
8217 RNA_def_property_struct_type(prop, "FileAssetSelectIDFilter");
8219 prop, "rna_FileAssetSelectParams_filter_id_get", nullptr, nullptr, nullptr);
8221 "Filter Asset Types",
8222 "Which asset types to show/hide, when browsing an asset library");
8223
8224 prop = RNA_def_property(srna, "import_method", PROP_ENUM, PROP_NONE);
8227 prop, nullptr, nullptr, "rna_FileAssetSelectParams_import_method_itemf");
8228 RNA_def_property_ui_text(prop, "Import Method", "Determine how the asset will be imported");
8229 /* Asset drag info saved by buttons stores the import method, so the space must redraw when
8230 * import method changes. */
8232
8233 prop = RNA_def_property(srna, "instance_collections_on_link", PROP_BOOLEAN, PROP_NONE);
8235 prop, nullptr, "import_flags", FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_LINK);
8237 "Instance Collections on Linking",
8238 "Create instances for collections when linking, rather than adding "
8239 "them directly to the scene");
8241
8242 prop = RNA_def_property(srna, "asset_access", PROP_ENUM, PROP_NONE);
8245 prop, "Asset Access", "Choose the visibility of online and offline assets");
8247
8248 prop = RNA_def_property(srna, "instance_collections_on_append", PROP_BOOLEAN, PROP_NONE);
8250 prop, nullptr, "import_flags", FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_APPEND);
8252 "Instance Collections on Appending",
8253 "Create instances for collections when appending, rather than adding "
8254 "them directly to the scene");
8256}
8257
8259{
8260 StructRNA *srna;
8261 PropertyRNA *prop;
8262
8263 srna = RNA_def_struct(brna, "FileBrowserFSMenuEntry", nullptr);
8264 RNA_def_struct_sdna(srna, "FSMenuEntry");
8265 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
8266
8267 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_FILEPATH);
8269 "rna_FileBrowser_FSMenuEntry_path_get",
8270 "rna_FileBrowser_FSMenuEntry_path_length",
8271 "rna_FileBrowser_FSMenuEntry_path_set");
8272 RNA_def_property_ui_text(prop, "Path", "");
8274
8275 /* Use #PROP_FILENAME sub-type so the UI can manipulate non-UTF8 names. */
8276 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
8278 "rna_FileBrowser_FSMenuEntry_name_get",
8279 "rna_FileBrowser_FSMenuEntry_name_length",
8280 "rna_FileBrowser_FSMenuEntry_name_set");
8281 RNA_def_property_editable_func(prop, "rna_FileBrowser_FSMenuEntry_name_get_editable");
8282 RNA_def_property_ui_text(prop, "Name", "");
8283 RNA_def_struct_name_property(srna, prop);
8284
8285 prop = RNA_def_property(srna, "icon", PROP_INT, PROP_NONE);
8287 "rna_FileBrowser_FSMenuEntry_icon_get",
8288 "rna_FileBrowser_FSMenuEntry_icon_set",
8289 nullptr);
8290 RNA_def_property_ui_text(prop, "Icon", "");
8291
8292 prop = RNA_def_property(srna, "use_save", PROP_BOOLEAN, PROP_NONE);
8293 RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_use_save_get", nullptr);
8295 prop, "Save", "Whether this path is saved in bookmarks, or generated from OS");
8297}
8298
8300{
8301 StructRNA *srna;
8302 PropertyRNA *prop;
8303
8304 srna = RNA_def_struct(brna, "SpaceFileBrowser", "Space");
8305 RNA_def_struct_sdna(srna, "SpaceFile");
8306 RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
8307
8309 srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_TOOL_PROPS));
8310
8311 prop = RNA_def_property(srna, "browse_mode", PROP_ENUM, PROP_NONE);
8314 prop,
8315 "Browsing Mode",
8316 "Type of the File Editor view (regular file browsing or asset browsing)");
8317 RNA_def_property_update(prop, 0, "rna_SpaceFileBrowser_browse_mode_update");
8318
8319 prop = RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
8320 RNA_def_property_struct_type(prop, "FileSelectParams");
8322 prop, "rna_FileBrowser_params_get", nullptr, "rna_FileBrowser_params_typef", nullptr);
8324 prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser");
8325
8326 prop = RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE);
8327 RNA_def_property_pointer_sdna(prop, nullptr, "op");
8328 RNA_def_property_ui_text(prop, "Active Operator", "");
8329
8330 /* Keep this for compatibility with existing presets,
8331 * not exposed in c++ API because of keyword conflict. */
8332 prop = RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
8333 RNA_def_property_pointer_sdna(prop, nullptr, "op");
8334 RNA_def_property_ui_text(prop, "Active Operator", "");
8335
8336 /* bookmarks, recent files etc. */
8337 prop = RNA_def_collection(srna,
8338 "system_folders",
8339 "FileBrowserFSMenuEntry",
8340 "System Folders",
8341 "System's folders (usually root, available hard drives, etc)");
8343 "rna_FileBrowser_FSMenuSystem_data_begin",
8344 "rna_FileBrowser_FSMenu_next",
8345 "rna_FileBrowser_FSMenu_end",
8346 "rna_FileBrowser_FSMenu_get",
8347 "rna_FileBrowser_FSMenuSystem_data_length",
8348 nullptr,
8349 nullptr,
8350 nullptr);
8352
8353 prop = RNA_def_int(srna,
8354 "system_folders_active",
8355 -1,
8356 -1,
8357 INT_MAX,
8358 "Active System Folder",
8359 "Index of active system folder (-1 if none)",
8360 -1,
8361 INT_MAX);
8362 RNA_def_property_int_sdna(prop, nullptr, "systemnr");
8364 "rna_FileBrowser_FSMenuSystem_active_get",
8365 "rna_FileBrowser_FSMenuSystem_active_set",
8366 "rna_FileBrowser_FSMenuSystem_active_range");
8369 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
8370
8371 prop = RNA_def_collection(srna,
8372 "system_bookmarks",
8373 "FileBrowserFSMenuEntry",
8374 "System Bookmarks",
8375 "System's bookmarks");
8377 "rna_FileBrowser_FSMenuSystemBookmark_data_begin",
8378 "rna_FileBrowser_FSMenu_next",
8379 "rna_FileBrowser_FSMenu_end",
8380 "rna_FileBrowser_FSMenu_get",
8381 "rna_FileBrowser_FSMenuSystemBookmark_data_length",
8382 nullptr,
8383 nullptr,
8384 nullptr);
8386
8387 prop = RNA_def_int(srna,
8388 "system_bookmarks_active",
8389 -1,
8390 -1,
8391 INT_MAX,
8392 "Active System Bookmark",
8393 "Index of active system bookmark (-1 if none)",
8394 -1,
8395 INT_MAX);
8396 RNA_def_property_int_sdna(prop, nullptr, "system_bookmarknr");
8398 "rna_FileBrowser_FSMenuSystemBookmark_active_get",
8399 "rna_FileBrowser_FSMenuSystemBookmark_active_set",
8400 "rna_FileBrowser_FSMenuSystemBookmark_active_range");
8403 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
8404
8405 prop = RNA_def_collection(
8406 srna, "bookmarks", "FileBrowserFSMenuEntry", "Bookmarks", "User's bookmarks");
8408 "rna_FileBrowser_FSMenuBookmark_data_begin",
8409 "rna_FileBrowser_FSMenu_next",
8410 "rna_FileBrowser_FSMenu_end",
8411 "rna_FileBrowser_FSMenu_get",
8412 "rna_FileBrowser_FSMenuBookmark_data_length",
8413 nullptr,
8414 nullptr,
8415 nullptr);
8417
8418 prop = RNA_def_int(srna,
8419 "bookmarks_active",
8420 -1,
8421 -1,
8422 INT_MAX,
8423 "Active Bookmark",
8424 "Index of active bookmark (-1 if none)",
8425 -1,
8426 INT_MAX);
8427 RNA_def_property_int_sdna(prop, nullptr, "bookmarknr");
8429 "rna_FileBrowser_FSMenuBookmark_active_get",
8430 "rna_FileBrowser_FSMenuBookmark_active_set",
8431 "rna_FileBrowser_FSMenuBookmark_active_range");
8434 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
8435
8436 prop = RNA_def_collection(
8437 srna, "recent_folders", "FileBrowserFSMenuEntry", "Recent Folders", "");
8439 "rna_FileBrowser_FSMenuRecent_data_begin",
8440 "rna_FileBrowser_FSMenu_next",
8441 "rna_FileBrowser_FSMenu_end",
8442 "rna_FileBrowser_FSMenu_get",
8443 "rna_FileBrowser_FSMenuRecent_data_length",
8444 nullptr,
8445 nullptr,
8446 nullptr);
8448
8449 prop = RNA_def_int(srna,
8450 "recent_folders_active",
8451 -1,
8452 -1,
8453 INT_MAX,
8454 "Active Recent Folder",
8455 "Index of active recent folder (-1 if none)",
8456 -1,
8457 INT_MAX);
8458 RNA_def_property_int_sdna(prop, nullptr, "recentnr");
8460 "rna_FileBrowser_FSMenuRecent_active_get",
8461 "rna_FileBrowser_FSMenuRecent_active_set",
8462 "rna_FileBrowser_FSMenuRecent_active_range");
8465 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
8466
8468}
8469
8471{
8472 StructRNA *srna;
8473 PropertyRNA *prop;
8474
8475 srna = RNA_def_struct(brna, "SpaceInfo", "Space");
8476 RNA_def_struct_sdna(srna, "SpaceInfo");
8477 RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
8478
8479 /* reporting display */
8480 prop = RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
8481 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_DEBUG);
8482 RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
8484
8485 prop = RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
8486 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_INFO);
8487 RNA_def_property_ui_text(prop, "Show Info", "Display general information");
8489
8490 prop = RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
8491 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_OP);
8492 RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
8494
8495 prop = RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
8496 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_WARN);
8497 RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
8499
8500 prop = RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
8501 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_ERR);
8502 RNA_def_property_ui_text(prop, "Show Error", "Display error text");
8504}
8505
8507{
8508 static const EnumPropertyItem filter_type_items[] = {
8509 {0, "NAME", 0, "Name", "Filter based on the operator name"},
8510 {1, "KEY", 0, "Key-Binding", "Filter based on key bindings"},
8511 {0, nullptr, 0, nullptr, nullptr},
8512 };
8513
8514 StructRNA *srna;
8515 PropertyRNA *prop;
8516
8517 srna = RNA_def_struct(brna, "SpacePreferences", "Space");
8518 RNA_def_struct_sdna(srna, "SpaceUserPref");
8519 RNA_def_struct_ui_text(srna, "Space Preferences", "Blender preferences space data");
8520
8522
8523 prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
8524 RNA_def_property_enum_sdna(prop, nullptr, "filter_type");
8525 RNA_def_property_enum_items(prop, filter_type_items);
8526 RNA_def_property_ui_text(prop, "Filter Type", "Filter method");
8528
8529 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
8530 RNA_def_property_string_sdna(prop, nullptr, "filter");
8532 RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
8533
8534 prop = RNA_def_property(srna, "tab_search_results", PROP_BOOLEAN, PROP_NONE);
8535 RNA_def_property_array(prop, 0); /* Dynamic length, see next line. */
8538 RNA_def_property_boolean_funcs(prop, "rna_SpaceUserPref_tab_search_results_get", nullptr);
8539 RNA_def_property_dynamic_array_funcs(prop, "rna_SpaceUserPref_tab_search_results_getlength");
8541 prop, "Tab Search Results", "Whether or not each visible tab has a search result");
8542 prop = RNA_def_property(srna, "search_filter", PROP_STRING, PROP_NONE);
8543 /* The search filter is stored in the property editor's runtime which
8544 * is only defined in an internal header, so use the getter / setter here. */
8546 "rna_SpaceUserPref_search_filter_get",
8547 "rna_SpaceUserPref_search_filter_length",
8548 "rna_SpaceUserPref_search_filter_set");
8549 RNA_def_property_editable_func(prop, "rna_SpaceUserPref_search_filter_editable");
8550 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
8553 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceUserPref_search_filter_update");
8554}
8555
8557{
8558 StructRNA *srna;
8559 PropertyRNA *prop;
8560
8561 srna = RNA_def_struct(brna, "NodeTreePath", nullptr);
8562 RNA_def_struct_sdna(srna, "bNodeTreePath");
8563 RNA_def_struct_ui_text(srna, "Node Tree Path", "Element of the node space tree path");
8564
8565 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
8566 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
8568 RNA_def_property_ui_text(prop, "Node Tree", "Base node tree from context");
8569}
8570
8572{
8573 StructRNA *srna;
8574 PropertyRNA *prop, *parm;
8575 FunctionRNA *func;
8576
8577 RNA_def_property_srna(cprop, "SpaceNodeEditorPath");
8578 srna = RNA_def_struct(brna, "SpaceNodeEditorPath", nullptr);
8579 RNA_def_struct_sdna(srna, "SpaceNode");
8580 RNA_def_struct_ui_text(srna, "Space Node Editor Path", "History of node trees in the editor");
8581
8582 prop = RNA_def_property(srna, "to_string", PROP_STRING, PROP_NONE);
8584 prop, "rna_SpaceNodeEditor_path_get", "rna_SpaceNodeEditor_path_length", nullptr);
8586 RNA_def_struct_ui_text(srna, "Path", "Get the node tree path as a string");
8588
8589 func = RNA_def_function(srna, "clear", "rna_SpaceNodeEditor_path_clear");
8590 RNA_def_function_ui_description(func, "Reset the node tree path");
8592
8593 func = RNA_def_function(srna, "start", "rna_SpaceNodeEditor_path_start");
8594 RNA_def_function_ui_description(func, "Set the root node tree");
8596 parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", "");
8598
8599 func = RNA_def_function(srna, "append", "rna_SpaceNodeEditor_path_append");
8600 RNA_def_function_ui_description(func, "Append a node group tree to the path");
8602 parm = RNA_def_pointer(
8603 func, "node_tree", "NodeTree", "Node Tree", "Node tree to append to the node editor path");
8605 parm = RNA_def_pointer(func, "node", "Node", "Node", "Group node linking to this node tree");
8607
8608 func = RNA_def_function(srna, "pop", "rna_SpaceNodeEditor_path_pop");
8609 RNA_def_function_ui_description(func, "Remove the last node tree from the path");
8611}
8612
8614{
8615 StructRNA *srna;
8616 PropertyRNA *prop;
8617
8618 static const EnumPropertyItem preview_shapes[] = {
8619 {SN_OVERLAY_PREVIEW_FLAT, "FLAT", ICON_MESH_PLANE, "Flat", "Use the default flat previews"},
8621 "3D",
8622 ICON_SPHERE,
8623 "3D",
8624 "Use the material preview scene for the node previews"},
8625 {0, nullptr, 0, nullptr, nullptr},
8626 };
8627
8628 srna = RNA_def_struct(brna, "SpaceNodeOverlay", nullptr);
8629 RNA_def_struct_sdna(srna, "SpaceNode");
8630 RNA_def_struct_nested(brna, srna, "SpaceNodeEditor");
8631 RNA_def_struct_path_func(srna, "rna_SpaceNodeOverlay_path");
8633 srna, "Overlay Settings", "Settings for display of overlays in the Node Editor");
8634
8635 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
8636 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_OVERLAYS);
8638 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like colored or dashed wires");
8640
8641 prop = RNA_def_property(srna, "show_wire_color", PROP_BOOLEAN, PROP_NONE);
8642 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_WIRE_COLORS);
8645 prop, "Show Wire Colors", "Color node links based on their connected sockets");
8647
8648 prop = RNA_def_property(srna, "show_reroute_auto_labels", PROP_BOOLEAN, PROP_NONE);
8650 prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_REROUTE_AUTO_LABELS);
8653 "Show Reroute Auto Labels",
8654 "Label reroute nodes based on the label of connected reroute nodes");
8656
8657 prop = RNA_def_property(srna, "show_timing", PROP_BOOLEAN, PROP_NONE);
8658 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_TIMINGS);
8660 RNA_def_property_ui_text(prop, "Show Timing", "Display each node's last execution time");
8662
8663 prop = RNA_def_property(srna, "show_context_path", PROP_BOOLEAN, PROP_NONE);
8664 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_PATH);
8666 RNA_def_property_ui_text(prop, "Show Tree Path", "Display breadcrumbs for the editor's context");
8668
8669 prop = RNA_def_property(srna, "show_named_attributes", PROP_BOOLEAN, PROP_NONE);
8673 prop, "Show Named Attributes", "Show when nodes are using named attributes");
8675
8676 prop = RNA_def_property(srna, "show_previews", PROP_BOOLEAN, PROP_NONE);
8677 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_PREVIEWS);
8680 prop, "Show Node Previews", "Display each node's preview if node is toggled");
8682
8683 prop = RNA_def_property(srna, "preview_shape", PROP_ENUM, PROP_NONE);
8684 RNA_def_property_enum_sdna(prop, nullptr, "overlay.preview_shape");
8685 RNA_def_property_enum_items(prop, preview_shapes);
8687 RNA_def_property_ui_text(prop, "Preview Shape", "Preview shape used by the node previews");
8689
8690 prop = RNA_def_property(srna, "show_render_size", PROP_BOOLEAN, PROP_NONE);
8691 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_RENDER_REGION);
8693 RNA_def_property_ui_text(prop, "Render Region", "Display the region of the final render");
8695
8696 prop = RNA_def_property(srna, "show_text_info", PROP_BOOLEAN, PROP_NONE);
8697 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_TEXT_INFO);
8698 RNA_def_property_ui_text(prop, "Text Info", "Display overlay text");
8700
8701 prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
8702 RNA_def_property_float_sdna(prop, nullptr, "overlay.passepartout_alpha");
8705 prop, "Passepartout Alpha", "Opacity of the darkened overlay outside the render region");
8707}
8708
8710{
8711 StructRNA *srna;
8712 PropertyRNA *prop;
8713
8714 static const EnumPropertyItem texture_id_type_items[] = {
8715 {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World"},
8716 {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"},
8717# ifdef WITH_FREESTYLE
8719 "LINESTYLE",
8720 ICON_LINE_DATA,
8721 "Line Style",
8722 "Edit texture nodes from Line Style"},
8723# endif
8724 {0, nullptr, 0, nullptr, nullptr},
8725 };
8726
8727 static const EnumPropertyItem shader_type_items[] = {
8728 {SNODE_SHADER_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit shader nodes from Object"},
8729 {SNODE_SHADER_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit shader nodes from World"},
8730# ifdef WITH_FREESTYLE
8732 "LINESTYLE",
8733 ICON_LINE_DATA,
8734 "Line Style",
8735 "Edit shader nodes from Line Style"},
8736# endif
8737 {0, nullptr, 0, nullptr, nullptr},
8738 };
8739
8740 static const EnumPropertyItem backdrop_channels_items[] = {
8742 "COLOR_ALPHA",
8743 ICON_IMAGE_RGB_ALPHA,
8744 "Color & Alpha",
8745 "Display image with RGB colors and alpha transparency"},
8746 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
8747 {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Display alpha transparency channel"},
8748 {SNODE_SHOW_R, "RED", ICON_RGB_RED, "Red", ""},
8749 {SNODE_SHOW_G, "GREEN", ICON_RGB_GREEN, "Green", ""},
8750 {SNODE_SHOW_B, "BLUE", ICON_RGB_BLUE, "Blue", ""},
8751 {0, nullptr, 0, nullptr, nullptr},
8752 };
8753
8754 static const EnumPropertyItem insert_ofs_dir_items[] = {
8755 {SNODE_INSERTOFS_DIR_RIGHT, "RIGHT", 0, "Right"},
8756 {SNODE_INSERTOFS_DIR_LEFT, "LEFT", 0, "Left"},
8757 {0, nullptr, 0, nullptr, nullptr},
8758 };
8759
8760 srna = RNA_def_struct(brna, "SpaceNodeEditor", "Space");
8761 RNA_def_struct_sdna(srna, "SpaceNode");
8762 RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data");
8763
8765 srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_ASSET_SHELF));
8766
8767 prop = RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
8770 "rna_SpaceNodeEditor_tree_type_get",
8771 "rna_SpaceNodeEditor_tree_type_set",
8772 "rna_SpaceNodeEditor_tree_type_itemf");
8774 RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit");
8776
8777 prop = RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
8778 RNA_def_property_enum_sdna(prop, nullptr, "texfrom");
8779 RNA_def_property_enum_items(prop, texture_id_type_items);
8780 RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from");
8783
8784 prop = RNA_def_property(srna, "shader_type", PROP_ENUM, PROP_NONE);
8785 RNA_def_property_enum_sdna(prop, nullptr, "shaderfrom");
8786 RNA_def_property_enum_items(prop, shader_type_items);
8787 RNA_def_property_ui_text(prop, "Shader Type", "Type of data to take shader from");
8790
8791 prop = RNA_def_property(srna, "node_tree_sub_type", PROP_ENUM, PROP_NONE);
8792 RNA_def_property_enum_sdna(prop, nullptr, "node_tree_sub_type");
8795 prop, nullptr, nullptr, "rna_SpaceNodeEditor_node_tree_sub_type_itemf");
8796 RNA_def_property_ui_text(prop, "Node Tree Sub-Type", "");
8798 prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_sub_type_update");
8799
8800 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8802 RNA_def_property_ui_text(prop, "ID", "Data-block whose nodes are being edited");
8803
8804 prop = RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
8805 RNA_def_property_pointer_sdna(prop, nullptr, "from");
8808 prop, "ID From", "Data-block from which the edited data-block is linked");
8809
8810 prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE);
8811 RNA_def_property_collection_sdna(prop, nullptr, "treepath", nullptr);
8812 RNA_def_property_struct_type(prop, "NodeTreePath");
8814 prop, "Node Tree Path", "Path from the data-block to the currently edited node tree");
8815 rna_def_space_node_path_api(brna, prop);
8816
8817 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
8819 nullptr,
8820 "rna_SpaceNodeEditor_node_tree_set",
8821 nullptr,
8822 "rna_SpaceNodeEditor_node_tree_poll");
8823 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
8826 RNA_def_property_ui_text(prop, "Node Tree", "Base node tree from context");
8827 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
8828
8829 prop = RNA_def_property(srna, "edit_tree", PROP_POINTER, PROP_NONE);
8830 RNA_def_property_pointer_sdna(prop, nullptr, "edittree");
8832 RNA_def_property_ui_text(prop, "Edit Tree", "Node tree being displayed and edited");
8833
8834 prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
8835 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_PIN);
8836 RNA_def_property_ui_text(prop, "Pinned", "Use the pinned node tree");
8837 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
8839
8840 prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
8841 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_BACKDRAW);
8843 prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
8845 prop, NC_SPACE | ND_SPACE_NODE_VIEW, "rna_SpaceNodeEditor_show_backdrop_update");
8846
8847 prop = RNA_def_property(srna, "selected_node_group", PROP_POINTER, PROP_NONE);
8850 prop, nullptr, nullptr, nullptr, "rna_SpaceNodeEditor_selected_node_group_poll");
8852 RNA_def_property_ui_text(prop, "Selected Node Group", "Node group to edit");
8853 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
8854
8855 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
8856 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_SHOW_GPENCIL);
8857 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
8859
8860 prop = RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
8861 RNA_def_property_float_sdna(prop, nullptr, "zoom");
8863 RNA_def_property_range(prop, 0.01f, FLT_MAX);
8864 RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
8865 RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor");
8867
8868 prop = RNA_def_property(srna, "backdrop_offset", PROP_FLOAT, PROP_XYZ);
8869 RNA_def_property_float_sdna(prop, nullptr, "xof");
8870 RNA_def_property_array(prop, 2);
8871 RNA_def_property_ui_text(prop, "Backdrop Offset", "Backdrop offset");
8873
8874 prop = RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
8875 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
8876 RNA_def_property_enum_items(prop, backdrop_channels_items);
8877 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to draw");
8879 /* the mx/my "cursor" in the node editor is used only by operators to store the mouse position */
8880 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
8881 RNA_def_property_array(prop, 2);
8883 "rna_SpaceNodeEditor_cursor_location_get",
8884 "rna_SpaceNodeEditor_cursor_location_set",
8885 nullptr);
8886 RNA_def_property_ui_text(prop, "Cursor Location", "Location for adding new nodes");
8888
8889 prop = RNA_def_property(srna, "insert_offset_direction", PROP_ENUM, PROP_NONE);
8890 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "insert_ofs_dir");
8891 RNA_def_property_enum_items(prop, insert_ofs_dir_items);
8893 prop, "Auto-offset Direction", "Direction to offset nodes on insertion");
8895
8896 /* Gizmo Toggles. */
8897 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
8898 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SNODE_GIZMO_HIDE);
8899 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
8901
8902 prop = RNA_def_property(srna, "show_gizmo_active_node", PROP_BOOLEAN, PROP_NONE);
8904 prop, nullptr, "gizmo_flag", SNODE_GIZMO_HIDE_ACTIVE_NODE);
8905 RNA_def_property_ui_text(prop, "Active Node", "Context sensitive gizmo for the active node");
8907
8908 /* Overlays */
8909 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
8911 RNA_def_property_struct_type(prop, "SpaceNodeOverlay");
8912 RNA_def_property_pointer_funcs(prop, "rna_SpaceNode_overlay_get", nullptr, nullptr, nullptr);
8914 prop, "Overlay Settings", "Settings for display of overlays in the Node Editor");
8915
8916 prop = RNA_def_property(srna, "supports_previews", PROP_BOOLEAN, PROP_NONE);
8917 RNA_def_property_boolean_funcs(prop, "rna_SpaceNode_supports_previews", nullptr);
8920 "Supports Previews",
8921 "Whether the node editor's type supports displaying node previews");
8922
8924 RNA_api_space_node(srna);
8925}
8926
8928{
8929 StructRNA *srna;
8930 PropertyRNA *prop;
8931
8932 srna = RNA_def_struct(brna, "SpaceClipOverlay", nullptr);
8933 RNA_def_struct_sdna(srna, "SpaceClip");
8934 RNA_def_struct_nested(brna, srna, "SpaceClipEditor");
8935 RNA_def_struct_path_func(srna, "rna_SpaceClipOverlay_path");
8937 srna, "Overlay Settings", "Settings for display of overlays in the Movie Clip editor");
8938
8939 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
8940 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SC_SHOW_OVERLAYS);
8941 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like cursor and annotations");
8943
8944 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
8945 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SC_SHOW_CURSOR);
8946 RNA_def_property_ui_text(prop, "Show Overlays", "Display 2D cursor");
8948}
8949
8951{
8952 StructRNA *srna;
8953 PropertyRNA *prop;
8954
8955 static const EnumPropertyItem view_items[] = {
8956 {SC_VIEW_CLIP, "CLIP", ICON_SEQUENCE, "Clip", "Show editing clip preview"},
8957 {SC_VIEW_GRAPH, "GRAPH", ICON_GRAPH, "Graph", "Show graph view for active element"},
8959 "DOPESHEET",
8960 ICON_ACTION,
8961 "Dope Sheet",
8962 "Dope Sheet view for tracking data"},
8963 {0, nullptr, 0, nullptr, nullptr},
8964 };
8965
8966 static const EnumPropertyItem annotation_source_items[] = {
8968 "CLIP",
8969 0,
8970 "Clip",
8971 "Show annotation data-block which belongs to movie clip"},
8973 "TRACK",
8974 0,
8975 "Track",
8976 "Show annotation data-block which belongs to active track"},
8977 {0, nullptr, 0, nullptr, nullptr},
8978 };
8979
8980 static const EnumPropertyItem pivot_items[] = {
8982 "BOUNDING_BOX_CENTER",
8983 ICON_PIVOT_BOUNDBOX,
8984 "Bounding Box Center",
8985 "Pivot around bounding box center of selected object(s)"},
8986 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
8988 "INDIVIDUAL_ORIGINS",
8989 ICON_PIVOT_INDIVIDUAL,
8990 "Individual Origins",
8991 "Pivot around each object's own origin"},
8993 "MEDIAN_POINT",
8994 ICON_PIVOT_MEDIAN,
8995 "Median Point",
8996 "Pivot around the median point of selected objects"},
8997 {0, nullptr, 0, nullptr, nullptr},
8998 };
8999
9000 srna = RNA_def_struct(brna, "SpaceClipEditor", "Space");
9001 RNA_def_struct_sdna(srna, "SpaceClip");
9002 RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data");
9003
9005 (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) |
9006 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
9007
9008 /* movieclip */
9009 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
9011 RNA_def_property_ui_text(prop, "Movie Clip", "Movie clip displayed and edited in this space");
9012 RNA_def_property_pointer_funcs(prop, nullptr, "rna_SpaceClipEditor_clip_set", nullptr, nullptr);
9015
9016 /* clip user */
9017 prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
9019 RNA_def_property_struct_type(prop, "MovieClipUser");
9020 RNA_def_property_pointer_sdna(prop, nullptr, "user");
9022 prop, "Movie Clip User", "Parameters defining which frame of the movie clip is displayed");
9024
9025 /* mask */
9026 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_mask_set");
9027
9028 /* mode */
9029 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
9030 RNA_def_property_enum_sdna(prop, nullptr, "mode");
9032 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
9034 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_clip_mode_update");
9035
9036 /* view */
9037 prop = RNA_def_property(srna, "view", PROP_ENUM, PROP_NONE);
9038 RNA_def_property_enum_sdna(prop, nullptr, "view");
9039 RNA_def_property_enum_items(prop, view_items);
9040 RNA_def_property_ui_text(prop, "View", "Type of the clip editor view");
9042 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_view_type_update");
9043
9044 /* show pattern */
9045 prop = RNA_def_property(srna, "show_marker_pattern", PROP_BOOLEAN, PROP_NONE);
9046 RNA_def_property_ui_text(prop, "Show Marker Pattern", "Show pattern boundbox for markers");
9049
9050 /* show search */
9051 prop = RNA_def_property(srna, "show_marker_search", PROP_BOOLEAN, PROP_NONE);
9052 RNA_def_property_ui_text(prop, "Show Marker Search", "Show search boundbox for markers");
9055
9056 /* lock to selection */
9057 prop = RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE);
9059 prop, "Lock to Selection", "Lock viewport to selected markers during playback");
9060 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_LOCK_SELECTION);
9062 prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_lock_selection_update");
9063
9064 /* lock to time cursor */
9065 prop = RNA_def_property(srna, "lock_time_cursor", PROP_BOOLEAN, PROP_NONE);
9067 prop, "Lock to Time Cursor", "Lock curves view to time cursor during playback and tracking");
9068 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_LOCK_TIMECURSOR);
9070
9071 /* show markers paths */
9072 prop = RNA_def_property(srna, "show_track_path", PROP_BOOLEAN, PROP_NONE);
9073 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_TRACK_PATH);
9074 RNA_def_property_ui_text(prop, "Show Track Path", "Show path of how track moves");
9076
9077 /* path length */
9078 prop = RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
9079 RNA_def_property_int_sdna(prop, nullptr, "path_length");
9081 RNA_def_property_ui_text(prop, "Path Length", "Length of displaying path, in frames");
9083
9084 /* show tiny markers */
9085 prop = RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE);
9086 RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers in a more compact manner");
9087 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_TINY_MARKER);
9089
9090 /* show bundles */
9091 prop = RNA_def_property(srna, "show_bundles", PROP_BOOLEAN, PROP_NONE);
9092 RNA_def_property_ui_text(prop, "Show Bundles", "Show projection of 3D markers into footage");
9093 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_BUNDLES);
9095
9096 /* mute footage */
9097 prop = RNA_def_property(srna, "use_mute_footage", PROP_BOOLEAN, PROP_NONE);
9098 RNA_def_property_ui_text(prop, "Mute Footage", "Mute footage and show black background instead");
9099 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_MUTE_FOOTAGE);
9101
9102 /* hide disabled */
9103 prop = RNA_def_property(srna, "show_disabled", PROP_BOOLEAN, PROP_NONE);
9104 RNA_def_property_ui_text(prop, "Show Disabled", "Show disabled tracks from the footage");
9107
9108 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
9109 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_METADATA);
9110 RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of clip");
9112
9113 /* scopes */
9114 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
9115 RNA_def_property_pointer_sdna(prop, nullptr, "scopes");
9116 RNA_def_property_struct_type(prop, "MovieClipScopes");
9117 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize movie clip statistics");
9118
9119 /* show names */
9120 prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
9121 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_NAMES);
9122 RNA_def_property_ui_text(prop, "Show Names", "Show track names and status");
9124
9125 /* show grid */
9126 prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
9127 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_GRID);
9128 RNA_def_property_ui_text(prop, "Show Grid", "Show grid showing lens distortion");
9130
9131 /* show stable */
9132 prop = RNA_def_property(srna, "show_stable", PROP_BOOLEAN, PROP_NONE);
9133 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_STABLE);
9135 prop, "Show Stable", "Show stable footage in editor (if stabilization is enabled)");
9137
9138 /* manual calibration */
9139 prop = RNA_def_property(srna, "use_manual_calibration", PROP_BOOLEAN, PROP_NONE);
9141 RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers");
9143
9144 /* show annotation */
9145 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
9146 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_ANNOTATION);
9147 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
9149
9150 /* show filters */
9151 prop = RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE);
9152 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_FILTERS);
9153 RNA_def_property_ui_text(prop, "Show Filters", "Show filters for graph editor");
9155
9156 /* show graph_frames */
9157 prop = RNA_def_property(srna, "show_graph_frames", PROP_BOOLEAN, PROP_NONE);
9160 prop,
9161 "Show Frames",
9162 "Show curve for per-frame average error (camera motion should be solved first)");
9164
9165 /* show graph tracks motion */
9166 prop = RNA_def_property(srna, "show_graph_tracks_motion", PROP_BOOLEAN, PROP_NONE);
9169 prop, "Show Tracks Motion", "Display speed curves for the selected tracks");
9171
9172 /* show graph tracks motion */
9173 prop = RNA_def_property(srna, "show_graph_tracks_error", PROP_BOOLEAN, PROP_NONE);
9176 prop, "Show Tracks Error", "Display the reprojection error curve for selected tracks");
9178
9179 /* show_only_selected */
9180 prop = RNA_def_property(srna, "show_graph_only_selected", PROP_BOOLEAN, PROP_NONE);
9183 prop, "Only Show Selected", "Only include channels relating to selected objects and data");
9184 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
9186
9187 /* show_hidden */
9188 prop = RNA_def_property(srna, "show_graph_hidden", PROP_BOOLEAN, PROP_NONE);
9191 prop, "Display Hidden", "Include channels from objects/bone that are not visible");
9192 RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
9194
9195 /* ** channels ** */
9196
9197 /* show_red_channel */
9198 prop = RNA_def_property(srna, "show_red_channel", PROP_BOOLEAN, PROP_NONE);
9200 prop, nullptr, "postproc_flag", int(MovieClipPostprocFlag::DisableRed));
9201 RNA_def_property_ui_text(prop, "Show Red Channel", "Show red channel in the frame");
9203
9204 /* show_green_channel */
9205 prop = RNA_def_property(srna, "show_green_channel", PROP_BOOLEAN, PROP_NONE);
9207 prop, nullptr, "postproc_flag", int(MovieClipPostprocFlag::DisableGreen));
9208 RNA_def_property_ui_text(prop, "Show Green Channel", "Show green channel in the frame");
9210
9211 /* show_blue_channel */
9212 prop = RNA_def_property(srna, "show_blue_channel", PROP_BOOLEAN, PROP_NONE);
9214 prop, nullptr, "postproc_flag", int(MovieClipPostprocFlag::DisableBlue));
9215 RNA_def_property_ui_text(prop, "Show Blue Channel", "Show blue channel in the frame");
9217
9218 /* preview_grayscale */
9219 prop = RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
9221 prop, nullptr, "postproc_flag", int(MovieClipPostprocFlag::PreviewGray));
9222 RNA_def_property_ui_text(prop, "Grayscale", "Display frame in grayscale mode");
9224
9225 /* timeline */
9226 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
9227 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_SECONDS);
9228 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
9230
9231 /* grease pencil source */
9232 prop = RNA_def_property(srna, "annotation_source", PROP_ENUM, PROP_NONE);
9233 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_src");
9234 RNA_def_property_enum_items(prop, annotation_source_items);
9235 RNA_def_property_ui_text(prop, "Annotation Source", "Where the annotation comes from");
9238
9239 /* transform */
9240 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
9241 RNA_def_property_float_sdna(prop, nullptr, "cursor");
9242 RNA_def_property_array(prop, 2);
9243 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
9245
9246 /* pivot point */
9247 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
9248 RNA_def_property_enum_sdna(prop, nullptr, "around");
9249 RNA_def_property_enum_items(prop, pivot_items);
9250 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
9252
9253 /* Gizmo Toggles. */
9254 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
9255 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SCLIP_GIZMO_HIDE);
9256 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
9258
9259 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
9261 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
9263
9264 /* Zoom. */
9265 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
9267 "rna_SpaceClipEditor_zoom_percentage_get",
9268 "rna_SpaceClipEditor_zoom_percentage_set",
9269 nullptr);
9270 RNA_def_property_float_default(prop, 100.0);
9271 RNA_def_property_range(prop, .4f, 80000);
9272 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
9273 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
9274
9275 /* Overlays */
9276 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
9278 RNA_def_property_struct_type(prop, "SpaceClipOverlay");
9279 RNA_def_property_pointer_funcs(prop, "rna_SpaceClip_overlay_get", nullptr, nullptr, nullptr);
9281 prop, "Overlay Settings", "Settings for display of overlays in the Movie Clip editor");
9282
9284}
9285
9287{
9288 StructRNA *srna;
9289 PropertyRNA *prop;
9290
9291 srna = RNA_def_struct(brna, "SpreadsheetColumnID", nullptr);
9292 RNA_def_struct_sdna(srna, "SpreadsheetColumnID");
9294 srna, "Spreadsheet Column ID", "Data used to identify a spreadsheet column");
9295
9296 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
9297 RNA_def_property_ui_text(prop, "Column Name", "");
9299}
9300
9302{
9303 StructRNA *srna;
9304 PropertyRNA *prop;
9305
9306 static const EnumPropertyItem data_type_items[] = {
9307 {SPREADSHEET_VALUE_TYPE_INT32, "INT32", ICON_NONE, "Integer", ""},
9308 {SPREADSHEET_VALUE_TYPE_FLOAT, "FLOAT", ICON_NONE, "Float", ""},
9309 {SPREADSHEET_VALUE_TYPE_BOOL, "BOOLEAN", ICON_NONE, "Boolean", ""},
9310 {SPREADSHEET_VALUE_TYPE_INSTANCES, "INSTANCES", ICON_NONE, "Instances", ""},
9311 {0, nullptr, 0, nullptr, nullptr},
9312 };
9313
9314 srna = RNA_def_struct(brna, "SpreadsheetColumn", nullptr);
9315 RNA_def_struct_sdna(srna, "SpreadsheetColumn");
9317 srna, "Spreadsheet Column", "Persistent data associated with a spreadsheet column");
9318
9319 prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);
9320 RNA_def_property_enum_sdna(prop, nullptr, "data_type");
9321 RNA_def_property_enum_items(prop, data_type_items);
9323 prop, "Data Type", "The data type of the corresponding column visible in the spreadsheet");
9326
9328
9329 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
9330 RNA_def_property_struct_type(prop, "SpreadsheetColumnID");
9332 prop, "ID", "Data used to identify the corresponding data from the data source");
9333}
9334
9336{
9337 StructRNA *srna;
9338 PropertyRNA *prop;
9339
9340 srna = RNA_def_struct(brna, "SpreadsheetTableID", nullptr);
9342 srna, "Spreadsheet Table ID", "Data used to identify a spreadsheet table");
9343 RNA_def_struct_refine_func(srna, "rna_SpreadsheetTableID_refine");
9344
9345 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
9348 RNA_def_property_ui_text(prop, "Type", "The type of the table identifier");
9349}
9350
9352{
9353 StructRNA *srna;
9354 PropertyRNA *prop;
9355
9356 /* The properties below are read-only, because they are used as key for a table. */
9357 srna = RNA_def_struct(brna, "SpreadsheetTableIDGeometry", "SpreadsheetTableID");
9358
9359 prop = RNA_def_property(srna, "object_eval_state", PROP_ENUM, PROP_NONE);
9362 RNA_def_property_ui_text(prop, "Object Evaluation State", "");
9363
9364 prop = RNA_def_property(srna, "geometry_component_type", PROP_ENUM, PROP_NONE);
9368 prop, "Geometry Component", "Part of the geometry to display data from");
9369
9370 prop = RNA_def_property(srna, "attribute_domain", PROP_ENUM, PROP_NONE);
9373 RNA_def_property_ui_text(prop, "Attribute Domain", "Attribute domain to display");
9374
9375 prop = RNA_def_property(srna, "geometry_item_type", PROP_ENUM, PROP_NONE);
9378 RNA_def_property_ui_text(prop, "Geometry Item Type", "Item Type");
9379
9380 prop = RNA_def_property(srna, "viewer_path", PROP_POINTER, PROP_NONE);
9381 RNA_def_property_ui_text(prop, "Viewer Path", "Path to the data that is displayed");
9382
9383 prop = RNA_def_property(srna, "layer_index", PROP_INT, PROP_NONE);
9385 RNA_def_property_ui_text(prop, "Layer Index", "Index of the Grease Pencil layer");
9386}
9387
9389{
9390 StructRNA *srna;
9391 PropertyRNA *prop;
9392
9396
9397 srna = RNA_def_struct(brna, "SpreadsheetTable", nullptr);
9398 RNA_def_struct_ui_text(srna, "Spreadsheet Table", "Persistent data associated with a table");
9399
9400 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
9401 RNA_def_property_struct_type(prop, "SpreadsheetTableID");
9402 RNA_def_property_ui_text(prop, "ID", "Data used to identify the table");
9403
9404 prop = RNA_def_property(srna, "columns", PROP_COLLECTION, PROP_NONE);
9405 RNA_def_property_struct_type(prop, "SpreadsheetColumn");
9407 "rna_iterator_SpreadsheetTable_columns_begin",
9408 "rna_iterator_array_next",
9409 "rna_iterator_array_end",
9410 "rna_iterator_array_dereference_get",
9411 "rna_iterator_SpreadsheetTable_columns_length",
9412 nullptr,
9413 nullptr,
9414 nullptr);
9415 RNA_def_property_ui_text(prop, "Columns", "Columns within the table");
9416}
9417
9419{
9420 StructRNA *srna;
9421 PropertyRNA *prop;
9422
9423 srna = RNA_def_struct(brna, "SpreadsheetTables", nullptr);
9424 RNA_def_struct_sdna(srna, "SpaceSpreadsheet");
9426 "Spreadsheet Tables",
9427 "Active table and persisted state of previously displayed tables");
9428
9429 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
9430 RNA_def_property_struct_type(prop, "SpreadsheetTable");
9432 prop, "rna_SpreadsheetTables_active_get", nullptr, nullptr, nullptr);
9433 RNA_def_property_ui_text(prop, "Active Table", "");
9434}
9435
9437{
9438 StructRNA *srna;
9439 PropertyRNA *prop;
9440
9441 static const EnumPropertyItem rule_operation_items[] = {
9442 {SPREADSHEET_ROW_FILTER_EQUAL, "EQUAL", ICON_NONE, "Equal To", ""},
9443 {SPREADSHEET_ROW_FILTER_GREATER, "GREATER", ICON_NONE, "Greater Than", ""},
9444 {SPREADSHEET_ROW_FILTER_LESS, "LESS", ICON_NONE, "Less Than", ""},
9445 {0, nullptr, 0, nullptr, nullptr},
9446 };
9447
9448 srna = RNA_def_struct(brna, "SpreadsheetRowFilter", nullptr);
9449 RNA_def_struct_sdna(srna, "SpreadsheetRowFilter");
9450 RNA_def_struct_ui_text(srna, "Spreadsheet Row Filter", "");
9451
9452 prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
9454 RNA_def_property_ui_text(prop, "Enabled", "");
9455 RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1);
9457
9458 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
9460 RNA_def_property_ui_text(prop, "Show Expanded", "");
9461 RNA_def_property_ui_icon(prop, ICON_RIGHTARROW, 1);
9463
9464 prop = RNA_def_property(srna, "column_name", PROP_STRING, PROP_NONE);
9465 RNA_def_property_ui_text(prop, "Column Name", "");
9467
9468 prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
9469 RNA_def_property_enum_items(prop, rule_operation_items);
9470 RNA_def_property_ui_text(prop, "Operation", "");
9472
9473 prop = RNA_def_property(srna, "value_float", PROP_FLOAT, PROP_NONE);
9474 RNA_def_property_ui_text(prop, "Float Value", "");
9476
9477 prop = RNA_def_property(srna, "value_float2", PROP_FLOAT, PROP_NONE);
9478 RNA_def_property_array(prop, 2);
9479 RNA_def_property_ui_text(prop, "2D Vector Value", "");
9481
9482 prop = RNA_def_property(srna, "value_float3", PROP_FLOAT, PROP_NONE);
9483 RNA_def_property_array(prop, 3);
9484 RNA_def_property_ui_text(prop, "Vector Value", "");
9486
9487 prop = RNA_def_property(srna, "value_float4", PROP_FLOAT, PROP_NONE);
9488 RNA_def_property_array(prop, 4);
9489 RNA_def_property_ui_text(prop, "4D Vector Value", "");
9491
9492 prop = RNA_def_property(srna, "value_color", PROP_FLOAT, PROP_NONE);
9493 RNA_def_property_array(prop, 4);
9494 RNA_def_property_ui_text(prop, "Color Value", "");
9496
9497 prop = RNA_def_property(srna, "value_string", PROP_STRING, PROP_NONE);
9498 RNA_def_property_ui_text(prop, "Text Value", "");
9500
9501 prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
9502 RNA_def_property_ui_text(prop, "Threshold", "How close float values need to be to be equal");
9503 RNA_def_property_range(prop, 0.0, FLT_MAX);
9505
9506 prop = RNA_def_property(srna, "value_int", PROP_INT, PROP_NONE);
9507 RNA_def_property_int_sdna(prop, nullptr, "value_int");
9508 RNA_def_property_ui_text(prop, "Integer Value", "");
9510
9511 prop = RNA_def_property(srna, "value_int8", PROP_INT, PROP_NONE);
9512 RNA_def_property_int_sdna(prop, nullptr, "value_int");
9513 RNA_def_property_range(prop, -128, 127);
9514 RNA_def_property_ui_text(prop, "8-Bit Integer Value", "");
9516
9517 prop = RNA_def_property(srna, "value_int2", PROP_INT, PROP_NONE);
9518 RNA_def_property_array(prop, 2);
9519 RNA_def_property_ui_text(prop, "2D Vector Value", "");
9521
9522 prop = RNA_def_property(srna, "value_int3", PROP_INT, PROP_NONE);
9523 RNA_def_property_array(prop, 3);
9524 RNA_def_property_ui_text(prop, "3D Vector Value", "");
9526
9527 prop = RNA_def_property(srna, "value_boolean", PROP_BOOLEAN, PROP_NONE);
9529 RNA_def_property_ui_text(prop, "Boolean Value", "");
9531}
9532
9534 {VIEWER_PATH_ELEM_TYPE_ID, "ID", ICON_NONE, "ID", ""},
9535 {VIEWER_PATH_ELEM_TYPE_MODIFIER, "MODIFIER", ICON_NONE, "Modifier", ""},
9536 {VIEWER_PATH_ELEM_TYPE_GROUP_NODE, "GROUP_NODE", ICON_NONE, "Group Node", ""},
9537 {VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE, "SIMULATION_ZONE", ICON_NONE, "Simulation Zone", ""},
9538 {VIEWER_PATH_ELEM_TYPE_VIEWER_NODE, "VIEWER_NODE", ICON_NONE, "Viewer Node", ""},
9539 {VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE, "REPEAT_ZONE", ICON_NONE, "Repeat", ""},
9541 "FOREACH_GEOMETRY_ELEMENT_ZONE",
9542 ICON_NONE,
9543 "For Each Geometry Element",
9544 ""},
9545 {VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE, "EVALUATE_CLOSURE", ICON_NONE, "EvaluateClosure", ""},
9546 {0, nullptr, 0, nullptr, nullptr},
9547};
9548
9550{
9551 StructRNA *srna;
9552 PropertyRNA *prop;
9553
9554 srna = RNA_def_struct(brna, "ViewerPathElem", nullptr);
9555 RNA_def_struct_ui_text(srna, "Viewer Path Element", "Element of a viewer path");
9556 RNA_def_struct_refine_func(srna, "rna_viewer_path_elem_refine");
9557
9558 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
9560 RNA_def_property_ui_text(prop, "Type", "Type of the path element");
9562
9563 prop = RNA_def_property(srna, "ui_name", PROP_STRING, PROP_NONE);
9565 prop, "UI Name", "Name that can be displayed in the UI for this element");
9567}
9568
9570{
9571 StructRNA *srna;
9572 PropertyRNA *prop;
9573
9574 srna = RNA_def_struct(brna, "IDViewerPathElem", "ViewerPathElem");
9575
9576 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
9577 RNA_def_property_ui_text(prop, "ID", "");
9578}
9579
9581{
9582 StructRNA *srna;
9583 PropertyRNA *prop;
9584
9585 srna = RNA_def_struct(brna, "ModifierViewerPathElem", "ViewerPathElem");
9586
9587 prop = RNA_def_property(srna, "modifier_uid", PROP_INT, PROP_NONE);
9588 RNA_def_property_ui_text(prop, "Modifier UID", "The persistent UID of the modifier");
9589}
9590
9592{
9593 StructRNA *srna;
9594 PropertyRNA *prop;
9595
9596 srna = RNA_def_struct(brna, "GroupNodeViewerPathElem", "ViewerPathElem");
9597
9598 prop = RNA_def_property(srna, "node_id", PROP_INT, PROP_NONE);
9599 RNA_def_property_ui_text(prop, "Node ID", "");
9600}
9601
9603{
9604 StructRNA *srna;
9605 PropertyRNA *prop;
9606
9607 srna = RNA_def_struct(brna, "SimulationZoneViewerPathElem", "ViewerPathElem");
9608
9609 prop = RNA_def_property(srna, "sim_output_node_id", PROP_INT, PROP_NONE);
9610 RNA_def_property_ui_text(prop, "Simulation Output Node ID", "");
9611}
9612
9614{
9615 StructRNA *srna;
9616 PropertyRNA *prop;
9617
9618 srna = RNA_def_struct(brna, "RepeatZoneViewerPathElem", "ViewerPathElem");
9619
9620 prop = RNA_def_property(srna, "repeat_output_node_id", PROP_INT, PROP_NONE);
9621 RNA_def_property_ui_text(prop, "Repeat Output Node ID", "");
9622}
9623
9625{
9626 StructRNA *srna;
9627 PropertyRNA *prop;
9628
9629 srna = RNA_def_struct(brna, "ForeachGeometryElementZoneViewerPathElem", "ViewerPathElem");
9630
9631 prop = RNA_def_property(srna, "zone_output_node_id", PROP_INT, PROP_NONE);
9632 RNA_def_property_ui_text(prop, "Zone Output Node ID", "");
9633}
9634
9636{
9637 StructRNA *srna;
9638 PropertyRNA *prop;
9639
9640 srna = RNA_def_struct(brna, "EvaluateClosureNodeViewerPathElem", "ViewerPathElem");
9641
9642 prop = RNA_def_property(srna, "evaluate_node_id", PROP_INT, PROP_NONE);
9643 RNA_def_property_ui_text(prop, "Evaluate Node ID", "");
9644
9645 prop = RNA_def_property(srna, "source_output_node_id", PROP_INT, PROP_NONE);
9646 RNA_def_property_ui_text(prop, "Closure Node ID", "");
9647
9648 prop = RNA_def_property(srna, "source_node_tree", PROP_POINTER, PROP_NONE);
9649 RNA_def_property_ui_text(prop, "Source Tree", "");
9650}
9651
9653{
9654 StructRNA *srna;
9655 PropertyRNA *prop;
9656
9657 srna = RNA_def_struct(brna, "ViewerNodeViewerPathElem", "ViewerPathElem");
9658
9659 prop = RNA_def_property(srna, "node_id", PROP_INT, PROP_NONE);
9660 RNA_def_property_ui_text(prop, "Node ID", "");
9661}
9662
9664{
9665 StructRNA *srna;
9666 PropertyRNA *prop;
9667
9677
9678 srna = RNA_def_struct(brna, "ViewerPath", nullptr);
9679 RNA_def_struct_ui_text(srna, "Viewer Path", "Path to data that is viewed");
9680
9681 prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE);
9682 RNA_def_property_struct_type(prop, "ViewerPathElem");
9683 RNA_def_property_ui_text(prop, "Viewer Path", nullptr);
9684}
9685
9687{
9688 PropertyRNA *prop;
9689 StructRNA *srna;
9690
9693
9694 srna = RNA_def_struct(brna, "SpaceSpreadsheet", "Space");
9695 RNA_def_struct_ui_text(srna, "Space Spreadsheet", "Spreadsheet space data");
9696
9698 (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) |
9699 (1 << RGN_TYPE_CHANNELS) | (1 << RGN_TYPE_FOOTER));
9700
9701 prop = RNA_def_property(srna, "is_pinned", PROP_BOOLEAN, PROP_NONE);
9703 RNA_def_property_ui_text(prop, "Is Pinned", "Context path is pinned");
9705
9706 prop = RNA_def_property(srna, "show_internal_attributes", PROP_BOOLEAN, PROP_NONE);
9709 prop,
9710 "Show Internal Attributes",
9711 "Display attributes with names starting with a period that are meant for internal use");
9713
9714 prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
9715 RNA_def_property_boolean_sdna(prop, nullptr, "filter_flag", SPREADSHEET_FILTER_ENABLE);
9716 RNA_def_property_ui_text(prop, "Use Filter", "");
9718
9719 prop = RNA_def_property(srna, "viewer_path", PROP_POINTER, PROP_NONE);
9720 RNA_def_property_pointer_sdna(prop, nullptr, "geometry_id.viewer_path");
9722 prop, "Viewer Path", "Path to the data that is displayed in the spreadsheet");
9723
9724 prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
9727 prop, "Show Only Selected", "Only include rows that correspond to selected elements");
9728 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
9730
9731 prop = RNA_def_property(srna, "geometry_item_type", PROP_ENUM, PROP_NONE);
9732 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.geometry_item_type");
9734 RNA_def_property_ui_text(prop, "Geometry Item Type", "Item Type");
9736
9737 prop = RNA_def_property(srna, "geometry_component_type", PROP_ENUM, PROP_NONE);
9738 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.geometry_component_type");
9741 prop, "Geometry Component", "Part of the geometry to display data from");
9744 "rna_SpaceSpreadsheet_geometry_component_type_update");
9745
9746 prop = RNA_def_property(srna, "attribute_domain", PROP_ENUM, PROP_NONE);
9747 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.attribute_domain");
9750 prop, nullptr, nullptr, "rna_SpaceSpreadsheet_attribute_domain_itemf");
9751 RNA_def_property_ui_text(prop, "Attribute Domain", "Attribute domain to display");
9753
9754 prop = RNA_def_property(srna, "object_eval_state", PROP_ENUM, PROP_NONE);
9755 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.object_eval_state");
9757 RNA_def_property_ui_text(prop, "Object Evaluation State", "");
9759
9760 prop = RNA_def_property(srna, "tables", PROP_COLLECTION, PROP_NONE);
9761 RNA_def_property_struct_type(prop, "SpreadsheetTable");
9762 RNA_def_property_srna(prop, "SpreadsheetTables");
9764 "rna_iterator_SpaceSpreadsheet_tables_begin",
9765 "rna_iterator_array_next",
9766 "rna_iterator_array_end",
9767 "rna_iterator_array_dereference_get",
9768 "rna_iterator_SpaceSpreadsheet_tables_length",
9769 nullptr,
9770 nullptr,
9771 nullptr);
9773 prop, "Tables", "Persistent data for the tables shown in this spreadsheet editor");
9774
9776
9777 prop = RNA_def_property(srna, "row_filters", PROP_COLLECTION, PROP_NONE);
9778 RNA_def_property_collection_sdna(prop, nullptr, "row_filters", nullptr);
9779 RNA_def_property_struct_type(prop, "SpreadsheetRowFilter");
9780 RNA_def_property_ui_text(prop, "Row Filters", "Filters to remove rows from the displayed data");
9782}
9783
9785{
9786 StructRNA *srna;
9787
9788 srna = RNA_def_struct(brna, "SpaceProject", "Space");
9789 RNA_def_struct_sdna(srna, "SpaceProject");
9790 RNA_def_struct_ui_text(srna, "Space Project", "Project space data");
9791
9793
9794 PropertyRNA *prop;
9795
9796 prop = RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
9799 "rna_SpaceProject_active_section_get",
9800 "rna_SpaceProject_active_section_set",
9801 "rna_SpaceProject_active_section_itemf");
9802 RNA_def_property_ui_text(prop, "Active Section", "Choose the category of options to display");
9803}
9804
9835
9836} // namespace blender
9837
9838#endif
Main runtime representation of an asset.
#define G_MAIN
#define M_PI
#define FILE_MAXFILE
#define SNPRINTF(dst, format,...)
#define BLT_I18NCONTEXT_RENDER_LAYER
#define BLT_I18NCONTEXT_EDITOR_VIEW3D
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_TEXT
#define CTX_N_(context, msgid)
#define BLT_I18NCONTEXT_ID_ID
#define BLT_I18NCONTEXT_ID_MOVIECLIP
#define BLT_I18NCONTEXT_EDITOR_PYTHON_CONSOLE
#define BLT_I18NCONTEXT_ID_MESH
#define BLT_I18NCONTEXT_EDITOR_FILEBROWSER
#define FILTER_ID_GD_LEGACY
Definition DNA_ID.h:1204
#define FILTER_ID_OB
Definition DNA_ID.h:1216
#define FILTER_ID_MC
Definition DNA_ID.h:1212
#define FILTER_ID_SPK
Definition DNA_ID.h:1220
#define FILTER_ID_CF
Definition DNA_ID.h:1227
#define FILTER_ID_AC
Definition DNA_ID.h:1199
#define FILTER_ID_MA
Definition DNA_ID.h:1210
#define FILTER_ID_CA
Definition DNA_ID.h:1202
#define FILTER_ID_SO
Definition DNA_ID.h:1221
#define FILTER_ID_PT
Definition DNA_ID.h:1231
#define FILTER_ID_CU_LEGACY
Definition DNA_ID.h:1203
#define FILTER_ID_BR
Definition DNA_ID.h:1201
#define FILTER_ID_WS
Definition DNA_ID.h:1228
#define FILTER_ID_MB
Definition DNA_ID.h:1211
#define FILTER_ID_VF
Definition DNA_ID.h:1224
#define FILTER_ID_LA
Definition DNA_ID.h:1207
#define FILTER_ID_GR
Definition DNA_ID.h:1205
#define FILTER_ID_TE
Definition DNA_ID.h:1222
#define FILTER_ID_LT
Definition DNA_ID.h:1209
#define FILTER_ID_LS
Definition DNA_ID.h:1208
#define FILTER_ID_PA
Definition DNA_ID.h:1226
#define FILTER_ID_CV
Definition DNA_ID.h:1230
#define FILTER_ID_ME
Definition DNA_ID.h:1213
#define FILTER_ID_AR
Definition DNA_ID.h:1200
#define FILTER_ID_MSK
Definition DNA_ID.h:1214
#define INDEX_ID_MAX
Definition DNA_ID.h:1362
#define FILTER_ID_PC
Definition DNA_ID.h:1218
#define FILTER_ID_PAL
Definition DNA_ID.h:1217
#define FILTER_ID_IM
Definition DNA_ID.h:1206
#define FILTER_ID_SCE
Definition DNA_ID.h:1219
#define FILTER_ID_LP
Definition DNA_ID.h:1229
#define FILTER_ID_VO
Definition DNA_ID.h:1232
#define FILTER_ID_WO
Definition DNA_ID.h:1225
#define FILTER_ID_NT
Definition DNA_ID.h:1215
#define FILTER_ID_TXT
Definition DNA_ID.h:1223
#define MAX_NAME
Definition DNA_defs.h:63
Object is a sort of wrapper for general info.
#define UI_SCALE_FAC
#define UUID_STRING_SIZE
#define RV3D_VIEW_IS_AXIS(view)
#define RV3D_CAMZOOM_MAX
#define RV3D_CAMZOOM_MIN
#define ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS
#define RNA_MAX_ARRAY_DIMENSION
Definition RNA_define.hh:29
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:272
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition RNA_types.hh:759
#define C
Definition RandGen.cpp:29
#define UI_PANEL_CATEGORY_MIN_WIDTH
#define V2D_LOCK_SET
Definition UI_view2d.hh:108
#define ND_SEQUENCER
Definition WM_types.hh:456
#define NC_WORLD
Definition WM_types.hh:400
#define ND_SHADING
Definition WM_types.hh:520
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:578
#define NC_WINDOW
Definition WM_types.hh:388
#define NC_NODE
Definition WM_types.hh:407
#define NC_GEOM
Definition WM_types.hh:406
#define ND_DATA
Definition WM_types.hh:552
#define ND_SPACE_DOPESHEET
Definition WM_types.hh:576
#define ND_SPACE_NLA
Definition WM_types.hh:577
#define ND_SPACE_NODE
Definition WM_types.hh:569
#define ND_DISPLAY
Definition WM_types.hh:534
#define NC_MOVIECLIP
Definition WM_types.hh:410
#define ND_SPACE_PROPERTIES
Definition WM_types.hh:572
#define NC_SCENE
Definition WM_types.hh:391
#define ND_SPACE_NODE_VIEW
Definition WM_types.hh:579
#define ND_NODES
Definition WM_types.hh:455
#define ND_TOOLSETTINGS
Definition WM_types.hh:468
#define ND_SPACE_IMAGE
Definition WM_types.hh:565
#define NA_EDITED
Definition WM_types.hh:634
#define ND_SPACE_GRAPH
Definition WM_types.hh:575
#define NC_TEXT
Definition WM_types.hh:399
#define NC_MATERIAL
Definition WM_types.hh:393
#define NC_LAMP
Definition WM_types.hh:395
#define NC_IMAGE
Definition WM_types.hh:397
#define ND_SPACE_CLIP
Definition WM_types.hh:582
#define ND_SPACE_INFO_REPORT
Definition WM_types.hh:563
#define ND_SPACE_TIME
Definition WM_types.hh:574
#define NC_TEXTURE
Definition WM_types.hh:394
#define ND_SPACE_TEXT
Definition WM_types.hh:573
#define ND_SPACE_SPREADSHEET
Definition WM_types.hh:584
#define ND_SPACE_VIEW3D
Definition WM_types.hh:571
#define NS_VIEW3D_SHADING
Definition WM_types.hh:627
#define ND_SPACE_CONSOLE
Definition WM_types.hh:562
#define ND_SPACE_FILE_PARAMS
Definition WM_types.hh:566
#define NC_SPACE
Definition WM_types.hh:405
#define ND_SPACE_OUTLINER
Definition WM_types.hh:570
#define ND_SPACE_FILE_LIST
Definition WM_types.hh:567
volatile int lock
#define BLI_assert_unreachable()
#define UNUSED_VARS(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define ELEM(...)
#define BLI_assert_msg(a, msg)
#define STREQ(a, b)
btScalar max
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
Definition btVector3.h:257
Camera * camera
Definition scene.h:145
constexpr IndexRange()=default
constexpr const char * c_str() const
#define offsetof(t, d)
#define FLT_MAX
#define INT_MAX
#define main()
constexpr T clamp(T, U, U) RET
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
Definition math_dual.h:263
Scene * scene_or_sequencer_scene_from_context(const bContext &C)
int library_reference_to_enum_value(const AssetLibraryReference *library)
AssetLibraryReference library_reference_from_enum_value(int value)
void tree_update(const bContext *C)
Definition node_draw.cc:189
ID * get_current_id(const SpaceSpreadsheet *sspreadsheet)
SpreadsheetTable * get_active_table(SpaceSpreadsheet &sspreadsheet)
bool proxy_build_start(Main *bmain, Scene *scene, Strip *strip, Set< std::string > *processed_paths, bool build_only_on_bad_performance, Vector< ProxyBuildContext * > &r_queue)
Definition proxy.cc:455
ListBaseT< Strip > * active_seqbase_get(const Editing *ed)
Definition sequencer.cc:463
IMB_Proxy_Size rendersize_to_proxysize(eSpaceSeq_Proxy_RenderSize render_size)
Definition proxy.cc:137
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:304
constexpr int MAX_CHANNELS
ProxyJob * ED_seq_proxy_job_get(const bContext *C, wmJob *wm_job)
Definition proxy_job.cc:71
wmJob * ED_seq_proxy_wm_job_get(const bContext *C)
Definition proxy_job.cc:86
void cache_cleanup(Scene *scene, CacheCleanup mode)
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
Definition view2d.cc:1651
void view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
Definition view2d.cc:850
void ED_area_type_hud_ensure(bContext *C, ScrArea *area)
bool view2d_area_supports_sync(ScrArea *area)
Definition view2d.cc:845
BMesh Iterators.
void RE_engine_view_pause_set(RenderEngine *engine, const bool pause)
@ V3D_OVERLAY_HIDE_OBJECT_ORIGINS
@ V3D_OVERLAY_SCULPT_SHOW_MASK
@ V3D_OVERLAY_FADE_INACTIVE
@ V3D_OVERLAY_VIEWER_ATTRIBUTE
@ V3D_OVERLAY_ONION_SKINS
@ V3D_OVERLAY_HIDE_MOTION_PATHS
@ V3D_OVERLAY_SCULPT_SHOW_FACE_SETS
@ V3D_OVERLAY_SCULPT_CURVES_CAGE
@ V3D_OVERLAY_VIEWER_ATTRIBUTE_TEXT
@ V3D_OVERLAY_PERFORMANCE
@ V3D_OVERLAY_HIDE_OBJECT_XTRAS
@ V3D_OVERLAY_SHOW_LIGHT_COLORS
@ V3D_OVERLAY_FACE_ORIENTATION
@ V3D_OVERLAY_BONE_SELECT
@ V3D_OVERLAY_HIDE_CURSOR
void WM_main_add_notifier(uint type, void *reference)
bool ED_node_is_compositor(const SpaceNode *snode)
Definition node_edit.cc:135
static const EnumPropertyItem fileselectparams_display_type_items[]
Definition rna_space.cc:654
UserDef U
Definition blender.cc:58
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
static void rna_def_id_viewer_path_elem(BlenderRNA *brna)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
@ SEQ_RENDER_SIZE_PROXY_75
@ SEQ_RENDER_SIZE_PROXY_50
@ SEQ_RENDER_SIZE_PROXY_100
@ SEQ_RENDER_SIZE_PROXY_25
@ SEQ_RENDER_SIZE_SCENE
@ SI_PIXEL_ROUND_DISABLED
@ SI_PIXEL_ROUND_CORNER
@ SI_PIXEL_ROUND_CENTER
MINLINE void negate_v3_v3(float r[3], const float a[3])
static const EnumPropertyItem rna_enum_space_image_mode_ui_items[]
Definition rna_space.cc:322
static void rna_def_space_text(BlenderRNA *brna)
@ SEQ_GIZMO_HIDE_CONTEXT
@ SEQ_GIZMO_HIDE_NAVIGATE
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
FSMenu * ED_fsmenu_get()
Definition fsmenu.cc:48
@ SO_FILTER_NO_OB_EMPTY
@ SO_FILTER_NO_OB_MATERIAL
@ SO_FILTER_NO_OB_CONSTRAINTS
@ SO_FILTER_NO_OB_SHAPE_KEYS
@ SO_FILTER_NO_ARMATURE_BONE_COLLECTION
@ SO_FILTER_NO_OB_ARMATURE
@ SO_FILTER_NO_CHILDREN
@ SO_FILTER_NO_OB_OTHERS
@ SO_FILTER_NO_OB_MODIFIERS
@ SO_FILTER_NO_OB_GREASE_PENCIL
@ SO_FILTER_NO_VIEW_LAYERS
@ SO_FILTER_OB_STATE_INVERSE
@ SO_FILTER_NO_GREASE_PENCIL_EFFECTS
@ SO_FILTER_NO_POSE_BONES
@ SO_FILTER_NO_OB_CONTENT
@ SO_FILTER_NO_OB_DEFGROUP
@ SO_FILTER_NO_COLLECTION
@ SO_FILTER_SHOW_SYSTEM_OVERRIDES
@ SO_FILTER_NO_OB_CAMERA
@ SO_FILTER_NO_OB_ANIMATION
static void rna_def_spreadsheet_table_id(BlenderRNA *brna)
bool ED_view3d_quat_to_axis_view_and_reset_quat(float quat[4], float epsilon, eRegionView3D_View *r_view, eRegionView3D_ViewAxisRoll *r_view_axis_roll)
@ MASK_OVERLAY_COMBINED
@ MASK_OVERLAY_ALPHACHANNEL
@ COMPOSITION_GUIDES_THIRDS
@ COMPOSITION_GUIDES_GOLDEN
@ COMPOSITION_GUIDES_CENTER_DIAG
@ COMPOSITION_GUIDES_HARMONY_TRI_B
@ COMPOSITION_GUIDES_GOLDEN_TRI_A
@ COMPOSITION_GUIDES_HARMONY_TRI_A
@ COMPOSITION_GUIDES_CENTER
@ COMPOSITION_GUIDES_GOLDEN_TRI_B
@ FILE_ASSET_IMPORT_LINK
@ FILE_ASSET_IMPORT_FOLLOW_PREFS
@ FILE_ASSET_IMPORT_APPEND_REUSE
@ FILE_ASSET_IMPORT_APPEND
@ FILE_ASSET_IMPORT_PACK
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
ScrArea * CTX_wm_area(const bContext *C)
void ED_node_tree_push(ARegion *region, SpaceNode *snode, bNodeTree *ntree, bNode *gnode)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
@ CURVE_HANDLE_SELECTED
static void rna_def_space_userpref(BlenderRNA *brna)
@ STUDIOLIGHT_INTERNAL
@ STUDIOLIGHT_EXTERNAL_FILE
@ STUDIOLIGHT_TYPE_MATCAP
@ STUDIOLIGHT_TYPE_STUDIO
@ STUDIOLIGHT_TYPE_WORLD
const EnumPropertyItem rna_enum_shading_type_items[]
Definition rna_space.cc:484
char * STRNCPY(char(&dst)[N], const char *src)
@ PROPERTIES_SYNC_ALWAYS
@ PROPERTIES_SYNC_NEVER
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
ViewLayer * WM_windows_view_layer_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
@ SNODE_SHADER_LINESTYLE
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void BKE_image_multiview_index(const Image *ima, ImageUser *iuser)
@ SEQ_TIMELINE_ALL_WAVEFORMS
@ SEQ_TIMELINE_SHOW_STRIP_OFFSETS
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SEQ_TIMELINE_MIDDLE_THUMBNAILS
@ SEQ_TIMELINE_NO_WAVEFORMS
@ SEQ_TIMELINE_STRIP_END_THUMBNAILS
@ SEQ_TIMELINE_SHOW_STRIP_RETIMING
@ SEQ_TIMELINE_SHOW_FCURVES
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_THUMBNAILS
@ SEQ_TIMELINE_WAVEFORMS_HALF
@ SEQ_TIMELINE_SHOW_GRID
@ SEQ_TIMELINE_CONTINUOUS_THUMBNAILS
@ SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG
void ED_file_change_dir_ex(bContext *C, ScrArea *area)
Definition filesel.cc:1193
@ SPREADSHEET_FILTER_SELECTED_ONLY
@ SPREADSHEET_FILTER_ENABLE
bool ED_node_is_geometry(const SpaceNode *snode)
Definition node_edit.cc:150
static void rna_def_simulation_zone_viewer_path_elem(BlenderRNA *brna)
const EnumPropertyItem rna_enum_id_type_items[]
Definition rna_ID.cc:33
static void rna_def_spreadsheet_row_filter(BlenderRNA *brna)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Scene * CTX_data_sequencer_scene(const bContext *C)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
const EnumPropertyItem rna_enum_transform_pivot_full_items[]
Definition rna_scene.cc:591
bool ED_view3d_local_collections_set(const Main *bmain, View3D *v3d)
@ SI_UVDT_STRETCH_ANGLE
void RNA_def_property_enum_default_func(PropertyRNA *prop, const char *get_default)
const EnumPropertyItem rna_enum_space_type_items[]
Definition rna_space.cc:91
static void rna_def_space_clip_overlay(BlenderRNA *brna)
const EnumPropertyItem rna_enum_geometry_item_type_items[]
Definition rna_space.cc:85
int rna_node_tree_idname_to_enum(const char *idname)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
int ED_file_icon(const FileDirEntry *file)
Definition filelist.cc:446
void RNA_api_region_view3d(StructRNA *srna)
@ V3D_SHADING_USE_COMPOSITOR_CAMERA
@ V3D_SHADING_USE_COMPOSITOR_ALWAYS
@ V3D_SHADING_USE_COMPOSITOR_DISABLED
unsigned int uint
Definition BKE_text.h:55
static void rna_def_space_dopesheet_overlays(BlenderRNA *brna)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
@ SNODE_GEOMETRY_MODIFIER
@ V2D_VIEWSYNC_SCREEN_TIME
static void rna_def_space_properties(BlenderRNA *brna)
const char * ED_buttons_search_string_get(SpaceProperties *sbuts)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
int ED_space_text_visible_lines_get(const SpaceText *st)
Definition text_draw.cc:49
bool ED_space_image_check_show_maskedit(SpaceImage *sima, Object *obedit)
@ RGN_TYPE_ASSET_SHELF_HEADER
const EnumPropertyItem rna_enum_space_file_browse_mode_items[]
Definition rna_space.cc:220
static const EnumPropertyItem viewer_path_elem_type_items[]
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
int ED_node_tree_path_length(SpaceNode *snode)
@ V3D_GIZMO_SHOW_OBJECT_TRANSLATE
@ V3D_GIZMO_SHOW_OBJECT_SCALE
@ V3D_GIZMO_SHOW_OBJECT_ROTATE
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
PointerRNA RNA_id_pointer_create(ID *id)
@ ASSET_LIBRARY_USE_REMOTE_URL
@ ANIM_UNITCONV_NORMALIZE
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
const EnumPropertyItem buttons_context_items[]
Definition rna_space.cc:600
void ED_node_tree_pop(ARegion *region, SpaceNode *snode)
bool WM_xr_session_exists(const wmXrData *xr)
@ FILE_SORT_ASSET_CATALOG
MINLINE void copy_v2_v2(float r[2], const float a[2])
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
FSMenuEntry * ED_fsmenu_get_entry(FSMenu *fsmenu, FSMenuCategory category, int idx)
Definition fsmenu.cc:113
StructRNA * ID_code_to_RNA_type(short idcode)
static void rna_def_space_view3d(BlenderRNA *brna)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
@ SPREADSHEET_OBJECT_EVAL_STATE_VIEWER_NODE
@ SPREADSHEET_OBJECT_EVAL_STATE_ORIGINAL
@ SPREADSHEET_OBJECT_EVAL_STATE_EVALUATED
char * ED_fsmenu_entry_get_name(FSMenuEntry *fsentry)
Definition fsmenu.cc:177
void RNA_def_struct_system_idprops_func(StructRNA *srna, const char *system_idproperties)
void ED_node_cursor_location_get(const SpaceNode *snode, float value[2])
static void rna_def_space_sequencer_preview_overlay(BlenderRNA *brna)
static EnumPropertyItem rna_enum_space_action_mode_all_items[]
Definition rna_space.cc:273
static void rna_def_console_line(BlenderRNA *brna)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void ED_fsmenu_entry_set_path(FSMenuEntry *fsentry, const char *path)
Definition fsmenu.cc:131
bool BKE_regiontype_uses_category_tabs(const ARegionType *region_type)
Definition screen.cc:407
static void rna_def_fileselect_params(BlenderRNA *brna)
ImBuf * ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile, const bool ensure_host_buffer)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
@ PROP_UNIT_CAMERA
Definition RNA_types.hh:231
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
@ FILE_HORIZONTALDISPLAY
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition rct.cc:671
static const EnumPropertyItem dt_uv_items[]
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
static void rna_def_spreadsheet_column_id(BlenderRNA *brna)
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_AROUND_CENTER_MEDIAN
@ FUNC_USE_CONTEXT
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
static void rna_def_spreadsheet_tables(BlenderRNA *brna)
@ SPREADSHEET_FLAG_SHOW_INTERNAL_ATTRIBUTES
@ SPREADSHEET_FLAG_PINNED
@ SNODE_GIZMO_HIDE_ACTIVE_NODE
@ SO_FIND_CASE_SENSITIVE
void rna_def_object_type_visibility_flags_common(StructRNA *srna, int noteflag, const char *update_func)
struct bUserAssetLibrary * BKE_preferences_asset_library_find_index(const struct UserDef *userdef, int index) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
@ FILE_DETAILS_DATETIME
@ V3D_LOCAL_COLLECTIONS
@ V3D_XR_SESSION_MIRROR
@ FILE_BROWSE_MODE_FILES
@ FILE_BROWSE_MODE_ASSETS
@ GEO_NODE_ASSET_TOOL
@ GEO_NODE_ASSET_MODIFIER
const IDFilterEnumPropertyItem rna_enum_id_type_filter_items[]
Definition rna_ID.cc:126
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
static const EnumPropertyItem display_channels_items[]
Definition rna_space.cc:465
void ED_region_search_filter_update(const ScrArea *area, ARegion *region)
Definition area.cc:957
@ SEQ_VIEW_SEQUENCE_PREVIEW
void ED_node_tree_start(ARegion *region, SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from)
Definition space_node.cc:79
@ SI_OVERLAY_SHOW_OVERLAYS
@ SI_OVERLAY_SHOW_GRID_BACKGROUND
@ SI_OVERLAY_DRAW_TEXT_INFO
@ SI_OVERLAY_DRAW_RENDER_REGION
const EnumPropertyItem rna_enum_geometry_component_type_items[]
Definition rna_space.cc:51
static void rna_def_viewer_node_viewer_path_elem(BlenderRNA *brna)
ARegion ARegion ScrArea ARegion * BKE_screen_find_region_in_space(const bScreen *screen, const SpaceLink *sl, int region_type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
Definition screen.cc:1102
void RNA_def_space(BlenderRNA *brna)
void invert_qt_qt(float q1[4], const float q2[4])
const EnumPropertyItem rna_enum_fileselect_params_sort_items[]
Definition rna_space.cc:366
Vector< eSpaceButtons_Context > ED_buttons_tabs_list(const SpaceProperties *sbuts, bool apply_filter=true)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:681
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock)
bool ED_userpref_tab_has_search_result(SpaceUserPref *sprefs, int index)
@ V3D_SHADING_WORLD_ORIENTATION
@ V3D_SHADING_SCENE_WORLD
@ V3D_SHADING_BACKFACE_CULLING
@ V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION
@ V3D_SHADING_XRAY_WIREFRAME
@ V3D_SHADING_SCENE_LIGHTS
@ V3D_SHADING_MATCAP_FLIP_X
@ V3D_SHADING_SCENE_LIGHTS_RENDER
@ V3D_SHADING_OBJECT_OUTLINE
@ V3D_SHADING_SPECULAR_HIGHLIGHT
@ V3D_SHADING_DEPTH_OF_FIELD
@ V3D_SHADING_SCENE_WORLD_RENDER
@ ASSET_LIBRARY_CUSTOM
void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic)
Definition image_edit.cc:49
int rna_AssetMetaData_editable(const PointerRNA *ptr, const char **r_info)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_animate_sdna(bool animate)
const EnumPropertyItem rna_enum_space_action_mode_items[]
Definition rna_space.cc:294
@ V3D_SHOW_RECONSTRUCTION
@ V3D_SHOW_CAMERA_PASSEPARTOUT
ViewLayer * CTX_data_view_layer(const bContext *C)
@ SPREADSHEET_GEOMETRY_ITEM_TYPE_DOMAIN
@ SPREADSHEET_GEOMETRY_ITEM_TYPE_BUNDLE
@ USER_SEQ_PROXY_SETUP_AUTOMATIC
int ED_fsmenu_entry_get_icon(FSMenuEntry *fsentry)
Definition fsmenu.cc:150
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
@ ADS_OVERLAY_SHOW_OVERLAYS
@ ADS_SHOW_SCENE_STRIP_FRAME_RANGE
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static const EnumPropertyItem stereo3d_eye_items[]
Definition rna_space.cc:458
static void rna_def_space_filebrowser(BlenderRNA *brna)
@ RGN_ALIGN_HIDE_WITH_PREV
@ SPREADSHEET_ROW_FILTER_BOOL_VALUE
@ SPREADSHEET_ROW_FILTER_UI_EXPAND
@ SPREADSHEET_ROW_FILTER_ENABLED
static void rna_def_spreadsheet_table(BlenderRNA *brna)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition wm_jobs.cc:498
void RNA_def_property_float_default(PropertyRNA *prop, float value)
@ SO_RESTRICT_INDIRECT_ONLY
void ED_fsmenu_entry_set_name(FSMenuEntry *fsentry, const char *name)
Definition fsmenu.cc:191
void ED_space_text_scroll_to_cursor(SpaceText *st, ARegion *region, bool center)
static const EnumPropertyItem rna_enum_curve_display_handle_items[]
Definition rna_space.cc:669
void ED_space_clip_set_mask(bContext *C, SpaceClip *sc, Mask *mask)
struct StudioLight * BKE_studiolight_findindex(int index, int flag)
struct StudioLight * BKE_studiolight_find(const char *name, int flag)
static void rna_def_space_properties_filter(StructRNA *srna)
Global G
Definition blender.cc:57
@ TIME_CACHE_DYNAMICPAINT
@ TIME_CACHE_SIMULATION_NODES
static const EnumPropertyItem stereo3d_camera_items[]
Definition rna_space.cc:347
@ SEQ_OVERLAY_FRAME_TYPE_CURRENT
@ SEQ_OVERLAY_FRAME_TYPE_REFERENCE
@ SEQ_OVERLAY_FRAME_TYPE_RECT
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
static const EnumPropertyItem spreadsheet_table_id_type_items[]
Definition rna_space.cc:695
@ V3D_SHADING_CAVITY_SSAO
@ V3D_SHADING_CAVITY_CURVATURE
@ V3D_SHADING_CAVITY_BOTH
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:541
@ SNODE_COMPOSITOR_SEQUENCER
@ SNODE_COMPOSITOR_SCENE
int BLI_findstringindex(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:794
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:593
static void rna_def_space_sequencer_cache_overlay(BlenderRNA *brna)
static void rna_def_group_node_viewer_path_elem(BlenderRNA *brna)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.hh:207
@ SC_SHOW_GRAPH_TRACKS_MOTION
@ SC_SHOW_GRAPH_TRACKS_ERROR
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void ED_region_visibility_change_update_animated(bContext *C, ScrArea *area, ARegion *region)
Scene * WM_window_get_active_scene(const wmWindow *win)
bool ED_space_image_show_paint(const SpaceImage *sima)
ListBaseT< StudioLight > & BKE_studiolight_listbase()
bool BKE_scene_uses_blender_eevee(const Scene *scene)
Definition scene.cc:3077
bool ED_space_image_show_render(const SpaceImage *sima)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBaseT< bAnimListElem > *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
static void rna_def_space_info(BlenderRNA *brna)
static void rna_def_viewer_path(BlenderRNA *brna)
@ SI_GIZMO_HIDE_ACTIVE_NODE
@ SI_GIZMO_HIDE_NAVIGATE
static void rna_def_space_generic_show_region_toggles(StructRNA *srna, int region_type_mask)
@ ANIMFILTER_FCURVESONLY
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_CURVE_VISIBLE
@ ANIMFILTER_NODUPLIS
@ PROP_BOOLEAN
Definition RNA_types.hh:210
@ PROP_POINTER
Definition RNA_types.hh:215
@ PROP_STRING
Definition RNA_types.hh:213
@ PROP_COLLECTION
Definition RNA_types.hh:216
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
PropertyRNA * rna_def_asset_library_ui_reference_common(StructRNA *srna, const char *get, const char *set)
Definition rna_asset.cc:896
int rna_object_type_visibility_icon_get_common(int object_type_exclude_viewport, const int *object_type_exclude_select)
@ SEQ_DRAW_EDIT_POINT_PREVIEW
RenderPass * BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
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)
bke::bNodeTreeType * rna_node_tree_type_from_enum(int value)
static const EnumPropertyItem rna_enum_asset_catalog_visibility_items[]
Definition rna_space.cc:389
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
int ED_buttons_search_string_length(SpaceProperties *sbuts)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
void DEG_id_tag_update(ID *id, unsigned int flags)
const EnumPropertyItem rna_enum_space_sequencer_view_type_items[]
Definition rna_space.cc:209
BMesh const char void * data
static void rna_def_fileselect_asset_params(BlenderRNA *brna)
static void rna_def_filemenu_entry(BlenderRNA *brna)
wmWindowManager * CTX_wm_manager(const bContext *C)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
@ SNLA_NOREALTIMEUPDATES
@ SPREADSHEET_ROW_FILTER_GREATER
@ SPREADSHEET_ROW_FILTER_EQUAL
@ SPREADSHEET_ROW_FILTER_LESS
@ SEQ_PREVIEW_SHOW_SAFE_CENTER
@ SEQ_PREVIEW_SHOW_METADATA
@ SEQ_PREVIEW_SHOW_OUTLINE_SELECTED
@ SEQ_PREVIEW_SHOW_COMPOSITION_GUIDES
@ SEQ_PREVIEW_SHOW_GPENCIL
@ SEQ_PREVIEW_SHOW_2D_CURSOR
@ SEQ_PREVIEW_SHOW_SAFE_MARGINS
const EnumPropertyItem rna_enum_space_image_mode_items[]
Definition rna_space.cc:329
const EnumPropertyItem rna_enum_space_graph_mode_items[]
Definition rna_space.cc:195
unsigned char uint8_t
Definition BKE_text.h:79
@ VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE
@ VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE
@ VIEWER_PATH_ELEM_TYPE_GROUP_NODE
@ VIEWER_PATH_ELEM_TYPE_VIEWER_NODE
@ VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE
@ VIEWER_PATH_ELEM_TYPE_FOREACH_GEOMETRY_ELEMENT_ZONE
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
static void rna_def_node_tree_path(BlenderRNA *brna)
@ SO_FILTER_OB_SELECTED
@ SO_FILTER_OB_SELECTABLE
@ V3D_GIZMO_SHOW_CAMERA_DOF_DIST
@ V3D_GIZMO_SHOW_CAMERA_LENS
static void rna_def_space_sequencer(BlenderRNA *brna)
@ SEQ_CACHE_SHOW_FINAL_OUT
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
bool BKE_layer_collection_local_sync(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Vector< int > ED_userpref_tabs_list(SpaceUserPref *prefs)
static const EnumPropertyItem rna_enum_fileselect_params_asset_import_method_items[]
Definition rna_space.cc:404
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
@ BCONTEXT_STRIP_MODIFIER
@ BCONTEXT_BONE_CONSTRAINT
@ FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_APPEND
@ FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_LINK
bool BLI_path_extension_glob_validate(char *ext_fnmatch) ATTR_NONNULL(1)
static void rna_def_space_node_path_api(BlenderRNA *brna, PropertyRNA *cprop)
float ED_view3d_grid_scale(const Scene *scene, const View3D *v3d, const char **r_grid_unit)
static void rna_def_space_image_overlay(BlenderRNA *brna)
static void rna_def_space_graph(BlenderRNA *brna)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
static void rna_def_space_dopesheet(BlenderRNA *brna)
@ V3D_GP_ONION_SKIN_ACTIVE_OBJECT
@ V3D_GP_SHOW_MATERIAL_NAME
@ V3D_GP_SHOW_STROKE_DIRECTION
@ V3D_GP_FADE_NOACTIVE_LAYERS
@ V3D_GP_SHOW_MULTIEDIT_LINES
@ V3D_GP_FADE_NOACTIVE_GPENCIL
void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item, int value)
@ V3D_GIZMO_SHOW_LIGHT_LOOK_AT
@ V3D_GIZMO_SHOW_LIGHT_SIZE
@ V3D_OVERLAY_WPAINT_CONTOURS
Scene * ED_screen_scene_find(const bScreen *screen, const wmWindowManager *wm)
static const EnumPropertyItem rna_enum_shading_wire_color_type_items[]
Definition rna_space.cc:529
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:34
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
int ED_space_image_get_display_channel_mask(ImBuf *ibuf)
bool RE_engine_view_pause_get(const RenderEngine *engine)
void RNA_api_space_node(StructRNA *srna)
static const EnumPropertyItem rna_enum_studio_light_items[]
Definition rna_space.cc:540
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void ED_region_toggle_hidden(bContext *C, ARegion *region)
Definition area.cc:2623
@ SIPO_NO_DRAW_EXTRAPOLATION
@ SIPO_NORMALIZE_FREEZE
@ SIPO_NOREALTIMEUPDATES
const EnumPropertyItem rna_enum_dummy_NULL_items[]
Definition rna_rna.cc:28
@ V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD
@ V3D_GIZMO_SHOW_EMPTY_IMAGE
static void rna_def_space_console(BlenderRNA *brna)
@ MASK_DRAWFLAG_SPLINE
@ MASK_DRAWFLAG_OVERLAY
const char * ED_userpref_search_string_get(SpaceUserPref *sprefs)
@ V3D_SHADING_SINGLE_COLOR
@ V3D_SHADING_RANDOM_COLOR
@ V3D_SHADING_MATERIAL_COLOR
@ V3D_SHADING_VERTEX_COLOR
@ V3D_SHADING_TEXTURE_COLOR
@ V3D_SHADING_OBJECT_COLOR
static const EnumPropertyItem fileselectparams_recursion_level_items[]
Definition rna_space.cc:641
bool ED_buttons_tab_has_search_result(SpaceProperties *sbuts, int index)
FileSelectParams * ED_fileselect_get_active_params(const SpaceFile *sfile)
Definition filesel.cc:393
static IDFilterEnumPropertyItem rna_enum_space_file_id_filter_categories[]
ARegion ARegion ScrArea ARegion std::optional< std::string > BKE_screen_path_to_space(const PointerRNA *ptr)
Definition screen.cc:1118
static const EnumPropertyItem rna_enum_shading_color_type_items[]
Definition rna_space.cc:515
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.hh:203
void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip)
static void rna_def_foreach_geometry_element_zone_viewer_path_elem(BlenderRNA *brna)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_collection(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
RenderEngineType * RE_engines_find(const char *idname)
@ SI_GRID_SHAPE_DYNAMIC
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
static void rna_def_evaluate_closure_node_viewer_path_elem(BlenderRNA *brna)
void BKE_image_init_imageuser(Image *ima, ImageUser *iuser)
@ SEQ_DRAW_IMG_VECTORSCOPE
@ SEQ_DRAW_IMG_WAVEFORM
@ SEQ_DRAW_IMG_HISTOGRAM
@ SEQ_DRAW_IMG_RGBPARADE
int ED_userpref_search_string_length(SpaceUserPref *sprefs)
void ED_userpref_search_string_set(SpaceUserPref *sprefs, const char *value)
void ED_space_image_scopes_update(const bContext *C, SpaceImage *sima, ImBuf *ibuf, bool use_view_settings)
static void rna_def_space_view3d_overlay(BlenderRNA *brna)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void ED_node_cursor_location_set(SpaceNode *snode, const float value[2])
bool BKE_view_layer_has_valid_aov(ViewLayer *view_layer)
static void rna_def_viewer_path_elem(BlenderRNA *brna)
void WM_windows_scene_data_sync(const ListBaseT< wmWindow > *win_lb, Scene *scene)
void ED_fsmenu_entry_set_icon(FSMenuEntry *fsentry, int icon)
Definition fsmenu.cc:155
int BLI_str_utf8_offset_from_index(const char *str, size_t str_len, int index_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void ED_region_visibility_change_update(bContext *C, ScrArea *area, ARegion *region)
Definition area.cc:2599
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:1024
@ V3D_SHADING_BACKGROUND_VIEWPORT
@ V3D_SHADING_BACKGROUND_WORLD
@ V3D_SHADING_BACKGROUND_THEME
void id_us_ensure_real(ID *id)
Definition lib_id.cc:388
@ FILE_SHOW_ASSETS_FROM_CATALOG
@ FILE_SHOW_ASSETS_WITHOUT_CATALOG
@ FILE_SHOW_ASSETS_ALL_CATALOGS
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
bool BLI_uuid_parse_string(bUUID *uuid, const char *buffer) ATTR_NONNULL()
Definition uuid.cc:105
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
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_iterator_listbase_get(CollectionPropertyIterator *iter)
FileSelectParams * ED_fileselect_get_file_params(const SpaceFile *sfile)
Definition filesel.cc:411
@ SO_LIB_OVERRIDE_VIEW_PROPERTIES
@ SO_LIB_OVERRIDE_VIEW_HIERARCHIES
static EnumPropertyItem rna_enum_space_action_ui_mode_items[]
Definition rna_space.cc:283
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
@ SPREADSHEET_TABLE_ID_TYPE_GEOMETRY
void BLI_uuid_format(char *buffer, bUUID uuid) ATTR_NONNULL()
Definition uuid.cc:82
FileAssetSelectParams * ED_fileselect_get_asset_params(const SpaceFile *sfile)
Definition filesel.cc:416
char * ED_fsmenu_entry_get_path(FSMenuEntry *fsentry)
Definition fsmenu.cc:126
@ IMA_SHOW_SEQUENCER_SCENE
bool BKE_scene_uses_blender_workbench(const Scene *scene)
Definition scene.cc:3082
static void rna_def_modifier_viewer_path_elem(BlenderRNA *brna)
Main * CTX_data_main(const bContext *C)
void RNA_api_space_text(StructRNA *srna)
static void rna_def_space_spreadsheet(BlenderRNA *brna)
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.hh:211
static void rna_def_space_node(BlenderRNA *brna)
static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *mask_set_func)
@ EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET
@ EEVEE_RENDER_PASS_MIST
@ EEVEE_RENDER_PASS_SPECULAR_LIGHT
@ EEVEE_RENDER_PASS_DIFFUSE_COLOR
@ EEVEE_RENDER_PASS_DENOISING_NORMAL
@ EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL
@ EEVEE_RENDER_PASS_ENVIRONMENT
@ EEVEE_RENDER_PASS_EMIT
@ EEVEE_RENDER_PASS_AOV
@ EEVEE_RENDER_PASS_AO
@ EEVEE_RENDER_PASS_DENOISING_ROUGHNESS
@ EEVEE_RENDER_PASS_DENOISING_DIFFUSE_ALBEDO
@ EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT
@ EEVEE_RENDER_PASS_COMBINED
@ EEVEE_RENDER_PASS_VOLUME_LIGHT
@ EEVEE_RENDER_PASS_DENOISING_SPECULAR_ALBEDO
@ EEVEE_RENDER_PASS_TRANSPARENT
@ EEVEE_RENDER_PASS_NORMAL
@ EEVEE_RENDER_PASS_POSITION
@ EEVEE_RENDER_PASS_DIFFUSE_LIGHT
@ EEVEE_RENDER_PASS_SPECULAR_COLOR
@ EEVEE_RENDER_PASS_SHADOW
@ EEVEE_RENDER_PASS_DENOISING_DEPTH
static void rna_def_space(BlenderRNA *brna)
static void rna_def_space_project(BlenderRNA *brna)
@ V3D_DEBUG_FREEZE_CULLING
void ANIM_animdata_freelist(ListBaseT< bAnimListElem > *anim_data)
Definition anim_deps.cc:472
Scene * WM_windows_scene_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
Definition anim_draw.cc:636
static const EnumPropertyItem rna_enum_viewport_lighting_items[]
Definition rna_space.cc:508
ARegion ARegion ScrArea * BKE_screen_find_area_from_space(const bScreen *screen, const SpaceLink *sl) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
Definition screen.cc:1091
@ ID_RECALC_COMPOSITOR
Definition DNA_ID.h:1161
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1104
ID_Type GS(const char *name)
Definition DNA_ID.h:410
@ PROP_TEXTEDIT_UPDATE
Definition RNA_types.hh:396
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:477
@ PROP_EDITABLE
Definition RNA_types.hh:376
@ PROP_ENUM_NO_CONTEXT
Definition RNA_types.hh:500
@ PROP_DYNAMIC
Definition RNA_types.hh:498
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:454
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:434
@ PROP_NEVER_NULL
Definition RNA_types.hh:447
@ PROP_HIDDEN
Definition RNA_types.hh:408
@ PROP_ANIMATABLE
Definition RNA_types.hh:389
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
const EnumPropertyItem rna_enum_asset_access_items[]
Definition rna_space.cc:438
void ED_drivers_editor_init(bContext *C, ScrArea *area)
const EnumPropertyItem * rna_node_tree_type_itemf(void *data, bool(*poll)(void *data, bke::bNodeTreeType *), bool *r_free)
const EnumPropertyItem * RNA_enum_node_tree_types_itemf_impl(bContext *C, bool *r_free)
@ FILE_TYPE_BLENDER_BACKUP
void ED_render_view3d_pause_notify(Main *bmain)
static void rna_def_space_outliner(BlenderRNA *brna)
void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
@ V3D_OVERLAY_EDIT_LOOP_NORMALS
@ V3D_OVERLAY_EDIT_WEIGHT
@ V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS
@ V3D_OVERLAY_EDIT_BWEIGHTS
@ V3D_OVERLAY_EDIT_FACE_AREA
@ V3D_OVERLAY_EDIT_STATVIS
@ V3D_OVERLAY_EDIT_CREASES
@ V3D_OVERLAY_EDIT_EDGE_ANG
@ V3D_OVERLAY_EDIT_EDGE_LEN
@ V3D_OVERLAY_EDIT_VERT_NORMALS
@ V3D_OVERLAY_EDIT_FACE_NORMALS
@ V3D_OVERLAY_EDIT_FREESTYLE_EDGE
@ V3D_OVERLAY_EDIT_FACE_ANG
@ V3D_OVERLAY_EDIT_CU_NORMALS
@ V3D_OVERLAY_EDIT_RETOPOLOGY
@ V3D_OVERLAY_EDIT_FREESTYLE_FACE
@ V3D_OVERLAY_EDIT_FACE_DOT
@ V3D_OVERLAY_EDIT_INDICES
void ED_space_image_get_zoom(SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
static void rna_def_space_image(BlenderRNA *brna)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
void ED_node_set_tree_type(SpaceNode *snode, bke::bNodeTreeType *typeinfo)
Definition node_edit.cc:121
@ FS_CATEGORY_BOOKMARKS
@ FS_CATEGORY_SYSTEM_BOOKMARKS
RenderEngine * RE_view_engine_get(const ViewRender *view_render)
int BLI_str_utf8_offset_to_index(const char *str, size_t str_len, int offset_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Scene * CTX_data_scene(const bContext *C)
const EnumPropertyItem rna_enum_region_panel_category_items[]
Definition rna_screen.cc:49
@ SCE_VIEWS_FORMAT_MULTIVIEW
@ SNODE_INSERTOFS_DIR_LEFT
@ SNODE_INSERTOFS_DIR_RIGHT
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
@ SACTION_NOREALTIMEUPDATES
@ SACTION_SHOW_INTERPOLATION
@ SACTION_POSEMARKERS_SHOW
void RNA_define_verify_sdna(bool verify)
@ RGN_FLAG_HIDDEN_BY_USER
void ED_area_tag_refresh(ScrArea *area)
Definition area.cc:813
static void rna_def_space_node_overlay(BlenderRNA *brna)
bool ED_text_is_syntax_highlight_supported(Text *text)
bool ED_node_supports_preview(SpaceNode *snode)
Definition node_edit.cc:155
void ED_space_clip_set_clip(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *clip)
void ED_space_image_paint_update(Main *bmain, wmWindowManager *wm, Scene *scene)
static void rna_def_space_nla(BlenderRNA *brna)
static void rna_def_fileselect_asset_idfilter(BlenderRNA *brna)
int ED_fsmenu_get_nentries(FSMenu *fsmenu, FSMenuCategory category)
Definition fsmenu.cc:101
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_space_image_mode_all_items[]
Definition rna_space.cc:314
@ PROP_PERCENTAGE
Definition RNA_types.hh:307
@ PROP_FACTOR
Definition RNA_types.hh:308
@ PROP_TRANSLATION
Definition RNA_types.hh:318
@ PROP_FILENAME
Definition RNA_types.hh:286
@ PROP_MATRIX
Definition RNA_types.hh:322
@ PROP_BYTESTRING
Definition RNA_types.hh:295
@ PROP_DISTANCE
Definition RNA_types.hh:313
@ PROP_FILEPATH
Definition RNA_types.hh:284
@ PROP_QUATERNION
Definition RNA_types.hh:324
@ PROP_UNSIGNED
Definition RNA_types.hh:306
@ PARM_REQUIRED
Definition RNA_types.hh:631
@ PARM_RNAPTR
Definition RNA_types.hh:633
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
@ SN_OVERLAY_PREVIEW_FLAT
@ SN_OVERLAY_PREVIEW_3D
static void rna_def_repeat_zone_viewer_path_elem(BlenderRNA *brna)
@ SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC
static void rna_def_fileselect_idfilter(BlenderRNA *brna)
@ SPREADSHEET_VALUE_TYPE_INSTANCES
@ SPREADSHEET_VALUE_TYPE_FLOAT
@ SPREADSHEET_VALUE_TYPE_BOOL
@ SPREADSHEET_VALUE_TYPE_INT32
void RNA_def_property_int_default(PropertyRNA *prop, int value)
FSMenuEntry * ED_fsmenu_get_category(FSMenu *fsmenu, FSMenuCategory category)
Definition fsmenu.cc:56
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
bScreen * WM_window_get_active_screen(const wmWindow *win)
static void rna_def_spreadsheet_column(BlenderRNA *brna)
bool BKE_id_is_in_global_main(ID *id)
Definition lib_id.cc:2759
void RNA_def_property_array(PropertyRNA *prop, int length)
static void rna_def_space_clip(BlenderRNA *brna)
ARegion * CTX_wm_region(const bContext *C)
static const EnumPropertyItem spreadsheet_object_eval_state_items[]
Definition rna_space.cc:676
const EnumPropertyItem rna_enum_clip_editor_mode_items[]
Definition rna_space.cc:590
const int rna_matrix_dimsize_4x4[]
@ V3D_GIZMO_HIDE_MODIFIER
@ V3D_GIZMO_HIDE_NAVIGATE
static void rna_def_spreadsheet_table_id_geometry(BlenderRNA *brna)
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist, float roll)
bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
bUUID BLI_uuid_nil()
Definition uuid.cc:66
wmWindow * ED_screen_window_find(const bScreen *screen, const wmWindowManager *wm)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
static void rna_def_space_image_uv(BlenderRNA *brna)
void ED_buttons_search_string_set(SpaceProperties *sbuts, const char *value)
const EnumPropertyItem rna_enum_attribute_domain_items[]
void RNA_api_space_filebrowser(StructRNA *srna)
@ SCLIP_GIZMO_HIDE_NAVIGATE
static const EnumPropertyItem rna_enum_view3dshading_render_pass_type_items[]
Definition rna_space.cc:545
@ AREA_FLAG_ACTIVE_TOOL_UPDATE
static void rna_def_space_sequencer_timeline_overlay(BlenderRNA *brna)
bool WM_jobs_is_running(const wmJob *wm_job)
Definition wm_jobs.cc:358
static void rna_def_space_view3d_shading(BlenderRNA *brna)
@ SN_OVERLAY_SHOW_TEXT_INFO
@ SN_OVERLAY_SHOW_OVERLAYS
@ SN_OVERLAY_SHOW_TIMINGS
@ SN_OVERLAY_SHOW_REROUTE_AUTO_LABELS
@ SN_OVERLAY_SHOW_PREVIEWS
@ SN_OVERLAY_SHOW_WIRE_COLORS
@ SN_OVERLAY_SHOW_RENDER_REGION
@ SN_OVERLAY_SHOW_NAMED_ATTRIBUTES
@ SEQ_SHOW_SCRUBBING_REGION
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:784
void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area)
void ANIM_frame_channel_y_extents(bContext *C, bAnimContext *ac)
void ED_node_tree_path_get(SpaceNode *snode, char *value)
static void rna_def_fileselect_entry(BlenderRNA *brna)
#define SACT_ITEM_MASK
Definition rna_space.cc:254
#define SI_ITEM_MASK
Definition rna_space.cc:312
#define SACT_ITEM_CACHEFILE
Definition rna_space.cc:256
#define DEF_SHOW_REGION_PROPERTY(identifier, label, description)
#define SACT_ITEM_SHAPEKEY
Definition rna_space.cc:242
#define SI_ITEM_VIEW(identifier, name, icon)
Definition rna_space.cc:308
#define SACT_ITEM_DOPESHEET
Definition rna_space.cc:234
#define SI_ITEM_PAINT
Definition rna_space.cc:311
#define SACT_ITEM_ACTION
Definition rna_space.cc:236
#define SACT_ITEM_GPENCIL
Definition rna_space.cc:248
#define SACT_ITEM_TIMELINE
Definition rna_space.cc:262
#define V3D_S3D_CAMERA_LEFT
Definition rna_space.cc:340
#define V3D_S3D_CAMERA_RIGHT
Definition rna_space.cc:341
#define SI_ITEM_UV
Definition rna_space.cc:310
#define V3D_S3D_CAMERA_S3D
Definition rna_space.cc:342
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
#define min(a, b)
Definition sort.cc:38
const NodeType * type
Definition graph/node.h:179
The meta-data of an asset. By creating and giving this for a data-block (ID.asset_data),...
AssetLibraryReference asset_library_ref
PointerRNA parent() const
Definition RNA_types.hh:147
struct ViewRender * view_render
struct MovieClipScopes scopes
eSpaceButtons_Context mainb
struct IDProperty * prop
Universally Unique Identifier according to RFC4122.
#define N_(msgid)