Blender V5.0
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.h"
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.h"
19
20#include "ED_asset.hh"
21#include "ED_buttons.hh"
22#include "ED_spreadsheet.hh"
23
24#include "BLI_string.h"
25#include "BLI_sys_types.h"
26
27#include "DNA_action_types.h"
28#include "DNA_mask_types.h"
29#include "DNA_object_types.h"
30#include "DNA_space_types.h"
31#include "DNA_view3d_types.h"
32
33#include "RNA_define.hh"
34
35#include "rna_internal.hh"
36
37#include "SEQ_sequencer.hh"
38
39#include "WM_api.hh"
40#include "WM_types.hh"
41
42#include "RNA_enum_types.hh"
43
46 "MESH",
47 ICON_MESH_DATA,
48 "Mesh",
49 "Mesh component containing point, corner, edge and face data"},
51 "POINTCLOUD",
52 ICON_POINTCLOUD_DATA,
53 "Point Cloud",
54 "Point cloud component containing only point data"},
56 "CURVE",
57 ICON_CURVE_DATA,
58 "Curve",
59 "Curve component containing spline and control point data"},
61 "INSTANCES",
62 ICON_EMPTY_AXIS,
63 "Instances",
64 "Instances of objects or collections"},
66 "GREASEPENCIL",
67 ICON_GREASEPENCIL,
68 "Grease Pencil",
69 "Grease Pencil component containing layers and curves data"},
70 {0, nullptr, 0, nullptr, nullptr},
71};
72
74 /* empty must be here for python, is skipped for UI */
75 {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""},
76
77 /* General. */
78 RNA_ENUM_ITEM_HEADING(N_("General"), nullptr),
80 "VIEW_3D",
81 ICON_VIEW3D,
82 "3D Viewport",
83 "Manipulate objects in a 3D environment"},
85 "IMAGE_EDITOR",
86 ICON_IMAGE,
87 "UV/Image Editor",
88 "View and edit images and UV Maps"},
90 "NODE_EDITOR",
91 ICON_NODETREE,
92 "Node Editor",
93 "Editor for node-based shading and compositing tools"},
94 {SPACE_SEQ,
95 "SEQUENCE_EDITOR",
96 ICON_SEQUENCE,
97 "Video Sequencer",
98 "Non-linear editor for arranging and mixing scenes, video, audio, and effects"},
99 {SPACE_CLIP, "CLIP_EDITOR", ICON_TRACKER, "Movie Clip Editor", "Motion tracking tools"},
100
101 /* Animation. */
102 RNA_ENUM_ITEM_HEADING(N_("Animation"), nullptr),
103#if 0
105 "TIMELINE",
106 ICON_TIME,
107 "Timeline",
108 "Timeline and playback controls (NOTE: Switch to 'Timeline' mode)"}, /* XXX */
109#endif
110 {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", "Adjust timing of keyframes"},
112 "GRAPH_EDITOR",
113 ICON_GRAPH,
114 "Graph Editor",
115 "Edit drivers and keyframe interpolation"},
116 {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", "Combine and layer Actions"},
117
118 /* Scripting. */
119 RNA_ENUM_ITEM_HEADING(N_("Scripting"), nullptr),
120 {SPACE_TEXT,
121 "TEXT_EDITOR",
122 ICON_TEXT,
123 "Text Editor",
124 "Edit scripts and in-file documentation"},
126 "CONSOLE",
127 ICON_CONSOLE,
128 "Python Console",
129 "Interactive programmatic console for "
130 "advanced editing and script development"},
131 {SPACE_INFO, "INFO", ICON_INFO, "Info", "Log of operations, warnings and error messages"},
132 /* Special case: Top-bar and Status-bar aren't supposed to be a regular editor for the user. */
134 "TOPBAR",
135 ICON_NONE,
136 "Top Bar",
137 "Global bar at the top of the screen for "
138 "global per-window settings"},
140 "STATUSBAR",
141 ICON_NONE,
142 "Status Bar",
143 "Global bar at the bottom of the "
144 "screen for general status information"},
145
146 /* Data. */
147 RNA_ENUM_ITEM_HEADING(N_("Data"), nullptr),
149 "OUTLINER",
150 ICON_OUTLINER,
151 "Outliner",
152 "Overview of scene graph and all available data-blocks"},
154 "PROPERTIES",
155 ICON_PROPERTIES,
156 "Properties",
157 "Edit properties of active object and related data-blocks"},
158 {SPACE_FILE, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", "Browse for files and assets"},
160 "SPREADSHEET",
161 ICON_SPREADSHEET,
162 "Spreadsheet",
163 "Explore geometry data in a table"},
165 "PREFERENCES",
166 ICON_PREFERENCES,
167 "Preferences",
168 "Edit persistent configuration settings"},
169 {0, nullptr, 0, nullptr, nullptr},
170};
171
174 "FCURVES",
175 ICON_GRAPH,
176 "Graph Editor",
177 "Edit animation/keyframes displayed as 2D curves"},
179 "DRIVERS",
180 ICON_DRIVER,
181 "Drivers",
182 "Define and edit drivers that link properties to custom functions or other data"},
183 {0, nullptr, 0, nullptr, nullptr},
184};
185
187 {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
188 {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Preview", ""},
190 "SEQUENCER_PREVIEW",
191 ICON_SEQ_SPLITVIEW,
192 "Sequencer & Preview",
193 ""},
194 {0, nullptr, 0, nullptr, nullptr},
195};
196
199 "FILES",
200 ICON_FILEBROWSER,
201 "File Browser",
202 "Built-in file manager for opening, saving, and linking data"},
204 "ASSETS",
205 ICON_ASSET_MANAGER,
206 "Asset Browser",
207 "Manage assets in the current file and access linked asset libraries"},
208 {0, nullptr, 0, nullptr, nullptr},
209};
210
211#define SACT_ITEM_DOPESHEET \
212 {SACTCONT_DOPESHEET, "DOPESHEET", ICON_ACTION, "Dope Sheet", "Edit all keyframes in scene"}
213#define SACT_ITEM_ACTION \
214 {SACTCONT_ACTION, \
215 "ACTION", \
216 ICON_OBJECT_DATA, \
217 "Action Editor", \
218 "Edit keyframes in active object's Object-level action"}
219#define SACT_ITEM_SHAPEKEY \
220 {SACTCONT_SHAPEKEY, \
221 "SHAPEKEY", \
222 ICON_SHAPEKEY_DATA, \
223 "Shape Key Editor", \
224 "Edit keyframes in active object's Shape Keys action"}
225#define SACT_ITEM_GPENCIL \
226 {SACTCONT_GPENCIL, \
227 "GPENCIL", \
228 ICON_OUTLINER_OB_GREASEPENCIL, \
229 "Grease Pencil", \
230 "Edit timings for all Grease Pencil sketches in file"}
231#define SACT_ITEM_MASK \
232 {SACTCONT_MASK, "MASK", ICON_MOD_MASK, "Mask", "Edit timings for Mask Editor splines"}
233#define SACT_ITEM_CACHEFILE \
234 {SACTCONT_CACHEFILE, \
235 "CACHEFILE", \
236 ICON_FILE, \
237 "Cache File", \
238 "Edit timings for Cache File data-blocks"}
239#define SACT_ITEM_TIMELINE \
240 {SACTCONT_TIMELINE, \
241 "TIMELINE", \
242 ICON_TIME, \
243 "Timeline", \
244 "Simple timeline view with playback controls in the header, without channel list, " \
245 "side-panel, or footer"}
246
247#ifndef RNA_RUNTIME
248/* XXX: action-editor is currently for object-level only actions,
249 * so show that using object-icon hint */
269#endif
270
274 {0, nullptr, 0, nullptr, nullptr},
275};
276
277#undef SACT_ITEM_DOPESHEET
278#undef SACT_ITEM_ACTION
279#undef SACT_ITEM_SHAPEKEY
280#undef SACT_ITEM_GPENCIL
281#undef SACT_ITEM_MASK
282#undef SACT_ITEM_CACHEFILE
283#undef SACT_ITEM_TIMELINE
284
285#define SI_ITEM_VIEW(identifier, name, icon) \
286 {SI_MODE_VIEW, identifier, icon, name, "Inspect images or render results"}
287#define SI_ITEM_UV {SI_MODE_UV, "UV", ICON_UV, "UV Editor", "View and edit UVs"}
288#define SI_ITEM_PAINT {SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "Paint images in 2D"}
289#define SI_ITEM_MASK {SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "View and edit masks"}
290
292 SI_ITEM_VIEW("VIEW", "View", ICON_FILE_IMAGE),
296 {0, nullptr, 0, nullptr, nullptr},
297};
298
300 SI_ITEM_VIEW("VIEW", "View", ICON_FILE_IMAGE),
303 {0, nullptr, 0, nullptr, nullptr},
304};
305
307 SI_ITEM_VIEW("IMAGE_EDITOR", "Image Editor", ICON_IMAGE),
309 {0, nullptr, 0, nullptr, nullptr},
310};
311
312#undef SI_ITEM_VIEW
313#undef SI_ITEM_UV
314#undef SI_ITEM_PAINT
315#undef SI_ITEM_MASK
316
317#define V3D_S3D_CAMERA_LEFT {STEREO_LEFT_ID, "LEFT", ICON_RESTRICT_RENDER_OFF, "Left", ""},
318#define V3D_S3D_CAMERA_RIGHT {STEREO_RIGHT_ID, "RIGHT", ICON_RESTRICT_RENDER_OFF, "Right", ""},
319#define V3D_S3D_CAMERA_S3D {STEREO_3D_ID, "S3D", ICON_CAMERA_STEREO, "3D", ""},
320#ifdef RNA_RUNTIME
321# define V3D_S3D_CAMERA_VIEWS {STEREO_MONO_ID, "MONO", ICON_RESTRICT_RENDER_OFF, "Views", ""},
322#endif
323
325 V3D_S3D_CAMERA_LEFT V3D_S3D_CAMERA_RIGHT V3D_S3D_CAMERA_S3D{0, nullptr, 0, nullptr, nullptr},
326};
327
328#ifdef RNA_RUNTIME
329static const EnumPropertyItem multiview_camera_items[] = {
330 V3D_S3D_CAMERA_VIEWS V3D_S3D_CAMERA_S3D{0, nullptr, 0, nullptr, nullptr},
331};
332#endif
333
334#undef V3D_S3D_CAMERA_LEFT
335#undef V3D_S3D_CAMERA_RIGHT
336#undef V3D_S3D_CAMERA_S3D
337#undef V3D_S3D_CAMERA_VIEWS
338
344 {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_NONE, "Name", "Sort the file list alphabetically"},
346 "FILE_SORT_EXTENSION",
347 ICON_NONE,
348 "Extension",
349 "Sort the file list by extension/type"},
351 "FILE_SORT_TIME",
352 ICON_NONE,
353 "Modified Date",
354 "Sort files by modification time"},
355 {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_NONE, "Size", "Sort files by size"},
357 "ASSET_CATALOG",
358 0,
359 "Asset Catalog",
360 "Sort the asset list so that assets in the same catalog are kept together. Within a single "
361 "catalog, assets are ordered by name. The catalogs are in order of the flattened catalog "
362 "hierarchy."},
363 {0, nullptr, 0, nullptr, nullptr},
364};
365
368 "FOLLOW_PREFS",
369 0,
370 "Follow Preferences",
371 "Use the import method set in the Preferences for this asset library, don't override it "
372 "for this Asset Browser"},
374 "LINK",
375 ICON_LINK_BLEND,
376 "Link",
377 "Import the assets as linked data-block"},
379 "APPEND",
380 ICON_APPEND_BLEND,
381 "Append",
382 "Import the asset as copied data-block, with no link to the original asset data-block"},
384 "APPEND_REUSE",
385 ICON_APPEND_BLEND,
386 "Append (Reuse Data)",
387 "Import the asset as copied data-block while avoiding multiple copies of nested, "
388 "typically heavy data. For example the textures of a material asset, or the mesh of an "
389 "object asset, don't have to be copied every time this asset is imported. The instances of "
390 "the asset share the data instead"},
392 "PACK",
393 ICON_PACKAGE,
394 "Pack",
395 "Import the asset as linked data-block, and pack it in the current file (ensures that it "
396 "remains unchanged in case the library data is modified, is not available anymore, etc.)"},
397 {0, nullptr, 0, nullptr, nullptr},
398};
399
400#ifndef RNA_RUNTIME
402 {STEREO_LEFT_ID, "LEFT_EYE", ICON_NONE, "Left Eye"},
403 {STEREO_RIGHT_ID, "RIGHT_EYE", ICON_NONE, "Right Eye"},
404 {0, nullptr, 0, nullptr, nullptr},
405};
406#endif
407
410 "COLOR_ALPHA",
411 ICON_IMAGE_RGB_ALPHA,
412 "Color & Alpha",
413 "Display image with RGB colors and alpha transparency"},
414 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
415 {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Display alpha transparency channel"},
417 "Z_BUFFER",
418 ICON_IMAGE_ZDEPTH,
419 "Z-Buffer",
420 "Display Z-buffer associated with image (mapped from camera clip start to end)"},
421 {SI_SHOW_R, "RED", ICON_RGB_RED, "Red", ""},
422 {SI_SHOW_G, "GREEN", ICON_RGB_GREEN, "Green", ""},
423 {SI_SHOW_B, "BLUE", ICON_RGB_BLUE, "Blue", ""},
424 {0, nullptr, 0, nullptr, nullptr},
425};
426
428 {OB_WIRE,
429 "WIREFRAME",
430 ICON_SHADING_WIRE,
431 "Wireframe",
432 "Display only edges of geometry without surface shading"},
433 {OB_SOLID,
434 "SOLID",
435 ICON_SHADING_SOLID,
436 "Solid",
437 "Display objects with flat lighting and basic surface shading"},
439 "MATERIAL",
440 ICON_SHADING_TEXTURE,
441 "Material Preview",
442 "Preview materials using predefined environment lights"},
443 {OB_RENDER,
444 "RENDERED",
445 ICON_SHADING_RENDERED,
446 "Rendered",
447 "Preview the final scene using the active render engine"},
448 {0, nullptr, 0, nullptr, nullptr},
449};
450
452 {V3D_LIGHTING_STUDIO, "STUDIO", 0, "Studio", "Display using studio lighting"},
453 {V3D_LIGHTING_MATCAP, "MATCAP", 0, "MatCap", "Display using matcap material and lighting"},
454 {V3D_LIGHTING_FLAT, "FLAT", 0, "Flat", "Display using flat lighting"},
455 {0, nullptr, 0, nullptr, nullptr},
456};
457
459 {V3D_SHADING_MATERIAL_COLOR, "MATERIAL", 0, "Material", "Show material color"},
460 {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color"},
461 {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color"},
462 {V3D_SHADING_VERTEX_COLOR, "VERTEX", 0, "Attribute", "Show active color attribute"},
464 "TEXTURE",
465 0,
466 "Texture",
467 "Show the texture from the active image texture node using the active UV map coordinates"},
468 {V3D_SHADING_SINGLE_COLOR, "SINGLE", 0, "Custom", "Show scene in a single custom color"},
469 {0, nullptr, 0, nullptr, nullptr},
470};
471
474 "THEME",
475 0,
476 "Theme",
477 "Show scene wireframes with the theme's wire color"},
478 {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color on wireframe"},
479 {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color on wireframe"},
480 {0, nullptr, 0, nullptr, nullptr},
481};
482
484 {0, "DEFAULT", 0, "Default", ""},
485 {0, nullptr, 0, nullptr, nullptr},
486};
487
490 {EEVEE_RENDER_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
491 {EEVEE_RENDER_PASS_EMIT, "EMISSION", 0, "Emission", ""},
492 {EEVEE_RENDER_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
493 {EEVEE_RENDER_PASS_AO, "AO", 0, "Ambient Occlusion", ""},
494 {EEVEE_RENDER_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
495 {EEVEE_RENDER_PASS_TRANSPARENT, "TRANSPARENT", 0, "Transparent", ""},
496
498 {EEVEE_RENDER_PASS_DIFFUSE_LIGHT, "DIFFUSE_LIGHT", 0, "Diffuse Light", ""},
499 {EEVEE_RENDER_PASS_DIFFUSE_COLOR, "DIFFUSE_COLOR", 0, "Diffuse Color", ""},
500 {EEVEE_RENDER_PASS_SPECULAR_LIGHT, "SPECULAR_LIGHT", 0, "Specular Light", ""},
501 {EEVEE_RENDER_PASS_SPECULAR_COLOR, "SPECULAR_COLOR", 0, "Specular Color", ""},
502 {EEVEE_RENDER_PASS_VOLUME_LIGHT, "VOLUME_LIGHT", 0, "Volume Light", ""},
503
505 {EEVEE_RENDER_PASS_POSITION, "POSITION", 0, "Position", ""},
506 {EEVEE_RENDER_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
507 {EEVEE_RENDER_PASS_MIST, "MIST", 0, "Mist", ""},
508 {EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT, "CryptoObject", 0, "CryptoObject", ""},
509 {EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET, "CryptoAsset", 0, "CryptoAsset", ""},
510 {EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL, "CryptoMaterial", 0, "CryptoMaterial", ""},
511
513 {EEVEE_RENDER_PASS_AOV, "AOV", 0, "AOV", ""},
514
515 {0, nullptr, 0, nullptr, nullptr},
516};
517
519 {SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"},
520 {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"},
521 {0, nullptr, 0, nullptr, nullptr},
522};
523
524/* Actually populated dynamically through a function,
525 * but helps for context-less access (e.g. doc, i18n...). */
527 {BCONTEXT_TOOL, "TOOL", ICON_TOOL_SETTINGS, "Tool", "Active Tool and Workspace settings"},
528 {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene Properties"},
529 {BCONTEXT_RENDER, "RENDER", ICON_SCENE, "Render", "Render Properties"},
530 {BCONTEXT_OUTPUT, "OUTPUT", ICON_OUTPUT, "Output", "Output Properties"},
531 {BCONTEXT_VIEW_LAYER, "VIEW_LAYER", ICON_RENDER_RESULT, "View Layer", "View Layer Properties"},
532 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World Properties"},
533 {BCONTEXT_COLLECTION, "COLLECTION", ICON_GROUP, "Collection", "Collection Properties"},
534 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object Properties"},
536 "CONSTRAINT",
537 ICON_CONSTRAINT,
538 "Constraints",
539 "Object Constraint Properties"},
540 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifier Properties"},
541 {BCONTEXT_DATA, "DATA", ICON_NONE, "Data", "Object Data Properties"},
542 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone Properties"},
544 "BONE_CONSTRAINT",
545 ICON_CONSTRAINT_BONE,
546 "Bone Constraints",
547 "Bone Constraint Properties"},
548 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material Properties"},
549 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture Properties"},
550 {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle Properties"},
551 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics Properties"},
552 {BCONTEXT_SHADERFX, "SHADERFX", ICON_SHADERFX, "Effects", "Visual Effects Properties"},
553 {BCONTEXT_STRIP, "STRIP", ICON_SEQ_SEQUENCER, "Strip", "Strip Properties"},
555 "STRIP_MODIFIER",
556 ICON_SEQ_STRIP_MODIFIER,
557 "Strip Modifiers",
558 "Strip Modifier Properties"},
559 {0, nullptr, 0, nullptr, nullptr},
560};
561
563 {0, "NONE", 0, "None", "Only list current directory's content, with no recursion"},
564 {1, "BLEND", 0, "Blend File", "List .blend files' content"},
565 {2, "ALL_1", 0, "One Level", "List all sub-directories' content, one level of recursion"},
566 {3, "ALL_2", 0, "Two Levels", "List all sub-directories' content, two levels of recursion"},
567 {4,
568 "ALL_3",
569 0,
570 "Three Levels",
571 "List all sub-directories' content, three levels of recursion"},
572 {0, nullptr, 0, nullptr, nullptr},
573};
574
577 "LIST_VERTICAL",
578 ICON_LONGDISPLAY,
579 "Vertical List",
580 "Display files as a vertical list"},
582 "LIST_HORIZONTAL",
583 ICON_SHORTDISPLAY,
584 "Horizontal List",
585 "Display files as a horizontal list"},
586 {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
587 {0, nullptr, 0, nullptr, nullptr},
588};
589
591 {CURVE_HANDLE_NONE, "NONE", 0, "None", ""},
592 {CURVE_HANDLE_SELECTED, "SELECTED", 0, "Selected", ""},
593 {CURVE_HANDLE_ALL, "ALL", 0, "All", ""},
594 {0, nullptr, 0, nullptr, nullptr},
595};
596
599 "EVALUATED",
600 ICON_NONE,
601 "Evaluated",
602 "Use data from fully or partially evaluated object"},
604 "ORIGINAL",
605 ICON_NONE,
606 "Original",
607 "Use data from original object without any modifiers applied"},
609 "VIEWER_NODE",
610 ICON_NONE,
611 "Viewer Node",
612 "Use intermediate data from viewer node"},
613 {0, nullptr, 0, nullptr, nullptr},
614};
615
618 "GEOMETRY",
619 ICON_NONE,
620 "Geometry",
621 "Table contains geometry data"},
622 {0, nullptr, 0, nullptr, nullptr},
623
624};
625
626#ifdef RNA_RUNTIME
627
628# include <algorithm>
629# include <fmt/format.h>
630
632
633# include "DNA_anim_types.h"
634# include "DNA_asset_types.h"
635# include "DNA_key_types.h"
636# include "DNA_scene_types.h"
637# include "DNA_screen_types.h"
638# include "DNA_sequence_types.h"
639# include "DNA_userdef_types.h"
640
641# include "BLI_index_range.hh"
642# include "BLI_math_matrix.h"
643# include "BLI_math_rotation.h"
644# include "BLI_math_vector.h"
645# include "BLI_path_utils.hh"
646# include "BLI_string.h"
647
648# include "BKE_anim_data.hh"
649# include "BKE_brush.hh"
650# include "BKE_context.hh"
651# include "BKE_global.hh"
652# include "BKE_icons.h"
653# include "BKE_idprop.hh"
654# include "BKE_image.hh"
655# include "BKE_key.hh"
656# include "BKE_layer.hh"
657# include "BKE_nla.hh"
658# include "BKE_node.hh"
659# include "BKE_paint.hh"
660# include "BKE_preferences.h"
661# include "BKE_scene.hh"
662# include "BKE_screen.hh"
663# include "BKE_studiolight.h"
664# include "BKE_workspace.hh"
665
666# include "DEG_depsgraph.hh"
667# include "DEG_depsgraph_build.hh"
668
669# include "ED_anim_api.hh"
670# include "ED_asset.hh"
671# include "ED_buttons.hh"
672# include "ED_clip.hh"
673# include "ED_fileselect.hh"
674# include "ED_image.hh"
675# include "ED_node.hh"
676# include "ED_screen.hh"
677# include "ED_sequencer.hh"
678# include "ED_spreadsheet.hh"
679# include "ED_text.hh"
680# include "ED_transform.hh"
681# include "ED_view3d.hh"
682
683# include "GPU_material.hh"
684
685# include "IMB_imbuf_types.hh"
686
687# include "UI_interface.hh"
688# include "UI_view2d.hh"
689
690# include "SEQ_proxy.hh"
691# include "SEQ_relations.hh"
692
693# include "RE_engine.h"
694
695/* -------------------------------------------------------------------- */
698
699static StructRNA *rna_Space_refine(PointerRNA *ptr)
700{
701 SpaceLink *space = (SpaceLink *)ptr->data;
702
703 switch ((eSpace_Type)space->spacetype) {
704 case SPACE_VIEW3D:
705 return &RNA_SpaceView3D;
706 case SPACE_GRAPH:
707 return &RNA_SpaceGraphEditor;
708 case SPACE_OUTLINER:
709 return &RNA_SpaceOutliner;
710 case SPACE_PROPERTIES:
711 return &RNA_SpaceProperties;
712 case SPACE_FILE:
713 return &RNA_SpaceFileBrowser;
714 case SPACE_IMAGE:
715 return &RNA_SpaceImageEditor;
716 case SPACE_INFO:
717 return &RNA_SpaceInfo;
718 case SPACE_SEQ:
719 return &RNA_SpaceSequenceEditor;
720 case SPACE_TEXT:
721 return &RNA_SpaceTextEditor;
722 case SPACE_ACTION:
723 return &RNA_SpaceDopeSheetEditor;
724 case SPACE_NLA:
725 return &RNA_SpaceNLA;
726 case SPACE_NODE:
727 return &RNA_SpaceNodeEditor;
728 case SPACE_CONSOLE:
729 return &RNA_SpaceConsole;
730 case SPACE_USERPREF:
731 return &RNA_SpacePreferences;
732 case SPACE_CLIP:
733 return &RNA_SpaceClipEditor;
735 return &RNA_SpaceSpreadsheet;
736
737 /* Currently no type info. */
738 case SPACE_SCRIPT:
739 case SPACE_EMPTY:
740 case SPACE_TOPBAR:
741 case SPACE_STATUSBAR:
742 break;
743 }
744
745 return &RNA_Space;
746}
747
748static ScrArea *rna_area_from_space(const PointerRNA *ptr)
749{
750 RNA_struct_is_a(ptr->type, &RNA_Space);
751 bScreen *screen = reinterpret_cast<bScreen *>(ptr->owner_id);
752 SpaceLink *link = static_cast<SpaceLink *>(ptr->data);
753 return BKE_screen_find_area_from_space(screen, link);
754}
755
756static void area_region_from_regiondata(bScreen *screen,
757 void *regiondata,
758 ScrArea **r_area,
759 ARegion **r_region)
760{
761 *r_area = nullptr;
762 *r_region = nullptr;
763
764 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
765 LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
766 if (region->regiondata == regiondata) {
767 *r_area = area;
768 *r_region = region;
769 return;
770 }
771 }
772 }
773}
774
775static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_area, ARegion **r_region)
776{
777 bScreen *screen = (bScreen *)ptr->owner_id;
778 void *regiondata = (ptr->data);
779
780 area_region_from_regiondata(screen, regiondata, r_area, r_region);
781}
782
788static void rna_space_active_tool_reset(const PointerRNA *ptr)
789{
790 if (ScrArea *area = rna_area_from_space(ptr)) {
791 area->runtime.tool = nullptr;
792 area->runtime.is_tool_set = false;
793 area->flag |= AREA_FLAG_ACTIVE_TOOL_UPDATE;
794 }
795}
796
798
799/* -------------------------------------------------------------------- */
802
803static bool rna_Space_bool_from_region_flag_get_by_type(PointerRNA *ptr,
804 const int region_type,
805 const int region_flag)
806{
807 ScrArea *area = rna_area_from_space(ptr);
808 ARegion *region = BKE_area_find_region_type(area, region_type);
809 if (region) {
810 return (region->flag & region_flag);
811 }
812 return false;
813}
814
815static void rna_Space_bool_from_region_flag_set_by_type(PointerRNA *ptr,
816 const int region_type,
817 const int region_flag,
818 bool value)
819{
820 ScrArea *area = rna_area_from_space(ptr);
821 ARegion *region = BKE_area_find_region_type(area, region_type);
822 if (region && (region->alignment != RGN_ALIGN_NONE)) {
823 SET_FLAG_FROM_TEST(region->flag, value, region_flag);
824 }
825 ED_region_tag_redraw(region);
826}
827
828static void rna_Space_bool_from_region_flag_update_by_type(bContext *C,
830 const int region_type,
831 const int region_flag)
832{
833 ScrArea *area = rna_area_from_space(ptr);
834 ARegion *region = BKE_area_find_region_type(area, region_type);
835 if (region) {
836 if (region_flag == RGN_FLAG_HIDDEN) {
837 /* Only support animation when the area is in the current context. */
838 if (region->overlap && (area == CTX_wm_area(C)) && !(U.uiflag & USER_REDUCE_MOTION)) {
840 }
841 else {
843 }
844 }
845 else if (region_flag == RGN_FLAG_HIDDEN_BY_USER) {
846 if (!(region->flag & RGN_FLAG_HIDDEN_BY_USER) != !(region->flag & RGN_FLAG_HIDDEN)) {
847 ED_region_toggle_hidden(C, region);
848
849 if ((region->flag & RGN_FLAG_HIDDEN_BY_USER) == 0) {
851 }
852 }
853 }
854 }
855}
856
858
859/* -------------------------------------------------------------------- */
862
863/* Header Region. */
864static bool rna_Space_show_region_header_get(PointerRNA *ptr)
865{
866 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN);
867}
868static void rna_Space_show_region_header_set(PointerRNA *ptr, bool value)
869{
870 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN, !value);
871
872 /* Special case, never show the tool properties when the header is invisible. */
873 bool value_for_tool_header = value;
874 if (value == true) {
875 ScrArea *area = rna_area_from_space(ptr);
876 ARegion *region_tool_header = BKE_area_find_region_type(area, RGN_TYPE_TOOL_HEADER);
877 if (region_tool_header != nullptr) {
878 value_for_tool_header = !(region_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER);
879 }
880 }
881 rna_Space_bool_from_region_flag_set_by_type(
882 ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN, !value_for_tool_header);
883}
884static void rna_Space_show_region_header_update(bContext *C, PointerRNA *ptr)
885{
886 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN);
887}
888
889/* Footer Region. */
890static bool rna_Space_show_region_footer_get(PointerRNA *ptr)
891{
892 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN);
893}
894static void rna_Space_show_region_footer_set(PointerRNA *ptr, bool value)
895{
896 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN, !value);
897}
898static void rna_Space_show_region_footer_update(bContext *C, PointerRNA *ptr)
899{
900 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN);
901}
902
903/* Tool Header Region.
904 *
905 * This depends on the 'RGN_TYPE_TOOL_HEADER'
906 */
907static bool rna_Space_show_region_tool_header_get(PointerRNA *ptr)
908{
909 return !rna_Space_bool_from_region_flag_get_by_type(
911}
912static void rna_Space_show_region_tool_header_set(PointerRNA *ptr, bool value)
913{
914 rna_Space_bool_from_region_flag_set_by_type(
916 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN, !value);
917}
918static void rna_Space_show_region_tool_header_update(bContext *C, PointerRNA *ptr)
919{
920 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN);
921}
922
923/* Tools Region. */
924static bool rna_Space_show_region_toolbar_get(PointerRNA *ptr)
925{
926 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN);
927}
928static void rna_Space_show_region_toolbar_set(PointerRNA *ptr, bool value)
929{
930 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN, !value);
931}
932static void rna_Space_show_region_toolbar_update(bContext *C, PointerRNA *ptr)
933{
934 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN);
935}
936
937static bool rna_Space_show_region_tool_props_get(PointerRNA *ptr)
938{
939 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
940}
941static void rna_Space_show_region_tool_props_set(PointerRNA *ptr, bool value)
942{
943 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN, !value);
944}
945static void rna_Space_show_region_tool_props_update(bContext *C, PointerRNA *ptr)
946{
947 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
948}
949
950/* Channels Region. */
951static bool rna_Space_show_region_channels_get(PointerRNA *ptr)
952{
953 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN);
954}
955static void rna_Space_show_region_channels_set(PointerRNA *ptr, bool value)
956{
957 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN, !value);
958}
959static void rna_Space_show_region_channels_update(bContext *C, PointerRNA *ptr)
960{
961 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN);
962}
963
964/* UI Region */
965static bool rna_Space_show_region_ui_get(PointerRNA *ptr)
966{
967 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN);
968}
969static void rna_Space_show_region_ui_set(PointerRNA *ptr, bool value)
970{
971 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN, !value);
972}
973static void rna_Space_show_region_ui_update(bContext *C, PointerRNA *ptr)
974{
975 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN);
976}
977
978/* Redo (HUD) Region */
979static bool rna_Space_show_region_hud_get(PointerRNA *ptr)
980{
981 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER);
982}
983static void rna_Space_show_region_hud_set(PointerRNA *ptr, bool value)
984{
985 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER, !value);
986}
987static void rna_Space_show_region_hud_update(bContext *C, PointerRNA *ptr)
988{
989 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER);
990}
991
992/* Asset Shelf Regions */
993static bool rna_Space_show_region_asset_shelf_get(PointerRNA *ptr)
994{
995 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN);
996}
997static void rna_Space_show_region_asset_shelf_set(PointerRNA *ptr, bool value)
998{
999 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN, !value);
1000}
1001static int rna_Space_show_region_asset_shelf_editable(const PointerRNA *ptr, const char **r_info)
1002{
1003 ScrArea *area = rna_area_from_space(ptr);
1005
1006 if (!region) {
1007 return 0;
1008 }
1009
1010 if (region->flag & RGN_FLAG_POLL_FAILED) {
1011 if (r_info) {
1012 *r_info = N_(
1013 "The asset shelf is not available in the current context (try changing the active mode "
1014 "or tool)");
1015 }
1016 return 0;
1017 }
1018
1019 return PROP_EDITABLE;
1020}
1021
1022static void rna_Space_show_region_asset_shelf_update(bContext *C, PointerRNA *ptr)
1023{
1024 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN);
1025}
1026
1028
1029static bool rna_Space_view2d_sync_get(PointerRNA *ptr)
1030{
1031 ScrArea *area;
1032 ARegion *region;
1033
1034 area = rna_area_from_space(ptr); /* can be nullptr */
1035 if (area == nullptr) {
1036 return false;
1037 }
1038
1039 if (area->spacetype == SPACE_CLIP) {
1041 }
1042 else {
1044 }
1045 if (region) {
1046 View2D *v2d = &region->v2d;
1047 return (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME) != 0;
1048 }
1049
1050 return false;
1051}
1052
1053static void rna_Space_view2d_sync_set(PointerRNA *ptr, bool value)
1054{
1055 ScrArea *area;
1056 ARegion *region;
1057
1058 area = rna_area_from_space(ptr); /* can be nullptr */
1059 if (!area) {
1060 return;
1061 }
1062
1063 if (!UI_view2d_area_supports_sync(area)) {
1064 BKE_reportf(nullptr,
1065 RPT_ERROR,
1066 "'show_locked_time' is not supported for the '%s' editor",
1067 area->type->name);
1068 return;
1069 }
1070
1071 if (area->spacetype == SPACE_CLIP) {
1073 }
1074 else {
1076 }
1077 if (region) {
1078 View2D *v2d = &region->v2d;
1079 if (value) {
1081 }
1082 else {
1084 }
1085 }
1086}
1087
1088static void rna_Space_view2d_sync_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1089{
1090 ScrArea *area;
1091 ARegion *region;
1092
1093 area = rna_area_from_space(ptr); /* can be nullptr */
1094 if (area == nullptr) {
1095 return;
1096 }
1097
1098 if (area->spacetype == SPACE_CLIP) {
1100 }
1101 else {
1103 }
1104
1105 if (region) {
1106 bScreen *screen = (bScreen *)ptr->owner_id;
1107 View2D *v2d = &region->v2d;
1108
1109 UI_view2d_sync(screen, area, v2d, V2D_LOCK_SET);
1110 }
1111}
1112
1113/* Space 3D View */
1114static void rna_SpaceView3D_camera_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1115{
1116 View3D *v3d = (View3D *)(ptr->data);
1117 if (v3d->scenelock && scene != nullptr) {
1118 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
1119
1120 scene->camera = v3d->camera;
1122 }
1123}
1124
1125static void rna_SpaceView3D_use_local_camera_set(PointerRNA *ptr, bool value)
1126{
1127 View3D *v3d = (View3D *)(ptr->data);
1128 bScreen *screen = (bScreen *)ptr->owner_id;
1129
1130 v3d->scenelock = !value;
1131
1132 if (!value) {
1133 Scene *scene = ED_screen_scene_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1134 /* nullptr if the screen isn't in an active window (happens when setting from Python).
1135 * This could be moved to the update function, in that case the scene won't relate to the
1136 * screen so keep it working this way. */
1137 if (scene != nullptr) {
1138 v3d->camera = scene->camera;
1139 }
1140 }
1141}
1142
1143static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr)
1144{
1145 View3D *v3d = (View3D *)(ptr->data);
1146 bScreen *screen = (bScreen *)ptr->owner_id;
1147 Scene *scene = ED_screen_scene_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1148 if (scene != nullptr) {
1149 return ED_view3d_grid_scale(scene, v3d, nullptr);
1150 }
1151 else {
1152 /* When accessed from non-active screen. */
1153 return 1.0f;
1154 }
1155}
1156
1157static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
1158{
1159 View3D *v3d = (View3D *)(ptr->data);
1160 ScrArea *area = rna_area_from_space(ptr);
1161 void *regiondata = nullptr;
1162 if (area) {
1163 ListBase *regionbase = (area->spacedata.first == v3d) ? &area->regionbase : &v3d->regionbase;
1164 ARegion *region = static_cast<ARegion *>(regionbase->last); /* always last in list, weak. */
1165 regiondata = region->regiondata;
1166 }
1167
1168 return RNA_pointer_create_with_parent(*ptr, &RNA_RegionView3D, regiondata);
1169}
1170
1171static void rna_SpaceView3D_object_type_visibility_update(Main * /*bmain*/,
1172 Scene *scene,
1173 PointerRNA * /*ptr*/)
1174{
1176}
1177
1178static void rna_SpaceView3D_shading_use_compositor_update(Main * /*bmain*/,
1179 Scene * /*scene*/,
1180 PointerRNA * /*ptr*/)
1181{
1182 /* Nodes may display warnings when the compositor is enabled, so we need a redraw in that case,
1183 * and even when it gets disabled in order to potentially remove the warning. */
1185}
1186
1187static void rna_SpaceView3D_retopology_update(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
1188{
1189 /* Retopology can change the visibility of active object.
1190 * There is no actual data change but we just notify the viewport engine to refresh and pickup
1191 * the new visibility. */
1193}
1194
1195static void rna_SpaceView3D_show_overlay_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1196{
1197 /* If Retopology is enabled, toggling overlays can change the visibility of active object. */
1198 const View3D *v3d = static_cast<View3D *>(ptr->data);
1200 rna_SpaceView3D_retopology_update(bmain, scene, ptr);
1201 }
1202}
1203
1204static void rna_SpaceView3D_region_quadviews_begin(CollectionPropertyIterator *iter,
1205 PointerRNA *ptr)
1206{
1207 View3D *v3d = (View3D *)(ptr->data);
1208 ScrArea *area = rna_area_from_space(ptr);
1209 int i = 3;
1210
1211 ARegion *region = static_cast<ARegion *>(
1212 ((area && area->spacedata.first == v3d) ? &area->regionbase : &v3d->regionbase)->last);
1213 ListBase lb = {nullptr, nullptr};
1214
1215 if (region && region->alignment == RGN_ALIGN_QSPLIT) {
1216 while (i-- && region) {
1217 region = region->prev;
1218 }
1219
1220 if (i < 0) {
1221 lb.first = region;
1222 }
1223 }
1224
1225 rna_iterator_listbase_begin(iter, ptr, &lb, nullptr);
1226}
1227
1228static PointerRNA rna_SpaceView3D_region_quadviews_get(CollectionPropertyIterator *iter)
1229{
1230 void *regiondata = ((ARegion *)rna_iterator_listbase_get(iter))->regiondata;
1231
1232 return RNA_pointer_create_with_parent(iter->parent, &RNA_RegionView3D, regiondata);
1233}
1234
1235static void rna_RegionView3D_quadview_update(Main * /*main*/, Scene * /*scene*/, PointerRNA *ptr)
1236{
1237 ScrArea *area;
1238 ARegion *region;
1239
1240 rna_area_region_from_regiondata(ptr, &area, &region);
1241 if (area && region && region->alignment == RGN_ALIGN_QSPLIT) {
1242 ED_view3d_quadview_update(area, region, false);
1243 }
1244}
1245
1247static void rna_RegionView3D_quadview_clip_update(Main * /*main*/,
1248 Scene * /*scene*/,
1249 PointerRNA *ptr)
1250{
1251 ScrArea *area;
1252 ARegion *region;
1253
1254 rna_area_region_from_regiondata(ptr, &area, &region);
1255 if (area && region && region->alignment == RGN_ALIGN_QSPLIT) {
1256 ED_view3d_quadview_update(area, region, true);
1257 }
1258}
1259
1265static void rna_RegionView3D_view_rotation_set_validate_view_axis(RegionView3D *rv3d)
1266{
1267 /* Never rotate from a "User" view into an axis aligned view,
1268 * otherwise rotation could be aligned by accident - giving unexpected behavior. */
1269 if (!RV3D_VIEW_IS_AXIS(rv3d->view)) {
1270 return;
1271 }
1272 /* Keep this small as script authors wont expect the assigned value to change. */
1273 const float eps_quat = 1e-6f;
1275 rv3d->viewquat, eps_quat, &rv3d->view, &rv3d->view_axis_roll);
1276}
1277
1278static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
1279{
1280 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1281 negate_v3_v3(values, rv3d->ofs);
1282}
1283
1284static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
1285{
1286 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1287 negate_v3_v3(rv3d->ofs, values);
1288}
1289
1290static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
1291{
1292 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1293 invert_qt_qt(values, rv3d->viewquat);
1294}
1295
1296static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
1297{
1298 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1299 invert_qt_qt(rv3d->viewquat, values);
1300 rna_RegionView3D_view_rotation_set_validate_view_axis(rv3d);
1301}
1302
1303static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
1304{
1305 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1306 float mat[4][4];
1307 invert_m4_m4(mat, (float (*)[4])values);
1308 ED_view3d_from_m4(mat, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
1309 rna_RegionView3D_view_rotation_set_validate_view_axis(rv3d);
1310}
1311
1312static bool rna_RegionView3D_is_orthographic_side_view_get(PointerRNA *ptr)
1313{
1314 /* NOTE: only checks axis alignment, not orthographic,
1315 * we may deprecate the current name to reflect this. */
1316 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1317 return RV3D_VIEW_IS_AXIS(rv3d->view);
1318}
1319
1320static void rna_RegionView3D_is_orthographic_side_view_set(PointerRNA *ptr, bool value)
1321{
1322 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1323 const bool was_axis_view = RV3D_VIEW_IS_AXIS(rv3d->view);
1324 if (value) {
1325 /* Already axis aligned, nothing to do. */
1326 if (was_axis_view) {
1327 return;
1328 }
1329 /* Use a large value as we always want to set this to the closest axis. */
1330 const float eps_quat = FLT_MAX;
1332 rv3d->viewquat, eps_quat, &rv3d->view, &rv3d->view_axis_roll);
1333 }
1334 else {
1335 /* Only allow changing from axis-views to user view as camera view for example
1336 * doesn't make sense to update. */
1337 if (!was_axis_view) {
1338 return;
1339 }
1340 rv3d->view = RV3D_VIEW_USER;
1341 }
1342}
1343
1344static IDProperty **rna_View3DShading_idprops(PointerRNA *ptr)
1345{
1346 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1347 return &shading->prop;
1348}
1349
1350static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1351{
1352 ID *id = ptr->owner_id;
1353 if (GS(id->name) != ID_SCR) {
1354 return;
1355 }
1356
1357 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1358 if (shading->type == OB_MATERIAL ||
1359 (shading->type == OB_RENDER && !BKE_scene_uses_blender_workbench(scene)))
1360 {
1361 /* When switching from workbench to render or material mode the geometry of any
1362 * active sculpt session needs to be recalculated. */
1363 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1364 if (ob->sculpt) {
1366 }
1367 }
1368 }
1369
1370 bScreen *screen = (bScreen *)ptr->owner_id;
1371 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1372 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1373 if (sl->spacetype == SPACE_VIEW3D) {
1374 View3D *v3d = (View3D *)sl;
1375 if (&v3d->shading == shading) {
1376 ED_view3d_shade_update(bmain, v3d, area);
1377 return;
1378 }
1379 }
1380 }
1381 }
1382}
1383
1384static Scene *rna_3DViewShading_scene(PointerRNA *ptr)
1385{
1386 /* Get scene, depends if using 3D view or OpenGL render settings. */
1387 ID *id = ptr->owner_id;
1388 if (GS(id->name) == ID_SCE) {
1389 return (Scene *)id;
1390 }
1391 else {
1392 bScreen *screen = (bScreen *)ptr->owner_id;
1393 return WM_windows_scene_get_from_screen(static_cast<wmWindowManager *>(G_MAIN->wm.first),
1394 screen);
1395 }
1396}
1397
1398static ViewLayer *rna_3DViewShading_view_layer(PointerRNA *ptr)
1399{
1400 /* Get scene, depends if using 3D view or OpenGL render settings. */
1401 ID *id = ptr->owner_id;
1402 if (GS(id->name) == ID_SCE) {
1403 return nullptr;
1404 }
1405 else {
1406 bScreen *screen = (bScreen *)ptr->owner_id;
1407 return WM_windows_view_layer_get_from_screen(static_cast<wmWindowManager *>(G_MAIN->wm.first),
1408 screen);
1409 }
1410}
1411
1412static int rna_3DViewShading_type_get(PointerRNA *ptr)
1413{
1414 /* Available shading types depend on render engine. */
1415 Scene *scene = rna_3DViewShading_scene(ptr);
1416 RenderEngineType *type = (scene) ? RE_engines_find(scene->r.engine) : nullptr;
1417 View3DShading *shading = (View3DShading *)ptr->data;
1418
1419 if (scene == nullptr || BKE_scene_uses_blender_eevee(scene)) {
1420 return shading->type;
1421 }
1422 else if (BKE_scene_uses_blender_workbench(scene)) {
1423 return (shading->type == OB_MATERIAL) ? int(OB_SOLID) : shading->type;
1424 }
1425 else {
1426 if (shading->type == OB_RENDER && !(type && type->view_draw)) {
1427 return OB_MATERIAL;
1428 }
1429 else {
1430 return shading->type;
1431 }
1432 }
1433}
1434
1435static void rna_3DViewShading_type_set(PointerRNA *ptr, int value)
1436{
1437 View3DShading *shading = (View3DShading *)ptr->data;
1438 if (value != shading->type && value == OB_RENDER) {
1439 shading->prev_type = shading->type;
1440 }
1441 shading->type = value;
1442}
1443
1444static const EnumPropertyItem *rna_3DViewShading_type_itemf(bContext * /*C*/,
1445 PointerRNA *ptr,
1446 PropertyRNA * /*prop*/,
1447 bool *r_free)
1448{
1449 Scene *scene = rna_3DViewShading_scene(ptr);
1450 RenderEngineType *type = (scene) ? RE_engines_find(scene->r.engine) : nullptr;
1451
1452 EnumPropertyItem *item = nullptr;
1453 int totitem = 0;
1454
1457
1458 if (scene == nullptr || BKE_scene_uses_blender_eevee(scene)) {
1461 }
1462 else if (BKE_scene_uses_blender_workbench(scene)) {
1464 }
1465 else {
1467 if (type && type->view_draw) {
1469 }
1470 }
1471
1472 RNA_enum_item_end(&item, &totitem);
1473 *r_free = true;
1474
1475 return item;
1476}
1477
1478/* Shading.selected_studio_light */
1479static PointerRNA rna_View3DShading_selected_studio_light_get(PointerRNA *ptr)
1480{
1481 View3DShading *shading = (View3DShading *)ptr->data;
1482 StudioLight *sl;
1483 if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_MATCAP) {
1485 }
1486 else if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_STUDIO) {
1488 }
1489 else {
1490 /* OB_MATERIAL and OB_RENDER */
1492 }
1493 return RNA_pointer_create_with_parent(*ptr, &RNA_StudioLight, sl);
1494}
1495
1496/* shading.light */
1497static void rna_View3DShading_studio_light_get_storage(View3DShading *shading,
1498 char **dna_storage,
1499 int *flag)
1500{
1501 *dna_storage = shading->studio_light;
1502
1504 if (shading->type == OB_SOLID) {
1505 if (shading->light == V3D_LIGHTING_MATCAP) {
1507 *dna_storage = shading->matcap;
1508 }
1509 }
1510 else {
1512 *dna_storage = shading->lookdev_light;
1513 }
1514}
1515
1516static int rna_View3DShading_studio_light_get(PointerRNA *ptr)
1517{
1518 View3DShading *shading = (View3DShading *)ptr->data;
1519 char *dna_storage;
1520 int flag;
1521
1522 rna_View3DShading_studio_light_get_storage(shading, &dna_storage, &flag);
1523 StudioLight *sl = BKE_studiolight_find(dna_storage, flag);
1524 if (sl) {
1525 BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE);
1526 return sl->index;
1527 }
1528 else {
1529 return 0;
1530 }
1531}
1532
1533static void rna_View3DShading_studio_light_set(PointerRNA *ptr, int value)
1534{
1535 View3DShading *shading = (View3DShading *)ptr->data;
1536 char *dna_storage;
1537 int flag;
1538
1539 rna_View3DShading_studio_light_get_storage(shading, &dna_storage, &flag);
1541 if (sl) {
1542 BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE);
1543 }
1544}
1545
1546static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(bContext * /*C*/,
1547 PointerRNA *ptr,
1548 PropertyRNA * /*prop*/,
1549 bool *r_free)
1550{
1551 View3DShading *shading = (View3DShading *)ptr->data;
1552 EnumPropertyItem *item = nullptr;
1553 int totitem = 0;
1554
1555 if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_MATCAP) {
1557
1559 int icon_id = (shading->flag & V3D_SHADING_MATCAP_FLIP_X) ? sl->icon_id_matcap_flipped :
1560 sl->icon_id_matcap;
1561 if ((sl->flag & flags) == flags) {
1562 EnumPropertyItem tmp = {sl->index, sl->name, icon_id, sl->name, ""};
1563 RNA_enum_item_add(&item, &totitem, &tmp);
1564 }
1565 }
1566 }
1567 else {
1569 int icon_id = sl->icon_id_irradiance;
1570 bool show_studiolight = false;
1571
1572 if (sl->flag & STUDIOLIGHT_INTERNAL) {
1573 /* always show internal lights for solid */
1574 if (shading->type == OB_SOLID) {
1575 show_studiolight = true;
1576 }
1577 }
1578 else {
1579 switch (shading->type) {
1580 case OB_SOLID:
1581 case OB_TEXTURE:
1582 show_studiolight = ((sl->flag & STUDIOLIGHT_TYPE_STUDIO) != 0);
1583 break;
1584
1585 case OB_MATERIAL:
1586 case OB_RENDER:
1587 show_studiolight = ((sl->flag & STUDIOLIGHT_TYPE_WORLD) != 0);
1588 icon_id = sl->icon_id_radiance;
1589 break;
1590 }
1591 }
1592
1593 if (show_studiolight) {
1594 EnumPropertyItem tmp = {sl->index, sl->name, icon_id, sl->name, ""};
1595 RNA_enum_item_add(&item, &totitem, &tmp);
1596 }
1597 }
1598 }
1599
1600 RNA_enum_item_end(&item, &totitem);
1601 *r_free = true;
1602 return item;
1603}
1604
1605static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C,
1606 PointerRNA * /*ptr*/,
1607 PropertyRNA * /*prop*/,
1608 bool *r_free)
1609{
1610 Scene *scene = CTX_data_scene(C);
1611 ViewLayer *view_layer = CTX_data_view_layer(C);
1612
1613 const bool aov_available = BKE_view_layer_has_valid_aov(view_layer);
1614 const bool eevee_active = STREQ(scene->r.engine, "BLENDER_EEVEE");
1615
1616 int totitem = 0;
1617 EnumPropertyItem *result = nullptr;
1618 EnumPropertyItem aov_template;
1619 for (int i = 0; rna_enum_view3dshading_render_pass_type_items[i].identifier != nullptr; i++) {
1621 if (item->value == EEVEE_RENDER_PASS_AOV) {
1622 aov_template.value = item->value;
1623 aov_template.icon = 0;
1624 aov_template.description = item->description;
1625 LISTBASE_FOREACH (ViewLayerAOV *, aov, &view_layer->aovs) {
1626 if ((aov->flag & AOV_CONFLICT) != 0) {
1627 continue;
1628 }
1629 aov_template.name = aov->name;
1630 aov_template.identifier = aov->name;
1631 RNA_enum_item_add(&result, &totitem, &aov_template);
1632 aov_template.value++;
1633 }
1634 }
1635 else if (ELEM(item->value,
1639 !eevee_active)
1640 {
1641 }
1642 else if (!aov_available && STREQ(item->name, "Shader AOV")) {
1643 /* Don't add Shader AOV submenu when there are no AOVs defined. */
1644 }
1645 else {
1646 RNA_enum_item_add(&result, &totitem, item);
1647 }
1648 }
1649
1650 RNA_enum_item_end(&result, &totitem);
1651 *r_free = true;
1652 return result;
1653}
1654static int rna_3DViewShading_render_pass_get(PointerRNA *ptr)
1655{
1656 View3DShading *shading = (View3DShading *)ptr->data;
1658 ViewLayer *view_layer = rna_3DViewShading_view_layer(ptr);
1659
1661 if (!view_layer) {
1663 }
1664 const int aov_index = BLI_findstringindex(
1665 &view_layer->aovs, shading->aov_name, offsetof(ViewLayerAOV, name));
1666 if (aov_index == -1) {
1668 }
1669 return result + aov_index;
1670 }
1671
1672 return result;
1673}
1674
1675static void rna_3DViewShading_render_pass_set(PointerRNA *ptr, int value)
1676{
1677 View3DShading *shading = (View3DShading *)ptr->data;
1678 ViewLayer *view_layer = rna_3DViewShading_view_layer(ptr);
1679 shading->aov_name[0] = 0;
1680
1681 if ((value & EEVEE_RENDER_PASS_AOV) != 0) {
1682 if (!view_layer) {
1684 return;
1685 }
1686 const int aov_index = value & ~EEVEE_RENDER_PASS_AOV;
1687 ViewLayerAOV *aov = static_cast<ViewLayerAOV *>(BLI_findlink(&view_layer->aovs, aov_index));
1688 if (!aov) {
1689 /* AOV not found, cannot select AOV. */
1691 return;
1692 }
1693
1695 STRNCPY(shading->aov_name, aov->name);
1696 }
1697 else {
1698 shading->render_pass = value;
1699 }
1700}
1701
1702static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA *ptr)
1703{
1704 Main *bmain = CTX_data_main(C);
1705 Scene *scene = CTX_data_scene(C);
1706 ViewLayer *view_layer = CTX_data_view_layer(C);
1707 View3D *v3d = (View3D *)ptr->data;
1708
1709 if (ED_view3d_local_collections_set(bmain, v3d)) {
1710 BKE_layer_collection_local_sync(scene, view_layer, v3d);
1712 }
1713}
1714
1715static const EnumPropertyItem *rna_SpaceView3D_stereo3d_camera_itemf(bContext *C,
1716 PointerRNA * /*ptr*/,
1717 PropertyRNA * /*prop*/,
1718 bool * /*r_free*/)
1719{
1720 Scene *scene = CTX_data_scene(C);
1721
1723 return multiview_camera_items;
1724 }
1725 else {
1726 return stereo3d_camera_items;
1727 }
1728}
1729
1730static void rna_SpaceView3D_mirror_xr_session_update(Main *main,
1731 Scene * /*scene*/,
1732 PointerRNA *ptr)
1733{
1734# ifdef WITH_XR_OPENXR
1735 const wmWindowManager *wm = static_cast<wmWindowManager *>(main->wm.first);
1736
1737 /* Handle mirror toggling while there is a session already. */
1738 if (WM_xr_session_exists(&wm->xr)) {
1739 const View3D *v3d = static_cast<const View3D *>(ptr->data);
1740 const ScrArea *area = rna_area_from_space(ptr);
1741 ED_view3d_xr_mirror_update(area, v3d, v3d->flag & V3D_XR_SESSION_MIRROR);
1742 }
1743
1744# else
1746# endif
1747}
1748
1749static int rna_SpaceView3D_icon_from_show_object_viewport_get(PointerRNA *ptr)
1750{
1751 const View3D *v3d = (View3D *)ptr->data;
1754}
1755
1756static std::optional<std::string> rna_View3DShading_path(const PointerRNA *ptr)
1757{
1758 if (GS(ptr->owner_id->name) == ID_SCE) {
1759 return "display.shading";
1760 }
1761 else if (GS(ptr->owner_id->name) == ID_SCR) {
1762 const bScreen *screen = reinterpret_cast<bScreen *>(ptr->owner_id);
1763 const View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1764 int area_index;
1765 int space_index;
1766 LISTBASE_FOREACH_INDEX (ScrArea *, area, &screen->areabase, area_index) {
1767 LISTBASE_FOREACH_INDEX (SpaceLink *, sl, &area->spacedata, space_index) {
1768 if (sl->spacetype == SPACE_VIEW3D) {
1769 View3D *v3d = reinterpret_cast<View3D *>(sl);
1770 if (&v3d->shading == shading) {
1771 return fmt::format("areas[{}].spaces[{}].shading", area_index, space_index);
1772 }
1773 }
1774 }
1775 }
1776 }
1777
1778 return "shading";
1779}
1780
1781static PointerRNA rna_SpaceView3D_overlay_get(PointerRNA *ptr)
1782{
1783 return RNA_pointer_create_with_parent(*ptr, &RNA_View3DOverlay, ptr->data);
1784}
1785
1786static std::optional<std::string> rna_View3DOverlay_path(const PointerRNA *ptr)
1787{
1788 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
1789 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
1790}
1791
1792/* Space Image Editor */
1793
1794static PointerRNA rna_SpaceImage_overlay_get(PointerRNA *ptr)
1795{
1796 return RNA_pointer_create_with_parent(*ptr, &RNA_SpaceImageOverlay, ptr->data);
1797}
1798
1799static std::optional<std::string> rna_SpaceImageOverlay_path(const PointerRNA *ptr)
1800{
1801 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
1802 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
1803}
1804
1805static std::optional<std::string> rna_SpaceUVEditor_path(const PointerRNA *ptr)
1806{
1807 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
1808 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "uv_editor");
1809}
1810
1811static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
1812{
1813 return RNA_pointer_create_with_parent(*ptr, &RNA_SpaceUVEditor, ptr->data);
1814}
1815
1816static void rna_SpaceImageEditor_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1817{
1818 if (scene != nullptr) {
1819 ED_space_image_paint_update(bmain, static_cast<wmWindowManager *>(bmain->wm.first), scene);
1820 }
1821
1822 /* The mode defines the tool. */
1823 rna_space_active_tool_reset(ptr);
1824}
1825
1826static void rna_SpaceImageEditor_show_stereo_set(PointerRNA *ptr, bool value)
1827{
1828 SpaceImage *sima = (SpaceImage *)(ptr->data);
1829
1830 if (value) {
1831 sima->iuser.flag |= IMA_SHOW_STEREO;
1832 }
1833 else {
1834 sima->iuser.flag &= ~IMA_SHOW_STEREO;
1835 }
1836}
1837
1838static bool rna_SpaceImageEditor_show_stereo_get(PointerRNA *ptr)
1839{
1840 SpaceImage *sima = (SpaceImage *)(ptr->data);
1841 return (sima->iuser.flag & IMA_SHOW_STEREO) != 0;
1842}
1843
1844static void rna_SpaceImageEditor_show_stereo_update(Main * /*bmain*/,
1845 Scene * /*scene*/,
1846 PointerRNA *ptr)
1847{
1848 SpaceImage *sima = (SpaceImage *)(ptr->data);
1849 Image *ima = sima->image;
1850
1851 if (ima) {
1852 if (ima->rr) {
1853 BKE_image_multilayer_index(ima->rr, &sima->iuser);
1854 }
1855 else {
1856 BKE_image_multiview_index(ima, &sima->iuser);
1857 }
1858 }
1859}
1860
1861static void rna_SpaceImageEditor_show_sequencer_scene_set(PointerRNA *ptr, bool value)
1862{
1863 SpaceImage *sima = ptr->data_as<SpaceImage>();
1864
1865 if (value) {
1867 }
1868 else {
1870 }
1871}
1872
1873static bool rna_SpaceImageEditor_show_sequencer_scene_get(PointerRNA *ptr)
1874{
1875 SpaceImage *sima = ptr->data_as<SpaceImage>();
1876 return (sima->iuser.flag & IMA_SHOW_SEQUENCER_SCENE) != 0;
1877}
1878
1879static bool rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
1880{
1881 SpaceImage *sima = (SpaceImage *)(ptr->data);
1882 return ED_space_image_show_render(sima);
1883}
1884
1885static bool rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
1886{
1887 SpaceImage *sima = (SpaceImage *)(ptr->data);
1888 return ED_space_image_show_paint(sima);
1889}
1890
1891static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
1892{
1893 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
1894 bScreen *screen = (bScreen *)ptr->owner_id;
1895 Object *obedit = nullptr;
1896 wmWindow *win = ED_screen_window_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1897 if (win != nullptr) {
1898 Scene *scene = WM_window_get_active_scene(win);
1899 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
1900 BKE_view_layer_synced_ensure(scene, view_layer);
1901 obedit = BKE_view_layer_edit_object_get(view_layer);
1902 }
1903 return ED_space_image_show_uvedit(sima, obedit);
1904}
1905
1906static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
1907{
1908 SpaceImage *sima = (SpaceImage *)(ptr->data);
1909 bScreen *screen = (bScreen *)ptr->owner_id;
1910 Object *obedit = nullptr;
1911 wmWindow *win = ED_screen_window_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1912 if (win != nullptr) {
1913 Scene *scene = WM_window_get_active_scene(win);
1914 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
1915 BKE_view_layer_synced_ensure(scene, view_layer);
1916 obedit = BKE_view_layer_edit_object_get(view_layer);
1917 }
1918 return ED_space_image_check_show_maskedit(sima, obedit);
1919}
1920
1921static void rna_SpaceImageEditor_image_set(PointerRNA *ptr,
1922 PointerRNA value,
1923 ReportList * /*reports*/)
1924{
1925 BLI_assert(BKE_id_is_in_global_main(static_cast<ID *>(value.data)));
1926 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
1927 ED_space_image_set(G_MAIN, sima, (Image *)value.data, false);
1928}
1929
1930static void rna_SpaceImageEditor_mask_set(PointerRNA *ptr,
1931 PointerRNA value,
1932 ReportList * /*reports*/)
1933{
1934 SpaceImage *sima = (SpaceImage *)(ptr->data);
1935
1936 ED_space_image_set_mask(nullptr, sima, (Mask *)value.data);
1937}
1938
1939static const EnumPropertyItem *rna_SpaceImageEditor_display_channels_itemf(bContext * /*C*/,
1940 PointerRNA *ptr,
1941 PropertyRNA * /*prop*/,
1942 bool *r_free)
1943{
1944 SpaceImage *sima = (SpaceImage *)ptr->data;
1945 EnumPropertyItem *item = nullptr;
1946 ImBuf *ibuf;
1947 void *lock;
1948 int totitem = 0;
1949
1950 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
1953
1954 if (mask & SI_USE_ALPHA) {
1956 }
1958 if (mask & SI_SHOW_ALPHA) {
1960 }
1961 if (mask & SI_SHOW_ZBUF) {
1963 }
1964 if (mask & SI_SHOW_R) {
1966 }
1967 if (mask & SI_SHOW_G) {
1969 }
1970 if (mask & SI_SHOW_B) {
1972 }
1973
1974 RNA_enum_item_end(&item, &totitem);
1975 *r_free = true;
1976
1977 return item;
1978}
1979
1980static int rna_SpaceImageEditor_display_channels_get(PointerRNA *ptr)
1981{
1982 SpaceImage *sima = (SpaceImage *)ptr->data;
1983 ImBuf *ibuf;
1984 void *lock;
1985
1986 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
1989
1990 return sima->flag & mask;
1991}
1992
1993static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
1994{
1995 SpaceImage *sima = (SpaceImage *)ptr->data;
1996 ScrArea *area;
1997 ARegion *region;
1998
1999 values[0] = values[1] = 1;
2000
2001 /* Find #ARegion. */
2002 area = rna_area_from_space(ptr); /* can be nullptr */
2004 if (region) {
2005 ED_space_image_get_zoom(sima, region, &values[0], &values[1]);
2006 }
2007}
2008
2009static float rna_SpaceImageEditor_zoom_percentage_get(PointerRNA *ptr)
2010{
2011 SpaceImage *sima = (SpaceImage *)ptr->data;
2012 return sima->zoom * 100.0f;
2013}
2014
2015static void rna_SpaceImageEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
2016{
2017 SpaceImage *sima = (SpaceImage *)ptr->data;
2018 sima->zoom = value / 100.0f;
2019}
2020
2021static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
2022{
2023 SpaceImage *sima = (SpaceImage *)ptr->data;
2024
2025 if (sima->flag & SI_COORDFLOATS) {
2026 copy_v2_v2(values, sima->cursor);
2027 }
2028 else {
2029 int w, h;
2030 ED_space_image_get_size(sima, &w, &h);
2031
2032 values[0] = sima->cursor[0] * w;
2033 values[1] = sima->cursor[1] * h;
2034 }
2035}
2036
2037static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
2038{
2039 SpaceImage *sima = (SpaceImage *)ptr->data;
2040
2041 if (sima->flag & SI_COORDFLOATS) {
2042 copy_v2_v2(sima->cursor, values);
2043 }
2044 else {
2045 int w, h;
2046 ED_space_image_get_size(sima, &w, &h);
2047
2048 sima->cursor[0] = values[0] / w;
2049 sima->cursor[1] = values[1] / h;
2050 }
2051}
2052
2053static void rna_SpaceImageEditor_image_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2054{
2055 SpaceImage *sima = (SpaceImage *)ptr->data;
2056 Image *ima = sima->image;
2057
2058 /* make sure all the iuser settings are valid for the sima image */
2059 if (ima) {
2060 if (ima->rr) {
2061 if (BKE_image_multilayer_index(sima->image->rr, &sima->iuser) == nullptr) {
2062 BKE_image_init_imageuser(sima->image, &sima->iuser);
2063 }
2064 }
2065 else {
2066 BKE_image_multiview_index(ima, &sima->iuser);
2067 }
2068 }
2069}
2070
2071static void rna_SpaceImageEditor_scopes_update(bContext *C, PointerRNA *ptr)
2072{
2073 SpaceImage *sima = (SpaceImage *)ptr->data;
2074 ImBuf *ibuf;
2075 void *lock;
2076
2077 /* TODO(lukas): Support tiles in scopes? */
2078 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
2079 if (ibuf) {
2080 ED_space_image_scopes_update(C, sima, ibuf, true);
2082 }
2084}
2085
2086static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext * /*C*/,
2087 PointerRNA *ptr,
2088 PropertyRNA * /*prop*/,
2089 bool * /*r_free*/)
2090{
2091 static const EnumPropertyItem pivot_items[] = {
2092 {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
2093 {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
2094 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
2096 "INDIVIDUAL_ORIGINS",
2097 ICON_PIVOT_INDIVIDUAL,
2098 "Individual Origins",
2099 "Pivot around each selected island's own median point"},
2100 {0, nullptr, 0, nullptr, nullptr},
2101 };
2102
2103 SpaceImage *sima = (SpaceImage *)ptr->data;
2104
2105 if (sima->mode == SI_MODE_PAINT) {
2107 }
2108 else {
2109 return pivot_items;
2110 }
2111}
2112
2113static void rna_SpaceUVEditor_tile_grid_shape_set(PointerRNA *ptr, const int *values)
2114{
2115 SpaceImage *data = (SpaceImage *)(ptr->data);
2116
2117 int clamp[2] = {10, 100};
2118 for (int i = 0; i < 2; i++) {
2119 data->tile_grid_shape[i] = std::clamp(values[i], 1, clamp[i]);
2120 }
2121}
2122
2123static void rna_SpaceUVEditor_custom_grid_subdiv_set(PointerRNA *ptr, const int *values)
2124{
2125 SpaceImage *data = (SpaceImage *)(ptr->data);
2126
2127 for (int i = 0; i < 2; i++) {
2128 data->custom_grid_subdiv[i] = std::clamp(values[i], 1, 5000);
2129 }
2130}
2131
2132/* Space Text Editor */
2133
2134static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, bool value)
2135{
2136 SpaceText *st = (SpaceText *)(ptr->data);
2137
2138 st->wordwrap = value;
2139 st->left = 0;
2140}
2141
2142static void rna_SpaceTextEditor_text_set(PointerRNA *ptr,
2143 PointerRNA value,
2144 ReportList * /*reports*/)
2145{
2146 SpaceText *st = (SpaceText *)(ptr->data);
2147
2148 st->text = static_cast<Text *>(value.data);
2149 if (st->text != nullptr) {
2150 id_us_ensure_real((ID *)st->text);
2151 }
2152
2153 ScrArea *area = rna_area_from_space(ptr);
2154 if (area) {
2156 if (region) {
2157 ED_space_text_scroll_to_cursor(st, region, true);
2158 }
2159 }
2160}
2161
2162static bool rna_SpaceTextEditor_text_is_syntax_highlight_supported(SpaceText *space)
2163{
2165}
2166
2167static void rna_SpaceTextEditor_updateEdited(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2168{
2169 SpaceText *st = (SpaceText *)ptr->data;
2170
2171 if (st->text) {
2173 }
2174}
2175
2176static int rna_SpaceTextEditor_visible_lines_get(PointerRNA *ptr)
2177{
2178 const SpaceText *st = static_cast<SpaceText *>(ptr->data);
2180}
2181
2182/* Space Properties */
2183
2184static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
2185{
2186 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2187
2188 if (sbuts->pinid) {
2189 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
2190 }
2191
2192 return &RNA_ID;
2193}
2194
2195static void rna_SpaceProperties_pin_id_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2196{
2197 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2198 ID *id = sbuts->pinid;
2199
2200 if (id == nullptr) {
2201 sbuts->flag &= ~SB_PIN_CONTEXT;
2202 return;
2203 }
2204
2205 switch (GS(id->name)) {
2206 case ID_MA:
2208 break;
2209 case ID_TE:
2211 break;
2212 case ID_WO:
2214 break;
2215 case ID_LA:
2216 WM_main_add_notifier(NC_LAMP, nullptr);
2217 break;
2218 default:
2219 break;
2220 }
2221}
2222
2223static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
2224{
2225 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2226
2227 sbuts->mainb = value;
2228 sbuts->mainbuser = value;
2229}
2230
2231static const EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext * /*C*/,
2232 PointerRNA *ptr,
2233 PropertyRNA * /*prop*/,
2234 bool *r_free)
2235{
2236 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2237 EnumPropertyItem *item = nullptr;
2238
2239 /* Although it would never reach this amount, a theoretical maximum number of tabs
2240 * is BCONTEXT_TOT * 2, with every tab displayed and a spacer in every other item. */
2241 const blender::Vector<eSpaceButtons_Context> context_tabs_array = ED_buttons_tabs_list(sbuts);
2242
2243 int totitem_added = 0;
2244 bool add_separator = true;
2245 for (const eSpaceButtons_Context tab : context_tabs_array) {
2246 if (tab == -1) {
2247 if (add_separator) {
2248 RNA_enum_item_add_separator(&item, &totitem_added);
2249 add_separator = false;
2250 }
2251 continue;
2252 }
2253
2254 RNA_enum_items_add_value(&item, &totitem_added, buttons_context_items, tab);
2255 add_separator = true;
2256
2257 /* Add the object data icon dynamically for the data tab. */
2258 if (tab == BCONTEXT_DATA) {
2259 (item + totitem_added - 1)->icon = sbuts->dataicon;
2260 }
2261 }
2262
2263 RNA_enum_item_end(&item, &totitem_added);
2264 *r_free = true;
2265
2266 return item;
2267}
2268
2269static void rna_SpaceProperties_context_update(Main * /*bmain*/,
2270 Scene * /*scene*/,
2271 PointerRNA *ptr)
2272{
2273 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2274 /* XXX BCONTEXT_DATA is ugly, but required for lights... See #51318. */
2276 sbuts->preview = 1;
2277 }
2278}
2279
2280static int rna_SpaceProperties_tab_search_results_getlength(const PointerRNA *ptr,
2282{
2283 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2284
2285 const blender::Vector<eSpaceButtons_Context> context_tabs_array = ED_buttons_tabs_list(sbuts);
2286
2287 length[0] = context_tabs_array.size();
2288
2289 return length[0];
2290}
2291
2292static void rna_SpaceProperties_tab_search_results_get(PointerRNA *ptr, bool *values)
2293{
2294 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2295
2296 const blender::Vector<eSpaceButtons_Context> context_tabs_array = ED_buttons_tabs_list(sbuts);
2297
2298 for (const int i : context_tabs_array.index_range()) {
2299 values[i] = ED_buttons_tab_has_search_result(sbuts, i);
2300 }
2301}
2302
2303static void rna_SpaceProperties_search_filter_get(PointerRNA *ptr, char *value)
2304{
2305 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2306 const char *search_filter = ED_buttons_search_string_get(sbuts);
2307
2308 strcpy(value, search_filter);
2309}
2310
2311static int rna_SpaceProperties_search_filter_length(PointerRNA *ptr)
2312{
2313 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2314
2315 return ED_buttons_search_string_length(sbuts);
2316}
2317
2318static void rna_SpaceProperties_search_filter_set(PointerRNA *ptr, const char *value)
2319{
2320 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2321
2322 ED_buttons_search_string_set(sbuts, value);
2323}
2324
2325static void rna_SpaceProperties_search_filter_update(Main * /*bmain*/,
2326 Scene * /*scene*/,
2327 PointerRNA *ptr)
2328{
2329 ScrArea *area = rna_area_from_space(ptr);
2330
2331 /* Update the search filter flag for the main region with the panels. */
2333 BLI_assert(main_region != nullptr);
2334 ED_region_search_filter_update(area, main_region);
2335}
2336
2337/* Space Console */
2338static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
2339{
2340 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2341 memcpy(value, ci->line, ci->len + 1);
2342}
2343
2344static int rna_ConsoleLine_body_length(PointerRNA *ptr)
2345{
2346 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2347 return ci->len;
2348}
2349
2350static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
2351{
2352 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2353 size_t len = strlen(value);
2354
2355 if ((len >= size_t(ci->len_alloc)) || (len * 2 < size_t(ci->len_alloc)))
2356 { /* allocate a new string */
2357 MEM_freeN(ci->line);
2358 ci->line = MEM_malloc_arrayN<char>(len + 1, "rna_consoleline");
2359 ci->len_alloc = int(len + 1);
2360 }
2361 memcpy(ci->line, value, len + 1);
2362 ci->len = int(len);
2363
2364 if (size_t(ci->cursor) > len) {
2365 /* clamp the cursor */
2366 ci->cursor = int(len);
2367 }
2368}
2369
2370static int rna_ConsoleLine_current_character_get(PointerRNA *ptr)
2371{
2372 const ConsoleLine *ci = (ConsoleLine *)ptr->data;
2373 return BLI_str_utf8_offset_to_index(ci->line, ci->len, ci->cursor);
2374}
2375
2376static void rna_ConsoleLine_current_character_set(PointerRNA *ptr, const int index)
2377{
2378 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2379 ci->cursor = BLI_str_utf8_offset_from_index(ci->line, ci->len, index);
2380}
2381
2382/* Space Dope-sheet */
2383
2384static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr)
2385{
2386 SpaceAction *saction = (SpaceAction *)(ptr->data);
2387 ScrArea *area = CTX_wm_area(C);
2388
2389 if (area && area->spacedata.first == saction) {
2390 ARegion *channels_region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS);
2391 if (channels_region) {
2392 channels_region->flag &= ~RGN_FLAG_HIDDEN;
2393 ED_region_visibility_change_update(C, area, channels_region);
2394 }
2395 }
2396
2397 /* recalculate extents of channel list */
2399
2400 /* store current mode as "old mode",
2401 * so that returning from other editors doesn't always reset to "Action Editor" */
2402 saction->mode_prev = saction->mode;
2403}
2404
2405/* Space Graph Editor */
2406
2407static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *ptr)
2408{
2409 ScrArea *area = rna_area_from_space(ptr);
2410 SpaceGraph *sipo = (SpaceGraph *)ptr->data;
2411
2412 /* for "Drivers" mode, enable all the necessary bits and pieces */
2413 if (sipo->mode == SIPO_MODE_DRIVERS) {
2415 ED_area_tag_redraw(area);
2416 }
2417
2418 /* after changing view mode, must force recalculation of F-Curve colors
2419 * which can only be achieved using refresh as opposed to redraw
2420 */
2421 ED_area_tag_refresh(area);
2422}
2423
2424static void rna_SpaceGraphEditor_normalize_update(bContext *C, PointerRNA * /*ptr*/)
2425{
2426 bAnimContext ac;
2427
2428 if (ANIM_animdata_get_context(C, &ac) == 0) {
2429 return;
2430 }
2431
2434}
2435
2436static bool rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
2437{
2438 SpaceGraph *sipo = (SpaceGraph *)(ptr->data);
2439 return (BLI_listbase_is_empty(&sipo->runtime.ghost_curves) == false);
2440}
2441
2442static void rna_SpaceConsole_rect_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2443{
2444 SpaceConsole *sc = static_cast<SpaceConsole *>(ptr->data);
2446}
2447
2448static void rna_SequenceEditor_update_cache(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
2449{
2451}
2452
2453static void seq_build_proxy(bContext *C, PointerRNA *ptr)
2454{
2455 if (U.sequencer_proxy_setup != USER_SEQ_PROXY_SETUP_AUTOMATIC) {
2456 return;
2457 }
2458
2459 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2462
2463 blender::Set<std::string> processed_paths;
2466
2467 LISTBASE_FOREACH (Strip *, strip, seqbase) {
2468 if (strip->type != STRIP_TYPE_MOVIE || strip->data == nullptr || strip->data->proxy == nullptr)
2469 {
2470 continue;
2471 }
2472
2473 /* Add new proxy size. */
2474 strip->data->proxy->build_size_flags |= blender::seq::rendersize_to_proxysize(
2476
2477 /* Build proxy. */
2479 pj->main, pj->depsgraph, pj->scene, strip, &processed_paths, &pj->queue, true);
2480 }
2481
2482 if (!WM_jobs_is_running(wm_job)) {
2483 G.is_break = false;
2484 WM_jobs_start(CTX_wm_manager(C), wm_job);
2485 }
2486
2488}
2489
2490static void rna_SequenceEditor_render_size_update(bContext *C, PointerRNA *ptr)
2491{
2492 seq_build_proxy(C, ptr);
2493 rna_SequenceEditor_update_cache(CTX_data_main(C), CTX_data_sequencer_scene(C), ptr);
2494}
2495
2496static bool rna_SequenceEditor_clamp_view_get(PointerRNA *ptr)
2497{
2498 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2499 return (sseq->flag & SEQ_CLAMP_VIEW) != 0;
2500}
2501
2502static void rna_SequenceEditor_clamp_view_set(PointerRNA *ptr, bool value)
2503{
2504 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2505 ScrArea *area;
2506 ARegion *region;
2507
2508 area = rna_area_from_space(ptr); /* can be nullptr */
2509 if (area == nullptr) {
2510 return;
2511 }
2512
2514 if (region) {
2515 if (value) {
2516 sseq->flag |= SEQ_CLAMP_VIEW;
2517 region->v2d.align &= ~V2D_ALIGN_NO_NEG_Y;
2518 }
2519 else {
2520 sseq->flag &= ~SEQ_CLAMP_VIEW;
2521 region->v2d.align |= V2D_ALIGN_NO_NEG_Y;
2522 }
2523 }
2524}
2525
2526static void rna_Sequencer_view_type_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2527{
2528 ScrArea *area = rna_area_from_space(ptr);
2529 ED_area_tag_refresh(area);
2530}
2531
2532static PointerRNA rna_SpaceSequenceEditor_preview_overlay_get(PointerRNA *ptr)
2533{
2534 return RNA_pointer_create_with_parent(*ptr, &RNA_SequencerPreviewOverlay, ptr->data);
2535}
2536
2537static std::optional<std::string> rna_SpaceSequencerPreviewOverlay_path(const PointerRNA *ptr)
2538{
2539 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2540 return fmt::format(
2541 "{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "preview_overlay");
2542}
2543
2544static PointerRNA rna_SpaceSequenceEditor_timeline_overlay_get(PointerRNA *ptr)
2545{
2546 return RNA_pointer_create_with_parent(*ptr, &RNA_SequencerTimelineOverlay, ptr->data);
2547}
2548
2549static std::optional<std::string> rna_SpaceSequencerTimelineOverlay_path(const PointerRNA *ptr)
2550{
2551 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2552 return fmt::format(
2553 "{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "timeline_overlay");
2554}
2555
2556static PointerRNA rna_SpaceSequenceEditor_cache_overlay_get(PointerRNA *ptr)
2557{
2558 return RNA_pointer_create_with_parent(*ptr, &RNA_SequencerCacheOverlay, ptr->data);
2559}
2560
2561static std::optional<std::string> rna_SpaceSequencerCacheOverlay_path(const PointerRNA *ptr)
2562{
2563 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2564 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "cache_overlay");
2565}
2566
2567static float rna_SpaceSequenceEditor_zoom_percentage_get(PointerRNA *ptr)
2568{
2569 ScrArea *area = rna_area_from_space(ptr);
2570 if (area == nullptr) {
2571 return 100.0f;
2572 }
2574 if (region == nullptr) {
2575 return 100.0f;
2576 }
2577
2578 View2D *v2d = &region->v2d;
2579 const float zoom = 1.0f / (BLI_rctf_size_x(&v2d->cur) / float(BLI_rcti_size_x(&v2d->mask))) *
2580 +100.0f;
2581 return zoom;
2582}
2583
2584static void rna_SpaceSequenceEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
2585{
2586 ScrArea *area = rna_area_from_space(ptr);
2587 if (area == nullptr) {
2588 return;
2589 }
2591 if (region == nullptr) {
2592 return;
2593 }
2594
2595 View2D *v2d = &region->v2d;
2596 BLI_rctf_resize(&v2d->cur,
2597 float(BLI_rcti_size_x(&v2d->mask)) / (value / 100.0f),
2598 float(BLI_rcti_size_y(&v2d->mask)) / (value / 100.0f));
2599 ED_region_tag_redraw(region);
2600}
2601
2602static PointerRNA rna_SpaceDopeSheet_overlay_get(PointerRNA *ptr)
2603{
2604 return RNA_pointer_create_with_parent(*ptr, &RNA_SpaceDopeSheetOverlay, ptr->data);
2605}
2606
2607static std::optional<std::string> rna_SpaceDopeSheetOverlay_path(const PointerRNA *ptr)
2608{
2609 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2610 if (!editor_path) {
2611 return std::nullopt;
2612 }
2613 return editor_path.value() + ".overlays";
2614}
2615
2616/* Space Node Editor */
2617static PointerRNA rna_SpaceNode_overlay_get(PointerRNA *ptr)
2618{
2619 return RNA_pointer_create_with_parent(*ptr, &RNA_SpaceNodeOverlay, ptr->data);
2620}
2621
2622static bool rna_SpaceNode_supports_previews(PointerRNA *ptr)
2623{
2624 return ED_node_supports_preview(static_cast<SpaceNode *>(ptr->data));
2625}
2626
2627static std::optional<std::string> rna_SpaceNodeOverlay_path(const PointerRNA *ptr)
2628{
2629 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2630 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
2631}
2632
2633static void rna_SpaceNodeEditor_node_tree_set(PointerRNA *ptr,
2634 const PointerRNA value,
2635 ReportList * /*reports*/)
2636{
2637 SpaceNode *snode = ptr->data_as<SpaceNode>();
2638 ScrArea *area = BKE_screen_find_area_from_space(reinterpret_cast<const bScreen *>(ptr->owner_id),
2639 reinterpret_cast<const SpaceLink *>(snode));
2641 ED_node_tree_start(region, snode, (bNodeTree *)value.data, nullptr, nullptr);
2642}
2643
2644static bool rna_SpaceNodeEditor_selected_node_group_poll(PointerRNA *space_node_pointer,
2645 const PointerRNA value)
2646{
2647 SpaceNode *space_node = space_node_pointer->data_as<SpaceNode>();
2648 const bNodeTree &ntree = *static_cast<const bNodeTree *>(value.data);
2649 if (ED_node_is_compositor(space_node)) {
2650 return ntree.type == NTREE_COMPOSIT;
2651 }
2652
2653 if (ntree.type != NTREE_GEOMETRY) {
2654 return false;
2655 }
2656 if (!ntree.geometry_node_asset_traits) {
2657 return false;
2658 }
2659 if ((ntree.geometry_node_asset_traits->flag & GEO_NODE_ASSET_TOOL) == 0) {
2660 return false;
2661 }
2662 return true;
2663}
2664
2665static bool space_node_node_geometry_nodes_poll(const SpaceNode &snode, const bNodeTree &ntree)
2666{
2669 if (!ntree.geometry_node_asset_traits) {
2670 return false;
2671 }
2673 return false;
2674 }
2675 return true;
2677 if (!ntree.geometry_node_asset_traits) {
2678 return false;
2679 }
2681 return false;
2682 }
2683 return true;
2684 }
2685 return false;
2686}
2687
2688static bool rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, const PointerRNA value)
2689{
2690 SpaceNode *snode = (SpaceNode *)ptr->data;
2691 bNodeTree *ntree = (bNodeTree *)value.data;
2692
2693 /* node tree type must match the selected type in node editor */
2694 if (!STREQ(snode->tree_idname, ntree->idname)) {
2695 return false;
2696 }
2697 if (ntree->type == NTREE_GEOMETRY) {
2698 if (!space_node_node_geometry_nodes_poll(*snode, *ntree)) {
2699 return false;
2700 }
2701 }
2702 return true;
2703}
2704
2705static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA * /*ptr*/)
2706{
2708}
2709
2710static const EnumPropertyItem *rna_SpaceNodeEditor_node_tree_sub_type_itemf(
2711 bContext * /*context*/,
2712 PointerRNA *space_node_pointer,
2713 PropertyRNA * /*property*/,
2714 bool * /*r_free*/)
2715{
2716 static const EnumPropertyItem geometry_nodes_sub_type_items[] = {
2718 "MODIFIER",
2719 ICON_MODIFIER_DATA,
2720 N_("Modifier"),
2721 N_("Edit node group from active object's active modifier")},
2723 "TOOL",
2724 ICON_TOOL_SETTINGS,
2725 N_("Tool"),
2726 N_("Edit any geometry node group for use as an operator")},
2727 {0, nullptr, 0, nullptr, nullptr},
2728 };
2729
2730 static const EnumPropertyItem compositor_sub_type_items[] = {
2732 "SCENE",
2733 ICON_SCENE_DATA,
2734 N_("Scene"),
2735 N_("Edit compositing node group for the current scene")},
2737 "SEQUENCER",
2738 ICON_SEQUENCE,
2739 N_("Sequencer"),
2740 N_("Edit compositing node group for Sequencer strip modifiers")},
2741 {0, nullptr, 0, nullptr, nullptr},
2742 };
2743
2744 SpaceNode *space_node = space_node_pointer->data_as<SpaceNode>();
2745 if (ED_node_is_geometry(space_node)) {
2746 return geometry_nodes_sub_type_items;
2747 }
2748 else {
2749 return compositor_sub_type_items;
2750 }
2751}
2752
2753static void rna_SpaceNodeEditor_node_tree_sub_type_update(Main * /*main*/,
2754 Scene * /*scene*/,
2755 PointerRNA *space_node_pointer)
2756{
2757 SpaceNode *space_node = space_node_pointer->data_as<SpaceNode>();
2758 if (ED_node_is_geometry(space_node)) {
2759 if (space_node->node_tree_sub_type == SNODE_GEOMETRY_TOOL) {
2760 space_node->flag &= ~SNODE_PIN;
2761 }
2762 }
2763 else {
2765 space_node->flag &= ~SNODE_PIN;
2766 }
2767 }
2768}
2769
2770static int rna_SpaceNodeEditor_tree_type_get(PointerRNA *ptr)
2771{
2772 SpaceNode *snode = (SpaceNode *)ptr->data;
2774}
2775static void rna_SpaceNodeEditor_tree_type_set(PointerRNA *ptr, int value)
2776{
2777 SpaceNode *snode = (SpaceNode *)ptr->data;
2779}
2780static bool rna_SpaceNodeEditor_tree_type_poll(void *Cv, blender::bke::bNodeTreeType *type)
2781{
2782 bContext *C = (bContext *)Cv;
2783 if (type->poll) {
2784 return type->poll(C, type);
2785 }
2786 else {
2787 return true;
2788 }
2789}
2790
2791static void rna_SpaceNodeEditor_cursor_location_get(PointerRNA *ptr, float value[2])
2792{
2793 const SpaceNode *snode = (SpaceNode *)ptr->data;
2794
2795 ED_node_cursor_location_get(snode, value);
2796}
2797
2798static void rna_SpaceNodeEditor_cursor_location_set(PointerRNA *ptr, const float value[2])
2799{
2800 SpaceNode *snode = (SpaceNode *)ptr->data;
2801
2802 ED_node_cursor_location_set(snode, value);
2803}
2804
2806{
2807 return rna_node_tree_type_itemf(C, C ? rna_SpaceNodeEditor_tree_type_poll : nullptr, r_free);
2808}
2809
2810static const EnumPropertyItem *rna_SpaceNodeEditor_tree_type_itemf(bContext *C,
2811 PointerRNA * /*ptr*/,
2812 PropertyRNA * /*prop*/,
2813 bool *r_free)
2814{
2815 return RNA_enum_node_tree_types_itemf_impl(C, r_free);
2816}
2817
2818static void rna_SpaceNodeEditor_path_get(PointerRNA *ptr, char *value)
2819{
2820 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
2821 ED_node_tree_path_get(snode, value);
2822}
2823
2824static int rna_SpaceNodeEditor_path_length(PointerRNA *ptr)
2825{
2826 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
2827 return ED_node_tree_path_length(snode);
2828}
2829
2830static void rna_SpaceNodeEditor_path_clear(SpaceNode *snode, bContext *C)
2831{
2832 ED_node_tree_start(nullptr, snode, nullptr, nullptr, nullptr);
2834}
2835
2836static ARegion *find_snode_region(SpaceNode *snode, bContext *C)
2837{
2838 if (wmWindowManager *wm = CTX_wm_manager(C)) {
2839 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
2840 bScreen *screen = WM_window_get_active_screen(win);
2842 reinterpret_cast<const SpaceLink *>(snode));
2843 if (ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW)) {
2844 return region;
2845 }
2846 }
2847 }
2848 return nullptr;
2849}
2850
2851static void rna_SpaceNodeEditor_path_start(SpaceNode *snode, bContext *C, PointerRNA *node_tree)
2852{
2853 ARegion *region = find_snode_region(snode, C);
2854 ED_node_tree_start(region, snode, (bNodeTree *)node_tree->data, nullptr, nullptr);
2856}
2857
2858static void rna_SpaceNodeEditor_path_append(SpaceNode *snode,
2859 bContext *C,
2860 PointerRNA *node_tree,
2861 PointerRNA *node)
2862{
2863 ARegion *region = find_snode_region(snode, C);
2865 region, snode, static_cast<bNodeTree *>(node_tree->data), static_cast<bNode *>(node->data));
2867}
2868
2869static void rna_SpaceNodeEditor_path_pop(SpaceNode *snode, bContext *C)
2870{
2871 ARegion *region = find_snode_region(snode, C);
2872 ED_node_tree_pop(region, snode);
2874}
2875
2876static void rna_SpaceNodeEditor_show_backdrop_update(Main * /*bmain*/,
2877 Scene * /*scene*/,
2878 PointerRNA * /*ptr*/)
2879{
2882}
2883
2884static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode,
2885 bContext *C,
2886 int x,
2887 int y)
2888{
2889 ARegion *region = CTX_wm_region(C);
2890
2891 float cursor_location[2];
2892
2893 UI_view2d_region_to_view(&region->v2d, x, y, &cursor_location[0], &cursor_location[1]);
2894 cursor_location[0] /= UI_SCALE_FAC;
2895 cursor_location[1] /= UI_SCALE_FAC;
2896
2897 ED_node_cursor_location_set(snode, cursor_location);
2898}
2899
2900static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr,
2901 PointerRNA value,
2902 ReportList * /*reports*/)
2903{
2904 SpaceClip *sc = (SpaceClip *)(ptr->data);
2905 bScreen *screen = (bScreen *)ptr->owner_id;
2906
2907 ED_space_clip_set_clip(nullptr, screen, sc, (MovieClip *)value.data);
2908}
2909
2910static void rna_SpaceClipEditor_mask_set(PointerRNA *ptr,
2911 PointerRNA value,
2912 ReportList * /*reports*/)
2913{
2914 SpaceClip *sc = (SpaceClip *)(ptr->data);
2915
2916 ED_space_clip_set_mask(nullptr, sc, (Mask *)value.data);
2917}
2918
2919static void rna_SpaceClipEditor_clip_mode_update(Main * /*bmain*/,
2920 Scene * /*scene*/,
2921 PointerRNA *ptr)
2922{
2923 SpaceClip *sc = (SpaceClip *)(ptr->data);
2924
2925 if (sc->mode == SC_MODE_MASKEDIT && sc->view != SC_VIEW_CLIP) {
2926 /* Make sure we are in the right view for mask editing */
2927 sc->view = SC_VIEW_CLIP;
2928 ScrArea *area = rna_area_from_space(ptr);
2929 ED_area_tag_refresh(area);
2930 }
2931
2932 sc->scopes.ok = 0;
2933}
2934
2935static void rna_SpaceClipEditor_lock_selection_update(Main * /*bmain*/,
2936 Scene * /*scene*/,
2937 PointerRNA *ptr)
2938{
2939 SpaceClip *sc = (SpaceClip *)(ptr->data);
2940
2941 sc->xlockof = 0.0f;
2942 sc->ylockof = 0.0f;
2943}
2944
2945static void rna_SpaceClipEditor_view_type_update(Main * /*bmain*/,
2946 Scene * /*scene*/,
2947 PointerRNA *ptr)
2948{
2949 ScrArea *area = rna_area_from_space(ptr);
2950 ED_area_tag_refresh(area);
2951}
2952
2953static float rna_SpaceClipEditor_zoom_percentage_get(PointerRNA *ptr)
2954{
2955 SpaceClip *sc = (SpaceClip *)ptr->data;
2956 return sc->zoom * 100.0f;
2957}
2958
2959static void rna_SpaceClipEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
2960{
2961 SpaceClip *sc = (SpaceClip *)ptr->data;
2962 sc->zoom = value / 100.0f;
2963}
2964
2965static PointerRNA rna_SpaceClip_overlay_get(PointerRNA *ptr)
2966{
2967 return RNA_pointer_create_with_parent(*ptr, &RNA_SpaceClipOverlay, ptr->data);
2968}
2969
2970static std::optional<std::string> rna_SpaceClipOverlay_path(const PointerRNA *ptr)
2971{
2972 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2973 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
2974}
2975
2976/* File browser. */
2977
2978static std::optional<std::string> rna_FileSelectParams_path(const PointerRNA * /*ptr*/)
2979{
2980 return "params";
2981}
2982
2983int rna_FileSelectParams_filename_editable(const PointerRNA *ptr, const char **r_info)
2984{
2985 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
2986
2987 if (params && (params->flag & FILE_DIRSEL_ONLY)) {
2988 *r_info = N_("Only directories can be chosen for the current operation.");
2989 return 0;
2990 }
2991
2992 return params ? int(PROP_EDITABLE) : 0;
2993}
2994
2995static bool rna_FileSelectParams_use_lib_get(PointerRNA *ptr)
2996{
2997 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
2998
2999 return params && (params->type == FILE_LOADLIB);
3000}
3001
3002static const EnumPropertyItem *rna_FileSelectParams_display_type_itemf(bContext * /*C*/,
3003 PointerRNA *ptr,
3004 PropertyRNA * /*prop*/,
3005 bool *r_free)
3006{
3007 if (RNA_struct_is_a(ptr->type, &RNA_FileAssetSelectParams)) {
3008 EnumPropertyItem *items = nullptr;
3009 int totitem = 0;
3010
3011 /* Only expose preview and column view for asset browsing. */
3016
3017 RNA_enum_item_end(&items, &totitem);
3018 *r_free = true;
3019
3020 return items;
3021 }
3022
3023 *r_free = false;
3025}
3026
3027static int rna_FileSelectParams_display_type_default(PointerRNA *ptr, PropertyRNA *prop)
3028{
3029 if (RNA_struct_is_a(ptr->type, &RNA_FileAssetSelectParams)) {
3030 return FILE_IMGDISPLAY;
3031 }
3032
3033 EnumPropertyRNA *eprop = reinterpret_cast<EnumPropertyRNA *>(prop);
3034 return eprop->defaultvalue;
3035}
3036
3037static const EnumPropertyItem *rna_FileSelectParams_recursion_level_itemf(bContext * /*C*/,
3038 PointerRNA *ptr,
3039 PropertyRNA * /*prop*/,
3040 bool *r_free)
3041{
3042 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
3043
3044 if (params && params->type != FILE_LOADLIB) {
3045 EnumPropertyItem *item = nullptr;
3046 int totitem = 0;
3047
3052
3053 RNA_enum_item_end(&item, &totitem);
3054 *r_free = true;
3055
3056 return item;
3057 }
3058
3059 *r_free = false;
3061}
3062
3063static const EnumPropertyItem *rna_FileSelectParams_sort_method_itemf(bContext * /*C*/,
3064 PointerRNA *ptr,
3065 PropertyRNA * /*prop*/,
3066 bool *r_free)
3067{
3068 EnumPropertyItem *items = nullptr;
3069 int totitem = 0;
3070
3071 if (RNA_struct_is_a(ptr->type, &RNA_FileAssetSelectParams)) {
3072 /* Only expose sorting by name and asset catalog for asset browsing. */
3073
3076 /* Address small annoyance: Tooltip talks about "file list", override to be "asset list"
3077 * instead. */
3078 items[0].description = N_("Sort the asset list alphabetically");
3079
3082 }
3083 else {
3084 /* Remove asset catalog from the items. */
3086 item++)
3087 {
3088 if (item->value != FILE_SORT_ASSET_CATALOG) {
3089 RNA_enum_item_add(&items, &totitem, item);
3090 }
3091 }
3092 }
3093
3094 RNA_enum_item_end(&items, &totitem);
3095
3096 *r_free = true;
3097 return items;
3098}
3099
3100static void rna_FileSelectPrams_filter_glob_set(PointerRNA *ptr, const char *value)
3101{
3102 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
3103
3104 STRNCPY(params->filter_glob, value);
3105
3106 /* Remove stupid things like last group being a wildcard-only one. */
3108}
3109
3110static PointerRNA rna_FileSelectParams_filter_id_get(PointerRNA *ptr)
3111{
3112 return RNA_pointer_create_with_parent(*ptr, &RNA_FileSelectIDFilter, ptr->data);
3113}
3114
3115static int rna_FileAssetSelectParams_asset_library_get(PointerRNA *ptr)
3116{
3117 FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3118 /* Just an extra sanity check to ensure this isn't somehow called for RNA_FileSelectParams. */
3119 BLI_assert(ptr->type == &RNA_FileAssetSelectParams);
3120
3122}
3123
3124static void rna_FileAssetSelectParams_asset_library_set(PointerRNA *ptr, int value)
3125{
3126 FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3128}
3129
3130static PointerRNA rna_FileAssetSelectParams_filter_id_get(PointerRNA *ptr)
3131{
3132 return RNA_pointer_create_with_parent(*ptr, &RNA_FileAssetSelectIDFilter, ptr->data);
3133}
3134
3135static PointerRNA rna_FileBrowser_FileSelectEntry_asset_data_get_impl(const PointerRNA *ptr)
3136{
3137 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3138
3139 if (!entry->asset) {
3140 return PointerRNA_NULL;
3141 }
3142
3143 AssetMetaData *asset_data = &entry->asset->get_metadata();
3144
3145 /* Note that the owning ID of the RNA pointer (`ptr->owner_id`) has to be set carefully:
3146 * Local IDs (`entry->id`) own their asset metadata themselves. Asset metadata from other blend
3147 * files are owned by the file browser (`entry`). Only if this is set correctly, we can tell from
3148 * the metadata RNA pointer if the metadata is stored locally and can thus be edited or not. */
3149
3150 if (entry->asset->is_local_id()) {
3151 PointerRNA id_ptr = RNA_id_pointer_create(entry->id);
3152 return RNA_pointer_create_with_parent(id_ptr, &RNA_AssetMetaData, asset_data);
3153 }
3154
3155 return RNA_pointer_create_with_parent(*ptr, &RNA_AssetMetaData, asset_data);
3156}
3157
3158static int rna_FileBrowser_FileSelectEntry_name_editable(const PointerRNA *ptr,
3159 const char **r_info)
3160{
3161 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3162
3163 /* This actually always returns 0 (the name is never editable) but we want to get a disabled
3164 * message returned to `r_info` in some cases. */
3165
3166 if (entry->asset) {
3167 PointerRNA asset_data_ptr = rna_FileBrowser_FileSelectEntry_asset_data_get_impl(ptr);
3168 /* Get disabled hint from asset metadata polling. */
3169 rna_AssetMetaData_editable(&asset_data_ptr, r_info);
3170 }
3171
3172 return 0;
3173}
3174
3175static PointerRNA rna_FileBrowser_FileSelectEntry_asset_data_get(PointerRNA *ptr)
3176{
3177 return rna_FileBrowser_FileSelectEntry_asset_data_get_impl(ptr);
3178}
3179
3180static void rna_FileBrowser_FileSelectEntry_name_get(PointerRNA *ptr, char *value)
3181{
3182 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3183 strcpy(value, entry->name);
3184}
3185
3186static int rna_FileBrowser_FileSelectEntry_name_length(PointerRNA *ptr)
3187{
3188 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3189 return int(strlen(entry->name));
3190}
3191
3192static void rna_FileBrowser_FileSelectEntry_relative_path_get(PointerRNA *ptr, char *value)
3193{
3194 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3195 strcpy(value, entry->relpath);
3196}
3197
3198static int rna_FileBrowser_FileSelectEntry_relative_path_length(PointerRNA *ptr)
3199{
3200 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3201 return int(strlen(entry->relpath));
3202}
3203
3204static int rna_FileBrowser_FileSelectEntry_preview_icon_id_get(PointerRNA *ptr)
3205{
3206 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3207 return ED_file_icon(entry);
3208}
3209
3210static StructRNA *rna_FileBrowser_params_typef(PointerRNA *ptr)
3211{
3212 SpaceFile *sfile = static_cast<SpaceFile *>(ptr->data);
3214
3215 if (params == ED_fileselect_get_file_params(sfile)) {
3216 return &RNA_FileSelectParams;
3217 }
3218 if (params == (void *)ED_fileselect_get_asset_params(sfile)) {
3219 return &RNA_FileAssetSelectParams;
3220 }
3221
3222 BLI_assert_msg(0, "Could not identify file select parameters");
3223 return nullptr;
3224}
3225
3226static PointerRNA rna_FileBrowser_params_get(PointerRNA *ptr)
3227{
3228 SpaceFile *sfile = static_cast<SpaceFile *>(ptr->data);
3230 StructRNA *params_struct = rna_FileBrowser_params_typef(ptr);
3231
3232 if (params && params_struct) {
3233 return RNA_pointer_create_with_parent(*ptr, params_struct, params);
3234 }
3235
3236 return PointerRNA_NULL;
3237}
3238
3239static void rna_FileBrowser_FSMenuEntry_path_get(PointerRNA *ptr, char *value)
3240{
3241 char *path = ED_fsmenu_entry_get_path(static_cast<FSMenuEntry *>(ptr->data));
3242
3243 strcpy(value, path ? path : "");
3244}
3245
3246static int rna_FileBrowser_FSMenuEntry_path_length(PointerRNA *ptr)
3247{
3248 char *path = ED_fsmenu_entry_get_path(static_cast<FSMenuEntry *>(ptr->data));
3249
3250 return int(path ? strlen(path) : 0);
3251}
3252
3253static void rna_FileBrowser_FSMenuEntry_path_set(PointerRNA *ptr, const char *value)
3254{
3255 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3256
3257 /* NOTE: this will write to file immediately.
3258 * Not nice (and to be fixed ultimately), but acceptable in this case for now. */
3259 ED_fsmenu_entry_set_path(fsm, value);
3260}
3261
3262static void rna_FileBrowser_FSMenuEntry_name_get(PointerRNA *ptr, char *value)
3263{
3264 strcpy(value, ED_fsmenu_entry_get_name(static_cast<FSMenuEntry *>(ptr->data)));
3265}
3266
3267static int rna_FileBrowser_FSMenuEntry_name_length(PointerRNA *ptr)
3268{
3269 return int(strlen(ED_fsmenu_entry_get_name(static_cast<FSMenuEntry *>(ptr->data))));
3270}
3271
3272static void rna_FileBrowser_FSMenuEntry_name_set(PointerRNA *ptr, const char *value)
3273{
3274 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3275
3276 /* NOTE: this will write to file immediately.
3277 * Not nice (and to be fixed ultimately), but acceptable in this case for now. */
3278 ED_fsmenu_entry_set_name(fsm, value);
3279}
3280
3281static int rna_FileBrowser_FSMenuEntry_name_get_editable(const PointerRNA *ptr,
3282 const char ** /*r_info*/)
3283{
3284 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3285
3286 return fsm->save ? int(PROP_EDITABLE) : 0;
3287}
3288
3289static int rna_FileBrowser_FSMenuEntry_icon_get(PointerRNA *ptr)
3290{
3291 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3292 return ED_fsmenu_entry_get_icon(fsm);
3293}
3294
3295static void rna_FileBrowser_FSMenuEntry_icon_set(PointerRNA *ptr, int value)
3296{
3297 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3298 ED_fsmenu_entry_set_icon(fsm, value);
3299}
3300
3301static bool rna_FileBrowser_FSMenuEntry_use_save_get(PointerRNA *ptr)
3302{
3303 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3304 return fsm->save;
3305}
3306
3307static void rna_FileBrowser_FSMenu_next(CollectionPropertyIterator *iter)
3308{
3309 ListBaseIterator *internal = &iter->internal.listbase;
3310
3311 if (internal->skip) {
3312 do {
3313 internal->link = (Link *)(((FSMenuEntry *)(internal->link))->next);
3314 iter->valid = (internal->link != nullptr);
3315 } while (iter->valid && internal->skip(iter, internal->link));
3316 }
3317 else {
3318 internal->link = (Link *)(((FSMenuEntry *)(internal->link))->next);
3319 iter->valid = (internal->link != nullptr);
3320 }
3321}
3322
3323static void rna_FileBrowser_FSMenu_begin(CollectionPropertyIterator *iter, FSMenuCategory category)
3324{
3325 ListBaseIterator *internal = &iter->internal.listbase;
3326
3327 FSMenu *fsmenu = ED_fsmenu_get();
3328 FSMenuEntry *fsmentry = ED_fsmenu_get_category(fsmenu, category);
3329
3330 internal->link = (fsmentry) ? (Link *)fsmentry : nullptr;
3331 internal->skip = nullptr;
3332
3333 iter->valid = (internal->link != nullptr);
3334}
3335
3336static PointerRNA rna_FileBrowser_FSMenu_get(CollectionPropertyIterator *iter)
3337{
3338 ListBaseIterator *internal = &iter->internal.listbase;
3340 iter->parent, &RNA_FileBrowserFSMenuEntry, internal->link);
3341 return ptr_result;
3342}
3343
3344static void rna_FileBrowser_FSMenu_end(CollectionPropertyIterator * /*iter*/) {}
3345
3346static void rna_FileBrowser_FSMenuSystem_data_begin(CollectionPropertyIterator *iter,
3347 PointerRNA * /*ptr*/)
3348{
3349 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_SYSTEM);
3350}
3351
3352static int rna_FileBrowser_FSMenuSystem_data_length(PointerRNA * /*ptr*/)
3353{
3354 FSMenu *fsmenu = ED_fsmenu_get();
3355
3357}
3358
3359static void rna_FileBrowser_FSMenuSystemBookmark_data_begin(CollectionPropertyIterator *iter,
3360 PointerRNA * /*ptr*/)
3361{
3362 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_SYSTEM_BOOKMARKS);
3363}
3364
3365static int rna_FileBrowser_FSMenuSystemBookmark_data_length(PointerRNA * /*ptr*/)
3366{
3367 FSMenu *fsmenu = ED_fsmenu_get();
3368
3370}
3371
3372static void rna_FileBrowser_FSMenuBookmark_data_begin(CollectionPropertyIterator *iter,
3373 PointerRNA * /*ptr*/)
3374{
3375 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_BOOKMARKS);
3376}
3377
3378static int rna_FileBrowser_FSMenuBookmark_data_length(PointerRNA * /*ptr*/)
3379{
3380 FSMenu *fsmenu = ED_fsmenu_get();
3381
3383}
3384
3385static void rna_FileBrowser_FSMenuRecent_data_begin(CollectionPropertyIterator *iter,
3386 PointerRNA * /*ptr*/)
3387{
3388 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_RECENT);
3389}
3390
3391static int rna_FileBrowser_FSMenuRecent_data_length(PointerRNA * /*ptr*/)
3392{
3393 FSMenu *fsmenu = ED_fsmenu_get();
3394
3396}
3397
3398static int rna_FileBrowser_FSMenu_active_get(PointerRNA *ptr, const FSMenuCategory category)
3399{
3400 SpaceFile *sf = static_cast<SpaceFile *>(ptr->data);
3401 int actnr = -1;
3402
3403 switch (category) {
3404 case FS_CATEGORY_SYSTEM:
3405 actnr = sf->systemnr;
3406 break;
3408 actnr = sf->system_bookmarknr;
3409 break;
3411 actnr = sf->bookmarknr;
3412 break;
3413 case FS_CATEGORY_RECENT:
3414 actnr = sf->recentnr;
3415 break;
3416 case FS_CATEGORY_OTHER:
3417 /* pass. */
3418 break;
3419 }
3420
3421 return actnr;
3422}
3423
3424static void rna_FileBrowser_FSMenu_active_set(PointerRNA *ptr,
3425 int value,
3426 const FSMenuCategory category)
3427{
3428 SpaceFile *sf = static_cast<SpaceFile *>(ptr->data);
3429 FSMenu *fsmenu = ED_fsmenu_get();
3430 FSMenuEntry *fsm = ED_fsmenu_get_entry(fsmenu, category, value);
3431
3432 if (fsm && sf->params) {
3433 switch (category) {
3434 case FS_CATEGORY_SYSTEM:
3435 sf->systemnr = value;
3436 break;
3438 sf->system_bookmarknr = value;
3439 break;
3441 sf->bookmarknr = value;
3442 break;
3443 case FS_CATEGORY_RECENT:
3444 sf->recentnr = value;
3445 break;
3446 case FS_CATEGORY_OTHER:
3447 /* pass. */
3448 break;
3449 }
3450
3451 STRNCPY(sf->params->dir, fsm->path);
3452 }
3453}
3454
3455static void rna_FileBrowser_FSMenu_active_range(PointerRNA * /*ptr*/,
3456 int *min,
3457 int *max,
3458 int *softmin,
3459 int *softmax,
3460 const FSMenuCategory category)
3461{
3462 FSMenu *fsmenu = ED_fsmenu_get();
3463
3464 *min = *softmin = -1;
3465 *max = *softmax = ED_fsmenu_get_nentries(fsmenu, category) - 1;
3466}
3467
3468static void rna_FileBrowser_FSMenu_active_update(bContext *C, PointerRNA *ptr)
3469{
3470 ScrArea *area = rna_area_from_space(ptr);
3471 ED_file_change_dir_ex(C, area);
3472}
3473
3474static int rna_FileBrowser_FSMenuSystem_active_get(PointerRNA *ptr)
3475{
3476 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_SYSTEM);
3477}
3478
3479static void rna_FileBrowser_FSMenuSystem_active_set(PointerRNA *ptr, int value)
3480{
3481 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_SYSTEM);
3482}
3483
3484static void rna_FileBrowser_FSMenuSystem_active_range(
3485 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3486{
3487 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_SYSTEM);
3488}
3489
3490static int rna_FileBrowser_FSMenuSystemBookmark_active_get(PointerRNA *ptr)
3491{
3492 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_SYSTEM_BOOKMARKS);
3493}
3494
3495static void rna_FileBrowser_FSMenuSystemBookmark_active_set(PointerRNA *ptr, int value)
3496{
3497 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_SYSTEM_BOOKMARKS);
3498}
3499
3500static void rna_FileBrowser_FSMenuSystemBookmark_active_range(
3501 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3502{
3503 rna_FileBrowser_FSMenu_active_range(
3504 ptr, min, max, softmin, softmax, FS_CATEGORY_SYSTEM_BOOKMARKS);
3505}
3506
3507static int rna_FileBrowser_FSMenuBookmark_active_get(PointerRNA *ptr)
3508{
3509 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_BOOKMARKS);
3510}
3511
3512static void rna_FileBrowser_FSMenuBookmark_active_set(PointerRNA *ptr, int value)
3513{
3514 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_BOOKMARKS);
3515}
3516
3517static void rna_FileBrowser_FSMenuBookmark_active_range(
3518 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3519{
3520 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_BOOKMARKS);
3521}
3522
3523static int rna_FileBrowser_FSMenuRecent_active_get(PointerRNA *ptr)
3524{
3525 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_RECENT);
3526}
3527
3528static void rna_FileBrowser_FSMenuRecent_active_set(PointerRNA *ptr, int value)
3529{
3530 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_RECENT);
3531}
3532
3533static void rna_FileBrowser_FSMenuRecent_active_range(
3534 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3535{
3536 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_RECENT);
3537}
3538
3539static void rna_SpaceFileBrowser_browse_mode_update(Main * /*bmain*/,
3540 Scene * /*scene*/,
3541 PointerRNA *ptr)
3542{
3543 ScrArea *area = rna_area_from_space(ptr);
3544 ED_area_tag_refresh(area);
3545}
3546
3547static void rna_SpaceSpreadsheet_geometry_component_type_update(Main * /*bmain*/,
3548 Scene * /*scene*/,
3549 PointerRNA *ptr)
3550{
3551 using namespace blender;
3552 SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data;
3553 switch (sspreadsheet->geometry_id.geometry_component_type) {
3555 if (!ELEM(bke::AttrDomain(sspreadsheet->geometry_id.attribute_domain),
3560 {
3561 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Point);
3562 }
3563 break;
3564 }
3566 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Point);
3567 break;
3568 }
3570 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Instance);
3571 break;
3572 }
3574 break;
3575 }
3577 if (!ELEM(bke::AttrDomain(sspreadsheet->geometry_id.attribute_domain),
3580 {
3581 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Point);
3582 }
3583 break;
3584 }
3585 }
3586}
3587
3588const EnumPropertyItem *rna_SpaceSpreadsheet_attribute_domain_itemf(bContext * /*C*/,
3589 PointerRNA *ptr,
3590 PropertyRNA * /*prop*/,
3591 bool *r_free)
3592{
3593 using namespace blender;
3594 SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data;
3595 auto component_type = bke::GeometryComponent::Type(
3596 sspreadsheet->geometry_id.geometry_component_type);
3597 if (sspreadsheet->geometry_id.object_eval_state == SPREADSHEET_OBJECT_EVAL_STATE_ORIGINAL) {
3598 ID *used_id = ed::spreadsheet::get_current_id(sspreadsheet);
3599 if (used_id != nullptr) {
3600 if (GS(used_id->name) == ID_OB) {
3601 Object *used_object = (Object *)used_id;
3602 if (used_object->type == OB_POINTCLOUD) {
3604 }
3605 else {
3606 component_type = bke::GeometryComponent::Type::Mesh;
3607 }
3608 }
3609 }
3610 }
3611
3612 static EnumPropertyItem mesh_vertex_domain_item = {
3613 int(bke::AttrDomain::Point), "POINT", 0, "Vertex", "Attribute per point/vertex"};
3614
3615 EnumPropertyItem *item_array = nullptr;
3616 int items_len = 0;
3617 for (const EnumPropertyItem *item = rna_enum_attribute_domain_items; item->identifier != nullptr;
3618 item++)
3619 {
3620 if (component_type == bke::GeometryComponent::Type::Mesh) {
3621 if (!ELEM(bke::AttrDomain(item->value),
3626 {
3627 continue;
3628 }
3629 }
3630 if (component_type == bke::GeometryComponent::Type::PointCloud) {
3632 continue;
3633 }
3634 }
3635 if (component_type == bke::GeometryComponent::Type::Curve) {
3637 continue;
3638 }
3639 }
3641 component_type == bke::GeometryComponent::Type::Mesh)
3642 {
3643 RNA_enum_item_add(&item_array, &items_len, &mesh_vertex_domain_item);
3644 }
3645 else {
3646 RNA_enum_item_add(&item_array, &items_len, item);
3647 }
3648 }
3649 RNA_enum_item_end(&item_array, &items_len);
3650
3651 *r_free = true;
3652 return item_array;
3653}
3654
3655static StructRNA *rna_SpreadsheetTableID_refine(PointerRNA *ptr)
3656{
3657 SpreadsheetTableID *table_id = ptr->data_as<SpreadsheetTableID>();
3658 switch (eSpreadsheetTableIDType(table_id->type)) {
3660 return &RNA_SpreadsheetTableIDGeometry;
3661 }
3662 return &RNA_SpreadsheetTableID;
3663}
3664
3665static void rna_iterator_SpreadsheetTable_columns_begin(CollectionPropertyIterator *iter,
3666 PointerRNA *ptr)
3667{
3668 SpreadsheetTable *table = ptr->data_as<SpreadsheetTable>();
3670 iter, ptr, table->columns, sizeof(SpreadsheetTable *), table->num_columns, 0, nullptr);
3671}
3672
3673static int rna_iterator_SpreadsheetTable_columns_length(PointerRNA *ptr)
3674{
3675 SpreadsheetTable *table = ptr->data_as<SpreadsheetTable>();
3676 return table->num_columns;
3677}
3678
3679static void rna_iterator_SpaceSpreadsheet_tables_begin(CollectionPropertyIterator *iter,
3680 PointerRNA *ptr)
3681{
3682 SpaceSpreadsheet *sspreadsheet = ptr->data_as<SpaceSpreadsheet>();
3684 ptr,
3685 sspreadsheet->tables,
3686 sizeof(SpaceSpreadsheet *),
3687 sspreadsheet->num_tables,
3688 0,
3689 nullptr);
3690}
3691
3692static int rna_iterator_SpaceSpreadsheet_tables_length(PointerRNA *ptr)
3693{
3694 SpaceSpreadsheet *sspreadsheet = ptr->data_as<SpaceSpreadsheet>();
3695 return sspreadsheet->num_tables;
3696}
3697
3698static PointerRNA rna_SpreadsheetTables_active_get(PointerRNA *ptr)
3699{
3700 SpaceSpreadsheet *sspreadsheet = ptr->data_as<SpaceSpreadsheet>();
3702 return RNA_pointer_create_discrete(ptr->owner_id, &RNA_SpreadsheetTable, table);
3703}
3704
3705static StructRNA *rna_viewer_path_elem_refine(PointerRNA *ptr)
3706{
3707 ViewerPathElem *elem = static_cast<ViewerPathElem *>(ptr->data);
3708 switch (ViewerPathElemType(elem->type)) {
3710 return &RNA_IDViewerPathElem;
3712 return &RNA_ModifierViewerPathElem;
3714 return &RNA_GroupNodeViewerPathElem;
3716 return &RNA_SimulationZoneViewerPathElem;
3718 return &RNA_ViewerNodeViewerPathElem;
3720 return &RNA_RepeatZoneViewerPathElem;
3722 return &RNA_ForeachGeometryElementZoneViewerPathElem;
3724 return &RNA_EvaluateClosureNodeViewerPathElem;
3725 }
3727 return nullptr;
3728}
3729
3730static void rna_FileAssetSelectParams_catalog_id_get(PointerRNA *ptr, char *value)
3731{
3732 const FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3733 BLI_uuid_format(value, params->catalog_id);
3734}
3735
3736static int rna_FileAssetSelectParams_catalog_id_length(PointerRNA * /*ptr*/)
3737{
3738 return UUID_STRING_SIZE - 1;
3739}
3740
3741static void rna_FileAssetSelectParams_catalog_id_set(PointerRNA *ptr, const char *value)
3742{
3743 FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3744
3745 if (value[0] == '\0') {
3746 params->catalog_id = BLI_uuid_nil();
3747 params->asset_catalog_visibility = FILE_SHOW_ASSETS_ALL_CATALOGS;
3748 return;
3749 }
3750
3751 bUUID new_uuid;
3752 if (!BLI_uuid_parse_string(&new_uuid, value)) {
3753 printf("UUID %s not formatted correctly, ignoring new value\n", value);
3754 return;
3755 }
3756
3757 params->catalog_id = new_uuid;
3758 params->asset_catalog_visibility = FILE_SHOW_ASSETS_FROM_CATALOG;
3759}
3760
3761static const EnumPropertyItem *rna_FileAssetSelectParams_import_method_itemf(
3762 bContext * /*C*/, PointerRNA * /*ptr*/, PropertyRNA * /*prop*/, bool *r_free)
3763{
3764 EnumPropertyItem *items = nullptr;
3765 int items_num = 0;
3766 for (const EnumPropertyItem *item = rna_enum_asset_import_method_items; item->identifier; item++)
3767 {
3768 switch (eFileAssetImportMethod(item->value)) {
3770 if (U.experimental.no_data_block_packing) {
3771 RNA_enum_item_add(&items, &items_num, item);
3772 }
3773 break;
3774 }
3776 if (!U.experimental.no_data_block_packing) {
3777 RNA_enum_item_add(&items, &items_num, item);
3778 }
3779 break;
3780 }
3781 default: {
3782 RNA_enum_item_add(&items, &items_num, item);
3783 break;
3784 }
3785 }
3786 }
3787 RNA_enum_item_end(&items, &items_num);
3788 *r_free = true;
3789 return items;
3790}
3791
3792#else
3793
3795 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Display white edges with black outline"},
3796 {SI_UVDT_DASH, "DASH", 0, "Dash", "Display dashed black-white edges"},
3797 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Display black edges"},
3798 {SI_UVDT_WHITE, "WHITE", 0, "White", "Display white edges"},
3799 {0, nullptr, 0, nullptr, nullptr},
3800};
3801
3803 /* Categories */
3804 {FILTER_ID_SCE, "category_scene", ICON_SCENE_DATA, "Scenes", "Show scenes"},
3805 {FILTER_ID_AC, "category_animation", ICON_ANIM_DATA, "Animations", "Show animation data"},
3807 "category_object",
3808 ICON_OUTLINER_COLLECTION,
3809 "Objects & Collections",
3810 "Show objects and collections"},
3813 "category_geometry",
3814 ICON_GEOMETRY_NODES,
3815 "Geometry",
3816 "Show meshes, curves, lattice, armatures and metaballs data"},
3818 "category_shading",
3819 ICON_MATERIAL_DATA,
3820 "Shading",
3821 "Show materials, node-trees, textures and Freestyle's line-styles"},
3823 "category_image",
3824 ICON_IMAGE_DATA,
3825 "Images & Sounds",
3826 "Show images, movie clips, sounds and masks"},
3828 "category_environment",
3829 ICON_WORLD_DATA,
3830 "Environment",
3831 "Show worlds, lights, cameras and speakers"},
3834 "category_misc",
3835 ICON_GREASEPENCIL,
3836 "Miscellaneous",
3837 "Show other data types"},
3838 {0, nullptr, 0, nullptr, nullptr},
3839};
3840
3841static void rna_def_space_generic_show_region_toggles(StructRNA *srna, int region_type_mask)
3842{
3843 PropertyRNA *prop;
3844
3845# define DEF_SHOW_REGION_PROPERTY(identifier, label, description) \
3846 { \
3847 prop = RNA_def_property(srna, STRINGIFY(identifier), PROP_BOOLEAN, PROP_NONE); \
3848 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); \
3849 RNA_def_property_boolean_funcs(prop, \
3850 STRINGIFY(rna_Space_##identifier##_get), \
3851 STRINGIFY(rna_Space_##identifier##_set)); \
3852 RNA_def_property_ui_text(prop, label, description); \
3853 RNA_def_property_update(prop, 0, STRINGIFY(rna_Space_##identifier##_update)); \
3854 } \
3855 ((void)0)
3856
3857 if (region_type_mask & (1 << RGN_TYPE_TOOL_HEADER)) {
3858 region_type_mask &= ~(1 << RGN_TYPE_TOOL_HEADER);
3859 DEF_SHOW_REGION_PROPERTY(show_region_tool_header, "Tool Settings", "");
3860 }
3861 if (region_type_mask & (1 << RGN_TYPE_HEADER)) {
3862 region_type_mask &= ~(1 << RGN_TYPE_HEADER);
3863 DEF_SHOW_REGION_PROPERTY(show_region_header, "Header", "");
3864 }
3865 if (region_type_mask & (1 << RGN_TYPE_FOOTER)) {
3866 region_type_mask &= ~(1 << RGN_TYPE_FOOTER);
3867 DEF_SHOW_REGION_PROPERTY(show_region_footer, "Footer", "");
3868 }
3869 if (region_type_mask & (1 << RGN_TYPE_TOOLS)) {
3870 region_type_mask &= ~(1 << RGN_TYPE_TOOLS);
3871 DEF_SHOW_REGION_PROPERTY(show_region_toolbar, "Toolbar", "");
3872 }
3873 if (region_type_mask & (1 << RGN_TYPE_TOOL_PROPS)) {
3874 region_type_mask &= ~(1 << RGN_TYPE_TOOL_PROPS);
3875 DEF_SHOW_REGION_PROPERTY(show_region_tool_props, "Toolbar", "");
3876 }
3877 if (region_type_mask & (1 << RGN_TYPE_CHANNELS)) {
3878 region_type_mask &= ~(1 << RGN_TYPE_CHANNELS);
3879 DEF_SHOW_REGION_PROPERTY(show_region_channels, "Channels", "");
3880 }
3881 if (region_type_mask & (1 << RGN_TYPE_UI)) {
3882 region_type_mask &= ~(1 << RGN_TYPE_UI);
3883 DEF_SHOW_REGION_PROPERTY(show_region_ui, "Sidebar", "");
3884 }
3885 if (region_type_mask & (1 << RGN_TYPE_HUD)) {
3886 region_type_mask &= ~(1 << RGN_TYPE_HUD);
3887 DEF_SHOW_REGION_PROPERTY(show_region_hud, "Adjust Last Operation", "");
3888 }
3889 if (region_type_mask & ((1 << RGN_TYPE_ASSET_SHELF) | (1 << RGN_TYPE_ASSET_SHELF_HEADER))) {
3890 region_type_mask &= ~((1 << RGN_TYPE_ASSET_SHELF) | (1 << RGN_TYPE_ASSET_SHELF_HEADER));
3891
3892 prop = RNA_def_property(srna, "show_region_asset_shelf", PROP_BOOLEAN, PROP_NONE);
3895 prop, "rna_Space_show_region_asset_shelf_get", "rna_Space_show_region_asset_shelf_set");
3896 RNA_def_property_editable_func(prop, "rna_Space_show_region_asset_shelf_editable");
3898 prop,
3899 "Asset Shelf",
3900 "Display a region with assets that may currently be relevant (such as "
3901 "brushes in paint modes, or poses in Pose Mode)");
3902 RNA_def_property_update(prop, 0, "rna_Space_show_region_asset_shelf_update");
3903 }
3904 BLI_assert(region_type_mask == 0);
3905}
3906
3907static void rna_def_space(BlenderRNA *brna)
3908{
3909 StructRNA *srna;
3910 PropertyRNA *prop;
3911
3912 srna = RNA_def_struct(brna, "Space", nullptr);
3913 RNA_def_struct_sdna(srna, "SpaceLink");
3914 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
3915 RNA_def_struct_path_func(srna, "BKE_screen_path_from_screen_to_space");
3916 RNA_def_struct_refine_func(srna, "rna_Space_refine");
3917
3918 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3919 RNA_def_property_enum_sdna(prop, nullptr, "spacetype");
3921 /* When making this editable, take care for the special case of global areas
3922 * (see rna_Area_type_set). */
3924 RNA_def_property_ui_text(prop, "Type", "Space data type");
3925
3926 /* Access to #V2D_VIEWSYNC_SCREEN_TIME. */
3927 prop = RNA_def_property(srna, "show_locked_time", PROP_BOOLEAN, PROP_NONE);
3928 RNA_def_property_boolean_funcs(prop, "rna_Space_view2d_sync_get", "rna_Space_view2d_sync_set");
3930 "Sync Visible Range",
3931 "Synchronize the visible timeline range with other time-based editors");
3932 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Space_view2d_sync_update");
3933
3935}
3936
3937/* for all spaces that use a mask */
3938static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *mask_set_func)
3939{
3940 PropertyRNA *prop;
3941
3942 static const EnumPropertyItem overlay_mode_items[] = {
3944 "ALPHACHANNEL",
3945 ICON_NONE,
3946 "Alpha Channel",
3947 "Show alpha channel of the mask"},
3949 "COMBINED",
3950 ICON_NONE,
3951 "Combined",
3952 "Combine space background image with the mask"},
3953 {0, nullptr, 0, nullptr, nullptr},
3954 };
3955
3956 prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
3957 RNA_def_property_pointer_sdna(prop, nullptr, "mask_info.mask");
3960 RNA_def_property_ui_text(prop, "Mask", "Mask displayed and edited in this space");
3961 RNA_def_property_pointer_funcs(prop, nullptr, mask_set_func, nullptr, nullptr);
3962 RNA_def_property_update(prop, noteflag, nullptr);
3963
3964 /* mask drawing */
3965 prop = RNA_def_property(srna, "mask_display_type", PROP_ENUM, PROP_NONE);
3966 RNA_def_property_enum_sdna(prop, nullptr, "mask_info.draw_type");
3968 RNA_def_property_ui_text(prop, "Edge Display Type", "Display type for mask splines");
3969 RNA_def_property_update(prop, noteflag, nullptr);
3970
3971 prop = RNA_def_property(srna, "show_mask_spline", PROP_BOOLEAN, PROP_NONE);
3972 RNA_def_property_boolean_sdna(prop, nullptr, "mask_info.draw_flag", MASK_DRAWFLAG_SPLINE);
3973 RNA_def_property_ui_text(prop, "Show Mask Spline", "");
3974 RNA_def_property_update(prop, noteflag, nullptr);
3975
3976 prop = RNA_def_property(srna, "show_mask_overlay", PROP_BOOLEAN, PROP_NONE);
3977 RNA_def_property_boolean_sdna(prop, nullptr, "mask_info.draw_flag", MASK_DRAWFLAG_OVERLAY);
3978 RNA_def_property_ui_text(prop, "Show Mask Overlay", "");
3979 RNA_def_property_update(prop, noteflag, nullptr);
3980
3981 prop = RNA_def_property(srna, "mask_overlay_mode", PROP_ENUM, PROP_NONE);
3982 RNA_def_property_enum_sdna(prop, nullptr, "mask_info.overlay_mode");
3983 RNA_def_property_enum_items(prop, overlay_mode_items);
3984 RNA_def_property_ui_text(prop, "Overlay Mode", "Overlay mode of rasterized mask");
3985 RNA_def_property_update(prop, noteflag, nullptr);
3986
3987 prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_FACTOR);
3988 RNA_def_property_float_sdna(prop, nullptr, "mask_info.blend_factor");
3989 RNA_def_property_range(prop, 0.0f, 1.0f);
3990 RNA_def_property_ui_range(prop, 0, 1., 0.1, 1);
3991 RNA_def_property_ui_text(prop, "Blending Factor", "Overlay blending factor of rasterized mask");
3992 RNA_def_property_update(prop, noteflag, nullptr);
3993}
3994
3996{
3997 StructRNA *srna;
3998 PropertyRNA *prop;
3999
4000 static const EnumPropertyItem dt_uvstretch_items[] = {
4001 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
4002 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
4003 {0, nullptr, 0, nullptr, nullptr},
4004 };
4005
4006 static const EnumPropertyItem pixel_round_mode_items[] = {
4007 {SI_PIXEL_ROUND_DISABLED, "DISABLED", 0, "Disabled", "Don't round to pixels"},
4008 {SI_PIXEL_ROUND_CORNER, "CORNER", 0, "Corner", "Round to pixel corners"},
4009 {SI_PIXEL_ROUND_CENTER, "CENTER", 0, "Center", "Round to pixel centers"},
4010 {0, nullptr, 0, nullptr, nullptr},
4011 };
4012
4013 static const EnumPropertyItem grid_shape_source_items[] = {
4014 {SI_GRID_SHAPE_DYNAMIC, "DYNAMIC", 0, "Dynamic", "Dynamic grid"},
4015 {SI_GRID_SHAPE_FIXED, "FIXED", 0, "Fixed", "Manually set grid divisions"},
4016 {SI_GRID_SHAPE_PIXEL, "PIXEL", 0, "Pixel", "Grid aligns with pixels from image"},
4017 {0, nullptr, 0, nullptr, nullptr},
4018 };
4019
4020 srna = RNA_def_struct(brna, "SpaceUVEditor", nullptr);
4021 RNA_def_struct_sdna(srna, "SpaceImage");
4022 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
4023 RNA_def_struct_path_func(srna, "rna_SpaceUVEditor_path");
4024 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
4025
4026 /* drawing */
4027 prop = RNA_def_property(srna, "edge_display_type", PROP_ENUM, PROP_NONE);
4028 RNA_def_property_enum_sdna(prop, nullptr, "dt_uv");
4030 RNA_def_property_ui_text(prop, "Display As", "Display style for UV edges");
4032
4033 prop = RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
4034 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_STRETCH);
4036 prop,
4037 "Display Stretch",
4038 "Display faces colored according to the difference in shape between UVs and "
4039 "their 3D coordinates (blue for low distortion, red for high distortion)");
4041
4042 prop = RNA_def_property(srna, "display_stretch_type", PROP_ENUM, PROP_NONE);
4043 RNA_def_property_enum_sdna(prop, nullptr, "dt_uvstretch");
4044 RNA_def_property_enum_items(prop, dt_uvstretch_items);
4045 RNA_def_property_ui_text(prop, "Display Stretch Type", "Type of stretch to display");
4048
4049 prop = RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
4050 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAWSHADOW);
4052 prop, "Display Modified Edges", "Display edges after modifiers are applied");
4054
4055 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
4056 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_METADATA);
4057 RNA_def_property_ui_text(prop, "Show Metadata", "Display metadata properties of the image");
4059
4060 prop = RNA_def_property(srna, "show_uv", PROP_BOOLEAN, PROP_NONE);
4062 RNA_def_property_ui_text(prop, "Display UVs", "Display overlay of UV layer");
4064
4065 prop = RNA_def_property(srna, "show_pixel_coords", PROP_BOOLEAN, PROP_NONE);
4068 prop, "Pixel Coordinates", "Display UV coordinates in pixels rather than from 0.0 to 1.0");
4070
4071 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
4073 RNA_def_property_ui_text(prop, "Display Faces", "Display faces over the image");
4075
4076 prop = RNA_def_property(srna, "tile_grid_shape", PROP_INT, PROP_XYZ);
4077 RNA_def_property_int_sdna(prop, nullptr, "tile_grid_shape");
4078 RNA_def_property_array(prop, 2);
4080 RNA_def_property_range(prop, 1, 100);
4081 RNA_def_property_int_funcs(prop, nullptr, "rna_SpaceUVEditor_tile_grid_shape_set", nullptr);
4083 prop, "Tile Grid Shape", "How many tiles will be shown in the background");
4085
4086 prop = RNA_def_property(srna, "show_grid_over_image", PROP_BOOLEAN, PROP_NONE);
4087 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_GRID_OVER_IMAGE);
4089 RNA_def_property_ui_text(prop, "Grid Over Image", "Show the grid over the image");
4091
4092 prop = RNA_def_property(srna, "grid_shape_source", PROP_ENUM, PROP_NONE);
4093 RNA_def_property_enum_items(prop, grid_shape_source_items);
4094 RNA_def_property_ui_text(prop, "Grid Shape Source", "Specify source for the grid shape");
4096
4097 prop = RNA_def_property(srna, "custom_grid_subdivisions", PROP_INT, PROP_XYZ);
4098 RNA_def_property_int_sdna(prop, nullptr, "custom_grid_subdiv");
4099 RNA_def_property_array(prop, 2);
4101 RNA_def_property_range(prop, 1, 5000);
4102 RNA_def_property_int_funcs(prop, nullptr, "rna_SpaceUVEditor_custom_grid_subdiv_set", nullptr);
4104 prop, "Dynamic Grid Size", "Number of grid units in UV space that make one UV Unit");
4106
4107 prop = RNA_def_property(srna, "uv_opacity", PROP_FLOAT, PROP_FACTOR);
4108 RNA_def_property_float_sdna(prop, nullptr, "uv_opacity");
4109 RNA_def_property_range(prop, 0.0f, 1.0f);
4110 RNA_def_property_ui_text(prop, "UV Opacity", "Opacity of UV overlays");
4112
4113 prop = RNA_def_property(srna, "uv_face_opacity", PROP_FLOAT, PROP_FACTOR);
4114 RNA_def_property_float_sdna(prop, nullptr, "uv_face_opacity");
4115 RNA_def_property_range(prop, 0.0f, 1.0f);
4116 RNA_def_property_ui_text(prop, "UV Face Opacity", "Opacity of faces in UV overlays");
4118
4119 prop = RNA_def_property(srna, "stretch_opacity", PROP_FLOAT, PROP_FACTOR);
4120 RNA_def_property_float_sdna(prop, nullptr, "stretch_opacity");
4121 RNA_def_property_range(prop, 0.0f, 1.0f);
4122 RNA_def_property_ui_text(prop, "Stretch Opacity", "Opacity of the UV Stretch overlay");
4124
4125 prop = RNA_def_property(srna, "pixel_round_mode", PROP_ENUM, PROP_NONE);
4126 RNA_def_property_enum_items(prop, pixel_round_mode_items);
4127 RNA_def_property_ui_text(prop, "Round to Pixels", "Round UVs to pixels while editing");
4129
4130 prop = RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
4131 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_CLIP_UV);
4133 "Constrain to Image Bounds",
4134 "Constraint to stay within the image bounds while editing");
4136
4137 prop = RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
4138 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_LIVE_UNWRAP);
4140 prop,
4141 "Live Unwrap",
4142 "Continuously unwrap the selected UV island while transforming pinned vertices");
4144}
4145
4147{
4148 StructRNA *srna;
4149 PropertyRNA *prop;
4150
4151 static const EnumPropertyItem display_mode_items[] = {
4152 {SO_SCENES,
4153 "SCENES",
4154 ICON_SCENE_DATA,
4155 "Scenes",
4156 "Display scenes and their view layers, collections and objects"},
4158 "VIEW_LAYER",
4159 ICON_RENDER_RESULT,
4160 "View Layer",
4161 "Display collections and objects in the view layer"},
4162 {SO_SEQUENCE,
4163 "SEQUENCE",
4164 ICON_SEQUENCE,
4165 "Video Sequencer",
4166 "Display data belonging to the Video Sequencer"},
4167 {SO_LIBRARIES,
4168 "LIBRARIES",
4169 ICON_FILE_BLEND,
4170 "Blender File",
4171 "Display data of current file and linked libraries"},
4172 {SO_DATA_API,
4173 "DATA_API",
4174 ICON_RNA,
4175 "Data API",
4176 "Display low level Blender data and its properties"},
4178 "LIBRARY_OVERRIDES",
4179 ICON_LIBRARY_DATA_OVERRIDE,
4180 "Library Overrides",
4181 "Display data-blocks with library overrides and list their overridden properties"},
4183 "ORPHAN_DATA",
4184 ICON_ORPHAN_DATA,
4185 "Unused Data",
4186 "Display data that is unused and/or will be lost when the file is reloaded"},
4187 {0, nullptr, 0, nullptr, nullptr},
4188 };
4189
4190 static const EnumPropertyItem lib_override_view_mode[] = {
4192 "PROPERTIES",
4193 ICON_NONE,
4194 "Properties",
4195 "Display all local override data-blocks with their overridden properties and buttons to "
4196 "edit them"},
4198 "HIERARCHIES",
4199 ICON_NONE,
4200 "Hierarchies",
4201 "Display library override relationships"},
4202 {0, nullptr, 0, nullptr, nullptr},
4203 };
4204
4205 static const EnumPropertyItem filter_state_items[] = {
4206 {SO_FILTER_OB_ALL, "ALL", 0, "All", "Show all objects in the view layer"},
4207 {SO_FILTER_OB_VISIBLE, "VISIBLE", 0, "Visible", "Show visible objects"},
4208 {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected", "Show selected objects"},
4209 {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active object"},
4210 {SO_FILTER_OB_SELECTABLE, "SELECTABLE", 0, "Selectable", "Show only selectable objects"},
4211 {0, nullptr, 0, nullptr, nullptr},
4212 };
4213
4214 srna = RNA_def_struct(brna, "SpaceOutliner", "Space");
4215 RNA_def_struct_sdna(srna, "SpaceOutliner");
4216 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
4217
4218 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
4219 RNA_def_property_enum_sdna(prop, nullptr, "outlinevis");
4220 RNA_def_property_enum_items(prop, display_mode_items);
4221 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
4223
4224 prop = RNA_def_property(srna, "lib_override_view_mode", PROP_ENUM, PROP_NONE);
4225 RNA_def_property_enum_items(prop, lib_override_view_mode);
4227 "Library Override View Mode",
4228 "Choose different visualizations of library override data");
4230
4231 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
4232 RNA_def_property_string_sdna(prop, nullptr, "search_string");
4233 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
4236
4237 prop = RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
4238 RNA_def_property_boolean_sdna(prop, nullptr, "search_flags", SO_FIND_CASE_SENSITIVE);
4240 prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
4242
4243 prop = RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
4244 RNA_def_property_boolean_sdna(prop, nullptr, "search_flags", SO_FIND_COMPLETE);
4246 prop, "Complete Matches Only", "Only use complete matches of search string");
4248
4249 prop = RNA_def_property(srna, "use_sort_alpha", PROP_BOOLEAN, PROP_NONE);
4251 RNA_def_property_ui_text(prop, "Sort Alphabetically", "");
4253
4254 prop = RNA_def_property(srna, "use_sync_select", PROP_BOOLEAN, PROP_NONE);
4255 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_SYNC_SELECT);
4257 prop, "Sync Outliner Selection", "Sync outliner selection with other editors");
4259
4260 prop = RNA_def_property(srna, "show_mode_column", PROP_BOOLEAN, PROP_NONE);
4261 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_MODE_COLUMN);
4263 prop, "Show Mode Column", "Show the mode column for mode toggle and activation");
4265
4266 /* Granular restriction column option. */
4267 prop = RNA_def_property(srna, "show_restrict_column_enable", PROP_BOOLEAN, PROP_NONE);
4268 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_ENABLE);
4269 RNA_def_property_ui_text(prop, "Exclude from View Layer", "Exclude from view layer");
4270 RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, 0);
4272
4273 prop = RNA_def_property(srna, "show_restrict_column_select", PROP_BOOLEAN, PROP_NONE);
4274 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_SELECT);
4275 RNA_def_property_ui_text(prop, "Selectable", "Selectable");
4276 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
4278
4279 prop = RNA_def_property(srna, "show_restrict_column_hide", PROP_BOOLEAN, PROP_NONE);
4280 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_HIDE);
4281 RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
4282 RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 0);
4284
4285 prop = RNA_def_property(srna, "show_restrict_column_viewport", PROP_BOOLEAN, PROP_NONE);
4286 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_VIEWPORT);
4287 RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
4288 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
4290
4291 prop = RNA_def_property(srna, "show_restrict_column_render", PROP_BOOLEAN, PROP_NONE);
4292 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_RENDER);
4293 RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");
4294 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 0);
4296
4297 prop = RNA_def_property(srna, "show_restrict_column_holdout", PROP_BOOLEAN, PROP_NONE);
4298 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_HOLDOUT);
4299 RNA_def_property_ui_text(prop, "Holdout", "Holdout");
4300 RNA_def_property_ui_icon(prop, ICON_HOLDOUT_ON, 0);
4302
4303 prop = RNA_def_property(srna, "show_restrict_column_indirect_only", PROP_BOOLEAN, PROP_NONE);
4304 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_INDIRECT_ONLY);
4305 RNA_def_property_ui_text(prop, "Indirect Only", "Indirect only");
4306 RNA_def_property_ui_icon(prop, ICON_INDIRECT_ONLY_ON, 0);
4308
4309 /* Filters. */
4310 prop = RNA_def_property(srna, "use_filter_object", PROP_BOOLEAN, PROP_NONE);
4312 RNA_def_property_ui_text(prop, "Filter Objects", "Show objects");
4314
4315 prop = RNA_def_property(srna, "use_filter_object_content", PROP_BOOLEAN, PROP_NONE);
4318 prop, "Show Object Contents", "Show what is inside the objects elements");
4320
4321 prop = RNA_def_property(srna, "use_filter_children", PROP_BOOLEAN, PROP_NONE);
4323 RNA_def_property_ui_text(prop, "Show Object Children", "Show children");
4325
4326 prop = RNA_def_property(srna, "use_filter_collection", PROP_BOOLEAN, PROP_NONE);
4328 RNA_def_property_ui_text(prop, "Show Collections", "Show collections");
4330
4331 prop = RNA_def_property(srna, "use_filter_view_layers", PROP_BOOLEAN, PROP_NONE);
4333 RNA_def_property_ui_text(prop, "Show All View Layers", "Show all the view layers");
4335
4336 /* Filters object state. */
4337 prop = RNA_def_property(srna, "filter_state", PROP_ENUM, PROP_NONE);
4338 RNA_def_property_enum_sdna(prop, nullptr, "filter_state");
4339 RNA_def_property_enum_items(prop, filter_state_items);
4340 RNA_def_property_ui_text(prop, "Object State Filter", "");
4342
4343 prop = RNA_def_property(srna, "filter_invert", PROP_BOOLEAN, PROP_NONE);
4345 RNA_def_property_ui_text(prop, "Invert", "Invert the object state filter");
4347
4348 /* Filters object type. */
4349 prop = RNA_def_property(srna, "use_filter_object_mesh", PROP_BOOLEAN, PROP_NONE);
4351 RNA_def_property_ui_text(prop, "Show Meshes", "Show mesh objects");
4353
4354 prop = RNA_def_property(srna, "use_filter_object_armature", PROP_BOOLEAN, PROP_NONE);
4356 RNA_def_property_ui_text(prop, "Show Armatures", "Show armature objects");
4358
4359 prop = RNA_def_property(srna, "use_filter_object_empty", PROP_BOOLEAN, PROP_NONE);
4361 RNA_def_property_ui_text(prop, "Show Empties", "Show empty objects");
4363
4364 prop = RNA_def_property(srna, "use_filter_object_light", PROP_BOOLEAN, PROP_NONE);
4366 RNA_def_property_ui_text(prop, "Show Lights", "Show light objects");
4368
4369 prop = RNA_def_property(srna, "use_filter_object_camera", PROP_BOOLEAN, PROP_NONE);
4371 RNA_def_property_ui_text(prop, "Show Cameras", "Show camera objects");
4373
4374 prop = RNA_def_property(srna, "use_filter_object_grease_pencil", PROP_BOOLEAN, PROP_NONE);
4376 RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show Grease Pencil objects");
4378
4379 prop = RNA_def_property(srna, "use_filter_object_others", PROP_BOOLEAN, PROP_NONE);
4382 prop, "Show Other Objects", "Show curves, lattices, light probes, fonts, ...");
4384
4385 /* Libraries filter. */
4386 prop = RNA_def_property(srna, "use_filter_id_type", PROP_BOOLEAN, PROP_NONE);
4387 RNA_def_property_boolean_sdna(prop, nullptr, "filter", SO_FILTER_ID_TYPE);
4388 RNA_def_property_ui_text(prop, "Filter by Type", "Show only data-blocks of one type");
4390
4391 prop = RNA_def_property(srna, "filter_id_type", PROP_ENUM, PROP_NONE);
4392 RNA_def_property_enum_sdna(prop, nullptr, "filter_id_type");
4394 RNA_def_property_ui_text(prop, "Filter by Type", "Data-block type to show");
4396
4397 prop = RNA_def_property(srna, "use_filter_lib_override_system", PROP_BOOLEAN, PROP_NONE);
4400 prop,
4401 "Show System Overrides",
4402 "For libraries with overrides created, show the overridden values that are "
4403 "defined/controlled automatically (e.g. to make users of an overridden data-block point to "
4404 "the override data, not the original linked data)");
4406}
4407
4409{
4410 StructRNA *srna;
4411 PropertyRNA *prop;
4412
4413 static const EnumPropertyItem background_type_items[] = {
4414 {V3D_SHADING_BACKGROUND_THEME, "THEME", 0, "Theme", "Use the theme for background color"},
4415 {V3D_SHADING_BACKGROUND_WORLD, "WORLD", 0, "World", "Use the world for background color"},
4417 "VIEWPORT",
4418 0,
4419 "Custom",
4420 "Use a custom color limited to this viewport only"},
4421 {0, nullptr, 0, nullptr, nullptr},
4422 };
4423
4424 static const EnumPropertyItem cavity_type_items[] = {
4426 "WORLD",
4427 0,
4428 "World",
4429 "Cavity shading computed in world space, useful for larger-scale occlusion"},
4431 "SCREEN",
4432 0,
4433 "Screen",
4434 "Curvature-based shading, useful for making fine details more visible"},
4435 {V3D_SHADING_CAVITY_BOTH, "BOTH", 0, "Both", "Use both effects simultaneously"},
4436 {0, nullptr, 0, nullptr, nullptr},
4437 };
4438
4439 static const EnumPropertyItem use_compositor_items[] = {
4441 "DISABLED",
4442 0,
4443 "Disabled",
4444 "The compositor is disabled"},
4446 "CAMERA",
4447 0,
4448 "Camera",
4449 "The compositor is enabled only in camera view"},
4451 "ALWAYS",
4452 0,
4453 "Always",
4454 "The compositor is always enabled regardless of the view"},
4455 {0, nullptr, 0, nullptr, nullptr},
4456 };
4457
4458 /* Note these settings are used for both 3D viewport and the OpenGL render
4459 * engine in the scene, so can't assume to always be part of a screen. */
4460 srna = RNA_def_struct(brna, "View3DShading", nullptr);
4461 RNA_def_struct_path_func(srna, "rna_View3DShading_path");
4463 srna, "3D View Shading Settings", "Settings for shading in the 3D viewport");
4464 RNA_def_struct_system_idprops_func(srna, "rna_View3DShading_idprops");
4465
4466 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4469 "rna_3DViewShading_type_get",
4470 "rna_3DViewShading_type_set",
4471 "rna_3DViewShading_type_itemf");
4473 prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
4475 prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, "rna_3DViewShading_type_update");
4476
4477 prop = RNA_def_property(srna, "light", PROP_ENUM, PROP_NONE);
4478 RNA_def_property_enum_sdna(prop, nullptr, "light");
4480 RNA_def_property_ui_text(prop, "Lighting", "Lighting Method for Solid/Texture Viewport Shading");
4482
4483 prop = RNA_def_property(srna, "show_object_outline", PROP_BOOLEAN, PROP_NONE);
4486 RNA_def_property_ui_text(prop, "Outline", "Show Object Outline");
4488
4489 prop = RNA_def_property(srna, "studio_light", PROP_ENUM, PROP_NONE);
4493 "rna_View3DShading_studio_light_get",
4494 "rna_View3DShading_studio_light_set",
4495 "rna_View3DShading_studio_light_itemf");
4496 RNA_def_property_ui_text(prop, "Studiolight", "Studio lighting setup");
4498
4499 prop = RNA_def_property(srna, "use_world_space_lighting", PROP_BOOLEAN, PROP_NONE);
4503 prop, "World Space Lighting", "Make the lighting fixed and not follow the camera");
4505
4506 prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE);
4509 prop, "Backface Culling", "Use back face culling to hide the back side of faces");
4511
4512 prop = RNA_def_property(srna, "show_cavity", PROP_BOOLEAN, PROP_NONE);
4513 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_CAVITY);
4515 RNA_def_property_ui_text(prop, "Cavity", "Show Cavity");
4517
4518 prop = RNA_def_property(srna, "cavity_type", PROP_ENUM, PROP_NONE);
4519 RNA_def_property_enum_items(prop, cavity_type_items);
4520 RNA_def_property_ui_text(prop, "Cavity Type", "Way to display the cavity shading");
4523
4524 prop = RNA_def_property(srna, "curvature_ridge_factor", PROP_FLOAT, PROP_FACTOR);
4525 RNA_def_property_float_sdna(prop, nullptr, "curvature_ridge_factor");
4526 RNA_def_property_ui_text(prop, "Curvature Ridge", "Factor for the curvature ridges");
4527 RNA_def_property_range(prop, 0.0f, 2.0f);
4530
4531 prop = RNA_def_property(srna, "curvature_valley_factor", PROP_FLOAT, PROP_FACTOR);
4532 RNA_def_property_float_sdna(prop, nullptr, "curvature_valley_factor");
4533 RNA_def_property_ui_text(prop, "Curvature Valley", "Factor for the curvature valleys");
4534 RNA_def_property_range(prop, 0.0f, 2.0f);
4537
4538 prop = RNA_def_property(srna, "cavity_ridge_factor", PROP_FLOAT, PROP_FACTOR);
4539 RNA_def_property_float_sdna(prop, nullptr, "cavity_ridge_factor");
4540 RNA_def_property_ui_text(prop, "Cavity Ridge", "Factor for the cavity ridges");
4541 RNA_def_property_range(prop, 0.0f, 250.0f);
4542 RNA_def_property_ui_range(prop, 0.00f, 2.5f, 1, 3);
4545
4546 prop = RNA_def_property(srna, "cavity_valley_factor", PROP_FLOAT, PROP_FACTOR);
4547 RNA_def_property_float_sdna(prop, nullptr, "cavity_valley_factor");
4548 RNA_def_property_ui_text(prop, "Cavity Valley", "Factor for the cavity valleys");
4549 RNA_def_property_range(prop, 0.0f, 250.0f);
4550 RNA_def_property_ui_range(prop, 0.00f, 2.5f, 1, 3);
4553
4554 prop = RNA_def_property(srna, "selected_studio_light", PROP_POINTER, PROP_NONE);
4555 RNA_def_property_struct_type(prop, "StudioLight");
4557 RNA_def_property_ui_text(prop, "Studio Light", "Selected StudioLight");
4559 prop, "rna_View3DShading_selected_studio_light_get", nullptr, nullptr, nullptr);
4562
4563 prop = RNA_def_property(srna, "studiolight_rotate_z", PROP_FLOAT, PROP_ANGLE);
4564 RNA_def_property_float_sdna(prop, nullptr, "studiolight_rot_z");
4566 prop, "Studiolight Rotation", "Rotation of the studiolight around the Z-Axis");
4570
4571 prop = RNA_def_property(srna, "studiolight_intensity", PROP_FLOAT, PROP_FACTOR);
4572 RNA_def_property_float_sdna(prop, nullptr, "studiolight_intensity");
4574 RNA_def_property_ui_text(prop, "Strength", "Strength of the studiolight");
4576 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4577 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
4579
4580 prop = RNA_def_property(srna, "studiolight_background_alpha", PROP_FLOAT, PROP_FACTOR);
4581 RNA_def_property_float_sdna(prop, nullptr, "studiolight_background");
4582 RNA_def_property_ui_text(prop, "World Opacity", "Show the studiolight in the background");
4583 RNA_def_property_range(prop, 0.0f, 1.0f);
4584 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
4587
4588 prop = RNA_def_property(srna, "studiolight_background_blur", PROP_FLOAT, PROP_FACTOR);
4589 RNA_def_property_float_sdna(prop, nullptr, "studiolight_blur");
4590 RNA_def_property_ui_text(prop, "Blur", "Blur the studiolight in the background");
4592 RNA_def_property_range(prop, 0.0f, 1.0f);
4593 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
4596
4597 prop = RNA_def_property(srna, "use_studiolight_view_rotation", PROP_BOOLEAN, PROP_NONE);
4599 prop, nullptr, "flag", V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION);
4602 prop, "World Space Lighting", "Make the HDR rotation fixed and not follow the camera");
4604
4605 prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE);
4606 RNA_def_property_enum_sdna(prop, nullptr, "color_type");
4608 RNA_def_property_ui_text(prop, "Color", "Color Type");
4611
4612 prop = RNA_def_property(srna, "wireframe_color_type", PROP_ENUM, PROP_NONE);
4613 RNA_def_property_enum_sdna(prop, nullptr, "wire_color_type");
4615 RNA_def_property_ui_text(prop, "Wire Color", "Wire Color Type");
4617
4618 prop = RNA_def_property(srna, "single_color", PROP_FLOAT, PROP_COLOR);
4619 RNA_def_property_float_sdna(prop, nullptr, "single_color");
4620 RNA_def_property_array(prop, 3);
4621 RNA_def_property_ui_text(prop, "Color", "Color for single color mode");
4622 RNA_def_property_range(prop, 0.0f, 1.0f);
4624
4625 prop = RNA_def_property(srna, "background_type", PROP_ENUM, PROP_NONE);
4626 RNA_def_property_enum_items(prop, background_type_items);
4627 RNA_def_property_ui_text(prop, "Background", "Way to display the background");
4630
4631 prop = RNA_def_property(srna, "background_color", PROP_FLOAT, PROP_COLOR);
4632 RNA_def_property_array(prop, 3);
4633 RNA_def_property_ui_text(prop, "Background Color", "Color for custom background color");
4634 RNA_def_property_range(prop, 0.0f, 1.0f);
4636
4637 prop = RNA_def_property(srna, "show_shadows", PROP_BOOLEAN, PROP_NONE);
4638 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_SHADOW);
4640 RNA_def_property_ui_text(prop, "Shadow", "Show Shadow");
4642
4643 prop = RNA_def_property(srna, "show_xray", PROP_BOOLEAN, PROP_NONE);
4644 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_XRAY);
4646 RNA_def_property_ui_text(prop, "Show X-Ray", "Show whole scene transparent");
4648
4649 prop = RNA_def_property(srna, "show_xray_wireframe", PROP_BOOLEAN, PROP_NONE);
4652 RNA_def_property_ui_text(prop, "Show X-Ray", "Show whole scene transparent");
4654
4655 prop = RNA_def_property(srna, "xray_alpha", PROP_FLOAT, PROP_FACTOR);
4656 RNA_def_property_float_sdna(prop, nullptr, "xray_alpha");
4657 RNA_def_property_ui_text(prop, "X-Ray Opacity", "Amount of opacity to use");
4658 RNA_def_property_range(prop, 0.0f, 1.0f);
4661
4662 prop = RNA_def_property(srna, "xray_alpha_wireframe", PROP_FLOAT, PROP_FACTOR);
4663 RNA_def_property_float_sdna(prop, nullptr, "xray_alpha_wire");
4664 RNA_def_property_ui_text(prop, "X-Ray Opacity", "Amount of opacity to use");
4665 RNA_def_property_range(prop, 0.0f, 1.0f);
4668
4669 prop = RNA_def_property(srna, "use_dof", PROP_BOOLEAN, PROP_NONE);
4673 prop,
4674 "Depth Of Field",
4675 "Use depth of field on viewport using the values from the active camera");
4677
4678 prop = RNA_def_property(srna, "use_scene_lights", PROP_BOOLEAN, PROP_NONE);
4682 RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene");
4684
4685 prop = RNA_def_property(srna, "use_scene_world", PROP_BOOLEAN, PROP_NONE);
4689 RNA_def_property_ui_text(prop, "Scene World", "Use scene world for lighting");
4691
4692 prop = RNA_def_property(srna, "use_scene_lights_render", PROP_BOOLEAN, PROP_NONE);
4695 RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene");
4697
4698 prop = RNA_def_property(srna, "use_scene_world_render", PROP_BOOLEAN, PROP_NONE);
4701 RNA_def_property_ui_text(prop, "Scene World", "Use scene world for lighting");
4703
4704 prop = RNA_def_property(srna, "show_specular_highlight", PROP_BOOLEAN, PROP_NONE);
4707 RNA_def_property_ui_text(prop, "Specular Highlights", "Render specular highlights");
4709
4710 prop = RNA_def_property(srna, "object_outline_color", PROP_FLOAT, PROP_COLOR);
4711 RNA_def_property_float_sdna(prop, nullptr, "object_outline_color");
4712 RNA_def_property_array(prop, 3);
4713 RNA_def_property_ui_text(prop, "Outline Color", "Color for object outline");
4714 RNA_def_property_range(prop, 0.0f, 1.0f);
4716
4717 prop = RNA_def_property(srna, "shadow_intensity", PROP_FLOAT, PROP_FACTOR);
4718 RNA_def_property_float_sdna(prop, nullptr, "shadow_intensity");
4719 RNA_def_property_ui_text(prop, "Shadow Intensity", "Darkness of shadows");
4720 RNA_def_property_range(prop, 0.0f, 1.0f);
4721 RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 3);
4724
4725 prop = RNA_def_property(srna, "render_pass", PROP_ENUM, PROP_NONE);
4726 RNA_def_property_enum_sdna(prop, nullptr, "render_pass");
4728 RNA_def_property_ui_text(prop, "Render Pass", "Render Pass to show in the viewport");
4731 "rna_3DViewShading_render_pass_get",
4732 "rna_3DViewShading_render_pass_set",
4733 "rna_3DViewShading_render_pass_itemf");
4735
4736 prop = RNA_def_property(srna, "aov_name", PROP_STRING, PROP_NONE);
4737 RNA_def_property_string_sdna(prop, nullptr, "aov_name");
4738 RNA_def_property_ui_text(prop, "Shader AOV Name", "Name of the active Shader AOV");
4741
4742 prop = RNA_def_property(srna, "use_compositor", PROP_ENUM, PROP_NONE);
4743 RNA_def_property_enum_sdna(prop, nullptr, "use_compositor");
4744 RNA_def_property_enum_items(prop, use_compositor_items);
4747 prop, "Compositor", "When to preview the compositor output inside the viewport");
4750 "rna_SpaceView3D_shading_use_compositor_update");
4751}
4752
4754{
4755 StructRNA *srna;
4756 PropertyRNA *prop;
4757
4758 srna = RNA_def_struct(brna, "View3DOverlay", nullptr);
4759 RNA_def_struct_sdna(srna, "View3D");
4760 RNA_def_struct_nested(brna, srna, "SpaceView3D");
4761 RNA_def_struct_path_func(srna, "rna_View3DOverlay_path");
4763 srna, "3D View Overlay Settings", "Settings for display of overlays in the 3D viewport");
4764
4765 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
4767 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like gizmos and outlines");
4768 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_show_overlay_update");
4769
4770 prop = RNA_def_property(srna, "show_ortho_grid", PROP_BOOLEAN, PROP_NONE);
4771 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_ORTHO_GRID);
4772 RNA_def_property_ui_text(prop, "Display Grid", "Show grid in orthographic side view");
4774
4775 prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
4776 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_FLOOR);
4777 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid");
4779
4780 prop = RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
4781 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_X);
4782 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line");
4784
4785 prop = RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
4786 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_Y);
4787 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line");
4789
4790 prop = RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
4791 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_Z);
4792 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line");
4794
4795 prop = RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
4796 RNA_def_property_float_sdna(prop, nullptr, "grid");
4798 prop, "Grid Scale", "Multiplier for the distance between 3D View grid lines");
4799 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4800 RNA_def_property_ui_range(prop, 0.001f, 1000.0f, 0.1f, 3);
4802
4803 prop = RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
4804 RNA_def_property_int_sdna(prop, nullptr, "gridlines");
4806 prop, "Grid Lines", "Number of grid lines to display in perspective view");
4807 RNA_def_property_range(prop, 0, 1024);
4809
4810 prop = RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
4811 RNA_def_property_int_sdna(prop, nullptr, "gridsubdiv");
4812 RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions between grid lines");
4813 RNA_def_property_range(prop, 1, 1024);
4815
4816 prop = RNA_def_property(srna, "grid_scale_unit", PROP_FLOAT, PROP_NONE);
4818 RNA_def_property_float_funcs(prop, "rna_View3DOverlay_GridScaleUnit_get", nullptr, nullptr);
4820 prop, "Grid Scale Unit", "Grid cell size scaled by scene unit system settings");
4821
4822 prop = RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
4823 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SELECT_OUTLINE);
4825 prop, "Outline Selected", "Show an outline highlight around selected objects");
4827
4828 prop = RNA_def_property(srna, "show_object_origins", PROP_BOOLEAN, PROP_NONE);
4830 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_OBJECT_ORIGINS);
4831 RNA_def_property_ui_text(prop, "Object Origins", "Show object center dots");
4833
4834 prop = RNA_def_property(srna, "show_object_origins_all", PROP_BOOLEAN, PROP_NONE);
4835 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_DRAW_CENTERS);
4837 prop,
4838 "All Object Origins",
4839 "Show the object origin center dot for all (selected and unselected) objects");
4841
4842 prop = RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
4845 "Relationship Lines",
4846 "Show dashed lines indicating parent or constraint relationships");
4848
4849 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
4851 RNA_def_property_ui_text(prop, "Show 3D Cursor", "Display 3D Cursor Overlay");
4853
4854 prop = RNA_def_property(srna, "show_text", PROP_BOOLEAN, PROP_NONE);
4855 RNA_def_property_boolean_negative_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_TEXT);
4856 RNA_def_property_ui_text(prop, "Show Text", "Display overlay text");
4858
4859 prop = RNA_def_property(srna, "show_stats", PROP_BOOLEAN, PROP_NONE);
4860 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_STATS);
4861 RNA_def_property_ui_text(prop, "Show Statistics", "Display scene statistics overlay text");
4863
4864 /* show camera composition guides */
4865 prop = RNA_def_property(srna, "show_camera_guides", PROP_BOOLEAN, PROP_NONE);
4867 RNA_def_property_ui_text(prop, "Show Camera Guides", "Show camera composition guides");
4869
4870 prop = RNA_def_property(srna, "show_camera_passepartout", PROP_BOOLEAN, PROP_NONE);
4872 RNA_def_property_ui_text(prop, "Show Passepartout", "Show camera passepartout");
4874
4875 prop = RNA_def_property(srna, "show_extras", PROP_BOOLEAN, PROP_NONE);
4877 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_OBJECT_XTRAS);
4879 prop, "Extras", "Object details, including empty wire, cameras and other visual guides");
4881
4882 prop = RNA_def_property(srna, "show_light_colors", PROP_BOOLEAN, PROP_NONE);
4883 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SHOW_LIGHT_COLORS);
4884 RNA_def_property_ui_text(prop, "Light Colors", "Show light colors");
4886
4887 prop = RNA_def_property(srna, "show_bones", PROP_BOOLEAN, PROP_NONE);
4888 RNA_def_property_boolean_negative_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_BONES);
4890 prop, "Show Bones", "Display bones (disable to show motion paths only)");
4892
4893 prop = RNA_def_property(srna, "show_face_orientation", PROP_BOOLEAN, PROP_NONE);
4894 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_FACE_ORIENTATION);
4896 RNA_def_property_ui_text(prop, "Face Orientation", "Show the Face Orientation Overlay");
4898
4899 prop = RNA_def_property(srna, "show_fade_inactive", PROP_BOOLEAN, PROP_NONE);
4900 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_FADE_INACTIVE);
4903 prop, "Fade Inactive Objects", "Fade inactive geometry using the viewport background color");
4905
4906 prop = RNA_def_property(srna, "fade_inactive_alpha", PROP_FLOAT, PROP_FACTOR);
4907 RNA_def_property_float_sdna(prop, nullptr, "overlay.fade_alpha");
4908 RNA_def_property_ui_text(prop, "Opacity", "Strength of the fade effect");
4909 RNA_def_property_range(prop, 0.0f, 1.0f);
4912
4913 prop = RNA_def_property(srna, "show_xray_bone", PROP_BOOLEAN, PROP_NONE);
4914 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_BONE_SELECT);
4916 RNA_def_property_ui_text(prop, "Show Bone X-Ray", "Show the bone selection overlay");
4918
4919 prop = RNA_def_property(srna, "xray_alpha_bone", PROP_FLOAT, PROP_FACTOR);
4920 RNA_def_property_float_sdna(prop, nullptr, "overlay.xray_alpha_bone");
4921 RNA_def_property_ui_text(prop, "Opacity", "Opacity to use for bone selection");
4922 RNA_def_property_range(prop, 0.0f, 1.0f);
4925
4926 prop = RNA_def_property(srna, "bone_wire_alpha", PROP_FLOAT, PROP_FACTOR);
4927 RNA_def_property_float_sdna(prop, nullptr, "overlay.bone_wire_alpha");
4929 prop, "Bone Wireframe Opacity", "Maximum opacity of bones in wireframe display mode");
4930 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4931 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
4934
4935 prop = RNA_def_property(srna, "show_motion_paths", PROP_BOOLEAN, PROP_NONE);
4937 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_MOTION_PATHS);
4939 RNA_def_property_ui_text(prop, "Motion Paths", "Show the Motion Paths Overlay");
4941
4942 prop = RNA_def_property(srna, "show_onion_skins", PROP_BOOLEAN, PROP_NONE);
4943 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_ONION_SKINS);
4945 RNA_def_property_ui_text(prop, "Onion Skins", "Show the Onion Skinning Overlay");
4947
4948 prop = RNA_def_property(srna, "show_look_dev", PROP_BOOLEAN, PROP_NONE);
4949 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_LOOK_DEV);
4952 "Reference Spheres",
4953 "Show reference spheres with neutral shading that react to lighting to "
4954 "assist in look development");
4956
4957 prop = RNA_def_property(srna, "show_wireframes", PROP_BOOLEAN, PROP_NONE);
4958 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_WIREFRAMES);
4960 RNA_def_property_ui_text(prop, "Wireframe", "Show face edges wires");
4962
4963 prop = RNA_def_property(srna, "wireframe_threshold", PROP_FLOAT, PROP_FACTOR);
4964 RNA_def_property_float_sdna(prop, nullptr, "overlay.wireframe_threshold");
4966 "Wireframe Threshold",
4967 "Adjust the angle threshold for displaying edges "
4968 "(1.0 for all)");
4969 RNA_def_property_range(prop, 0.0f, 1.0f);
4972
4973 prop = RNA_def_property(srna, "wireframe_opacity", PROP_FLOAT, PROP_FACTOR);
4974 RNA_def_property_float_sdna(prop, nullptr, "overlay.wireframe_opacity");
4976 "Wireframe Opacity",
4977 "Opacity of the displayed edges "
4978 "(1.0 for opaque)");
4979 RNA_def_property_range(prop, 0.0f, 1.0f);
4982
4983 prop = RNA_def_property(srna, "show_viewer_attribute", PROP_BOOLEAN, PROP_NONE);
4984 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_VIEWER_ATTRIBUTE);
4986 RNA_def_property_ui_text(prop, "Viewer Node", "Show attribute overlay for active viewer node");
4988
4989 prop = RNA_def_property(srna, "viewer_attribute_opacity", PROP_FLOAT, PROP_FACTOR);
4990 RNA_def_property_float_sdna(prop, nullptr, "overlay.viewer_attribute_opacity");
4992 prop, "Viewer Attribute Opacity", "Opacity of the attribute that is currently visualized");
4993 RNA_def_property_range(prop, 0.0f, 1.0f);
4996
4997 prop = RNA_def_property(srna, "show_viewer_text", PROP_BOOLEAN, PROP_NONE);
5001 prop, "View Attribute Text", "Show attribute values as text in viewport");
5003
5004 prop = RNA_def_property(srna, "show_paint_wire", PROP_BOOLEAN, PROP_NONE);
5005 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.paint_flag", V3D_OVERLAY_PAINT_WIRE);
5006 RNA_def_property_ui_text(prop, "Show Wire", "Use wireframe display in painting modes");
5008
5009 prop = RNA_def_property(srna, "show_wpaint_contours", PROP_BOOLEAN, PROP_NONE);
5010 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.wpaint_flag", V3D_OVERLAY_WPAINT_CONTOURS);
5012 prop,
5013 "Show Weight Contours",
5014 "Show contour lines formed by points with the same interpolated weight");
5016
5017 prop = RNA_def_property(srna, "show_weight", PROP_BOOLEAN, PROP_NONE);
5018 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_WEIGHT);
5019 RNA_def_property_ui_text(prop, "Show Weights", "Display weights in editmode");
5021
5022 prop = RNA_def_property(srna, "show_retopology", PROP_BOOLEAN, PROP_NONE);
5023 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_RETOPOLOGY);
5025 "Retopology",
5026 "Hide the solid mesh and offset the overlay towards the view. "
5027 "Selection is occluded by inactive geometry, unless X-Ray is enabled");
5029 prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, "rna_SpaceView3D_retopology_update");
5030
5031 prop = RNA_def_property(srna, "retopology_offset", PROP_FLOAT, PROP_DISTANCE);
5032 RNA_def_property_float_sdna(prop, nullptr, "overlay.retopology_offset");
5034 prop, "Retopology Offset", "Offset used to draw edit mesh in front of other geometry");
5035 RNA_def_property_range(prop, 0.0f, FLT_MAX);
5036 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1f, 3);
5039
5040 prop = RNA_def_property(srna, "show_face_normals", PROP_BOOLEAN, PROP_NONE);
5041 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_NORMALS);
5042 RNA_def_property_ui_text(prop, "Display Normals", "Display face normals as lines");
5044
5045 prop = RNA_def_property(srna, "show_vertex_normals", PROP_BOOLEAN, PROP_NONE);
5046 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_VERT_NORMALS);
5047 RNA_def_property_ui_text(prop, "Display Vertex Normals", "Display vertex normals as lines");
5049
5050 prop = RNA_def_property(srna, "show_split_normals", PROP_BOOLEAN, PROP_NONE);
5051 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_LOOP_NORMALS);
5053 prop, "Display Custom Normals", "Display vertex-per-face normals as lines");
5055
5056 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
5057 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACES);
5058 RNA_def_property_ui_text(prop, "Display Faces", "Display a face selection overlay");
5060
5061 prop = RNA_def_property(srna, "show_face_center", PROP_BOOLEAN, PROP_NONE);
5062 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_DOT);
5064 prop,
5065 "Display Face Center",
5066 "Display face center when face selection is enabled in solid shading modes");
5068
5069 prop = RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
5070 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CREASES);
5072 prop, "Display Creases", "Display creases created for Subdivision Surface modifier");
5074
5075 prop = RNA_def_property(srna, "show_edge_bevel_weight", PROP_BOOLEAN, PROP_NONE);
5076 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_BWEIGHTS);
5078 prop, "Display Bevel Weights", "Display weights created for the Bevel modifier");
5080
5081 prop = RNA_def_property(srna, "show_edge_seams", PROP_BOOLEAN, PROP_NONE);
5082 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_SEAMS);
5083 RNA_def_property_ui_text(prop, "Display Seams", "Display UV unwrapping seams");
5085
5086 prop = RNA_def_property(srna, "show_edge_sharp", PROP_BOOLEAN, PROP_NONE);
5087 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_SHARP);
5089 prop, "Display Sharp", "Display sharp edges, used with the Edge Split modifier");
5091
5092 prop = RNA_def_property(srna, "show_freestyle_edge_marks", PROP_BOOLEAN, PROP_NONE);
5094 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FREESTYLE_EDGE);
5096 "Display Freestyle Edge Marks",
5097 "Display Freestyle edge marks, used with the Freestyle renderer");
5099
5100 prop = RNA_def_property(srna, "show_freestyle_face_marks", PROP_BOOLEAN, PROP_NONE);
5102 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FREESTYLE_FACE);
5104 "Display Freestyle Face Marks",
5105 "Display Freestyle face marks, used with the Freestyle renderer");
5107
5108 prop = RNA_def_property(srna, "show_statvis", PROP_BOOLEAN, PROP_NONE);
5109 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_STATVIS);
5111 prop, "Mesh Analysis", "Display statistical information about the mesh");
5113
5114 prop = RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
5115 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_EDGE_LEN);
5117 prop,
5118 "Edge Length",
5119 "Display selected edge lengths, using global values when set in the transform panel");
5121
5122 prop = RNA_def_property(srna, "show_extra_edge_angle", PROP_BOOLEAN, PROP_NONE);
5123 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_EDGE_ANG);
5125 prop,
5126 "Edge Angle",
5127 "Display selected edge angle, using global values when set in the transform panel");
5129
5130 prop = RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
5131 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_ANG);
5133 "Face Angles",
5134 "Display the angles in the selected edges, "
5135 "using global values when set in the transform panel");
5137
5138 prop = RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
5139 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_AREA);
5141 "Face Area",
5142 "Display the area of selected faces, "
5143 "using global values when set in the transform panel");
5145
5146 prop = RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
5147 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_INDICES);
5149 prop, "Indices", "Display the index numbers of selected vertices, edges, and faces");
5151
5152 prop = RNA_def_property(srna, "display_handle", PROP_ENUM, PROP_NONE);
5153 RNA_def_property_enum_sdna(prop, nullptr, "overlay.handle_display");
5156 prop, "Display Handles", "Limit the display of curve handles in edit mode");
5158
5159 prop = RNA_def_property(srna, "show_curve_normals", PROP_BOOLEAN, PROP_NONE);
5160 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CU_NORMALS);
5161 RNA_def_property_ui_text(prop, "Draw Normals", "Display 3D curve normals in editmode");
5163
5164 prop = RNA_def_property(srna, "normals_length", PROP_FLOAT, PROP_FACTOR);
5165 RNA_def_property_float_sdna(prop, nullptr, "overlay.normals_length");
5166 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
5167 RNA_def_property_range(prop, 0.00001, 100000.0);
5168 RNA_def_property_ui_range(prop, 0.01, 2.0, 1, 2);
5170
5171 prop = RNA_def_property(srna, "normals_constant_screen_size", PROP_FLOAT, PROP_PIXEL);
5172 RNA_def_property_float_sdna(prop, nullptr, "overlay.normals_constant_screen_size");
5173 RNA_def_property_ui_text(prop, "Normal Screen Size", "Screen size for normals in the 3D view");
5174 RNA_def_property_range(prop, 0.0, 100000.0);
5175 RNA_def_property_ui_range(prop, 1.0, 100.0, 50, 0);
5177
5178 prop = RNA_def_property(srna, "use_normals_constant_screen_size", PROP_BOOLEAN, PROP_NONE);
5180 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS);
5182 "Constant Screen Size Normals",
5183 "Keep size of normals constant in relation to 3D view");
5185
5186 prop = RNA_def_property(srna, "texture_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
5187 RNA_def_property_float_sdna(prop, nullptr, "overlay.texture_paint_mode_opacity");
5189 prop, "Stencil Mask Opacity", "Opacity of the texture paint mode stencil mask overlay");
5190 RNA_def_property_range(prop, 0.0f, 1.0f);
5192
5193 prop = RNA_def_property(srna, "vertex_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
5194 RNA_def_property_float_sdna(prop, nullptr, "overlay.vertex_paint_mode_opacity");
5196 prop, "Stencil Mask Opacity", "Opacity of the texture paint mode stencil mask overlay");
5197 RNA_def_property_range(prop, 0.0f, 1.0f);
5199
5200 prop = RNA_def_property(srna, "weight_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
5201 RNA_def_property_float_sdna(prop, nullptr, "overlay.weight_paint_mode_opacity");
5203 prop, "Weight Paint Opacity", "Opacity of the weight paint mode overlay");
5204 RNA_def_property_range(prop, 0.0f, 1.0f);
5206
5207 prop = RNA_def_property(srna, "sculpt_mode_mask_opacity", PROP_FLOAT, PROP_FACTOR);
5208 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_mode_mask_opacity");
5209 RNA_def_property_ui_text(prop, "Sculpt Mask Opacity", "");
5210 RNA_def_property_range(prop, 0.0f, 1.0f);
5212
5213 prop = RNA_def_property(srna, "show_sculpt_curves_cage", PROP_BOOLEAN, PROP_NONE);
5214 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SCULPT_CURVES_CAGE);
5216 prop, "Sculpt Curves Cage", "Show original curves that are currently being edited");
5218
5219 prop = RNA_def_property(srna, "sculpt_curves_cage_opacity", PROP_FLOAT, PROP_FACTOR);
5220 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_curves_cage_opacity");
5222 prop, "Curves Sculpt Cage Opacity", "Opacity of the cage overlay in curves sculpt mode");
5223 RNA_def_property_range(prop, 0.0f, 1.0f);
5225
5226 prop = RNA_def_property(srna, "sculpt_mode_face_sets_opacity", PROP_FLOAT, PROP_FACTOR);
5227 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_mode_face_sets_opacity");
5228 RNA_def_property_ui_text(prop, "Sculpt Face Sets Opacity", "");
5229 RNA_def_property_range(prop, 0.0f, 1.0f);
5231
5232 prop = RNA_def_property(srna, "show_sculpt_mask", PROP_BOOLEAN, PROP_NONE);
5233 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SCULPT_SHOW_MASK);
5234 RNA_def_property_ui_text(prop, "Sculpt Show Mask", "");
5236
5237 prop = RNA_def_property(srna, "show_sculpt_face_sets", PROP_BOOLEAN, PROP_NONE);
5239 RNA_def_property_ui_text(prop, "Sculpt Show Face Sets", "");
5241
5242 /* grease pencil paper settings */
5243 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
5244 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_ANNOTATION);
5245 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
5247
5248 prop = RNA_def_property(srna, "use_gpencil_fade_objects", PROP_BOOLEAN, PROP_NONE);
5249 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_FADE_OBJECTS);
5251 prop,
5252 "Fade Objects",
5253 "Fade all viewport objects with a full color layer to improve visibility");
5255
5256 prop = RNA_def_property(srna, "use_gpencil_grid", PROP_BOOLEAN, PROP_NONE);
5257 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_GRID);
5258 RNA_def_property_ui_text(prop, "Use Grid", "Display a grid over Grease Pencil paper");
5260
5261 prop = RNA_def_property(srna, "use_gpencil_fade_layers", PROP_BOOLEAN, PROP_NONE);
5264 prop, "Fade Layers", "Toggle fading of Grease Pencil layers except the active one");
5266
5267 prop = RNA_def_property(srna, "use_gpencil_fade_gp_objects", PROP_BOOLEAN, PROP_NONE);
5270 prop, "Fade Grease Pencil Objects", "Fade Grease Pencil Objects, except the active one");
5272
5273 prop = RNA_def_property(srna, "use_gpencil_canvas_xray", PROP_BOOLEAN, PROP_NONE);
5274 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_GRID_XRAY);
5275 RNA_def_property_ui_text(prop, "Canvas X-Ray", "Show Canvas grid in front");
5277
5278 prop = RNA_def_property(srna, "use_gpencil_show_directions", PROP_BOOLEAN, PROP_NONE);
5281 "Stroke Direction",
5282 "Show stroke drawing direction with a bigger green dot (start) "
5283 "and smaller red dot (end) points");
5285
5286 prop = RNA_def_property(srna, "use_gpencil_show_material_name", PROP_BOOLEAN, PROP_NONE);
5289 prop, "Stroke Material Name", "Show material name assigned to each stroke");
5291
5292 prop = RNA_def_property(srna, "gpencil_grid_opacity", PROP_FLOAT, PROP_NONE);
5293 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_opacity");
5294 RNA_def_property_range(prop, 0.1f, 1.0f);
5295 RNA_def_property_ui_text(prop, "Opacity", "Canvas grid opacity");
5297
5298 prop = RNA_def_property(srna, "gpencil_grid_color", PROP_FLOAT, PROP_COLOR);
5299 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_color");
5300 RNA_def_property_array(prop, 3);
5301 RNA_def_property_ui_text(prop, "Grid Color", "Canvas grid color");
5302 RNA_def_property_range(prop, 0.0f, 1.0f);
5304
5305 prop = RNA_def_property(srna, "gpencil_grid_scale", PROP_FLOAT, PROP_XYZ);
5306 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_scale");
5307 RNA_def_property_array(prop, 2);
5308 RNA_def_property_ui_text(prop, "Scale", "Canvas grid scale");
5309 RNA_def_property_range(prop, 0.0f, FLT_MAX);
5311
5312 prop = RNA_def_property(srna, "gpencil_grid_offset", PROP_FLOAT, PROP_DISTANCE);
5313 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_offset");
5314 RNA_def_property_array(prop, 2);
5315 RNA_def_property_ui_text(prop, "Offset", "Canvas grid offset");
5317
5318 prop = RNA_def_property(srna, "gpencil_grid_subdivisions", PROP_INT, PROP_NONE);
5319 RNA_def_property_int_sdna(prop, nullptr, "overlay.gpencil_grid_subdivisions");
5320 RNA_def_property_range(prop, 1, 100);
5321 RNA_def_property_ui_text(prop, "Subdivisions", "Canvas grid subdivisions");
5323
5324 /* Paper opacity factor */
5325 prop = RNA_def_property(srna, "gpencil_fade_objects", PROP_FLOAT, PROP_NONE);
5326 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_paper_opacity");
5327 RNA_def_property_range(prop, 0.0f, 1.0f);
5328 RNA_def_property_ui_text(prop, "Opacity", "Fade factor");
5330
5331 /* Paper opacity factor */
5332 prop = RNA_def_property(srna, "gpencil_fade_layer", PROP_FLOAT, PROP_NONE);
5333 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_fade_layer");
5334 RNA_def_property_range(prop, 0.0f, 1.0f);
5337 prop, "Opacity", "Fade layer opacity for Grease Pencil layers except the active one");
5339
5340 /* show edit lines */
5341 prop = RNA_def_property(srna, "use_gpencil_edit_lines", PROP_BOOLEAN, PROP_NONE);
5342 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_EDIT_LINES);
5343 RNA_def_property_ui_text(prop, "Show Edit Lines", "Show Edit Lines when editing strokes");
5345
5346 prop = RNA_def_property(srna, "use_gpencil_multiedit_line_only", PROP_BOOLEAN, PROP_NONE);
5348 RNA_def_property_ui_text(prop, "Lines Only", "Show Edit Lines only in multiframe");
5350
5351 /* main grease pencil onion switch */
5352 prop = RNA_def_property(srna, "use_gpencil_onion_skin", PROP_BOOLEAN, PROP_NONE);
5353 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_ONION_SKIN);
5355 prop, "Onion Skins", "Show ghosts of the keyframes before and after the current frame");
5357
5358 /* Show onion skin for active object only. */
5359 prop = RNA_def_property(srna, "use_gpencil_onion_skin_active_object", PROP_BOOLEAN, PROP_NONE);
5362 prop, "Active Object Only", "Show only the onion skins of the active object");
5364
5365 /* vertex opacity */
5366 prop = RNA_def_property(srna, "vertex_opacity", PROP_FLOAT, PROP_FACTOR);
5367 RNA_def_property_float_sdna(prop, nullptr, "vertex_opacity");
5368 RNA_def_property_range(prop, 0.0f, 1.0f);
5369 RNA_def_property_ui_text(prop, "Vertex Opacity", "Opacity for edit vertices");
5372
5373 /* Vertex Paint opacity factor */
5374 prop = RNA_def_property(srna, "gpencil_vertex_paint_opacity", PROP_FLOAT, PROP_FACTOR);
5375 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_vertex_paint_opacity");
5376 RNA_def_property_range(prop, 0.0f, 1.0f);
5377 RNA_def_property_ui_text(prop, "Opacity", "Vertex Paint mix factor");
5379
5380 /* Developer Debug overlay */
5381
5382 prop = RNA_def_property(srna, "use_debug_freeze_view_culling", PROP_BOOLEAN, PROP_NONE);
5383 RNA_def_property_boolean_sdna(prop, nullptr, "debug_flag", V3D_DEBUG_FREEZE_CULLING);
5384 RNA_def_property_ui_text(prop, "Freeze Culling", "Freeze view culling bounds");
5386}
5387
5389{
5390 StructRNA *srna;
5391 PropertyRNA *prop;
5392
5393 static const EnumPropertyItem rv3d_persp_items[] = {
5394 {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
5395 {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
5396 {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
5397 {0, nullptr, 0, nullptr, nullptr},
5398 };
5399
5400 static const EnumPropertyItem bundle_drawtype_items[] = {
5401 {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
5402 {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
5403 {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
5404 {OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
5405 {OB_CUBE, "CUBE", 0, "Cube", ""},
5406 {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
5407 {OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
5408 {0, nullptr, 0, nullptr, nullptr},
5409 };
5410
5411 srna = RNA_def_struct(brna, "SpaceView3D", "Space");
5412 RNA_def_struct_sdna(srna, "View3D");
5413 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
5414
5416 ((1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_TOOLS) |
5417 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) |
5418 (1 << RGN_TYPE_ASSET_SHELF)));
5419
5420 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
5422 RNA_def_property_pointer_sdna(prop, nullptr, "camera");
5424 prop,
5425 "Camera",
5426 "Active camera used in this view (when unlocked from the scene's active camera)");
5427 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_camera_update");
5428
5429 /* render border */
5430 prop = RNA_def_property(srna, "use_render_border", PROP_BOOLEAN, PROP_NONE);
5431 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_RENDER_BORDER);
5434 "Render Region",
5435 "Use a region within the frame size for rendered viewport "
5436 "(when not viewing through the camera)");
5438
5439 prop = RNA_def_property(srna, "render_border_min_x", PROP_FLOAT, PROP_NONE);
5440 RNA_def_property_float_sdna(prop, nullptr, "render_border.xmin");
5441 RNA_def_property_range(prop, 0.0f, 1.0f);
5442 RNA_def_property_ui_text(prop, "Region Minimum X", "Minimum X value for the render region");
5444
5445 prop = RNA_def_property(srna, "render_border_min_y", PROP_FLOAT, PROP_NONE);
5446 RNA_def_property_float_sdna(prop, nullptr, "render_border.ymin");
5447 RNA_def_property_range(prop, 0.0f, 1.0f);
5448 RNA_def_property_ui_text(prop, "Region Minimum Y", "Minimum Y value for the render region");
5450
5451 prop = RNA_def_property(srna, "render_border_max_x", PROP_FLOAT, PROP_NONE);
5452 RNA_def_property_float_sdna(prop, nullptr, "render_border.xmax");
5453 RNA_def_property_range(prop, 0.0f, 1.0f);
5454 RNA_def_property_ui_text(prop, "Region Maximum X", "Maximum X value for the render region");
5456
5457 prop = RNA_def_property(srna, "render_border_max_y", PROP_FLOAT, PROP_NONE);
5458 RNA_def_property_float_sdna(prop, nullptr, "render_border.ymax");
5459 RNA_def_property_range(prop, 0.0f, 1.0f);
5460 RNA_def_property_ui_text(prop, "Region Maximum Y", "Maximum Y value for the render region");
5462
5463 prop = RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
5465 RNA_def_property_pointer_sdna(prop, nullptr, "ob_center");
5467 prop, "Lock to Object", "3D View center is locked to this object's position");
5469
5470 prop = RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
5471 RNA_def_property_string_sdna(prop, nullptr, "ob_center_bone");
5473 prop, "Lock to Bone", "3D View center is locked to this bone's position");
5475
5476 prop = RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
5477 RNA_def_property_boolean_sdna(prop, nullptr, "ob_center_cursor", 1);
5479 prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
5481
5482 prop = RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
5483 RNA_def_property_pointer_sdna(prop, nullptr, "localvd");
5485 prop,
5486 "Local View",
5487 "Display an isolated subset of objects, apart from the scene visibility");
5488
5489 prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_UNIT_CAMERA);
5490 RNA_def_property_float_sdna(prop, nullptr, "lens");
5491 RNA_def_property_ui_text(prop, "Lens", "Viewport lens angle");
5492 RNA_def_property_range(prop, 1.0f, 250.0f);
5494
5495 prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
5496 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
5497 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
5499 prop, "Clip Start", "3D View near clipping distance (perspective view only)");
5501
5502 prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
5503 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
5504 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
5505 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
5507
5508 prop = RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
5509 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_LOCK_CAMERA);
5511 prop, "Lock Camera to View", "Enable view navigation within the camera view");
5513
5514 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
5515 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", V3D_GIZMO_HIDE);
5516 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
5518
5519 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
5521 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
5523
5524 prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE);
5526 RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item");
5528
5529 prop = RNA_def_property(srna, "show_gizmo_modifier", PROP_BOOLEAN, PROP_NONE);
5531 RNA_def_property_ui_text(prop, "Modifier Gizmo", "Gizmos for the active modifier");
5533
5534 prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE);
5535 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", V3D_GIZMO_HIDE_TOOL);
5536 RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo");
5538
5539 /* Per object type gizmo display flags. */
5540
5541 prop = RNA_def_property(srna, "show_gizmo_object_translate", PROP_BOOLEAN, PROP_NONE);
5543 prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_TRANSLATE);
5544 RNA_def_property_ui_text(prop, "Show Object Location", "Gizmo to adjust location");
5546
5547 prop = RNA_def_property(srna, "show_gizmo_object_rotate", PROP_BOOLEAN, PROP_NONE);
5548 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_ROTATE);
5549 RNA_def_property_ui_text(prop, "Show Object Rotation", "Gizmo to adjust rotation");
5551
5552 prop = RNA_def_property(srna, "show_gizmo_object_scale", PROP_BOOLEAN, PROP_NONE);
5553 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_SCALE);
5554 RNA_def_property_ui_text(prop, "Show Object Scale", "Gizmo to adjust scale");
5556
5557 /* Empty Object Data. */
5558 prop = RNA_def_property(srna, "show_gizmo_empty_image", PROP_BOOLEAN, PROP_NONE);
5559 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_empty", V3D_GIZMO_SHOW_EMPTY_IMAGE);
5560 RNA_def_property_ui_text(prop, "Show Empty Image", "Gizmo to adjust image size and position");
5562
5563 prop = RNA_def_property(srna, "show_gizmo_empty_force_field", PROP_BOOLEAN, PROP_NONE);
5565 prop, nullptr, "gizmo_show_empty", V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD);
5566 RNA_def_property_ui_text(prop, "Show Empty Force Field", "Gizmo to adjust the force field");
5568
5569 /* Light Object Data. */
5570 prop = RNA_def_property(srna, "show_gizmo_light_size", PROP_BOOLEAN, PROP_NONE);
5571 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_light", V3D_GIZMO_SHOW_LIGHT_SIZE);
5572 RNA_def_property_ui_text(prop, "Show Light Size", "Gizmo to adjust spot and area size");
5574
5575 prop = RNA_def_property(srna, "show_gizmo_light_look_at", PROP_BOOLEAN, PROP_NONE);
5576 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_light", V3D_GIZMO_SHOW_LIGHT_LOOK_AT);
5578 prop, "Show Light Look-At", "Gizmo to adjust the direction of the light");
5580
5581 /* Camera Object Data. */
5582 prop = RNA_def_property(srna, "show_gizmo_camera_lens", PROP_BOOLEAN, PROP_NONE);
5583 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_camera", V3D_GIZMO_SHOW_CAMERA_LENS);
5585 prop, "Show Camera Lens", "Gizmo to adjust camera focal length or orthographic scale");
5587
5588 prop = RNA_def_property(srna, "show_gizmo_camera_dof_distance", PROP_BOOLEAN, PROP_NONE);
5590 prop, nullptr, "gizmo_show_camera", V3D_GIZMO_SHOW_CAMERA_DOF_DIST);
5592 "Show Camera Focus Distance",
5593 "Gizmo to adjust camera focus distance "
5594 "(depends on limits display)");
5596
5597 prop = RNA_def_property(srna, "use_local_camera", PROP_BOOLEAN, PROP_NONE);
5598 RNA_def_property_boolean_negative_sdna(prop, nullptr, "scenelock", 1);
5599 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SpaceView3D_use_local_camera_set");
5601 "Use Local Camera",
5602 "Use a local camera in this view, rather than scene's active camera");
5604
5605 prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
5606 RNA_def_property_struct_type(prop, "RegionView3D");
5607 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", nullptr, nullptr, nullptr);
5609 prop,
5610 "3D Region",
5611 "3D region for this space. When the space is in quad view, the camera region");
5612
5613 prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE);
5614 RNA_def_property_struct_type(prop, "RegionView3D");
5616 "rna_SpaceView3D_region_quadviews_begin",
5617 "rna_iterator_listbase_next",
5618 "rna_iterator_listbase_end",
5619 "rna_SpaceView3D_region_quadviews_get",
5620 nullptr,
5621 nullptr,
5622 nullptr,
5623 nullptr);
5625 "Quad View Regions",
5626 "3D regions (the third one defines quad view settings, "
5627 "the fourth one is same as 'region_3d')");
5628
5629 prop = RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
5632 prop, "Show Reconstruction", "Display reconstruction data from active movie clip");
5634
5635 prop = RNA_def_property(srna, "tracks_display_size", PROP_FLOAT, PROP_NONE);
5636 RNA_def_property_range(prop, 0.0, FLT_MAX);
5637 RNA_def_property_ui_range(prop, 0, 5, 1, 3);
5638 RNA_def_property_float_sdna(prop, nullptr, "bundle_size");
5639 RNA_def_property_ui_text(prop, "Tracks Size", "Display size of tracks from reconstructed data");
5641
5642 prop = RNA_def_property(srna, "tracks_display_type", PROP_ENUM, PROP_NONE);
5643 RNA_def_property_enum_sdna(prop, nullptr, "bundle_drawtype");
5644 RNA_def_property_enum_items(prop, bundle_drawtype_items);
5645 RNA_def_property_ui_text(prop, "Tracks Display Type", "Viewport display style for tracks");
5647
5648 prop = RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE);
5649 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_CAMERAPATH);
5650 RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed camera path");
5652
5653 prop = RNA_def_property(srna, "show_bundle_names", PROP_BOOLEAN, PROP_NONE);
5654 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_BUNDLENAME);
5656 prop, "Show 3D Marker Names", "Show names for reconstructed tracks objects");
5658
5659 prop = RNA_def_property(srna, "use_local_collections", PROP_BOOLEAN, PROP_NONE);
5662 prop, "Local Collections", "Display a different set of collections in this viewport");
5665 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_use_local_collections_update");
5666
5667 /* Stereo Settings */
5668 prop = RNA_def_property(srna, "stereo_3d_eye", PROP_ENUM, PROP_NONE);
5669 RNA_def_property_enum_sdna(prop, nullptr, "multiview_eye");
5671 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceView3D_stereo3d_camera_itemf");
5672 RNA_def_property_ui_text(prop, "Stereo Eye", "Current stereo eye being displayed");
5674
5675 prop = RNA_def_property(srna, "stereo_3d_camera", PROP_ENUM, PROP_NONE);
5676 RNA_def_property_enum_sdna(prop, nullptr, "stereo3d_camera");
5678 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceView3D_stereo3d_camera_itemf");
5679 RNA_def_property_ui_text(prop, "Camera", "");
5681
5682 prop = RNA_def_property(srna, "show_stereo_3d_cameras", PROP_BOOLEAN, PROP_NONE);
5683 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPCAMERAS);
5684 RNA_def_property_ui_text(prop, "Cameras", "Show the left and right cameras");
5686
5687 prop = RNA_def_property(srna, "show_stereo_3d_convergence_plane", PROP_BOOLEAN, PROP_NONE);
5688 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPPLANE);
5689 RNA_def_property_ui_text(prop, "Plane", "Show the stereo 3D convergence plane");
5691
5692 prop = RNA_def_property(srna, "stereo_3d_convergence_plane_alpha", PROP_FLOAT, PROP_FACTOR);
5693 RNA_def_property_float_sdna(prop, nullptr, "stereo3d_convergence_alpha");
5694 RNA_def_property_ui_text(prop, "Plane Alpha", "Opacity (alpha) of the convergence plane");
5696
5697 prop = RNA_def_property(srna, "show_stereo_3d_volume", PROP_BOOLEAN, PROP_NONE);
5698 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPVOLUME);
5699 RNA_def_property_ui_text(prop, "Volume", "Show the stereo 3D frustum volume");
5701
5702 prop = RNA_def_property(srna, "stereo_3d_volume_alpha", PROP_FLOAT, PROP_FACTOR);
5703 RNA_def_property_float_sdna(prop, nullptr, "stereo3d_volume_alpha");
5704 RNA_def_property_ui_text(prop, "Volume Alpha", "Opacity (alpha) of the cameras' frustum volume");
5706
5707 prop = RNA_def_property(srna, "mirror_xr_session", PROP_BOOLEAN, PROP_NONE);
5710 prop,
5711 "Mirror VR Session",
5712 "Synchronize the viewer perspective of virtual reality sessions with this 3D viewport");
5714 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_mirror_xr_session_update");
5715
5718 "rna_SpaceView3D_object_type_visibility_update");
5719
5720 /* Helper for drawing the icon. */
5721 prop = RNA_def_property(srna, "icon_from_show_object_viewport", PROP_INT, PROP_NONE);
5723 prop, "rna_SpaceView3D_icon_from_show_object_viewport_get", nullptr, nullptr);
5725 RNA_def_property_ui_text(prop, "Visibility Icon", "");
5726
5727 prop = RNA_def_property(srna, "show_viewer", PROP_BOOLEAN, PROP_NONE);
5728 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_VIEWER);
5729 RNA_def_property_ui_text(prop, "Show Viewer", "Display non-final geometry from viewer nodes");
5731
5732 /* Nested Structs */
5733 prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
5735 RNA_def_property_struct_type(prop, "View3DShading");
5736 RNA_def_property_ui_text(prop, "Shading Settings", "Settings for shading in the 3D viewport");
5737
5738 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
5740 RNA_def_property_struct_type(prop, "View3DOverlay");
5741 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_overlay_get", nullptr, nullptr, nullptr);
5743 prop, "Overlay Settings", "Settings for display of overlays in the 3D viewport");
5744
5747
5748 /* *** Animated *** */
5750 /* region */
5751
5752 srna = RNA_def_struct(brna, "RegionView3D", nullptr);
5753 RNA_def_struct_sdna(srna, "RegionView3D");
5754 RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
5755
5756 prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
5757 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_LOCK_ROTATION);
5759 prop, "Lock Rotation", "Lock view rotation of side views to Top/Front/Right");
5760 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
5761
5762 prop = RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
5763 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_BOXVIEW);
5764 RNA_def_property_ui_text(prop, "Sync Zoom/Pan", "Sync view position between side views");
5765 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
5766
5767 prop = RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
5768 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_BOXCLIP);
5770 prop, "Clip Contents", "Clip view contents based on what is visible in other side views");
5772 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
5773
5774 prop = RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
5775 RNA_def_property_float_sdna(prop, nullptr, "persmat");
5777 prop, PROP_EDITABLE); /* XXX: for now, it's too risky for users to do this */
5780 prop, "Perspective Matrix", "Current perspective matrix (``window_matrix * view_matrix``)");
5781
5782 prop = RNA_def_property(srna, "window_matrix", PROP_FLOAT, PROP_MATRIX);
5783 RNA_def_property_float_sdna(prop, nullptr, "winmat");
5786 RNA_def_property_ui_text(prop, "Window Matrix", "Current window matrix");
5787
5788 prop = RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
5789 RNA_def_property_float_sdna(prop, nullptr, "viewmat");
5791 RNA_def_property_float_funcs(prop, nullptr, "rna_RegionView3D_view_matrix_set", nullptr);
5792 RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix");
5794
5795 prop = RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
5796 RNA_def_property_enum_sdna(prop, nullptr, "persp");
5797 RNA_def_property_enum_items(prop, rv3d_persp_items);
5798 RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
5800
5801 prop = RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
5802 RNA_def_property_boolean_sdna(prop, nullptr, "is_persp", 1);
5803 RNA_def_property_ui_text(prop, "Is Perspective", "");
5805
5806 /* WARNING: Using "orthographic" in this name isn't correct and could be changed. */
5807 prop = RNA_def_property(srna, "is_orthographic_side_view", PROP_BOOLEAN, PROP_NONE);
5808 RNA_def_property_boolean_sdna(prop, nullptr, "view", 0);
5810 "rna_RegionView3D_is_orthographic_side_view_get",
5811 "rna_RegionView3D_is_orthographic_side_view_set");
5813 prop,
5814 "Is Axis Aligned",
5815 "Whether the current view is aligned to an axis "
5816 "(does not check whether the view is orthographic, use \"is_perspective\" for that). "
5817 "Setting this will rotate the view to the closest axis");
5818
5819 /* This isn't directly accessible from the UI, only an operator. */
5820 prop = RNA_def_property(srna, "use_clip_planes", PROP_BOOLEAN, PROP_NONE);
5821 RNA_def_property_boolean_sdna(prop, nullptr, "rflag", RV3D_CLIPPING);
5822 RNA_def_property_ui_text(prop, "Use Clip Planes", "");
5823
5824 const int default_value[] = {6, 4};
5825 prop = RNA_def_property(srna, "clip_planes", PROP_FLOAT, PROP_NONE);
5826 RNA_def_property_float_sdna(prop, nullptr, "clip");
5827 RNA_def_property_multi_array(prop, 2, default_value);
5828 RNA_def_property_ui_text(prop, "Clip Planes", "");
5829
5830 prop = RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
5831# if 0
5832 RNA_def_property_float_sdna(prop, nullptr, "ofs"); /* can't use because it's negated */
5833# else
5834 RNA_def_property_array(prop, 3);
5836 prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", nullptr);
5837# endif
5838 RNA_def_property_ui_text(prop, "View Location", "View pivot location");
5839 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT);
5840 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5841
5842 prop = RNA_def_property(
5843 srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); /* can't use because it's inverted */
5844# if 0
5845 RNA_def_property_float_sdna(prop, nullptr, "viewquat");
5846# else
5847 RNA_def_property_array(prop, 4);
5849 prop, "rna_RegionView3D_view_rotation_get", "rna_RegionView3D_view_rotation_set", nullptr);
5850# endif
5851 RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
5853
5854 /* not sure we need rna access to these but adding anyway */
5855 prop = RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
5856 RNA_def_property_float_sdna(prop, nullptr, "dist");
5857 RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
5859
5860 prop = RNA_def_property(srna, "view_camera_zoom", PROP_FLOAT, PROP_UNSIGNED);
5861 RNA_def_property_float_sdna(prop, nullptr, "camzoom");
5862 RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view");
5865
5866 prop = RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE);
5867 RNA_def_property_float_sdna(prop, nullptr, "camdx");
5868 RNA_def_property_array(prop, 2);
5869 RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view");
5871
5873}
5874
5876{
5877 /* Order must follow `buttons_context_items`. */
5878 constexpr std::array<blender::StringRefNull, BCONTEXT_TOT> filter_items = {
5879 "show_properties_tool",
5880 "show_properties_scene",
5881 "show_properties_render",
5882 "show_properties_output",
5883 "show_properties_view_layer",
5884 "show_properties_world",
5885 "show_properties_collection",
5886 "show_properties_object",
5887 "show_properties_constraints",
5888 "show_properties_modifiers",
5889 "show_properties_data",
5890 "show_properties_bone",
5891 "show_properties_bone_constraints",
5892 "show_properties_material",
5893 "show_properties_texture",
5894 "show_properties_particles",
5895 "show_properties_physics",
5896 "show_properties_effects",
5897 "show_properties_strip",
5898 "show_properties_strip_modifier",
5899 };
5900
5901 for (const int i : blender::IndexRange(BCONTEXT_TOT)) {
5903 const int value = (1 << item.value);
5904 blender::StringRefNull prop_name = filter_items[i];
5905
5906 PropertyRNA *prop = RNA_def_property(srna, prop_name.c_str(), PROP_BOOLEAN, PROP_NONE);
5907 RNA_def_property_boolean_sdna(prop, nullptr, "visible_tabs", value);
5908 RNA_def_property_ui_text(prop, item.name, "");
5910 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update");
5911 }
5912}
5913
5915{
5916 StructRNA *srna;
5917 PropertyRNA *prop;
5918
5919 static const EnumPropertyItem tab_sync_items[] = {
5921 "ALWAYS",
5922 0,
5923 "Always",
5924 "Always change tabs when clicking an icon in an outliner"},
5926 "NEVER",
5927 0,
5928 "Never",
5929 "Never change tabs when clicking an icon in an outliner"},
5931 "AUTO",
5932 0,
5933 "Auto",
5934 "Change tabs only when this editor shares a border with an outliner"},
5935 {0, nullptr, 0, nullptr, nullptr},
5936 };
5937
5938 srna = RNA_def_struct(brna, "SpaceProperties", "Space");
5939 RNA_def_struct_sdna(srna, "SpaceProperties");
5940 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
5941
5942 prop = RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
5943 RNA_def_property_enum_sdna(prop, nullptr, "mainb");
5946 prop, nullptr, "rna_SpaceProperties_context_set", "rna_SpaceProperties_context_itemf");
5947 RNA_def_property_ui_text(prop, "", "");
5950 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update");
5951
5953
5954 /* pinned data */
5955 prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
5956 RNA_def_property_pointer_sdna(prop, nullptr, "pinid");
5957 RNA_def_property_struct_type(prop, "ID");
5959 prop, nullptr, nullptr, "rna_SpaceProperties_pin_id_typef", nullptr);
5963 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
5964
5965 prop = RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
5966 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SB_PIN_CONTEXT);
5967 RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
5968
5969 /* Property search. */
5970
5971 prop = RNA_def_property(srna, "tab_search_results", PROP_BOOLEAN, PROP_NONE);
5972 RNA_def_property_array(prop, 0); /* Dynamic length, see next line. */
5975 RNA_def_property_boolean_funcs(prop, "rna_SpaceProperties_tab_search_results_get", nullptr);
5976 RNA_def_property_dynamic_array_funcs(prop, "rna_SpaceProperties_tab_search_results_getlength");
5978 prop, "Tab Search Results", "Whether or not each visible tab has a search result");
5979
5980 prop = RNA_def_property(srna, "search_filter", PROP_STRING, PROP_NONE);
5981 /* The search filter is stored in the property editor's runtime which
5982 * is only defined in an internal header, so use the getter / setter here. */
5984 "rna_SpaceProperties_search_filter_get",
5985 "rna_SpaceProperties_search_filter_length",
5986 "rna_SpaceProperties_search_filter_set");
5987 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
5990 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_search_filter_update");
5991
5992 /* Outliner sync. */
5993 prop = RNA_def_property(srna, "outliner_sync", PROP_ENUM, PROP_NONE);
5994 RNA_def_property_enum_sdna(prop, nullptr, "outliner_sync");
5995 RNA_def_property_enum_items(prop, tab_sync_items);
5997 "Outliner Sync",
5998 "Change to the corresponding tab when outliner data icons are clicked");
6000}
6001
6003{
6004 StructRNA *srna;
6005 PropertyRNA *prop;
6006
6007 srna = RNA_def_struct(brna, "SpaceImageOverlay", nullptr);
6008 RNA_def_struct_sdna(srna, "SpaceImage");
6009 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
6010 RNA_def_struct_path_func(srna, "rna_SpaceImageOverlay_path");
6012 srna, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
6013
6014 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
6015 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_SHOW_OVERLAYS);
6016 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like UV Maps and Metadata");
6018
6019 prop = RNA_def_property(srna, "show_grid_background", PROP_BOOLEAN, PROP_NONE);
6020 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_SHOW_GRID_BACKGROUND);
6021 RNA_def_property_ui_text(prop, "Display Background", "Show the grid background and borders");
6023
6024 prop = RNA_def_property(srna, "show_render_size", PROP_BOOLEAN, PROP_NONE);
6025 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_DRAW_RENDER_REGION);
6026 RNA_def_property_ui_text(prop, "Render Region", "Display the region of the final render");
6028
6029 prop = RNA_def_property(srna, "show_text_info", PROP_BOOLEAN, PROP_NONE);
6030 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_DRAW_TEXT_INFO);
6031 RNA_def_property_ui_text(prop, "Text Info", "Display overlay text");
6033
6034 prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
6035 RNA_def_property_float_sdna(prop, nullptr, "overlay.passepartout_alpha");
6038 prop, "Passepartout Alpha", "Opacity of the darkened overlay outside the render region");
6040}
6041
6043{
6044 StructRNA *srna;
6045 PropertyRNA *prop;
6046
6047 srna = RNA_def_struct(brna, "SpaceImageEditor", "Space");
6048 RNA_def_struct_sdna(srna, "SpaceImage");
6049 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
6050
6052 ((1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_TOOLS) |
6053 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) |
6054 (1 << RGN_TYPE_ASSET_SHELF)));
6055
6056 /* image */
6057 prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
6059 prop, nullptr, "rna_SpaceImageEditor_image_set", nullptr, nullptr);
6060 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
6064 prop,
6065 NC_GEOM | ND_DATA,
6066 "rna_SpaceImageEditor_image_update"); /* is handled in image editor too */
6067
6068 prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
6070 RNA_def_property_pointer_sdna(prop, nullptr, "iuser");
6072 prop,
6073 "Image User",
6074 "Parameters defining which layer, pass and frame of the image is displayed");
6076
6077 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
6078 RNA_def_property_pointer_sdna(prop, nullptr, "scopes");
6079 RNA_def_property_struct_type(prop, "Scopes");
6080 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics");
6082 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
6083
6084 prop = RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
6085 RNA_def_property_boolean_sdna(prop, nullptr, "pin", 0);
6087 prop, "Image Pin", "Display current image regardless of object selection");
6088 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
6090
6091 prop = RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
6092 RNA_def_property_pointer_sdna(prop, nullptr, "sample_line_hist");
6093 RNA_def_property_struct_type(prop, "Histogram");
6094 RNA_def_property_ui_text(prop, "Line Sample", "Sampled colors along line");
6095
6096 prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
6097 RNA_def_property_array(prop, 2);
6099 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", nullptr, nullptr);
6100 RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
6101
6102 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
6104 "rna_SpaceImageEditor_zoom_percentage_get",
6105 "rna_SpaceImageEditor_zoom_percentage_set",
6106 nullptr);
6107 RNA_def_property_float_default(prop, 100.0);
6108 RNA_def_property_range(prop, .4, 80000);
6109 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
6110 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
6111
6112 /* image draw */
6113 prop = RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
6114 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_TILE);
6116 prop, "Display Repeated", "Display the image repeated outside of the main view");
6118
6119 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
6120 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_SHOW_GPENCIL);
6121 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
6123
6124 prop = RNA_def_property(srna, "display_channels", PROP_ENUM, PROP_NONE);
6125 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
6128 "rna_SpaceImageEditor_display_channels_get",
6129 nullptr,
6130 "rna_SpaceImageEditor_display_channels_itemf");
6131 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to display");
6133
6134 prop = RNA_def_property(srna, "show_stereo_3d", PROP_BOOLEAN, PROP_NONE);
6136 prop, "rna_SpaceImageEditor_show_stereo_get", "rna_SpaceImageEditor_show_stereo_set");
6137 RNA_def_property_ui_text(prop, "Show Stereo", "Display the image in Stereo 3D");
6138 RNA_def_property_ui_icon(prop, ICON_CAMERA_STEREO, 0);
6140 prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_show_stereo_update");
6141
6142 prop = RNA_def_property(srna, "show_sequencer_scene", PROP_BOOLEAN, PROP_NONE);
6144 "rna_SpaceImageEditor_show_sequencer_scene_get",
6145 "rna_SpaceImageEditor_show_sequencer_scene_set");
6147 prop,
6148 "Show Sequencer Scene",
6149 "Display the render result for the sequencer scene instead of the active scene");
6150 RNA_def_property_ui_icon(prop, ICON_SEQ_SEQUENCER, 0);
6152
6153 /* uv */
6154 prop = RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
6156 RNA_def_property_struct_type(prop, "SpaceUVEditor");
6158 prop, "rna_SpaceImageEditor_uvedit_get", nullptr, nullptr, nullptr);
6159 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
6160
6161 /* mode (hidden in the UI, see 'ui_mode') */
6162 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6163 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6165 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6166 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
6167
6168 prop = RNA_def_property(srna, "ui_mode", PROP_ENUM, PROP_NONE);
6169 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6171 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6172 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
6173
6174 /* transform */
6175 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
6176 RNA_def_property_array(prop, 2);
6178 "rna_SpaceImageEditor_cursor_location_get",
6179 "rna_SpaceImageEditor_cursor_location_set",
6180 nullptr);
6181 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
6183
6184 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
6185 RNA_def_property_enum_sdna(prop, nullptr, "around");
6187 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceImageEditor_pivot_itemf");
6188 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
6190
6191 /* Annotations */
6192 prop = RNA_def_property(srna, "annotation", PROP_POINTER, PROP_NONE);
6193 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
6194 RNA_def_property_struct_type(prop, "Annotation");
6196 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
6198 RNA_def_property_ui_text(prop, "Annotation", "Annotation data for this space");
6200
6201 /* update */
6202 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
6203 RNA_def_property_boolean_sdna(prop, nullptr, "lock", 0);
6205 "Update Automatically",
6206 "Update other affected window spaces automatically to reflect changes "
6207 "during interactive operations such as transform");
6208
6209 /* state */
6210 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
6211 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", nullptr);
6213 RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
6214
6215 prop = RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
6216 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", nullptr);
6218 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
6219
6220 prop = RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
6221 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", nullptr);
6223 RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
6224
6225 prop = RNA_def_property(srna, "show_maskedit", PROP_BOOLEAN, PROP_NONE);
6226 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_maskedit_get", nullptr);
6228 RNA_def_property_ui_text(prop, "Show Mask Editor", "Show Mask editing related properties");
6229
6230 /* Gizmo Toggles. */
6231 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
6232 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SI_GIZMO_HIDE);
6233 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
6235
6236 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
6238 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
6240
6241 /* Overlays */
6242 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
6244 RNA_def_property_struct_type(prop, "SpaceImageOverlay");
6245 RNA_def_property_pointer_funcs(prop, "rna_SpaceImage_overlay_get", nullptr, nullptr, nullptr);
6247 prop, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
6248
6251
6252 /* mask */
6253 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mask_set");
6254}
6255
6257{
6258 StructRNA *srna;
6259 PropertyRNA *prop;
6260
6261 srna = RNA_def_struct(brna, "SequencerPreviewOverlay", nullptr);
6262 RNA_def_struct_sdna(srna, "SpaceSeq");
6263 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6264 RNA_def_struct_path_func(srna, "rna_SpaceSequencerPreviewOverlay_path");
6265 RNA_def_struct_ui_text(srna, "Preview Overlay Settings", "");
6266
6267 prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE);
6269 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_SAFE_MARGINS);
6271 prop, "Safe Areas", "Show TV title safe and action safe areas in preview");
6273
6274 prop = RNA_def_property(srna, "show_safe_center", PROP_BOOLEAN, PROP_NONE);
6276 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_SAFE_CENTER);
6278 prop, "Center-Cut Safe Areas", "Show safe areas to fit content in a different aspect ratio");
6280
6281 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
6282 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_METADATA);
6283 RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of first visible strip");
6285
6286 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
6287 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_GPENCIL);
6288 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
6290
6291 prop = RNA_def_property(srna, "show_image_outline", PROP_BOOLEAN, PROP_NONE);
6293 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_OUTLINE_SELECTED);
6294 RNA_def_property_ui_text(prop, "Image Outline", "");
6296
6297 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
6298 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_2D_CURSOR);
6299 RNA_def_property_ui_text(prop, "2D Cursor", "");
6301}
6302
6304{
6305 StructRNA *srna;
6306 PropertyRNA *prop;
6307
6308 srna = RNA_def_struct(brna, "SequencerTimelineOverlay", nullptr);
6309 RNA_def_struct_sdna(srna, "SpaceSeq");
6310 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6311 RNA_def_struct_path_func(srna, "rna_SpaceSequencerTimelineOverlay_path");
6312 RNA_def_struct_ui_text(srna, "Timeline Overlay Settings", "");
6313
6314 static const EnumPropertyItem waveform_type_display_items[] = {
6316 "ALL_WAVEFORMS",
6317 0,
6318 "On",
6319 "Display waveforms for all sound strips"},
6320 {0, "DEFAULT_WAVEFORMS", 0, "Strip", "Display waveforms depending on strip setting"},
6322 "NO_WAVEFORMS",
6323 0,
6324 "Off",
6325 "Don't display waveforms for any sound strips"},
6326 {0, nullptr, 0, nullptr, nullptr},
6327 };
6328
6329 prop = RNA_def_property(srna, "waveform_display_type", PROP_ENUM, PROP_NONE);
6330 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "timeline_overlay.flag");
6331 RNA_def_property_enum_items(prop, waveform_type_display_items);
6332 RNA_def_property_ui_text(prop, "Waveform Display", "How Waveforms are displayed");
6334
6335 static const EnumPropertyItem waveform_style_display_items[] = {
6336 {0, "FULL_WAVEFORMS", 0, "Full", "Display full waveform"},
6338 "HALF_WAVEFORMS",
6339 0,
6340 "Half",
6341 "Display upper half of the absolute value waveform"},
6342 {0, nullptr, 0, nullptr, nullptr},
6343 };
6344
6345 prop = RNA_def_property(srna, "waveform_display_style", PROP_ENUM, PROP_NONE);
6346 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "timeline_overlay.flag");
6347 RNA_def_property_enum_items(prop, waveform_style_display_items);
6348 RNA_def_property_ui_text(prop, "Waveform Style", "How Waveforms are displayed");
6350
6351 prop = RNA_def_property(srna, "show_fcurves", PROP_BOOLEAN, PROP_NONE);
6352 RNA_def_property_boolean_sdna(prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_FCURVES);
6353 RNA_def_property_ui_text(prop, "Show F-Curves", "Display strip opacity/volume curve");
6355
6356 prop = RNA_def_property(srna, "show_strip_name", PROP_BOOLEAN, PROP_NONE);
6358 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_NAME);
6359 RNA_def_property_ui_text(prop, "Show Name", "");
6361
6362 prop = RNA_def_property(srna, "show_strip_source", PROP_BOOLEAN, PROP_NONE);
6364 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_SOURCE);
6366 prop, "Show Source", "Display path to source file, or name of source data-block");
6368
6369 prop = RNA_def_property(srna, "show_strip_duration", PROP_BOOLEAN, PROP_NONE);
6371 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_DURATION);
6372 RNA_def_property_ui_text(prop, "Show Duration", "");
6374
6375 prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
6376 RNA_def_property_boolean_sdna(prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_GRID);
6377 RNA_def_property_ui_text(prop, "Show Grid", "Show vertical grid lines");
6379
6380 prop = RNA_def_property(srna, "show_strip_offset", PROP_BOOLEAN, PROP_NONE);
6382 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_OFFSETS);
6383 RNA_def_property_ui_text(prop, "Show Offsets", "Display strip in/out offsets");
6385
6386 prop = RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
6388 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_THUMBNAILS);
6389 RNA_def_property_ui_text(prop, "Show Thumbnails", "Show strip thumbnails");
6391
6392 prop = RNA_def_property(srna, "show_strip_tag_color", PROP_BOOLEAN, PROP_NONE);
6394 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG);
6396 prop, "Show Color Tags", "Display the strip color tags in the sequencer");
6398
6399 prop = RNA_def_property(srna, "show_strip_retiming", PROP_BOOLEAN, PROP_NONE);
6401 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_RETIMING);
6402 RNA_def_property_ui_text(prop, "Show Retiming Keys", "Display retiming keys on top of strips");
6404}
6405
6407{
6408 StructRNA *srna;
6409 PropertyRNA *prop;
6410
6411 srna = RNA_def_struct(brna, "SequencerCacheOverlay", nullptr);
6412 RNA_def_struct_sdna(srna, "SpaceSeq");
6413 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6414 RNA_def_struct_path_func(srna, "rna_SpaceSequencerCacheOverlay_path");
6415 RNA_def_struct_ui_text(srna, "Cache Overlay Settings", "");
6416
6417 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
6418 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW);
6419 RNA_def_property_ui_text(prop, "Show Cache", "Visualize cached images on the timeline");
6421
6422 prop = RNA_def_property(srna, "show_cache_final_out", PROP_BOOLEAN, PROP_NONE);
6423 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_FINAL_OUT);
6424 RNA_def_property_ui_text(prop, "Final Images", "Visualize cached complete frames");
6426
6427 prop = RNA_def_property(srna, "show_cache_raw", PROP_BOOLEAN, PROP_NONE);
6428 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_RAW);
6429 RNA_def_property_ui_text(prop, "Raw Images", "Visualize cached raw images");
6431}
6432
6434{
6435 StructRNA *srna;
6436 PropertyRNA *prop;
6437
6438 static const EnumPropertyItem display_mode_items[] = {
6439 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
6440 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
6441 {SEQ_DRAW_IMG_RGBPARADE, "RGB_PARADE", ICON_RENDERLAYERS, "RGB Parade", ""},
6442 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
6443 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
6444 {0, nullptr, 0, nullptr, nullptr},
6445 };
6446
6447 static const EnumPropertyItem proxy_render_size_items[] = {
6448 {SEQ_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
6449 {SEQ_RENDER_SIZE_SCENE, "SCENE", 0, "Scene size", ""},
6450 {SEQ_RENDER_SIZE_PROXY_25, "PROXY_25", 0, "25%", ""},
6451 {SEQ_RENDER_SIZE_PROXY_50, "PROXY_50", 0, "50%", ""},
6452 {SEQ_RENDER_SIZE_PROXY_75, "PROXY_75", 0, "75%", ""},
6453 {SEQ_RENDER_SIZE_PROXY_100, "PROXY_100", 0, "100%", ""},
6454 {0, nullptr, 0, nullptr, nullptr},
6455 };
6456
6457 static const EnumPropertyItem overlay_frame_type_items[] = {
6458 {SEQ_OVERLAY_FRAME_TYPE_RECT, "RECTANGLE", 0, "Rectangle", "Show rectangle area overlay"},
6459 {SEQ_OVERLAY_FRAME_TYPE_REFERENCE, "REFERENCE", 0, "Reference", "Show reference frame only"},
6460 {SEQ_OVERLAY_FRAME_TYPE_CURRENT, "CURRENT", 0, "Current", "Show current frame only"},
6461 {0, nullptr, 0, nullptr, nullptr},
6462 };
6463
6464 static const EnumPropertyItem preview_channels_items[] = {
6466 "COLOR_ALPHA",
6467 ICON_IMAGE_RGB_ALPHA,
6468 "Color & Alpha",
6469 "Display image with RGB colors and alpha transparency"},
6470 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
6471 {0, nullptr, 0, nullptr, nullptr},
6472 };
6473
6474 srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
6475 RNA_def_struct_sdna(srna, "SpaceSeq");
6476 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
6477
6479 (1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_FOOTER) |
6480 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_TOOLS) |
6481 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
6482
6483 /* view type, fairly important */
6484 prop = RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
6485 RNA_def_property_enum_sdna(prop, nullptr, "view");
6488 prop, "View Type", "Type of the Sequencer view (sequencer, preview or both)");
6489 RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
6490
6491 /* display type, fairly important */
6492 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
6493 RNA_def_property_enum_sdna(prop, nullptr, "mainb");
6494 RNA_def_property_enum_items(prop, display_mode_items);
6496 prop, "Display Mode", "View mode to use for displaying sequencer output");
6498
6499 /* flags */
6500 prop = RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
6501 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_DRAWFRAMES);
6502 RNA_def_property_ui_text(prop, "Display Frames", "Display frames rather than seconds");
6504
6505 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
6506 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_MARKER_TRANS);
6507 RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips");
6509
6510 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
6512 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
6514
6515 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
6516 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_SHOW_MARKERS);
6518 prop,
6519 "Show Markers",
6520 "If any exists, show markers in a separate row at the bottom of the editor");
6522
6523 prop = RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
6524 RNA_def_property_int_sdna(prop, nullptr, "chanshown");
6526 prop,
6527 "Display Channel",
6528 "Preview all channels less than or equal to this value. 0 shows every channel, and negative "
6529 "values climb that many meta-strip levels if applicable, showing every channel there.");
6531 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
6532
6533 prop = RNA_def_property(srna, "preview_channels", PROP_ENUM, PROP_NONE);
6534 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
6535 RNA_def_property_enum_items(prop, preview_channels_items);
6536 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the preview to display");
6537 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
6538
6539 prop = RNA_def_property(srna, "use_zoom_to_fit", PROP_BOOLEAN, PROP_NONE);
6540 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_ZOOM_TO_FIT);
6542 prop, "Zoom to Fit", "Automatically zoom preview image to make it fully fit the region");
6544
6545 prop = RNA_def_property(srna, "show_overexposed", PROP_INT, PROP_NONE);
6546 RNA_def_property_int_sdna(prop, nullptr, "zebra");
6547 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
6548 RNA_def_property_range(prop, 0, 110);
6550
6551 prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
6552 RNA_def_property_enum_sdna(prop, nullptr, "render_size");
6553 RNA_def_property_enum_items(prop, proxy_render_size_items);
6555 "Proxy Render Size",
6556 "Display preview using full resolution or different proxy resolutions");
6559 prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_render_size_update");
6560
6561 prop = RNA_def_property(srna, "use_proxies", PROP_BOOLEAN, PROP_NONE);
6562 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_USE_PROXIES);
6564 prop, "Use Proxies", "Use optimized files for faster scrubbing when available");
6565 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
6566
6567 prop = RNA_def_property(srna, "use_clamp_view", PROP_BOOLEAN, PROP_NONE);
6568 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_CLAMP_VIEW);
6570 prop, "rna_SequenceEditor_clamp_view_get", "rna_SequenceEditor_clamp_view_set");
6572 prop, "Limit View to Contents", "Limit timeline height to maximum used channel slot");
6574
6575 /* Annotations */
6576 prop = RNA_def_property(srna, "annotation", PROP_POINTER, PROP_NONE);
6577 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
6578 RNA_def_property_struct_type(prop, "Annotation");
6580 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
6582 RNA_def_property_ui_text(prop, "Annotation", "Annotation data for this Preview region");
6584
6585 prop = RNA_def_property(srna, "overlay_frame_type", PROP_ENUM, PROP_NONE);
6586 RNA_def_property_enum_sdna(prop, nullptr, "overlay_frame_type");
6587 RNA_def_property_enum_items(prop, overlay_frame_type_items);
6588 RNA_def_property_ui_text(prop, "Overlay Type", "Overlay display method");
6590
6591 prop = RNA_def_property(srna, "show_transform_preview", PROP_BOOLEAN, PROP_NONE);
6592 RNA_def_property_boolean_sdna(prop, nullptr, "draw_flag", SEQ_DRAW_TRANSFORM_PREVIEW);
6594 "Transform Preview",
6595 "Show a preview of the start or end frame of a strip while "
6596 "transforming its respective handle");
6598
6599 /* Gizmo toggles. */
6600 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
6601 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SEQ_GIZMO_HIDE);
6602 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
6604
6605 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
6607 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
6609
6610 prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE);
6612 RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item");
6614
6615 prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE);
6616 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SEQ_GIZMO_HIDE_TOOL);
6617 RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo");
6619
6620 /* Overlay settings. */
6621 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
6622 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_SHOW_OVERLAY);
6623 RNA_def_property_ui_text(prop, "Show Overlays", "");
6625
6626 prop = RNA_def_property(srna, "preview_overlay", PROP_POINTER, PROP_NONE);
6628 RNA_def_property_struct_type(prop, "SequencerPreviewOverlay");
6630 prop, "rna_SpaceSequenceEditor_preview_overlay_get", nullptr, nullptr, nullptr);
6631 RNA_def_property_ui_text(prop, "Preview Overlay Settings", "Settings for display of overlays");
6632
6633 prop = RNA_def_property(srna, "timeline_overlay", PROP_POINTER, PROP_NONE);
6635 RNA_def_property_struct_type(prop, "SequencerTimelineOverlay");
6637 prop, "rna_SpaceSequenceEditor_timeline_overlay_get", nullptr, nullptr, nullptr);
6638 RNA_def_property_ui_text(prop, "Timeline Overlay Settings", "Settings for display of overlays");
6639
6640 prop = RNA_def_property(srna, "cache_overlay", PROP_POINTER, PROP_NONE);
6642 RNA_def_property_struct_type(prop, "SequencerCacheOverlay");
6644 prop, "rna_SpaceSequenceEditor_cache_overlay_get", nullptr, nullptr, nullptr);
6645 RNA_def_property_ui_text(prop, "Cache Overlay Settings", "Settings for display of overlays");
6649
6650 /* transform */
6651 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
6652 RNA_def_property_float_sdna(prop, nullptr, "cursor");
6653 RNA_def_property_array(prop, 2);
6654 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
6656
6657 /* Zoom. */
6658 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
6660 "rna_SpaceSequenceEditor_zoom_percentage_get",
6661 "rna_SpaceSequenceEditor_zoom_percentage_set",
6662 nullptr);
6663 RNA_def_property_float_default(prop, 100.0);
6664 RNA_def_property_range(prop, .4, 80000);
6665 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
6666 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
6667}
6668
6670{
6671 StructRNA *srna;
6672 PropertyRNA *prop;
6673 FunctionRNA *func;
6674
6675 srna = RNA_def_struct(brna, "SpaceTextEditor", "Space");
6676 RNA_def_struct_sdna(srna, "SpaceText");
6677 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
6678
6680
6681 /* text */
6682 prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
6684 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
6685 RNA_def_property_pointer_funcs(prop, nullptr, "rna_SpaceTextEditor_text_set", nullptr, nullptr);
6687
6688 /* display */
6689 prop = RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
6690 RNA_def_property_boolean_sdna(prop, nullptr, "wordwrap", 0);
6691 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SpaceTextEditor_word_wrap_set");
6693 prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
6694 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_ON, 0);
6696
6697 prop = RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
6698 RNA_def_property_boolean_sdna(prop, nullptr, "showlinenrs", 0);
6699 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
6700 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_ON, 0);
6702
6703 func = RNA_def_function(srna,
6704 "is_syntax_highlight_supported",
6705 "rna_SpaceTextEditor_text_is_syntax_highlight_supported");
6707 RNA_def_boolean(func, "is_syntax_highlight_supported", false, "", ""));
6709 "Returns True if the editor supports syntax highlighting "
6710 "for the current text data-block");
6711
6712 prop = RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
6713 RNA_def_property_boolean_sdna(prop, nullptr, "showsyntax", 0);
6714 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
6715 RNA_def_property_ui_icon(prop, ICON_SYNTAX_ON, 0);
6717
6718 prop = RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
6719 RNA_def_property_boolean_sdna(prop, nullptr, "line_hlight", 0);
6720 RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
6722
6723 prop = RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
6724 RNA_def_property_int_sdna(prop, nullptr, "tabnumber");
6725 RNA_def_property_range(prop, 2, 8);
6726 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
6727 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
6728
6729 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
6730 RNA_def_property_int_sdna(prop, nullptr, "lheight");
6731 RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */
6732 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
6734
6735 prop = RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
6736 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_SHOW_MARGIN);
6737 RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
6739
6740 prop = RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
6741 RNA_def_property_int_sdna(prop, nullptr, "margin_column");
6742 RNA_def_property_range(prop, 0, 1024);
6743 RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
6745
6746 prop = RNA_def_property(srna, "top", PROP_INT, PROP_NONE);
6747 RNA_def_property_int_sdna(prop, nullptr, "top");
6748 RNA_def_property_range(prop, 0, INT_MAX);
6749 RNA_def_property_ui_text(prop, "Top Line", "Top line visible");
6751
6752 prop = RNA_def_property(srna, "visible_lines", PROP_INT, PROP_NONE);
6754 RNA_def_property_int_funcs(prop, "rna_SpaceTextEditor_visible_lines_get", nullptr, nullptr);
6756 prop, "Visible Lines", "Amount of lines that can be visible in current editor");
6757
6758 /* functionality options */
6759 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
6760 RNA_def_property_boolean_sdna(prop, nullptr, "overwrite", 1);
6762 prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
6764
6765 prop = RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
6766 RNA_def_property_boolean_sdna(prop, nullptr, "live_edit", 1);
6767 RNA_def_property_ui_text(prop, "Live Edit", "Run Python while editing");
6769
6770 /* find */
6771 prop = RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
6772 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_FIND_ALL);
6774 prop, "Find All", "Search in all text data-blocks, instead of only the active one");
6776
6777 prop = RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
6778 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_FIND_WRAP);
6780 prop, "Find Wrap", "Search again from the start of the file when reaching the end");
6782
6783 prop = RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
6784 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_MATCH_CASE);
6786 prop, "Match Case", "Search string is sensitive to uppercase and lowercase letters");
6788
6789 prop = RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
6790 RNA_def_property_string_sdna(prop, nullptr, "findstr");
6791 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
6793
6794 prop = RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
6795 RNA_def_property_string_sdna(prop, nullptr, "replacestr");
6797 prop, "Replace Text", "Text to replace selected text with using the replace tool");
6799
6800 RNA_api_space_text(srna);
6801}
6802
6804{
6805 StructRNA *srna;
6806 PropertyRNA *prop;
6807
6808 srna = RNA_def_struct(brna, "SpaceDopeSheetOverlay", nullptr);
6809 RNA_def_struct_sdna(srna, "SpaceAction");
6810 RNA_def_struct_nested(brna, srna, "SpaceDopeSheetEditor");
6811 RNA_def_struct_path_func(srna, "rna_SpaceDopeSheetOverlay_path");
6812 RNA_def_struct_ui_text(srna, "Overlay Settings", "");
6813
6814 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
6815 RNA_def_property_boolean_sdna(prop, nullptr, "overlays.flag", ADS_OVERLAY_SHOW_OVERLAYS);
6817 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays");
6819
6820 prop = RNA_def_property(srna, "show_scene_strip_range", PROP_BOOLEAN, PROP_NONE);
6821 RNA_def_property_boolean_sdna(prop, nullptr, "overlays.flag", ADS_SHOW_SCENE_STRIP_FRAME_RANGE);
6823 "Show Scene Strip Range",
6824 "When using scene time synchronization in the sequence editor, display "
6825 "the range of the current scene strip");
6827}
6828
6830{
6831 StructRNA *srna;
6832 PropertyRNA *prop;
6833
6834 srna = RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
6835 RNA_def_struct_sdna(srna, "SpaceAction");
6836 RNA_def_struct_ui_text(srna, "Space Dope Sheet Editor", "Dope Sheet space data");
6837
6839 (1 << RGN_TYPE_FOOTER) | (1 << RGN_TYPE_UI) |
6840 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
6841
6842 /* mode (hidden in the UI, see 'ui_mode') */
6843 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6844 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6846 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6849 prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
6850
6851 prop = RNA_def_property(srna, "ui_mode", PROP_ENUM, PROP_NONE);
6852 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6854 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6857 prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
6858
6859 /* display */
6860 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
6861 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SACTION_DRAWTIME);
6862 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
6864
6865 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
6866 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SACTION_SLIDERS);
6867 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
6869
6870 prop = RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
6873 "Show Pose Markers",
6874 "Show markers belonging to the active action instead of Scene markers "
6875 "(Action and Shape Key Editors only)");
6877
6878 prop = RNA_def_property(srna, "show_interpolation", PROP_BOOLEAN, PROP_NONE);
6881 "Show Handles and Interpolation",
6882 "Display keyframe handle types and non-Bézier interpolation modes");
6884
6885 prop = RNA_def_property(srna, "show_extremes", PROP_BOOLEAN, PROP_NONE);
6888 "Show Curve Extremes",
6889 "Mark keyframes where the key value flow changes direction, based on "
6890 "comparison with adjacent keys");
6892
6893 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
6896 prop,
6897 "Show Markers",
6898 "If any exists, show markers in a separate row at the bottom of the editor");
6900
6901 /* editing */
6902 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
6904 RNA_def_property_ui_text(prop, "Auto-Merge Keyframes", "Automatically merge nearby keyframes");
6906
6907 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
6910 prop,
6911 "Realtime Updates",
6912 "When transforming keyframes, changes to the animation data are flushed to other views");
6914
6915 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
6917 RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
6918
6919 /* dopesheet */
6920 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
6921 RNA_def_property_struct_type(prop, "DopeSheet");
6922 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
6923 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
6924
6925 /* displaying cache status */
6926 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
6927 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_DISPLAY);
6928 RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");
6930
6931 prop = RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
6932 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SOFTBODY);
6933 RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
6935
6936 prop = RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
6937 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_PARTICLES);
6938 RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");
6940
6941 prop = RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
6942 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_CLOTH);
6943 RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");
6945
6946 prop = RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
6947 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SMOKE);
6948 RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");
6950
6951 prop = RNA_def_property(srna, "cache_simulation_nodes", PROP_BOOLEAN, PROP_NONE);
6952 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SIMULATION_NODES);
6954 prop, "Simulation Nodes", "Show the active object's simulation nodes cache and bake data");
6956
6957 prop = RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE);
6958 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_DYNAMICPAINT);
6959 RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");
6961
6962 prop = RNA_def_property(srna, "cache_rigidbody", PROP_BOOLEAN, PROP_NONE);
6963 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_RIGIDBODY);
6964 RNA_def_property_ui_text(prop, "Rigid Body", "Show the active object's Rigid Body cache");
6966
6967 prop = RNA_def_property(srna, "overlays", PROP_POINTER, PROP_NONE);
6969 RNA_def_property_struct_type(prop, "SpaceDopeSheetOverlay");
6971 prop, "rna_SpaceDopeSheet_overlay_get", nullptr, nullptr, nullptr);
6972 RNA_def_property_ui_text(prop, "Overlay Settings", "Settings for display of overlays");
6973
6975}
6976
6978{
6979 StructRNA *srna;
6980 PropertyRNA *prop;
6981
6982 /* this is basically the same as the one for the 3D-View, but with some entries omitted */
6983 static const EnumPropertyItem gpivot_items[] = {
6985 "BOUNDING_BOX_CENTER",
6986 ICON_PIVOT_BOUNDBOX,
6987 "Bounding Box Center",
6988 ""},
6989 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
6991 "INDIVIDUAL_ORIGINS",
6992 ICON_PIVOT_INDIVIDUAL,
6993 "Individual Centers",
6994 ""},
6995 // {V3D_AROUND_CENTER_MEDIAN, "MEDIAN_POINT", 0, "Median Point", ""},
6996 // {V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
6997 {0, nullptr, 0, nullptr, nullptr},
6998 };
6999
7000 srna = RNA_def_struct(brna, "SpaceGraphEditor", "Space");
7001 RNA_def_struct_sdna(srna, "SpaceGraph");
7002 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
7003
7005 (1 << RGN_TYPE_FOOTER) | (1 << RGN_TYPE_UI) |
7006 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
7007
7008 /* mode */
7009 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
7010 RNA_def_property_enum_sdna(prop, nullptr, "mode");
7012 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
7015 prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
7016
7017 /* display */
7018 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
7019 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_DRAWTIME);
7020 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
7022
7023 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
7024 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_SLIDERS);
7025 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
7027
7028 prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
7030 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bézier control points");
7032
7033 prop = RNA_def_property(srna, "use_auto_lock_translation_axis", PROP_BOOLEAN, PROP_NONE);
7034 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_AUTOLOCK_AXIS);
7036 "Auto-Lock Key Axis",
7037 "Automatically locks the movement of keyframes to the dominant axis");
7039
7040 prop = RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
7043 prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
7045
7046 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
7047 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_SHOW_MARKERS);
7049 prop,
7050 "Show Markers",
7051 "If any exists, show markers in a separate row at the bottom of the editor");
7053
7054 prop = RNA_def_property(srna, "show_extrapolation", PROP_BOOLEAN, PROP_NONE);
7056 RNA_def_property_ui_text(prop, "Show Extrapolation", "");
7058
7059 /* editing */
7060 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
7062 RNA_def_property_ui_text(prop, "Auto-Merge Keyframes", "Automatically merge nearby keyframes");
7064
7065 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
7068 prop,
7069 "Realtime Updates",
7070 "When transforming keyframes, changes to the animation data are flushed to other views");
7072
7073 /* cursor */
7074 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
7076 RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
7078
7079 prop = RNA_def_property(srna, "cursor_position_x", PROP_FLOAT, PROP_NONE);
7080 RNA_def_property_float_sdna(prop, nullptr, "cursorTime");
7082 prop, "Cursor X-Value", "Graph Editor 2D-Value cursor - X-Value component");
7084
7085 prop = RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
7086 RNA_def_property_float_sdna(prop, nullptr, "cursorVal");
7088 prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
7090
7091 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
7092 RNA_def_property_enum_sdna(prop, nullptr, "around");
7093 RNA_def_property_enum_items(prop, gpivot_items);
7094 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
7096
7097 /* Dope-sheet. */
7098 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
7099 RNA_def_property_struct_type(prop, "DopeSheet");
7100 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
7101 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
7102
7103 /* Read-only state info. */
7104 prop = RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
7105 RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", nullptr);
7108 prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
7109
7110 /* Normalize curves. */
7111 prop = RNA_def_property(srna, "use_normalization", PROP_BOOLEAN, PROP_NONE);
7112 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_NORMALIZE);
7114 "Use Normalization",
7115 "Display curves in normalized range from -1 to 1, "
7116 "for easier editing of multiple curves with different ranges");
7119 prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_normalize_update");
7120
7121 prop = RNA_def_property(srna, "use_auto_normalization", PROP_BOOLEAN, PROP_NONE);
7124 "Auto Normalization",
7125 "Automatically recalculate curve normalization on every curve edit");
7127}
7128
7130{
7131 StructRNA *srna;
7132 PropertyRNA *prop;
7133
7134 srna = RNA_def_struct(brna, "SpaceNLA", "Space");
7135 RNA_def_struct_sdna(srna, "SpaceNla");
7136 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
7137
7139 (1 << RGN_TYPE_FOOTER) | (1 << RGN_TYPE_UI) |
7140 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
7141
7142 /* display */
7143 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
7144 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNLA_DRAWTIME);
7145 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
7147
7148 prop = RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
7150 RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips");
7152
7153 prop = RNA_def_property(srna, "show_local_markers", PROP_BOOLEAN, PROP_NONE);
7156 prop,
7157 "Show Local Markers",
7158 "Show action-local markers on the strips, useful when synchronizing timing across strips");
7160
7161 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
7162 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNLA_SHOW_MARKERS);
7164 prop,
7165 "Show Markers",
7166 "If any exists, show markers in a separate row at the bottom of the editor");
7168
7169 /* editing */
7170 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
7173 prop,
7174 "Realtime Updates",
7175 "When transforming strips, changes to the animation data are flushed to other views");
7177
7178 /* dopesheet */
7179 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
7180 RNA_def_property_struct_type(prop, "DopeSheet");
7181 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
7182 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
7183}
7184
7186{
7187 static const EnumPropertyItem console_line_type_items[] = {
7188 {CONSOLE_LINE_OUTPUT, "OUTPUT", 0, "Output", ""},
7189 {CONSOLE_LINE_INPUT, "INPUT", 0, "Input", ""},
7190 {CONSOLE_LINE_INFO, "INFO", 0, "Info", ""},
7191 {CONSOLE_LINE_ERROR, "ERROR", 0, "Error", ""},
7192 {0, nullptr, 0, nullptr, nullptr},
7193 };
7194
7195 StructRNA *srna;
7196 PropertyRNA *prop;
7197
7198 srna = RNA_def_struct(brna, "ConsoleLine", nullptr);
7199 RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
7200
7201 prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
7203 prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
7204 RNA_def_property_ui_text(prop, "Line", "Text in the line");
7207
7208 prop = RNA_def_property(
7209 srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
7211 "rna_ConsoleLine_current_character_get",
7212 "rna_ConsoleLine_current_character_set",
7213 nullptr);
7215
7216 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
7217 RNA_def_property_enum_sdna(prop, nullptr, "type");
7218 RNA_def_property_enum_items(prop, console_line_type_items);
7219 RNA_def_property_ui_text(prop, "Type", "Console line type when used in scrollback");
7220}
7221
7223{
7224 StructRNA *srna;
7225 PropertyRNA *prop;
7226
7227 srna = RNA_def_struct(brna, "SpaceConsole", "Space");
7228 RNA_def_struct_sdna(srna, "SpaceConsole");
7229 RNA_def_struct_ui_text(srna, "Space Console", "Interactive Python console");
7230
7231 /* display */
7232 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
7233 RNA_def_property_int_sdna(prop, nullptr, "lheight");
7234 RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */
7235 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
7236 RNA_def_property_update(prop, 0, "rna_SpaceConsole_rect_update");
7237
7238 prop = RNA_def_property(
7239 srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
7240 RNA_def_property_int_sdna(prop, nullptr, "sel_start");
7242
7243 prop = RNA_def_property(
7244 srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
7245 RNA_def_property_int_sdna(prop, nullptr, "sel_end");
7247
7248 prop = RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
7249 RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
7250
7251 prop = RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
7252 RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
7254
7255 prop = RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
7256 RNA_def_property_collection_sdna(prop, nullptr, "history", nullptr);
7257 RNA_def_property_struct_type(prop, "ConsoleLine");
7258 RNA_def_property_ui_text(prop, "History", "Command history");
7259
7260 prop = RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
7261 RNA_def_property_collection_sdna(prop, nullptr, "scrollback", nullptr);
7262 RNA_def_property_struct_type(prop, "ConsoleLine");
7263 RNA_def_property_ui_text(prop, "Output", "Command output");
7264}
7265
7266/* Filter for datablock types in link/append. */
7268{
7269
7270 StructRNA *srna = RNA_def_struct(brna, "FileSelectIDFilter", nullptr);
7271 RNA_def_struct_sdna(srna, "FileSelectParams");
7272 RNA_def_struct_nested(brna, srna, "FileSelectParams");
7274 srna, "File Select ID Filter", "Which ID types to show/hide, when browsing a library");
7275
7276 const IDFilterEnumPropertyItem *individual_ids_and_categories[] = {
7279 nullptr,
7280 };
7281 for (uint i = 0; individual_ids_and_categories[i]; i++) {
7282 for (int j = 0; individual_ids_and_categories[i][j].identifier; j++) {
7284 srna, individual_ids_and_categories[i][j].identifier, PROP_BOOLEAN, PROP_NONE);
7286 prop, nullptr, "filter_id", individual_ids_and_categories[i][j].flag);
7288 individual_ids_and_categories[i][j].name,
7289 individual_ids_and_categories[i][j].description);
7290 RNA_def_property_ui_icon(prop, individual_ids_and_categories[i][j].icon, 0);
7292 }
7293 }
7294}
7295
7296/* Filter for datablock types in the Asset Browser. */
7298{
7299 StructRNA *srna = RNA_def_struct(brna, "FileAssetSelectIDFilter", nullptr);
7300 RNA_def_struct_sdna(srna, "FileSelectParams");
7301 RNA_def_struct_nested(brna, srna, "FileSelectParams");
7303 "File Select Asset Filter",
7304 "Which asset types to show/hide, when browsing an asset library");
7305
7306 static char experimental_prop_names[INDEX_ID_MAX][MAX_NAME];
7307
7308 for (uint i = 0; rna_enum_id_type_filter_items[i].identifier; i++) {
7310 const bool is_experimental = (ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS & item->flag) == 0;
7311
7312 const char *identifier = rna_enum_id_type_filter_items[i].identifier;
7313 if (is_experimental) {
7314 /* Create name for experimental property and store in static buffer. */
7315 SNPRINTF(experimental_prop_names[i], "experimental_%s", identifier);
7316 identifier = experimental_prop_names[i];
7317 }
7318
7319 PropertyRNA *prop = RNA_def_property(srna, identifier, PROP_BOOLEAN, PROP_NONE);
7320 RNA_def_property_boolean_sdna(prop, nullptr, "filter_id", item->flag);
7321 RNA_def_property_ui_text(prop, item->name, item->description);
7322 RNA_def_property_ui_icon(prop, item->icon, 0);
7324 }
7325}
7326
7328{
7329 PropertyRNA *prop;
7330 StructRNA *srna = RNA_def_struct(brna, "FileSelectEntry", nullptr);
7331 RNA_def_struct_sdna(srna, "FileDirEntry");
7332 RNA_def_struct_ui_text(srna, "File Select Entry", "A file viewable in the File Browser");
7333
7334 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
7335 RNA_def_property_editable_func(prop, "rna_FileBrowser_FileSelectEntry_name_editable");
7338 "rna_FileBrowser_FileSelectEntry_name_get",
7339 "rna_FileBrowser_FileSelectEntry_name_length",
7340 nullptr);
7341 RNA_def_property_ui_text(prop, "Name", "");
7342 RNA_def_struct_name_property(srna, prop);
7343
7344 prop = RNA_def_property(srna, "relative_path", PROP_STRING, PROP_FILEPATH);
7346 "rna_FileBrowser_FileSelectEntry_relative_path_get",
7347 "rna_FileBrowser_FileSelectEntry_relative_path_length",
7348 nullptr);
7350 "Relative Path",
7351 "Path relative to the directory currently displayed in the File "
7352 "Browser (includes the file name)");
7354
7355 prop = RNA_def_int(
7356 srna,
7357 "preview_icon_id",
7358 0,
7359 INT_MIN,
7360 INT_MAX,
7361 "Icon ID",
7362 "Unique integer identifying the preview of this file as an icon (zero means invalid)",
7363 INT_MIN,
7364 INT_MAX);
7367 prop, "rna_FileBrowser_FileSelectEntry_preview_icon_id_get", nullptr, nullptr);
7368
7369 prop = RNA_def_property(srna, "asset_data", PROP_POINTER, PROP_NONE);
7370 RNA_def_property_struct_type(prop, "AssetMetaData");
7372 prop, "rna_FileBrowser_FileSelectEntry_asset_data_get", nullptr, nullptr, nullptr);
7374 prop, "Asset Data", "Asset data, valid if the file represents an asset");
7375}
7376
7378{
7379 StructRNA *srna;
7380 PropertyRNA *prop;
7381
7382 static const EnumPropertyItem display_size_items[] = {
7383 {32, "TINY", 0, "Tiny", ""},
7384 {64, "SMALL", 0, "Small", ""},
7385 {96, "NORMAL", 0, "Medium", ""},
7386 {128, "BIG", 0, "Big", ""},
7387 {192, "LARGE", 0, "Large", ""},
7388 {0, nullptr, 0, nullptr, nullptr},
7389 };
7390
7391 srna = RNA_def_struct(brna, "FileSelectParams", nullptr);
7392 RNA_def_struct_path_func(srna, "rna_FileSelectParams_path");
7393 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
7394
7395 prop = RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
7396 RNA_def_property_string_sdna(prop, nullptr, "title");
7397 RNA_def_property_ui_text(prop, "Title", "Title for the file browser");
7399
7400 /* Use BYTESTRING rather than DIRPATH as sub-type so UI code doesn't add OT_directory_browse
7401 * button when displaying this prop in the file browser (it would just open a file browser). That
7402 * should be the only effective difference between the two. */
7403 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_BYTESTRING);
7404 RNA_def_property_string_sdna(prop, nullptr, "dir");
7405 RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
7407
7408 prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
7409 RNA_def_property_string_sdna(prop, nullptr, "file");
7410 RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
7411 RNA_def_property_editable_func(prop, "rna_FileSelectParams_filename_editable");
7413
7414 prop = RNA_def_property(srna, "use_library_browsing", PROP_BOOLEAN, PROP_NONE);
7416 prop, "Library Browser", "Whether we may browse Blender files' content or not");
7418 RNA_def_property_boolean_funcs(prop, "rna_FileSelectParams_use_lib_get", nullptr);
7419
7420 prop = RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
7421 RNA_def_property_enum_sdna(prop, nullptr, "display");
7423 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_FileSelectParams_display_type_itemf");
7424 RNA_def_property_enum_default_func(prop, "rna_FileSelectParams_display_type_default");
7425 RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
7427
7428 prop = RNA_def_property(srna, "recursion_level", PROP_ENUM, PROP_NONE);
7431 prop, nullptr, nullptr, "rna_FileSelectParams_recursion_level_itemf");
7432 RNA_def_property_ui_text(prop, "Recursion", "Numbers of dirtree levels to show simultaneously");
7434
7435 prop = RNA_def_property(srna, "show_details_size", PROP_BOOLEAN, PROP_NONE);
7436 RNA_def_property_boolean_sdna(prop, nullptr, "details_flags", FILE_DETAILS_SIZE);
7437 RNA_def_property_ui_text(prop, "File Size", "Show a column listing the size of each file");
7439
7440 prop = RNA_def_property(srna, "show_details_datetime", PROP_BOOLEAN, PROP_NONE);
7441 RNA_def_property_boolean_sdna(prop, nullptr, "details_flags", FILE_DETAILS_DATETIME);
7443 prop,
7444 "File Modification Date",
7445 "Show a column listing the date and time of modification for each file");
7447
7448 prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
7449 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_FILTER);
7450 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
7452
7453 prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
7455 RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
7457
7458 prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
7459 RNA_def_property_enum_sdna(prop, nullptr, "sort");
7461 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_FileSelectParams_sort_method_itemf");
7462 RNA_def_property_ui_text(prop, "Sort", "");
7464
7465 prop = RNA_def_property(srna, "use_sort_invert", PROP_BOOLEAN, PROP_NONE);
7466 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_SORT_INVERT);
7468 prop, "Reverse Sorting", "Sort items descending, from highest value to lowest");
7470
7471 prop = RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
7472 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_IMAGE);
7473 RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
7474 RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
7476
7477 prop = RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
7478 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_BLENDER);
7479 RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
7480 RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
7482
7483 prop = RNA_def_property(srna, "use_filter_backup", PROP_BOOLEAN, PROP_NONE);
7486 prop, "Filter Blender Backup Files", "Show .blend1, .blend2, etc. files");
7487 RNA_def_property_ui_icon(prop, ICON_FILE_BACKUP, 0);
7489
7490 prop = RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
7491 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_MOVIE);
7492 RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
7493 RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
7495
7496 prop = RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
7497 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_PYSCRIPT);
7498 RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
7499 RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
7501
7502 prop = RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
7503 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_FTFONT);
7504 RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
7505 RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
7507
7508 prop = RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
7509 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_SOUND);
7510 RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
7511 RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
7513
7514 prop = RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
7515 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_TEXT);
7516 RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
7517 RNA_def_property_ui_icon(prop, ICON_FILE_TEXT, 0);
7519
7520 prop = RNA_def_property(srna, "use_filter_volume", PROP_BOOLEAN, PROP_NONE);
7521 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_VOLUME);
7522 RNA_def_property_ui_text(prop, "Filter Volume", "Show 3D volume files");
7523 RNA_def_property_ui_icon(prop, ICON_FILE_VOLUME, 0);
7525
7526 prop = RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
7527 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_FOLDER);
7528 RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
7529 RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
7531
7532 prop = RNA_def_property(srna, "use_filter_blendid", PROP_BOOLEAN, PROP_NONE);
7533 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_BLENDERLIB);
7535 prop, "Filter Blender IDs", "Show .blend files items (objects, materials, etc.)");
7536 RNA_def_property_ui_icon(prop, ICON_BLENDER, 0);
7538
7539 prop = RNA_def_property(srna, "use_filter_asset_only", PROP_BOOLEAN, PROP_NONE);
7540 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_ASSETS_ONLY);
7542 prop, "Only Assets", "Hide .blend files items that are not data-blocks with asset metadata");
7544
7545 prop = RNA_def_property(srna, "filter_id", PROP_POINTER, PROP_NONE);
7547 RNA_def_property_struct_type(prop, "FileSelectIDFilter");
7549 prop, "rna_FileSelectParams_filter_id_get", nullptr, nullptr, nullptr);
7551 prop, "Filter ID Types", "Which ID types to show/hide, when browsing a library");
7552
7553 prop = RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
7554 RNA_def_property_string_sdna(prop, nullptr, "filter_glob");
7556 "Extension Filter",
7557 "UNIX shell-like filename patterns matching, supports wildcards ('*') "
7558 "and list of patterns separated by ';'");
7559 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_FileSelectPrams_filter_glob_set");
7561
7562 prop = RNA_def_property(srna, "filter_search", PROP_STRING, PROP_NONE);
7563 RNA_def_property_string_sdna(prop, nullptr, "filter_search");
7565 prop, "Name or Tag Filter", "Filter by name or tag, supports '*' wildcard");
7568
7569 prop = RNA_def_property(srna, "display_size", PROP_INT, PROP_NONE);
7570 RNA_def_property_int_sdna(prop, nullptr, "thumbnail_size");
7571 RNA_def_property_ui_text(prop, "Display Size", "Change the size of thumbnails");
7574 RNA_def_property_range(prop, 16, 256);
7575 RNA_def_property_ui_range(prop, 24, 256, 1, 0);
7576
7577 prop = RNA_def_property(srna, "display_size_discrete", PROP_ENUM, PROP_NONE);
7578 RNA_def_property_enum_sdna(prop, nullptr, "thumbnail_size");
7579 RNA_def_property_enum_items(prop, display_size_items);
7581 prop, "Display Size", "Change the size of thumbnails in discrete steps");
7583
7584 prop = RNA_def_property(srna, "list_display_size", PROP_INT, PROP_NONE);
7585 RNA_def_property_int_sdna(prop, nullptr, "list_thumbnail_size");
7586 RNA_def_property_ui_text(prop, "Display Size", "Change the size of thumbnails in list views");
7589 RNA_def_property_range(prop, 16, 128);
7590 RNA_def_property_ui_range(prop, 16, 128, 1, 0);
7591
7592 prop = RNA_def_property(srna, "list_column_size", PROP_INT, PROP_NONE);
7593 RNA_def_property_ui_text(prop, "Columns Size", "The width of columns in horizontal list views");
7596 RNA_def_property_range(prop, 32, 750);
7597 RNA_def_property_ui_range(prop, 32, 750, 1, 0);
7598}
7599
7601{
7602 StructRNA *srna;
7603 PropertyRNA *prop;
7604
7605 srna = RNA_def_struct(brna, "FileAssetSelectParams", "FileSelectParams");
7607 srna, "Asset Select Parameters", "Settings for the file selection in Asset Browser mode");
7608
7610 "rna_FileAssetSelectParams_asset_library_get",
7611 "rna_FileAssetSelectParams_asset_library_set");
7612 RNA_def_property_ui_text(prop, "Asset Library", "");
7614
7615 prop = RNA_def_property(srna, "catalog_id", PROP_STRING, PROP_NONE);
7617 "rna_FileAssetSelectParams_catalog_id_get",
7618 "rna_FileAssetSelectParams_catalog_id_length",
7619 "rna_FileAssetSelectParams_catalog_id_set");
7620 RNA_def_property_ui_text(prop, "Catalog UUID", "The UUID of the catalog shown in the browser");
7622
7623 prop = RNA_def_property(srna, "filter_asset_id", PROP_POINTER, PROP_NONE);
7625 RNA_def_property_struct_type(prop, "FileAssetSelectIDFilter");
7627 prop, "rna_FileAssetSelectParams_filter_id_get", nullptr, nullptr, nullptr);
7629 "Filter Asset Types",
7630 "Which asset types to show/hide, when browsing an asset library");
7631
7632 prop = RNA_def_property(srna, "import_method", PROP_ENUM, PROP_NONE);
7635 prop, nullptr, nullptr, "rna_FileAssetSelectParams_import_method_itemf");
7636 RNA_def_property_ui_text(prop, "Import Method", "Determine how the asset will be imported");
7637 /* Asset drag info saved by buttons stores the import method, so the space must redraw when
7638 * import method changes. */
7640
7641 prop = RNA_def_property(srna, "instance_collections_on_link", PROP_BOOLEAN, PROP_NONE);
7643 prop, nullptr, "import_flags", FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_LINK);
7645 "Instance Collections on Linking",
7646 "Create instances for collections when linking, rather than adding "
7647 "them directly to the scene");
7649
7650 prop = RNA_def_property(srna, "instance_collections_on_append", PROP_BOOLEAN, PROP_NONE);
7652 prop, nullptr, "import_flags", FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_APPEND);
7654 "Instance Collections on Appending",
7655 "Create instances for collections when appending, rather than adding "
7656 "them directly to the scene");
7658}
7659
7661{
7662 StructRNA *srna;
7663 PropertyRNA *prop;
7664
7665 srna = RNA_def_struct(brna, "FileBrowserFSMenuEntry", nullptr);
7666 RNA_def_struct_sdna(srna, "FSMenuEntry");
7667 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
7668
7669 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_FILEPATH);
7671 "rna_FileBrowser_FSMenuEntry_path_get",
7672 "rna_FileBrowser_FSMenuEntry_path_length",
7673 "rna_FileBrowser_FSMenuEntry_path_set");
7674 RNA_def_property_ui_text(prop, "Path", "");
7676
7677 /* Use #PROP_FILENAME sub-type so the UI can manipulate non-UTF8 names. */
7678 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
7680 "rna_FileBrowser_FSMenuEntry_name_get",
7681 "rna_FileBrowser_FSMenuEntry_name_length",
7682 "rna_FileBrowser_FSMenuEntry_name_set");
7683 RNA_def_property_editable_func(prop, "rna_FileBrowser_FSMenuEntry_name_get_editable");
7684 RNA_def_property_ui_text(prop, "Name", "");
7685 RNA_def_struct_name_property(srna, prop);
7686
7687 prop = RNA_def_property(srna, "icon", PROP_INT, PROP_NONE);
7689 "rna_FileBrowser_FSMenuEntry_icon_get",
7690 "rna_FileBrowser_FSMenuEntry_icon_set",
7691 nullptr);
7692 RNA_def_property_ui_text(prop, "Icon", "");
7693
7694 prop = RNA_def_property(srna, "use_save", PROP_BOOLEAN, PROP_NONE);
7695 RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_use_save_get", nullptr);
7697 prop, "Save", "Whether this path is saved in bookmarks, or generated from OS");
7699}
7700
7702{
7703 StructRNA *srna;
7704 PropertyRNA *prop;
7705
7706 srna = RNA_def_struct(brna, "SpaceFileBrowser", "Space");
7707 RNA_def_struct_sdna(srna, "SpaceFile");
7708 RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
7709
7711 srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_TOOL_PROPS));
7712
7713 prop = RNA_def_property(srna, "browse_mode", PROP_ENUM, PROP_NONE);
7716 prop,
7717 "Browsing Mode",
7718 "Type of the File Editor view (regular file browsing or asset browsing)");
7719 RNA_def_property_update(prop, 0, "rna_SpaceFileBrowser_browse_mode_update");
7720
7721 prop = RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
7722 RNA_def_property_struct_type(prop, "FileSelectParams");
7724 prop, "rna_FileBrowser_params_get", nullptr, "rna_FileBrowser_params_typef", nullptr);
7726 prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser");
7727
7728 prop = RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE);
7729 RNA_def_property_pointer_sdna(prop, nullptr, "op");
7730 RNA_def_property_ui_text(prop, "Active Operator", "");
7731
7732 /* Keep this for compatibility with existing presets,
7733 * not exposed in c++ API because of keyword conflict. */
7734 prop = RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
7735 RNA_def_property_pointer_sdna(prop, nullptr, "op");
7736 RNA_def_property_ui_text(prop, "Active Operator", "");
7737
7738 /* bookmarks, recent files etc. */
7739 prop = RNA_def_collection(srna,
7740 "system_folders",
7741 "FileBrowserFSMenuEntry",
7742 "System Folders",
7743 "System's folders (usually root, available hard drives, etc)");
7745 "rna_FileBrowser_FSMenuSystem_data_begin",
7746 "rna_FileBrowser_FSMenu_next",
7747 "rna_FileBrowser_FSMenu_end",
7748 "rna_FileBrowser_FSMenu_get",
7749 "rna_FileBrowser_FSMenuSystem_data_length",
7750 nullptr,
7751 nullptr,
7752 nullptr);
7754
7755 prop = RNA_def_int(srna,
7756 "system_folders_active",
7757 -1,
7758 -1,
7759 INT_MAX,
7760 "Active System Folder",
7761 "Index of active system folder (-1 if none)",
7762 -1,
7763 INT_MAX);
7764 RNA_def_property_int_sdna(prop, nullptr, "systemnr");
7766 "rna_FileBrowser_FSMenuSystem_active_get",
7767 "rna_FileBrowser_FSMenuSystem_active_set",
7768 "rna_FileBrowser_FSMenuSystem_active_range");
7771 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7772
7773 prop = RNA_def_collection(srna,
7774 "system_bookmarks",
7775 "FileBrowserFSMenuEntry",
7776 "System Bookmarks",
7777 "System's bookmarks");
7779 "rna_FileBrowser_FSMenuSystemBookmark_data_begin",
7780 "rna_FileBrowser_FSMenu_next",
7781 "rna_FileBrowser_FSMenu_end",
7782 "rna_FileBrowser_FSMenu_get",
7783 "rna_FileBrowser_FSMenuSystemBookmark_data_length",
7784 nullptr,
7785 nullptr,
7786 nullptr);
7788
7789 prop = RNA_def_int(srna,
7790 "system_bookmarks_active",
7791 -1,
7792 -1,
7793 INT_MAX,
7794 "Active System Bookmark",
7795 "Index of active system bookmark (-1 if none)",
7796 -1,
7797 INT_MAX);
7798 RNA_def_property_int_sdna(prop, nullptr, "system_bookmarknr");
7800 "rna_FileBrowser_FSMenuSystemBookmark_active_get",
7801 "rna_FileBrowser_FSMenuSystemBookmark_active_set",
7802 "rna_FileBrowser_FSMenuSystemBookmark_active_range");
7805 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7806
7807 prop = RNA_def_collection(
7808 srna, "bookmarks", "FileBrowserFSMenuEntry", "Bookmarks", "User's bookmarks");
7810 "rna_FileBrowser_FSMenuBookmark_data_begin",
7811 "rna_FileBrowser_FSMenu_next",
7812 "rna_FileBrowser_FSMenu_end",
7813 "rna_FileBrowser_FSMenu_get",
7814 "rna_FileBrowser_FSMenuBookmark_data_length",
7815 nullptr,
7816 nullptr,
7817 nullptr);
7819
7820 prop = RNA_def_int(srna,
7821 "bookmarks_active",
7822 -1,
7823 -1,
7824 INT_MAX,
7825 "Active Bookmark",
7826 "Index of active bookmark (-1 if none)",
7827 -1,
7828 INT_MAX);
7829 RNA_def_property_int_sdna(prop, nullptr, "bookmarknr");
7831 "rna_FileBrowser_FSMenuBookmark_active_get",
7832 "rna_FileBrowser_FSMenuBookmark_active_set",
7833 "rna_FileBrowser_FSMenuBookmark_active_range");
7836 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7837
7838 prop = RNA_def_collection(
7839 srna, "recent_folders", "FileBrowserFSMenuEntry", "Recent Folders", "");
7841 "rna_FileBrowser_FSMenuRecent_data_begin",
7842 "rna_FileBrowser_FSMenu_next",
7843 "rna_FileBrowser_FSMenu_end",
7844 "rna_FileBrowser_FSMenu_get",
7845 "rna_FileBrowser_FSMenuRecent_data_length",
7846 nullptr,
7847 nullptr,
7848 nullptr);
7850
7851 prop = RNA_def_int(srna,
7852 "recent_folders_active",
7853 -1,
7854 -1,
7855 INT_MAX,
7856 "Active Recent Folder",
7857 "Index of active recent folder (-1 if none)",
7858 -1,
7859 INT_MAX);
7860 RNA_def_property_int_sdna(prop, nullptr, "recentnr");
7862 "rna_FileBrowser_FSMenuRecent_active_get",
7863 "rna_FileBrowser_FSMenuRecent_active_set",
7864 "rna_FileBrowser_FSMenuRecent_active_range");
7867 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7868
7870}
7871
7873{
7874 StructRNA *srna;
7875 PropertyRNA *prop;
7876
7877 srna = RNA_def_struct(brna, "SpaceInfo", "Space");
7878 RNA_def_struct_sdna(srna, "SpaceInfo");
7879 RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
7880
7881 /* reporting display */
7882 prop = RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
7883 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_DEBUG);
7884 RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
7886
7887 prop = RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
7888 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_INFO);
7889 RNA_def_property_ui_text(prop, "Show Info", "Display general information");
7891
7892 prop = RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
7893 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_OP);
7894 RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
7896
7897 prop = RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
7898 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_WARN);
7899 RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
7901
7902 prop = RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
7903 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_ERR);
7904 RNA_def_property_ui_text(prop, "Show Error", "Display error text");
7906}
7907
7909{
7910 static const EnumPropertyItem filter_type_items[] = {
7911 {0, "NAME", 0, "Name", "Filter based on the operator name"},
7912 {1, "KEY", 0, "Key-Binding", "Filter based on key bindings"},
7913 {0, nullptr, 0, nullptr, nullptr},
7914 };
7915
7916 StructRNA *srna;
7917 PropertyRNA *prop;
7918
7919 srna = RNA_def_struct(brna, "SpacePreferences", "Space");
7920 RNA_def_struct_sdna(srna, "SpaceUserPref");
7921 RNA_def_struct_ui_text(srna, "Space Preferences", "Blender preferences space data");
7922
7924
7925 prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
7926 RNA_def_property_enum_sdna(prop, nullptr, "filter_type");
7927 RNA_def_property_enum_items(prop, filter_type_items);
7928 RNA_def_property_ui_text(prop, "Filter Type", "Filter method");
7930
7931 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
7932 RNA_def_property_string_sdna(prop, nullptr, "filter");
7934 RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
7935}
7936
7938{
7939 StructRNA *srna;
7940 PropertyRNA *prop;
7941
7942 srna = RNA_def_struct(brna, "NodeTreePath", nullptr);
7943 RNA_def_struct_sdna(srna, "bNodeTreePath");
7944 RNA_def_struct_ui_text(srna, "Node Tree Path", "Element of the node space tree path");
7945
7946 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
7947 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
7949 RNA_def_property_ui_text(prop, "Node Tree", "Base node tree from context");
7950}
7951
7953{
7954 StructRNA *srna;
7955 PropertyRNA *prop, *parm;
7956 FunctionRNA *func;
7957
7958 RNA_def_property_srna(cprop, "SpaceNodeEditorPath");
7959 srna = RNA_def_struct(brna, "SpaceNodeEditorPath", nullptr);
7960 RNA_def_struct_sdna(srna, "SpaceNode");
7961 RNA_def_struct_ui_text(srna, "Space Node Editor Path", "History of node trees in the editor");
7962
7963 prop = RNA_def_property(srna, "to_string", PROP_STRING, PROP_NONE);
7965 prop, "rna_SpaceNodeEditor_path_get", "rna_SpaceNodeEditor_path_length", nullptr);
7967 RNA_def_struct_ui_text(srna, "Path", "Get the node tree path as a string");
7969
7970 func = RNA_def_function(srna, "clear", "rna_SpaceNodeEditor_path_clear");
7971 RNA_def_function_ui_description(func, "Reset the node tree path");
7973
7974 func = RNA_def_function(srna, "start", "rna_SpaceNodeEditor_path_start");
7975 RNA_def_function_ui_description(func, "Set the root node tree");
7977 parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", "");
7979
7980 func = RNA_def_function(srna, "append", "rna_SpaceNodeEditor_path_append");
7981 RNA_def_function_ui_description(func, "Append a node group tree to the path");
7983 parm = RNA_def_pointer(
7984 func, "node_tree", "NodeTree", "Node Tree", "Node tree to append to the node editor path");
7986 parm = RNA_def_pointer(func, "node", "Node", "Node", "Group node linking to this node tree");
7988
7989 func = RNA_def_function(srna, "pop", "rna_SpaceNodeEditor_path_pop");
7990 RNA_def_function_ui_description(func, "Remove the last node tree from the path");
7992}
7993
7995{
7996 StructRNA *srna;
7997 PropertyRNA *prop;
7998
7999 static const EnumPropertyItem preview_shapes[] = {
8000 {SN_OVERLAY_PREVIEW_FLAT, "FLAT", ICON_MESH_PLANE, "Flat", "Use the default flat previews"},
8002 "3D",
8003 ICON_SPHERE,
8004 "3D",
8005 "Use the material preview scene for the node previews"},
8006 {0, nullptr, 0, nullptr, nullptr},
8007 };
8008
8009 srna = RNA_def_struct(brna, "SpaceNodeOverlay", nullptr);
8010 RNA_def_struct_sdna(srna, "SpaceNode");
8011 RNA_def_struct_nested(brna, srna, "SpaceNodeEditor");
8012 RNA_def_struct_path_func(srna, "rna_SpaceNodeOverlay_path");
8014 srna, "Overlay Settings", "Settings for display of overlays in the Node Editor");
8015
8016 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
8017 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_OVERLAYS);
8019 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like colored or dashed wires");
8021
8022 prop = RNA_def_property(srna, "show_wire_color", PROP_BOOLEAN, PROP_NONE);
8023 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_WIRE_COLORS);
8026 prop, "Show Wire Colors", "Color node links based on their connected sockets");
8028
8029 prop = RNA_def_property(srna, "show_reroute_auto_labels", PROP_BOOLEAN, PROP_NONE);
8031 prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_REROUTE_AUTO_LABELS);
8034 "Show Reroute Auto Labels",
8035 "Label reroute nodes based on the label of connected reroute nodes");
8037
8038 prop = RNA_def_property(srna, "show_timing", PROP_BOOLEAN, PROP_NONE);
8039 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_TIMINGS);
8041 RNA_def_property_ui_text(prop, "Show Timing", "Display each node's last execution time");
8043
8044 prop = RNA_def_property(srna, "show_context_path", PROP_BOOLEAN, PROP_NONE);
8045 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_PATH);
8047 RNA_def_property_ui_text(prop, "Show Tree Path", "Display breadcrumbs for the editor's context");
8049
8050 prop = RNA_def_property(srna, "show_named_attributes", PROP_BOOLEAN, PROP_NONE);
8054 prop, "Show Named Attributes", "Show when nodes are using named attributes");
8056
8057 prop = RNA_def_property(srna, "show_previews", PROP_BOOLEAN, PROP_NONE);
8058 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_PREVIEWS);
8061 prop, "Show Node Previews", "Display each node's preview if node is toggled");
8063
8064 prop = RNA_def_property(srna, "preview_shape", PROP_ENUM, PROP_NONE);
8065 RNA_def_property_enum_sdna(prop, nullptr, "overlay.preview_shape");
8066 RNA_def_property_enum_items(prop, preview_shapes);
8068 RNA_def_property_ui_text(prop, "Preview Shape", "Preview shape used by the node previews");
8070}
8071
8073{
8074 StructRNA *srna;
8075 PropertyRNA *prop;
8076
8077 static const EnumPropertyItem texture_id_type_items[] = {
8078 {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World"},
8079 {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"},
8080# ifdef WITH_FREESTYLE
8082 "LINESTYLE",
8083 ICON_LINE_DATA,
8084 "Line Style",
8085 "Edit texture nodes from Line Style"},
8086# endif
8087 {0, nullptr, 0, nullptr, nullptr},
8088 };
8089
8090 static const EnumPropertyItem shader_type_items[] = {
8091 {SNODE_SHADER_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit shader nodes from Object"},
8092 {SNODE_SHADER_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit shader nodes from World"},
8093# ifdef WITH_FREESTYLE
8095 "LINESTYLE",
8096 ICON_LINE_DATA,
8097 "Line Style",
8098 "Edit shader nodes from Line Style"},
8099# endif
8100 {0, nullptr, 0, nullptr, nullptr},
8101 };
8102
8103 static const EnumPropertyItem backdrop_channels_items[] = {
8105 "COLOR_ALPHA",
8106 ICON_IMAGE_RGB_ALPHA,
8107 "Color & Alpha",
8108 "Display image with RGB colors and alpha transparency"},
8109 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
8110 {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Display alpha transparency channel"},
8111 {SNODE_SHOW_R, "RED", ICON_RGB_RED, "Red", ""},
8112 {SNODE_SHOW_G, "GREEN", ICON_RGB_GREEN, "Green", ""},
8113 {SNODE_SHOW_B, "BLUE", ICON_RGB_BLUE, "Blue", ""},
8114 {0, nullptr, 0, nullptr, nullptr},
8115 };
8116
8117 static const EnumPropertyItem insert_ofs_dir_items[] = {
8118 {SNODE_INSERTOFS_DIR_RIGHT, "RIGHT", 0, "Right"},
8119 {SNODE_INSERTOFS_DIR_LEFT, "LEFT", 0, "Left"},
8120 {0, nullptr, 0, nullptr, nullptr},
8121 };
8122
8123 srna = RNA_def_struct(brna, "SpaceNodeEditor", "Space");
8124 RNA_def_struct_sdna(srna, "SpaceNode");
8125 RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data");
8126
8128 srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_ASSET_SHELF));
8129
8130 prop = RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
8133 "rna_SpaceNodeEditor_tree_type_get",
8134 "rna_SpaceNodeEditor_tree_type_set",
8135 "rna_SpaceNodeEditor_tree_type_itemf");
8137 RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit");
8139
8140 prop = RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
8141 RNA_def_property_enum_sdna(prop, nullptr, "texfrom");
8142 RNA_def_property_enum_items(prop, texture_id_type_items);
8143 RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from");
8146
8147 prop = RNA_def_property(srna, "shader_type", PROP_ENUM, PROP_NONE);
8148 RNA_def_property_enum_sdna(prop, nullptr, "shaderfrom");
8149 RNA_def_property_enum_items(prop, shader_type_items);
8150 RNA_def_property_ui_text(prop, "Shader Type", "Type of data to take shader from");
8153
8154 prop = RNA_def_property(srna, "node_tree_sub_type", PROP_ENUM, PROP_NONE);
8155 RNA_def_property_enum_sdna(prop, nullptr, "node_tree_sub_type");
8158 prop, nullptr, nullptr, "rna_SpaceNodeEditor_node_tree_sub_type_itemf");
8159 RNA_def_property_ui_text(prop, "Node Tree Sub-Type", "");
8161 prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_sub_type_update");
8162
8163 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8165 RNA_def_property_ui_text(prop, "ID", "Data-block whose nodes are being edited");
8166
8167 prop = RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
8168 RNA_def_property_pointer_sdna(prop, nullptr, "from");
8171 prop, "ID From", "Data-block from which the edited data-block is linked");
8172
8173 prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE);
8174 RNA_def_property_collection_sdna(prop, nullptr, "treepath", nullptr);
8175 RNA_def_property_struct_type(prop, "NodeTreePath");
8177 prop, "Node Tree Path", "Path from the data-block to the currently edited node tree");
8178 rna_def_space_node_path_api(brna, prop);
8179
8180 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
8182 nullptr,
8183 "rna_SpaceNodeEditor_node_tree_set",
8184 nullptr,
8185 "rna_SpaceNodeEditor_node_tree_poll");
8186 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
8189 RNA_def_property_ui_text(prop, "Node Tree", "Base node tree from context");
8190 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
8191
8192 prop = RNA_def_property(srna, "edit_tree", PROP_POINTER, PROP_NONE);
8193 RNA_def_property_pointer_sdna(prop, nullptr, "edittree");
8195 RNA_def_property_ui_text(prop, "Edit Tree", "Node tree being displayed and edited");
8196
8197 prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
8198 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_PIN);
8199 RNA_def_property_ui_text(prop, "Pinned", "Use the pinned node tree");
8200 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
8202
8203 prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
8204 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_BACKDRAW);
8206 prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
8208 prop, NC_SPACE | ND_SPACE_NODE_VIEW, "rna_SpaceNodeEditor_show_backdrop_update");
8209
8210 prop = RNA_def_property(srna, "selected_node_group", PROP_POINTER, PROP_NONE);
8213 prop, nullptr, nullptr, nullptr, "rna_SpaceNodeEditor_selected_node_group_poll");
8215 RNA_def_property_ui_text(prop, "Selected Node Group", "Node group to edit");
8216 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
8217
8218 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
8219 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_SHOW_GPENCIL);
8220 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
8222
8223 prop = RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
8224 RNA_def_property_float_sdna(prop, nullptr, "zoom");
8226 RNA_def_property_range(prop, 0.01f, FLT_MAX);
8227 RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
8228 RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor");
8230
8231 prop = RNA_def_property(srna, "backdrop_offset", PROP_FLOAT, PROP_NONE);
8232 RNA_def_property_float_sdna(prop, nullptr, "xof");
8233 RNA_def_property_array(prop, 2);
8234 RNA_def_property_ui_text(prop, "Backdrop Offset", "Backdrop offset");
8236
8237 prop = RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
8238 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
8239 RNA_def_property_enum_items(prop, backdrop_channels_items);
8240 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to draw");
8242 /* the mx/my "cursor" in the node editor is used only by operators to store the mouse position */
8243 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
8244 RNA_def_property_array(prop, 2);
8246 "rna_SpaceNodeEditor_cursor_location_get",
8247 "rna_SpaceNodeEditor_cursor_location_set",
8248 nullptr);
8249 RNA_def_property_ui_text(prop, "Cursor Location", "Location for adding new nodes");
8251
8252 prop = RNA_def_property(srna, "insert_offset_direction", PROP_ENUM, PROP_NONE);
8253 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "insert_ofs_dir");
8254 RNA_def_property_enum_items(prop, insert_ofs_dir_items);
8256 prop, "Auto-offset Direction", "Direction to offset nodes on insertion");
8258
8259 /* Gizmo Toggles. */
8260 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
8261 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SNODE_GIZMO_HIDE);
8262 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
8264
8265 prop = RNA_def_property(srna, "show_gizmo_active_node", PROP_BOOLEAN, PROP_NONE);
8267 prop, nullptr, "gizmo_flag", SNODE_GIZMO_HIDE_ACTIVE_NODE);
8268 RNA_def_property_ui_text(prop, "Active Node", "Context sensitive gizmo for the active node");
8271
8272 /* Overlays */
8273 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
8275 RNA_def_property_struct_type(prop, "SpaceNodeOverlay");
8276 RNA_def_property_pointer_funcs(prop, "rna_SpaceNode_overlay_get", nullptr, nullptr, nullptr);
8278 prop, "Overlay Settings", "Settings for display of overlays in the Node Editor");
8279
8280 prop = RNA_def_property(srna, "supports_previews", PROP_BOOLEAN, PROP_NONE);
8281 RNA_def_property_boolean_funcs(prop, "rna_SpaceNode_supports_previews", nullptr);
8284 "Supports Previews",
8285 "Whether the node editor's type supports displaying node previews");
8286
8288 RNA_api_space_node(srna);
8289}
8290
8292{
8293 StructRNA *srna;
8294 PropertyRNA *prop;
8295
8296 srna = RNA_def_struct(brna, "SpaceClipOverlay", nullptr);
8297 RNA_def_struct_sdna(srna, "SpaceClip");
8298 RNA_def_struct_nested(brna, srna, "SpaceClipEditor");
8299 RNA_def_struct_path_func(srna, "rna_SpaceClipOverlay_path");
8301 srna, "Overlay Settings", "Settings for display of overlays in the Movie Clip editor");
8302
8303 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
8304 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SC_SHOW_OVERLAYS);
8305 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like cursor and annotations");
8307
8308 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
8309 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SC_SHOW_CURSOR);
8310 RNA_def_property_ui_text(prop, "Show Overlays", "Display 2D cursor");
8312}
8313
8315{
8316 StructRNA *srna;
8317 PropertyRNA *prop;
8318
8319 static const EnumPropertyItem view_items[] = {
8320 {SC_VIEW_CLIP, "CLIP", ICON_SEQUENCE, "Clip", "Show editing clip preview"},
8321 {SC_VIEW_GRAPH, "GRAPH", ICON_GRAPH, "Graph", "Show graph view for active element"},
8323 "DOPESHEET",
8324 ICON_ACTION,
8325 "Dope Sheet",
8326 "Dope Sheet view for tracking data"},
8327 {0, nullptr, 0, nullptr, nullptr},
8328 };
8329
8330 static const EnumPropertyItem annotation_source_items[] = {
8332 "CLIP",
8333 0,
8334 "Clip",
8335 "Show annotation data-block which belongs to movie clip"},
8337 "TRACK",
8338 0,
8339 "Track",
8340 "Show annotation data-block which belongs to active track"},
8341 {0, nullptr, 0, nullptr, nullptr},
8342 };
8343
8344 static const EnumPropertyItem pivot_items[] = {
8346 "BOUNDING_BOX_CENTER",
8347 ICON_PIVOT_BOUNDBOX,
8348 "Bounding Box Center",
8349 "Pivot around bounding box center of selected object(s)"},
8350 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
8352 "INDIVIDUAL_ORIGINS",
8353 ICON_PIVOT_INDIVIDUAL,
8354 "Individual Origins",
8355 "Pivot around each object's own origin"},
8357 "MEDIAN_POINT",
8358 ICON_PIVOT_MEDIAN,
8359 "Median Point",
8360 "Pivot around the median point of selected objects"},
8361 {0, nullptr, 0, nullptr, nullptr},
8362 };
8363
8364 srna = RNA_def_struct(brna, "SpaceClipEditor", "Space");
8365 RNA_def_struct_sdna(srna, "SpaceClip");
8366 RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data");
8367
8369 (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) |
8370 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
8371
8372 /* movieclip */
8373 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
8375 RNA_def_property_ui_text(prop, "Movie Clip", "Movie clip displayed and edited in this space");
8376 RNA_def_property_pointer_funcs(prop, nullptr, "rna_SpaceClipEditor_clip_set", nullptr, nullptr);
8379
8380 /* clip user */
8381 prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
8383 RNA_def_property_struct_type(prop, "MovieClipUser");
8384 RNA_def_property_pointer_sdna(prop, nullptr, "user");
8386 prop, "Movie Clip User", "Parameters defining which frame of the movie clip is displayed");
8388
8389 /* mask */
8390 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_mask_set");
8391
8392 /* mode */
8393 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
8394 RNA_def_property_enum_sdna(prop, nullptr, "mode");
8396 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
8398 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_clip_mode_update");
8399
8400 /* view */
8401 prop = RNA_def_property(srna, "view", PROP_ENUM, PROP_NONE);
8402 RNA_def_property_enum_sdna(prop, nullptr, "view");
8403 RNA_def_property_enum_items(prop, view_items);
8404 RNA_def_property_ui_text(prop, "View", "Type of the clip editor view");
8406 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_view_type_update");
8407
8408 /* show pattern */
8409 prop = RNA_def_property(srna, "show_marker_pattern", PROP_BOOLEAN, PROP_NONE);
8410 RNA_def_property_ui_text(prop, "Show Marker Pattern", "Show pattern boundbox for markers");
8413
8414 /* show search */
8415 prop = RNA_def_property(srna, "show_marker_search", PROP_BOOLEAN, PROP_NONE);
8416 RNA_def_property_ui_text(prop, "Show Marker Search", "Show search boundbox for markers");
8419
8420 /* lock to selection */
8421 prop = RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE);
8423 prop, "Lock to Selection", "Lock viewport to selected markers during playback");
8424 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_LOCK_SELECTION);
8426 prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_lock_selection_update");
8427
8428 /* lock to time cursor */
8429 prop = RNA_def_property(srna, "lock_time_cursor", PROP_BOOLEAN, PROP_NONE);
8431 prop, "Lock to Time Cursor", "Lock curves view to time cursor during playback and tracking");
8432 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_LOCK_TIMECURSOR);
8434
8435 /* show markers paths */
8436 prop = RNA_def_property(srna, "show_track_path", PROP_BOOLEAN, PROP_NONE);
8437 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_TRACK_PATH);
8438 RNA_def_property_ui_text(prop, "Show Track Path", "Show path of how track moves");
8440
8441 /* path length */
8442 prop = RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
8443 RNA_def_property_int_sdna(prop, nullptr, "path_length");
8444 RNA_def_property_range(prop, 0, INT_MAX);
8445 RNA_def_property_ui_text(prop, "Path Length", "Length of displaying path, in frames");
8447
8448 /* show tiny markers */
8449 prop = RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE);
8450 RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers in a more compact manner");
8451 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_TINY_MARKER);
8453
8454 /* show bundles */
8455 prop = RNA_def_property(srna, "show_bundles", PROP_BOOLEAN, PROP_NONE);
8456 RNA_def_property_ui_text(prop, "Show Bundles", "Show projection of 3D markers into footage");
8457 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_BUNDLES);
8459
8460 /* mute footage */
8461 prop = RNA_def_property(srna, "use_mute_footage", PROP_BOOLEAN, PROP_NONE);
8462 RNA_def_property_ui_text(prop, "Mute Footage", "Mute footage and show black background instead");
8463 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_MUTE_FOOTAGE);
8465
8466 /* hide disabled */
8467 prop = RNA_def_property(srna, "show_disabled", PROP_BOOLEAN, PROP_NONE);
8468 RNA_def_property_ui_text(prop, "Show Disabled", "Show disabled tracks from the footage");
8471
8472 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
8473 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_METADATA);
8474 RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of clip");
8476
8477 /* scopes */
8478 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
8479 RNA_def_property_pointer_sdna(prop, nullptr, "scopes");
8480 RNA_def_property_struct_type(prop, "MovieClipScopes");
8481 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize movie clip statistics");
8482
8483 /* show names */
8484 prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
8485 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_NAMES);
8486 RNA_def_property_ui_text(prop, "Show Names", "Show track names and status");
8488
8489 /* show grid */
8490 prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
8491 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_GRID);
8492 RNA_def_property_ui_text(prop, "Show Grid", "Show grid showing lens distortion");
8494
8495 /* show stable */
8496 prop = RNA_def_property(srna, "show_stable", PROP_BOOLEAN, PROP_NONE);
8497 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_STABLE);
8499 prop, "Show Stable", "Show stable footage in editor (if stabilization is enabled)");
8501
8502 /* manual calibration */
8503 prop = RNA_def_property(srna, "use_manual_calibration", PROP_BOOLEAN, PROP_NONE);
8505 RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers");
8507
8508 /* show annotation */
8509 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
8510 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_ANNOTATION);
8511 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
8513
8514 /* show filters */
8515 prop = RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE);
8516 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_FILTERS);
8517 RNA_def_property_ui_text(prop, "Show Filters", "Show filters for graph editor");
8519
8520 /* show graph_frames */
8521 prop = RNA_def_property(srna, "show_graph_frames", PROP_BOOLEAN, PROP_NONE);
8524 prop,
8525 "Show Frames",
8526 "Show curve for per-frame average error (camera motion should be solved first)");
8528
8529 /* show graph tracks motion */
8530 prop = RNA_def_property(srna, "show_graph_tracks_motion", PROP_BOOLEAN, PROP_NONE);
8533 prop, "Show Tracks Motion", "Display speed curves for the selected tracks");
8535
8536 /* show graph tracks motion */
8537 prop = RNA_def_property(srna, "show_graph_tracks_error", PROP_BOOLEAN, PROP_NONE);
8540 prop, "Show Tracks Error", "Display the reprojection error curve for selected tracks");
8542
8543 /* show_only_selected */
8544 prop = RNA_def_property(srna, "show_graph_only_selected", PROP_BOOLEAN, PROP_NONE);
8547 prop, "Only Show Selected", "Only include channels relating to selected objects and data");
8548 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
8550
8551 /* show_hidden */
8552 prop = RNA_def_property(srna, "show_graph_hidden", PROP_BOOLEAN, PROP_NONE);
8555 prop, "Display Hidden", "Include channels from objects/bone that are not visible");
8556 RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
8558
8559 /* ** channels ** */
8560
8561 /* show_red_channel */
8562 prop = RNA_def_property(srna, "show_red_channel", PROP_BOOLEAN, PROP_NONE);
8563 RNA_def_property_boolean_negative_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_DISABLE_RED);
8564 RNA_def_property_ui_text(prop, "Show Red Channel", "Show red channel in the frame");
8566
8567 /* show_green_channel */
8568 prop = RNA_def_property(srna, "show_green_channel", PROP_BOOLEAN, PROP_NONE);
8569 RNA_def_property_boolean_negative_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_DISABLE_GREEN);
8570 RNA_def_property_ui_text(prop, "Show Green Channel", "Show green channel in the frame");
8572
8573 /* show_blue_channel */
8574 prop = RNA_def_property(srna, "show_blue_channel", PROP_BOOLEAN, PROP_NONE);
8575 RNA_def_property_boolean_negative_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_DISABLE_BLUE);
8576 RNA_def_property_ui_text(prop, "Show Blue Channel", "Show blue channel in the frame");
8578
8579 /* preview_grayscale */
8580 prop = RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
8581 RNA_def_property_boolean_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_PREVIEW_GRAYSCALE);
8582 RNA_def_property_ui_text(prop, "Grayscale", "Display frame in grayscale mode");
8584
8585 /* timeline */
8586 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
8587 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_SECONDS);
8588 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
8590
8591 /* grease pencil source */
8592 prop = RNA_def_property(srna, "annotation_source", PROP_ENUM, PROP_NONE);
8593 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_src");
8594 RNA_def_property_enum_items(prop, annotation_source_items);
8595 RNA_def_property_ui_text(prop, "Annotation Source", "Where the annotation comes from");
8598
8599 /* transform */
8600 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
8601 RNA_def_property_float_sdna(prop, nullptr, "cursor");
8602 RNA_def_property_array(prop, 2);
8603 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
8605
8606 /* pivot point */
8607 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
8608 RNA_def_property_enum_sdna(prop, nullptr, "around");
8609 RNA_def_property_enum_items(prop, pivot_items);
8610 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
8612
8613 /* Gizmo Toggles. */
8614 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
8615 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SCLIP_GIZMO_HIDE);
8616 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
8618
8619 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
8621 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
8623
8624 /* Zoom. */
8625 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
8627 "rna_SpaceClipEditor_zoom_percentage_get",
8628 "rna_SpaceClipEditor_zoom_percentage_set",
8629 nullptr);
8630 RNA_def_property_float_default(prop, 100.0);
8631 RNA_def_property_range(prop, .4f, 80000);
8632 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
8633 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
8634
8635 /* Overlays */
8636 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
8638 RNA_def_property_struct_type(prop, "SpaceClipOverlay");
8639 RNA_def_property_pointer_funcs(prop, "rna_SpaceClip_overlay_get", nullptr, nullptr, nullptr);
8641 prop, "Overlay Settings", "Settings for display of overlays in the Movie Clip editor");
8642
8644}
8645
8647{
8648 StructRNA *srna;
8649 PropertyRNA *prop;
8650
8651 srna = RNA_def_struct(brna, "SpreadsheetColumnID", nullptr);
8652 RNA_def_struct_sdna(srna, "SpreadsheetColumnID");
8654 srna, "Spreadsheet Column ID", "Data used to identify a spreadsheet column");
8655
8656 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
8657 RNA_def_property_ui_text(prop, "Column Name", "");
8659}
8660
8662{
8663 StructRNA *srna;
8664 PropertyRNA *prop;
8665
8666 static const EnumPropertyItem data_type_items[] = {
8667 {SPREADSHEET_VALUE_TYPE_INT32, "INT32", ICON_NONE, "Integer", ""},
8668 {SPREADSHEET_VALUE_TYPE_FLOAT, "FLOAT", ICON_NONE, "Float", ""},
8669 {SPREADSHEET_VALUE_TYPE_BOOL, "BOOLEAN", ICON_NONE, "Boolean", ""},
8670 {SPREADSHEET_VALUE_TYPE_INSTANCES, "INSTANCES", ICON_NONE, "Instances", ""},
8671 {0, nullptr, 0, nullptr, nullptr},
8672 };
8673
8674 srna = RNA_def_struct(brna, "SpreadsheetColumn", nullptr);
8675 RNA_def_struct_sdna(srna, "SpreadsheetColumn");
8677 srna, "Spreadsheet Column", "Persistent data associated with a spreadsheet column");
8678
8679 prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);
8680 RNA_def_property_enum_sdna(prop, nullptr, "data_type");
8681 RNA_def_property_enum_items(prop, data_type_items);
8683 prop, "Data Type", "The data type of the corresponding column visible in the spreadsheet");
8686
8688
8689 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8690 RNA_def_property_struct_type(prop, "SpreadsheetColumnID");
8692 prop, "ID", "Data used to identify the corresponding data from the data source");
8693}
8694
8696{
8697 StructRNA *srna;
8698 PropertyRNA *prop;
8699
8700 srna = RNA_def_struct(brna, "SpreadsheetTableID", nullptr);
8702 srna, "Spreadsheet Table ID", "Data used to identify a spreadsheet table");
8703 RNA_def_struct_refine_func(srna, "rna_SpreadsheetTableID_refine");
8704
8705 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
8708 RNA_def_property_ui_text(prop, "Type", "The type of the table identifier");
8709}
8710
8712{
8713 StructRNA *srna;
8714 PropertyRNA *prop;
8715
8716 /* The properties below are read-only, because they are used as key for a table. */
8717 srna = RNA_def_struct(brna, "SpreadsheetTableIDGeometry", "SpreadsheetTableID");
8718
8719 prop = RNA_def_property(srna, "object_eval_state", PROP_ENUM, PROP_NONE);
8722 RNA_def_property_ui_text(prop, "Object Evaluation State", "");
8723
8724 prop = RNA_def_property(srna, "geometry_component_type", PROP_ENUM, PROP_NONE);
8728 prop, "Geometry Component", "Part of the geometry to display data from");
8729
8730 prop = RNA_def_property(srna, "attribute_domain", PROP_ENUM, PROP_NONE);
8733 RNA_def_property_ui_text(prop, "Attribute Domain", "Attribute domain to display");
8734
8735 prop = RNA_def_property(srna, "viewer_path", PROP_POINTER, PROP_NONE);
8736 RNA_def_property_ui_text(prop, "Viewer Path", "Path to the data that is displayed");
8737
8738 prop = RNA_def_property(srna, "layer_index", PROP_INT, PROP_NONE);
8740 RNA_def_property_ui_text(prop, "Layer Index", "Index of the Grease Pencil layer");
8741}
8742
8744{
8745 StructRNA *srna;
8746 PropertyRNA *prop;
8747
8751
8752 srna = RNA_def_struct(brna, "SpreadsheetTable", nullptr);
8753 RNA_def_struct_ui_text(srna, "Spreadsheet Table", "Persistent data associated with a table");
8754
8755 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8756 RNA_def_property_struct_type(prop, "SpreadsheetTableID");
8757 RNA_def_property_ui_text(prop, "ID", "Data used to identify the table");
8758
8759 prop = RNA_def_property(srna, "columns", PROP_COLLECTION, PROP_NONE);
8760 RNA_def_property_struct_type(prop, "SpreadsheetColumn");
8762 "rna_iterator_SpreadsheetTable_columns_begin",
8763 "rna_iterator_array_next",
8764 "rna_iterator_array_end",
8765 "rna_iterator_array_dereference_get",
8766 "rna_iterator_SpreadsheetTable_columns_length",
8767 nullptr,
8768 nullptr,
8769 nullptr);
8770 RNA_def_property_ui_text(prop, "Columns", "Columns within the table");
8771}
8772
8774{
8775 StructRNA *srna;
8776 PropertyRNA *prop;
8777
8778 srna = RNA_def_struct(brna, "SpreadsheetTables", nullptr);
8779 RNA_def_struct_sdna(srna, "SpaceSpreadsheet");
8781 "Spreadsheet Tables",
8782 "Active table and persisted state of previously displayed tables");
8783
8784 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
8785 RNA_def_property_struct_type(prop, "SpreadsheetTable");
8787 prop, "rna_SpreadsheetTables_active_get", nullptr, nullptr, nullptr);
8788 RNA_def_property_ui_text(prop, "Active Table", "");
8789}
8790
8792{
8793 StructRNA *srna;
8794 PropertyRNA *prop;
8795
8796 static const EnumPropertyItem rule_operation_items[] = {
8797 {SPREADSHEET_ROW_FILTER_EQUAL, "EQUAL", ICON_NONE, "Equal To", ""},
8798 {SPREADSHEET_ROW_FILTER_GREATER, "GREATER", ICON_NONE, "Greater Than", ""},
8799 {SPREADSHEET_ROW_FILTER_LESS, "LESS", ICON_NONE, "Less Than", ""},
8800 {0, nullptr, 0, nullptr, nullptr},
8801 };
8802
8803 srna = RNA_def_struct(brna, "SpreadsheetRowFilter", nullptr);
8804 RNA_def_struct_sdna(srna, "SpreadsheetRowFilter");
8805 RNA_def_struct_ui_text(srna, "Spreadsheet Row Filter", "");
8806
8807 prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
8809 RNA_def_property_ui_text(prop, "Enabled", "");
8810 RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1);
8812
8813 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
8815 RNA_def_property_ui_text(prop, "Show Expanded", "");
8816 RNA_def_property_ui_icon(prop, ICON_RIGHTARROW, 1);
8818
8819 prop = RNA_def_property(srna, "column_name", PROP_STRING, PROP_NONE);
8820 RNA_def_property_ui_text(prop, "Column Name", "");
8822
8823 prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
8824 RNA_def_property_enum_items(prop, rule_operation_items);
8825 RNA_def_property_ui_text(prop, "Operation", "");
8827
8828 prop = RNA_def_property(srna, "value_float", PROP_FLOAT, PROP_NONE);
8829 RNA_def_property_ui_text(prop, "Float Value", "");
8831
8832 prop = RNA_def_property(srna, "value_float2", PROP_FLOAT, PROP_NONE);
8833 RNA_def_property_array(prop, 2);
8834 RNA_def_property_ui_text(prop, "2D Vector Value", "");
8836
8837 prop = RNA_def_property(srna, "value_float3", PROP_FLOAT, PROP_NONE);
8838 RNA_def_property_array(prop, 3);
8839 RNA_def_property_ui_text(prop, "Vector Value", "");
8841
8842 prop = RNA_def_property(srna, "value_color", PROP_FLOAT, PROP_NONE);
8843 RNA_def_property_array(prop, 4);
8844 RNA_def_property_ui_text(prop, "Color Value", "");
8846
8847 prop = RNA_def_property(srna, "value_string", PROP_STRING, PROP_NONE);
8848 RNA_def_property_ui_text(prop, "Text Value", "");
8850
8851 prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
8852 RNA_def_property_ui_text(prop, "Threshold", "How close float values need to be to be equal");
8853 RNA_def_property_range(prop, 0.0, FLT_MAX);
8855
8856 prop = RNA_def_property(srna, "value_int", PROP_INT, PROP_NONE);
8857 RNA_def_property_int_sdna(prop, nullptr, "value_int");
8858 RNA_def_property_ui_text(prop, "Integer Value", "");
8860
8861 prop = RNA_def_property(srna, "value_int8", PROP_INT, PROP_NONE);
8862 RNA_def_property_int_sdna(prop, nullptr, "value_int");
8863 RNA_def_property_range(prop, -128, 127);
8864 RNA_def_property_ui_text(prop, "8-Bit Integer Value", "");
8866
8867 prop = RNA_def_property(srna, "value_int2", PROP_INT, PROP_NONE);
8868 RNA_def_property_array(prop, 2);
8869 RNA_def_property_ui_text(prop, "2D Vector Value", "");
8871
8872 prop = RNA_def_property(srna, "value_int3", PROP_INT, PROP_NONE);
8873 RNA_def_property_array(prop, 3);
8874 RNA_def_property_ui_text(prop, "3D Vector Value", "");
8876
8877 prop = RNA_def_property(srna, "value_boolean", PROP_BOOLEAN, PROP_NONE);
8879 RNA_def_property_ui_text(prop, "Boolean Value", "");
8881}
8882
8884 {VIEWER_PATH_ELEM_TYPE_ID, "ID", ICON_NONE, "ID", ""},
8885 {VIEWER_PATH_ELEM_TYPE_MODIFIER, "MODIFIER", ICON_NONE, "Modifier", ""},
8886 {VIEWER_PATH_ELEM_TYPE_GROUP_NODE, "GROUP_NODE", ICON_NONE, "Group Node", ""},
8887 {VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE, "SIMULATION_ZONE", ICON_NONE, "Simulation Zone", ""},
8888 {VIEWER_PATH_ELEM_TYPE_VIEWER_NODE, "VIEWER_NODE", ICON_NONE, "Viewer Node", ""},
8889 {VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE, "REPEAT_ZONE", ICON_NONE, "Repeat", ""},
8891 "FOREACH_GEOMETRY_ELEMENT_ZONE",
8892 ICON_NONE,
8893 "For Each Geometry Element",
8894 ""},
8895 {VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE, "EVALUATE_CLOSURE", ICON_NONE, "EvaluateClosure", ""},
8896 {0, nullptr, 0, nullptr, nullptr},
8897};
8898
8900{
8901 StructRNA *srna;
8902 PropertyRNA *prop;
8903
8904 srna = RNA_def_struct(brna, "ViewerPathElem", nullptr);
8905 RNA_def_struct_ui_text(srna, "Viewer Path Element", "Element of a viewer path");
8906 RNA_def_struct_refine_func(srna, "rna_viewer_path_elem_refine");
8907
8908 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
8910 RNA_def_property_ui_text(prop, "Type", "Type of the path element");
8912
8913 prop = RNA_def_property(srna, "ui_name", PROP_STRING, PROP_NONE);
8915 prop, "UI Name", "Name that can be displayed in the UI for this element");
8917}
8918
8920{
8921 StructRNA *srna;
8922 PropertyRNA *prop;
8923
8924 srna = RNA_def_struct(brna, "IDViewerPathElem", "ViewerPathElem");
8925
8926 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8927 RNA_def_property_ui_text(prop, "ID", "");
8928}
8929
8931{
8932 StructRNA *srna;
8933 PropertyRNA *prop;
8934
8935 srna = RNA_def_struct(brna, "ModifierViewerPathElem", "ViewerPathElem");
8936
8937 prop = RNA_def_property(srna, "modifier_uid", PROP_INT, PROP_NONE);
8938 RNA_def_property_ui_text(prop, "Modifier UID", "The persistent UID of the modifier");
8939}
8940
8942{
8943 StructRNA *srna;
8944 PropertyRNA *prop;
8945
8946 srna = RNA_def_struct(brna, "GroupNodeViewerPathElem", "ViewerPathElem");
8947
8948 prop = RNA_def_property(srna, "node_id", PROP_INT, PROP_NONE);
8949 RNA_def_property_ui_text(prop, "Node ID", "");
8950}
8951
8953{
8954 StructRNA *srna;
8955 PropertyRNA *prop;
8956
8957 srna = RNA_def_struct(brna, "SimulationZoneViewerPathElem", "ViewerPathElem");
8958
8959 prop = RNA_def_property(srna, "sim_output_node_id", PROP_INT, PROP_NONE);
8960 RNA_def_property_ui_text(prop, "Simulation Output Node ID", "");
8961}
8962
8964{
8965 StructRNA *srna;
8966 PropertyRNA *prop;
8967
8968 srna = RNA_def_struct(brna, "RepeatZoneViewerPathElem", "ViewerPathElem");
8969
8970 prop = RNA_def_property(srna, "repeat_output_node_id", PROP_INT, PROP_NONE);
8971 RNA_def_property_ui_text(prop, "Repeat Output Node ID", "");
8972}
8973
8975{
8976 StructRNA *srna;
8977 PropertyRNA *prop;
8978
8979 srna = RNA_def_struct(brna, "ForeachGeometryElementZoneViewerPathElem", "ViewerPathElem");
8980
8981 prop = RNA_def_property(srna, "zone_output_node_id", PROP_INT, PROP_NONE);
8982 RNA_def_property_ui_text(prop, "Zone Output Node ID", "");
8983}
8984
8986{
8987 StructRNA *srna;
8988 PropertyRNA *prop;
8989
8990 srna = RNA_def_struct(brna, "EvaluateClosureNodeViewerPathElem", "ViewerPathElem");
8991
8992 prop = RNA_def_property(srna, "evaluate_node_id", PROP_INT, PROP_NONE);
8993 RNA_def_property_ui_text(prop, "Evaluate Node ID", "");
8994
8995 prop = RNA_def_property(srna, "source_output_node_id", PROP_INT, PROP_NONE);
8996 RNA_def_property_ui_text(prop, "Closure Node ID", "");
8997
8998 prop = RNA_def_property(srna, "source_node_tree", PROP_POINTER, PROP_NONE);
8999 RNA_def_property_ui_text(prop, "Source Tree", "");
9000}
9001
9003{
9004 StructRNA *srna;
9005 PropertyRNA *prop;
9006
9007 srna = RNA_def_struct(brna, "ViewerNodeViewerPathElem", "ViewerPathElem");
9008
9009 prop = RNA_def_property(srna, "node_id", PROP_INT, PROP_NONE);
9010 RNA_def_property_ui_text(prop, "Node ID", "");
9011}
9012
9014{
9015 StructRNA *srna;
9016 PropertyRNA *prop;
9017
9027
9028 srna = RNA_def_struct(brna, "ViewerPath", nullptr);
9029 RNA_def_struct_ui_text(srna, "Viewer Path", "Path to data that is viewed");
9030
9031 prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE);
9032 RNA_def_property_struct_type(prop, "ViewerPathElem");
9033 RNA_def_property_ui_text(prop, "Viewer Path", nullptr);
9034}
9035
9037{
9038 PropertyRNA *prop;
9039 StructRNA *srna;
9040
9043
9044 srna = RNA_def_struct(brna, "SpaceSpreadsheet", "Space");
9045 RNA_def_struct_ui_text(srna, "Space Spreadsheet", "Spreadsheet space data");
9046
9048 (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) |
9049 (1 << RGN_TYPE_CHANNELS) | (1 << RGN_TYPE_FOOTER));
9050
9051 prop = RNA_def_property(srna, "is_pinned", PROP_BOOLEAN, PROP_NONE);
9053 RNA_def_property_ui_text(prop, "Is Pinned", "Context path is pinned");
9055
9056 prop = RNA_def_property(srna, "show_internal_attributes", PROP_BOOLEAN, PROP_NONE);
9059 prop,
9060 "Show Internal Attributes",
9061 "Display attributes with names starting with a period that are meant for internal use");
9063
9064 prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
9065 RNA_def_property_boolean_sdna(prop, nullptr, "filter_flag", SPREADSHEET_FILTER_ENABLE);
9066 RNA_def_property_ui_text(prop, "Use Filter", "");
9068
9069 prop = RNA_def_property(srna, "viewer_path", PROP_POINTER, PROP_NONE);
9070 RNA_def_property_pointer_sdna(prop, nullptr, "geometry_id.viewer_path");
9072 prop, "Viewer Path", "Path to the data that is displayed in the spreadsheet");
9073
9074 prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
9077 prop, "Show Only Selected", "Only include rows that correspond to selected elements");
9078 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
9080
9081 prop = RNA_def_property(srna, "geometry_component_type", PROP_ENUM, PROP_NONE);
9082 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.geometry_component_type");
9085 prop, "Geometry Component", "Part of the geometry to display data from");
9088 "rna_SpaceSpreadsheet_geometry_component_type_update");
9089
9090 prop = RNA_def_property(srna, "attribute_domain", PROP_ENUM, PROP_NONE);
9091 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.attribute_domain");
9094 prop, nullptr, nullptr, "rna_SpaceSpreadsheet_attribute_domain_itemf");
9095 RNA_def_property_ui_text(prop, "Attribute Domain", "Attribute domain to display");
9097
9098 prop = RNA_def_property(srna, "object_eval_state", PROP_ENUM, PROP_NONE);
9099 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.object_eval_state");
9101 RNA_def_property_ui_text(prop, "Object Evaluation State", "");
9103
9104 prop = RNA_def_property(srna, "tables", PROP_COLLECTION, PROP_NONE);
9105 RNA_def_property_struct_type(prop, "SpreadsheetTable");
9106 RNA_def_property_srna(prop, "SpreadsheetTables");
9108 "rna_iterator_SpaceSpreadsheet_tables_begin",
9109 "rna_iterator_array_next",
9110 "rna_iterator_array_end",
9111 "rna_iterator_array_dereference_get",
9112 "rna_iterator_SpaceSpreadsheet_tables_length",
9113 nullptr,
9114 nullptr,
9115 nullptr);
9117 prop, "Tables", "Persistent data for the tables shown in this spreadsheet editor");
9118
9120
9121 prop = RNA_def_property(srna, "row_filters", PROP_COLLECTION, PROP_NONE);
9122 RNA_def_property_collection_sdna(prop, nullptr, "row_filters", nullptr);
9123 RNA_def_property_struct_type(prop, "SpreadsheetRowFilter");
9124 RNA_def_property_ui_text(prop, "Row Filters", "Filters to remove rows from the displayed data");
9126}
9127
9157
9158#endif
Main runtime representation of an asset.
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
Scene * CTX_data_sequencer_scene(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
#define G_MAIN
RenderPass * BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
void BKE_image_init_imageuser(Image *ima, ImageUser *iuser)
void BKE_image_multiview_index(const Image *ima, ImageUser *iuser)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
bool BKE_view_layer_has_valid_aov(ViewLayer *view_layer)
void BKE_layer_collection_local_sync(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
void id_us_ensure_real(ID *id)
Definition lib_id.cc:313
bool BKE_id_is_in_global_main(ID *id)
Definition lib_id.cc:2500
#define MOVIECLIP_PREVIEW_GRAYSCALE
#define MOVIECLIP_DISABLE_BLUE
#define MOVIECLIP_DISABLE_RED
#define MOVIECLIP_DISABLE_GREEN
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ RPT_ERROR
Definition BKE_report.hh:39
bool BKE_scene_uses_blender_workbench(const Scene *scene)
Definition scene.cc:2829
bool BKE_scene_uses_blender_eevee(const Scene *scene)
Definition scene.cc:2824
ARegion ARegion ScrArea * BKE_screen_find_area_from_space(const bScreen *screen, const SpaceLink *sl) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
ARegion ARegion ScrArea std::optional< std::string > BKE_screen_path_from_screen_to_space(const PointerRNA *ptr)
Definition screen.cc:924
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:846
@ STUDIOLIGHT_INTERNAL
@ STUDIOLIGHT_TYPE_MATCAP
@ STUDIOLIGHT_TYPE_WORLD
@ STUDIOLIGHT_TYPE_STUDIO
@ STUDIOLIGHT_EXTERNAL_FILE
struct StudioLight * BKE_studiolight_find(const char *name, int flag)
struct StudioLight * BKE_studiolight_findindex(int index, int flag)
struct ListBase * BKE_studiolight_listbase(void)
#define BLI_assert_unreachable()
Definition BLI_assert.h:93
#define BLI_assert(a)
Definition BLI_assert.h:46
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:53
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:534
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
int BLI_findstringindex(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:780
#define M_PI
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void invert_qt_qt(float q1[4], const float q2[4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void negate_v3_v3(float r[3], const float a[3])
#define FILE_MAXFILE
bool BLI_path_extension_glob_validate(char *ext_fnmatch) ATTR_NONNULL(1)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.h:198
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:194
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.h:202
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition rct.cc:657
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:604
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:693
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
int BLI_str_utf8_offset_from_index(const char *str, size_t str_len, int index_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_utf8_offset_to_index(const char *str, size_t str_len, int offset_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
unsigned int uint
#define UNUSED_VARS(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define ELEM(...)
#define STREQ(a, b)
bUUID BLI_uuid_nil()
Definition uuid.cc:73
bool BLI_uuid_parse_string(bUUID *uuid, const char *buffer) ATTR_NONNULL()
Definition uuid.cc:112
void BLI_uuid_format(char *buffer, bUUID uuid) ATTR_NONNULL()
Definition uuid.cc:89
#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
void DEG_id_tag_update(ID *id, unsigned int flags)
#define FILTER_ID_GD_LEGACY
Definition DNA_ID.h:1202
#define FILTER_ID_OB
Definition DNA_ID.h:1214
#define FILTER_ID_MC
Definition DNA_ID.h:1210
#define FILTER_ID_SPK
Definition DNA_ID.h:1218
#define FILTER_ID_CF
Definition DNA_ID.h:1225
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1104
#define FILTER_ID_AC
Definition DNA_ID.h:1197
#define FILTER_ID_MA
Definition DNA_ID.h:1208
#define FILTER_ID_CA
Definition DNA_ID.h:1200
#define FILTER_ID_SO
Definition DNA_ID.h:1219
#define FILTER_ID_PT
Definition DNA_ID.h:1229
#define FILTER_ID_CU_LEGACY
Definition DNA_ID.h:1201
#define FILTER_ID_BR
Definition DNA_ID.h:1199
#define FILTER_ID_WS
Definition DNA_ID.h:1226
#define FILTER_ID_MB
Definition DNA_ID.h:1209
#define FILTER_ID_VF
Definition DNA_ID.h:1222
#define FILTER_ID_LA
Definition DNA_ID.h:1205
#define FILTER_ID_GR
Definition DNA_ID.h:1203
#define FILTER_ID_TE
Definition DNA_ID.h:1220
#define FILTER_ID_LT
Definition DNA_ID.h:1207
#define FILTER_ID_LS
Definition DNA_ID.h:1206
#define FILTER_ID_PA
Definition DNA_ID.h:1224
#define FILTER_ID_CV
Definition DNA_ID.h:1228
#define FILTER_ID_ME
Definition DNA_ID.h:1211
#define FILTER_ID_AR
Definition DNA_ID.h:1198
#define FILTER_ID_MSK
Definition DNA_ID.h:1212
#define INDEX_ID_MAX
Definition DNA_ID.h:1360
#define FILTER_ID_PC
Definition DNA_ID.h:1216
#define FILTER_ID_PAL
Definition DNA_ID.h:1215
#define FILTER_ID_IM
Definition DNA_ID.h:1204
#define FILTER_ID_SCE
Definition DNA_ID.h:1217
#define FILTER_ID_LP
Definition DNA_ID.h:1227
#define FILTER_ID_VO
Definition DNA_ID.h:1230
#define FILTER_ID_WO
Definition DNA_ID.h:1223
#define FILTER_ID_NT
Definition DNA_ID.h:1213
#define FILTER_ID_TXT
Definition DNA_ID.h:1221
@ ID_TE
@ ID_LA
@ ID_SCE
@ ID_WO
@ ID_MA
@ ID_SCR
@ ID_OB
@ ADS_SHOW_SCENE_STRIP_FRAME_RANGE
@ ADS_OVERLAY_SHOW_OVERLAYS
@ TIME_CACHE_PARTICLES
@ TIME_CACHE_RIGIDBODY
@ TIME_CACHE_DYNAMICPAINT
@ TIME_CACHE_SOFTBODY
@ TIME_CACHE_DISPLAY
@ TIME_CACHE_SIMULATION_NODES
@ TIME_CACHE_CLOTH
@ TIME_CACHE_SMOKE
@ SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC
@ SACTION_NOTRANSKEYCULL
@ SACTION_POSEMARKERS_SHOW
@ SACTION_SHOW_INTERPOLATION
@ SACTION_SHOW_EXTREMES
@ SACTION_SHOW_MARKERS
@ SACTION_SLIDERS
@ SACTION_MARKERS_MOVE
@ SACTION_NOREALTIMEUPDATES
@ SACTION_DRAWTIME
#define MAX_NAME
Definition DNA_defs.h:50
@ IMA_SHOW_SEQUENCER_SCENE
@ IMA_SHOW_STEREO
eViewLayerEEVEEPassType
@ EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL
@ EEVEE_RENDER_PASS_AO
@ EEVEE_RENDER_PASS_NORMAL
@ EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT
@ EEVEE_RENDER_PASS_DIFFUSE_LIGHT
@ EEVEE_RENDER_PASS_VOLUME_LIGHT
@ EEVEE_RENDER_PASS_AOV
@ EEVEE_RENDER_PASS_DIFFUSE_COLOR
@ EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET
@ EEVEE_RENDER_PASS_ENVIRONMENT
@ EEVEE_RENDER_PASS_COMBINED
@ EEVEE_RENDER_PASS_SPECULAR_LIGHT
@ EEVEE_RENDER_PASS_SPECULAR_COLOR
@ EEVEE_RENDER_PASS_EMIT
@ EEVEE_RENDER_PASS_MIST
@ EEVEE_RENDER_PASS_TRANSPARENT
@ EEVEE_RENDER_PASS_SHADOW
@ EEVEE_RENDER_PASS_POSITION
@ AOV_CONFLICT
@ MASK_OVERLAY_COMBINED
@ MASK_OVERLAY_ALPHACHANNEL
@ MASK_DRAWFLAG_SPLINE
@ MASK_DRAWFLAG_OVERLAY
@ GEO_NODE_ASSET_MODIFIER
@ GEO_NODE_ASSET_TOOL
@ NTREE_GEOMETRY
@ NTREE_COMPOSIT
@ OB_WIRE
@ OB_TEXTURE
@ OB_SOLID
@ OB_RENDER
@ OB_MATERIAL
Object is a sort of wrapper for general info.
@ OB_EMPTY_CONE
@ OB_SINGLE_ARROW
@ OB_PLAINAXES
@ OB_ARROWS
@ OB_CIRCLE
@ OB_CUBE
@ OB_EMPTY_SPHERE
@ OB_POINTCLOUD
@ STEREO_LEFT_ID
@ STEREO_RIGHT_ID
@ SCE_VIEWS_FORMAT_MULTIVIEW
@ AREA_FLAG_ACTIVE_TOOL_UPDATE
@ RGN_ALIGN_NONE
@ RGN_ALIGN_QSPLIT
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_TOOL_HEADER
@ RGN_TYPE_UI
@ RGN_TYPE_ASSET_SHELF_HEADER
@ RGN_TYPE_WINDOW
@ RGN_TYPE_ASSET_SHELF
@ RGN_TYPE_HUD
@ RGN_TYPE_PREVIEW
@ RGN_TYPE_FOOTER
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_TYPE_TOOL_PROPS
@ RGN_FLAG_HIDDEN
@ RGN_FLAG_POLL_FAILED
@ RGN_FLAG_HIDDEN_BY_USER
@ STRIP_TYPE_MOVIE
@ SN_OVERLAY_SHOW_PATH
@ SN_OVERLAY_SHOW_PREVIEWS
@ SN_OVERLAY_SHOW_WIRE_COLORS
@ SN_OVERLAY_SHOW_REROUTE_AUTO_LABELS
@ SN_OVERLAY_SHOW_TIMINGS
@ SN_OVERLAY_SHOW_OVERLAYS
@ SN_OVERLAY_SHOW_NAMED_ATTRIBUTES
@ SI_DRAW_TILE
@ SI_SHOW_ZBUF
@ SI_NO_DRAW_UV_GUIDE
@ SI_GRID_OVER_IMAGE
@ SI_SHOW_R
@ SI_DRAW_STRETCH
@ SI_SHOW_GPENCIL
@ SI_DRAW_METADATA
@ SI_CLIP_UV
@ SI_USE_ALPHA
@ SI_COORDFLOATS
@ SI_SHOW_G
@ SI_SHOW_B
@ SI_SHOW_ALPHA
@ SI_LIVE_UNWRAP
@ SI_NO_DRAWFACES
@ SI_DRAWSHADOW
@ SNODE_PIN
@ SNODE_USE_ALPHA
@ SNODE_SHOW_B
@ SNODE_SHOW_G
@ SNODE_SHOW_R
@ SNODE_BACKDRAW
@ SNODE_SHOW_ALPHA
@ SNODE_SHOW_GPENCIL
@ SI_GIZMO_HIDE
@ SI_GIZMO_HIDE_NAVIGATE
@ FILE_SORT_ASSET_CATALOG
@ FILE_SORT_ALPHA
@ FILE_SORT_TIME
@ FILE_SORT_EXTENSION
@ FILE_SORT_SIZE
@ SI_OVERLAY_SHOW_OVERLAYS
@ SI_OVERLAY_DRAW_TEXT_INFO
@ SI_OVERLAY_SHOW_GRID_BACKGROUND
@ SI_OVERLAY_DRAW_RENDER_REGION
@ FILE_LOADLIB
eSpaceSeq_Proxy_RenderSize
@ SEQ_RENDER_SIZE_PROXY_25
@ SEQ_RENDER_SIZE_PROXY_75
@ SEQ_RENDER_SIZE_PROXY_50
@ SEQ_RENDER_SIZE_SCENE
@ SEQ_RENDER_SIZE_PROXY_100
@ SEQ_RENDER_SIZE_NONE
@ FILE_TYPE_BLENDER
@ FILE_TYPE_TEXT
@ FILE_TYPE_PYSCRIPT
@ FILE_TYPE_BLENDER_BACKUP
@ FILE_TYPE_VOLUME
@ FILE_TYPE_MOVIE
@ FILE_TYPE_SOUND
@ FILE_TYPE_FOLDER
@ FILE_TYPE_FTFONT
@ FILE_TYPE_BLENDERLIB
@ FILE_TYPE_IMAGE
eSpreadsheetTableIDType
@ SPREADSHEET_TABLE_ID_TYPE_GEOMETRY
eSpace_Type
@ SPACE_TEXT
@ SPACE_CLIP
@ SPACE_ACTION
@ SPACE_CONSOLE
@ SPACE_OUTLINER
@ SPACE_STATUSBAR
@ SPACE_TOPBAR
@ SPACE_NODE
@ SPACE_SPREADSHEET
@ SPACE_USERPREF
@ SPACE_FILE
@ SPACE_PROPERTIES
@ SPACE_NLA
@ SPACE_SEQ
@ SPACE_EMPTY
@ SPACE_SCRIPT
@ SPACE_IMAGE
@ SPACE_GRAPH
@ SPACE_VIEW3D
@ SPACE_INFO
@ SEQ_TIMELINE_SHOW_FCURVES
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_THUMBNAILS
@ SEQ_TIMELINE_SHOW_STRIP_RETIMING
@ SEQ_TIMELINE_SHOW_STRIP_OFFSETS
@ SEQ_TIMELINE_ALL_WAVEFORMS
@ SEQ_TIMELINE_WAVEFORMS_HALF
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SEQ_TIMELINE_SHOW_GRID
@ SEQ_TIMELINE_NO_WAVEFORMS
@ SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG
SpaceNodeGeometryNodesType
@ SNODE_GEOMETRY_MODIFIER
@ SNODE_GEOMETRY_TOOL
@ SI_UVDT_BLACK
@ SI_UVDT_DASH
@ SI_UVDT_WHITE
@ SI_UVDT_OUTLINE
@ SC_VIEW_GRAPH
@ SC_VIEW_CLIP
@ SC_VIEW_DOPESHEET
@ FILE_DETAILS_DATETIME
@ FILE_DETAILS_SIZE
@ SO_FIND_COMPLETE
@ SO_FIND_CASE_SENSITIVE
@ SN_OVERLAY_PREVIEW_3D
@ SN_OVERLAY_PREVIEW_FLAT
@ SEQ_VIEW_SEQUENCE_PREVIEW
@ SEQ_VIEW_SEQUENCE
@ SEQ_VIEW_PREVIEW
@ SI_UVDT_STRETCH_AREA
@ SI_UVDT_STRETCH_ANGLE
@ SIPO_MODE_DRIVERS
@ SIPO_MODE_ANIMATION
eFileAssetImportMethod
@ FILE_ASSET_IMPORT_APPEND_REUSE
@ FILE_ASSET_IMPORT_PACK
@ FILE_ASSET_IMPORT_APPEND
@ FILE_ASSET_IMPORT_LINK
@ FILE_ASSET_IMPORT_FOLLOW_PREFS
@ SIPO_DRAWTIME
@ SIPO_AUTOLOCK_AXIS
@ SIPO_NODRAWCURSOR
@ SIPO_SELVHANDLESONLY
@ SIPO_NORMALIZE_FREEZE
@ SIPO_NO_DRAW_EXTRAPOLATION
@ SIPO_NOREALTIMEUPDATES
@ SIPO_NOTRANSKEYCULL
@ SIPO_SHOW_MARKERS
@ SIPO_NOHANDLES
@ SIPO_NORMALIZE
@ SIPO_SLIDERS
@ CONSOLE_LINE_INFO
@ CONSOLE_LINE_ERROR
@ CONSOLE_LINE_INPUT
@ CONSOLE_LINE_OUTPUT
@ INFO_RPT_INFO
@ INFO_RPT_WARN
@ INFO_RPT_ERR
@ INFO_RPT_OP
@ INFO_RPT_DEBUG
@ FILE_SHOW_ASSETS_ALL_CATALOGS
@ FILE_SHOW_ASSETS_FROM_CATALOG
@ SC_SHOW_CURSOR
@ SC_SHOW_OVERLAYS
@ FILE_BROWSE_MODE_ASSETS
@ FILE_BROWSE_MODE_FILES
@ SO_LIB_OVERRIDE_VIEW_HIERARCHIES
@ SO_LIB_OVERRIDE_VIEW_PROPERTIES
@ SPREADSHEET_ROW_FILTER_BOOL_VALUE
@ SPREADSHEET_ROW_FILTER_UI_EXPAND
@ SPREADSHEET_ROW_FILTER_ENABLED
@ SO_RESTRICT_HIDE
@ SO_RESTRICT_RENDER
@ SO_RESTRICT_INDIRECT_ONLY
@ SO_RESTRICT_VIEWPORT
@ SO_RESTRICT_ENABLE
@ SO_RESTRICT_HOLDOUT
@ SO_RESTRICT_SELECT
@ SC_MODE_TRACKING
@ SC_MODE_MASKEDIT
@ SO_FILTER_NO_OB_MESH
@ SO_FILTER_SHOW_SYSTEM_OVERRIDES
@ SO_FILTER_NO_OB_CAMERA
@ SO_FILTER_NO_CHILDREN
@ SO_FILTER_NO_OB_CONTENT
@ SO_FILTER_NO_OB_GREASE_PENCIL
@ SO_FILTER_NO_OB_LAMP
@ SO_FILTER_ID_TYPE
@ SO_FILTER_OB_STATE_INVERSE
@ SO_FILTER_NO_OBJECT
@ SO_FILTER_NO_VIEW_LAYERS
@ SO_FILTER_NO_OB_OTHERS
@ SO_FILTER_NO_OB_EMPTY
@ SO_FILTER_NO_COLLECTION
@ SO_FILTER_NO_OB_ARMATURE
@ SPREADSHEET_FILTER_SELECTED_ONLY
@ SPREADSHEET_FILTER_ENABLE
@ SEQ_PREVIEW_SHOW_METADATA
@ SEQ_PREVIEW_SHOW_GPENCIL
@ SEQ_PREVIEW_SHOW_SAFE_MARGINS
@ SEQ_PREVIEW_SHOW_OUTLINE_SELECTED
@ SEQ_PREVIEW_SHOW_SAFE_CENTER
@ SEQ_PREVIEW_SHOW_2D_CURSOR
@ SNLA_DRAWTIME
@ SNLA_NOSTRIPCURVES
@ SNLA_NOLOCALMARKERS
@ SNLA_SHOW_MARKERS
@ SNLA_NOREALTIMEUPDATES
@ SO_SYNC_SELECT
@ SO_MODE_COLUMN
@ SO_SKIP_SORT_ALPHA
@ SEQ_DRAW_TRANSFORM_PREVIEW
@ SO_FILTER_OB_SELECTABLE
@ SO_FILTER_OB_SELECTED
@ SO_FILTER_OB_VISIBLE
@ SO_FILTER_OB_ALL
@ SO_FILTER_OB_ACTIVE
@ SC_HIDE_DISABLED
@ SC_SHOW_SECONDS
@ SC_SHOW_MARKER_SEARCH
@ SC_SHOW_GRAPH_HIDDEN
@ SC_SHOW_NAMES
@ SC_SHOW_TINY_MARKER
@ SC_SHOW_GRAPH_FRAMES
@ SC_LOCK_SELECTION
@ SC_SHOW_METADATA
@ SC_SHOW_ANNOTATION
@ SC_SHOW_GRAPH_SEL_ONLY
@ SC_SHOW_GRID
@ SC_SHOW_STABLE
@ SC_SHOW_GRAPH_TRACKS_MOTION
@ SC_MUTE_FOOTAGE
@ SC_SHOW_BUNDLES
@ SC_LOCK_TIMECURSOR
@ SC_SHOW_MARKER_PATTERN
@ SC_MANUAL_CALIBRATION
@ SC_SHOW_TRACK_PATH
@ SC_SHOW_GRAPH_TRACKS_ERROR
@ SC_SHOW_FILTERS
@ SB_PIN_CONTEXT
@ FILE_VERTICALDISPLAY
@ FILE_IMGDISPLAY
@ FILE_HORIZONTALDISPLAY
@ SNODE_INSERTOFS_DIR_RIGHT
@ SNODE_INSERTOFS_DIR_LEFT
@ SI_PIXEL_ROUND_CENTER
@ SI_PIXEL_ROUND_CORNER
@ SI_PIXEL_ROUND_DISABLED
@ ST_FIND_WRAP
@ ST_SHOW_MARGIN
@ ST_MATCH_CASE
@ ST_FIND_ALL
@ SEQ_OVERLAY_FRAME_TYPE_RECT
@ SEQ_OVERLAY_FRAME_TYPE_CURRENT
@ SEQ_OVERLAY_FRAME_TYPE_REFERENCE
@ SPREADSHEET_OBJECT_EVAL_STATE_VIEWER_NODE
@ SPREADSHEET_OBJECT_EVAL_STATE_EVALUATED
@ SPREADSHEET_OBJECT_EVAL_STATE_ORIGINAL
@ SEQ_CACHE_SHOW_RAW
@ SEQ_CACHE_SHOW
@ SEQ_CACHE_SHOW_FINAL_OUT
@ FILE_FILTER
@ FILE_SORT_INVERT
@ FILE_DIRSEL_ONLY
@ FILE_ASSETS_ONLY
@ FILE_HIDE_DOT
@ SEQ_DRAW_IMG_VECTORSCOPE
@ SEQ_DRAW_IMG_RGBPARADE
@ SEQ_DRAW_IMG_HISTOGRAM
@ SEQ_DRAW_IMG_IMBUF
@ SEQ_DRAW_IMG_WAVEFORM
@ SNODE_GIZMO_HIDE_ACTIVE_NODE
@ SNODE_GIZMO_HIDE
@ SEQ_DRAWFRAMES
@ SEQ_SHOW_MARKERS
@ SEQ_USE_ALPHA
@ SEQ_MARKER_TRANS
@ SEQ_USE_PROXIES
@ SEQ_ZOOM_TO_FIT
@ SEQ_CLAMP_VIEW
@ SEQ_SHOW_OVERLAY
@ SC_GPENCIL_SRC_CLIP
@ SC_GPENCIL_SRC_TRACK
@ SPREADSHEET_ROW_FILTER_GREATER
@ SPREADSHEET_ROW_FILTER_EQUAL
@ SPREADSHEET_ROW_FILTER_LESS
@ SCLIP_GIZMO_HIDE
@ SCLIP_GIZMO_HIDE_NAVIGATE
@ SPREADSHEET_VALUE_TYPE_FLOAT
@ SPREADSHEET_VALUE_TYPE_BOOL
@ SPREADSHEET_VALUE_TYPE_INT32
@ SPREADSHEET_VALUE_TYPE_INSTANCES
@ PROPERTIES_SYNC_NEVER
@ PROPERTIES_SYNC_ALWAYS
@ PROPERTIES_SYNC_AUTO
@ SI_GRID_SHAPE_FIXED
@ SI_GRID_SHAPE_PIXEL
@ SI_GRID_SHAPE_DYNAMIC
@ SI_MODE_PAINT
@ FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_LINK
@ FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_APPEND
@ SO_OVERRIDES_LIBRARY
@ SO_SEQUENCE
@ SO_DATA_API
@ SO_LIBRARIES
@ SO_VIEW_LAYER
@ SO_SCENES
@ SO_ID_ORPHANS
@ SNODE_TEX_BRUSH
@ SNODE_TEX_WORLD
@ SNODE_TEX_LINESTYLE
@ SNODE_SHADER_WORLD
@ SNODE_SHADER_LINESTYLE
@ SNODE_SHADER_OBJECT
@ SPREADSHEET_FLAG_SHOW_INTERNAL_ATTRIBUTES
@ SPREADSHEET_FLAG_PINNED
@ SNODE_COMPOSITOR_SCENE
@ SNODE_COMPOSITOR_SEQUENCER
eSpaceButtons_Context
@ BCONTEXT_STRIP
@ BCONTEXT_CONSTRAINT
@ BCONTEXT_COLLECTION
@ BCONTEXT_OUTPUT
@ BCONTEXT_VIEW_LAYER
@ BCONTEXT_MATERIAL
@ BCONTEXT_TOT
@ BCONTEXT_SHADERFX
@ BCONTEXT_MODIFIER
@ BCONTEXT_BONE
@ BCONTEXT_DATA
@ BCONTEXT_OBJECT
@ BCONTEXT_BONE_CONSTRAINT
@ BCONTEXT_PHYSICS
@ BCONTEXT_SCENE
@ BCONTEXT_WORLD
@ BCONTEXT_RENDER
@ BCONTEXT_STRIP_MODIFIER
@ BCONTEXT_TEXTURE
@ BCONTEXT_TOOL
@ BCONTEXT_PARTICLE
@ SEQ_GIZMO_HIDE
@ SEQ_GIZMO_HIDE_NAVIGATE
@ SEQ_GIZMO_HIDE_CONTEXT
@ SEQ_GIZMO_HIDE_TOOL
#define UI_SCALE_FAC
@ USER_REDUCE_MOTION
@ USER_SEQ_PROXY_SETUP_AUTOMATIC
#define UUID_STRING_SIZE
@ V2D_VIEWSYNC_SCREEN_TIME
@ V2D_ALIGN_NO_NEG_Y
@ V3D_SHADING_BACKGROUND_VIEWPORT
@ V3D_SHADING_BACKGROUND_WORLD
@ V3D_SHADING_BACKGROUND_THEME
@ V3D_SHADING_TEXTURE_COLOR
@ V3D_SHADING_VERTEX_COLOR
@ V3D_SHADING_MATERIAL_COLOR
@ V3D_SHADING_OBJECT_COLOR
@ V3D_SHADING_RANDOM_COLOR
@ V3D_SHADING_SINGLE_COLOR
@ V3D_LIGHTING_FLAT
@ V3D_LIGHTING_STUDIO
@ V3D_LIGHTING_MATCAP
@ V3D_SHADING_USE_COMPOSITOR_CAMERA
@ V3D_SHADING_USE_COMPOSITOR_DISABLED
@ V3D_SHADING_USE_COMPOSITOR_ALWAYS
@ V3D_SHOW_VIEWER
@ V3D_SHOW_CAMERA_PASSEPARTOUT
@ V3D_SHOW_BUNDLENAME
@ V3D_HIDE_OVERLAYS
@ V3D_SHOW_ANNOTATION
@ V3D_SHOW_CAMERAPATH
@ V3D_SHOW_RECONSTRUCTION
@ V3D_RENDER_BORDER
@ V3D_LOCK_CAMERA
@ V3D_SHOW_CAMERA_GUIDES
#define RV3D_VIEW_IS_AXIS(view)
@ V3D_SHADING_SHADOW
@ V3D_SHADING_SCENE_WORLD_RENDER
@ V3D_SHADING_SPECULAR_HIGHLIGHT
@ V3D_SHADING_DEPTH_OF_FIELD
@ V3D_SHADING_WORLD_ORIENTATION
@ V3D_SHADING_SCENE_WORLD
@ V3D_SHADING_OBJECT_OUTLINE
@ V3D_SHADING_SCENE_LIGHTS
@ V3D_SHADING_CAVITY
@ V3D_SHADING_SCENE_LIGHTS_RENDER
@ V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION
@ V3D_SHADING_MATCAP_FLIP_X
@ V3D_SHADING_XRAY_WIREFRAME
@ V3D_SHADING_XRAY
@ V3D_SHADING_BACKFACE_CULLING
@ V3D_GIZMO_HIDE_TOOL
@ V3D_GIZMO_HIDE_MODIFIER
@ V3D_GIZMO_HIDE
@ V3D_GIZMO_HIDE_NAVIGATE
@ V3D_GIZMO_HIDE_CONTEXT
@ RV3D_VIEW_USER
#define RV3D_CAMZOOM_MAX
@ V3D_GP_SHOW_MATERIAL_NAME
@ V3D_GP_FADE_OBJECTS
@ V3D_GP_SHOW_MULTIEDIT_LINES
@ V3D_GP_ONION_SKIN_ACTIVE_OBJECT
@ V3D_GP_SHOW_GRID_XRAY
@ V3D_GP_SHOW_STROKE_DIRECTION
@ V3D_GP_FADE_NOACTIVE_GPENCIL
@ V3D_GP_SHOW_EDIT_LINES
@ V3D_GP_SHOW_GRID
@ V3D_GP_FADE_NOACTIVE_LAYERS
@ V3D_GP_SHOW_ONION_SKIN
@ V3D_SHADING_CAVITY_BOTH
@ V3D_SHADING_CAVITY_SSAO
@ V3D_SHADING_CAVITY_CURVATURE
@ V3D_DEBUG_FREEZE_CULLING
@ RV3D_CLIPPING
@ V3D_GIZMO_SHOW_OBJECT_ROTATE
@ V3D_GIZMO_SHOW_OBJECT_SCALE
@ V3D_GIZMO_SHOW_OBJECT_TRANSLATE
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CURSOR
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_LOCAL_COLLECTIONS
@ V3D_DRAW_CENTERS
@ V3D_SELECT_OUTLINE
@ V3D_XR_SESSION_MIRROR
@ V3D_HIDE_HELPLINES
@ V3D_OVERLAY_EDIT_VERT_NORMALS
@ V3D_OVERLAY_EDIT_INDICES
@ V3D_OVERLAY_EDIT_FREESTYLE_FACE
@ V3D_OVERLAY_EDIT_RETOPOLOGY
@ V3D_OVERLAY_EDIT_LOOP_NORMALS
@ V3D_OVERLAY_EDIT_CU_NORMALS
@ V3D_OVERLAY_EDIT_FACE_NORMALS
@ V3D_OVERLAY_EDIT_CREASES
@ V3D_OVERLAY_EDIT_FREESTYLE_EDGE
@ V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS
@ V3D_OVERLAY_EDIT_FACES
@ V3D_OVERLAY_EDIT_FACE_AREA
@ V3D_OVERLAY_EDIT_EDGE_ANG
@ V3D_OVERLAY_EDIT_FACE_DOT
@ V3D_OVERLAY_EDIT_FACE_ANG
@ V3D_OVERLAY_EDIT_SEAMS
@ V3D_OVERLAY_EDIT_STATVIS
@ V3D_OVERLAY_EDIT_BWEIGHTS
@ V3D_OVERLAY_EDIT_WEIGHT
@ V3D_OVERLAY_EDIT_SHARP
@ V3D_OVERLAY_EDIT_EDGE_LEN
@ V3D_OVERLAY_WPAINT_CONTOURS
@ V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD
@ V3D_GIZMO_SHOW_EMPTY_IMAGE
@ RV3D_CAMOB
@ RV3D_PERSP
@ RV3D_ORTHO
@ V3D_SHOW_FLOOR
@ V3D_SHOW_Z
@ V3D_SHOW_X
@ V3D_SHOW_Y
@ V3D_SHOW_ORTHO_GRID
@ V3D_GIZMO_SHOW_CAMERA_DOF_DIST
@ V3D_GIZMO_SHOW_CAMERA_LENS
#define RV3D_CAMZOOM_MIN
@ V3D_OVERLAY_PAINT_WIRE
@ CURVE_HANDLE_NONE
@ CURVE_HANDLE_ALL
@ CURVE_HANDLE_SELECTED
@ RV3D_LOCK_ROTATION
@ RV3D_BOXVIEW
@ RV3D_BOXCLIP
@ V3D_OVERLAY_SCULPT_SHOW_FACE_SETS
@ V3D_OVERLAY_LOOK_DEV
@ V3D_OVERLAY_FACE_ORIENTATION
@ V3D_OVERLAY_VIEWER_ATTRIBUTE
@ V3D_OVERLAY_HIDE_OBJECT_ORIGINS
@ V3D_OVERLAY_HIDE_BONES
@ V3D_OVERLAY_HIDE_MOTION_PATHS
@ V3D_OVERLAY_WIREFRAMES
@ V3D_OVERLAY_SHOW_LIGHT_COLORS
@ V3D_OVERLAY_SCULPT_SHOW_MASK
@ V3D_OVERLAY_HIDE_OBJECT_XTRAS
@ V3D_OVERLAY_ONION_SKINS
@ V3D_OVERLAY_FADE_INACTIVE
@ V3D_OVERLAY_SCULPT_CURVES_CAGE
@ V3D_OVERLAY_VIEWER_ATTRIBUTE_TEXT
@ V3D_OVERLAY_HIDE_CURSOR
@ V3D_OVERLAY_HIDE_TEXT
@ V3D_OVERLAY_STATS
@ V3D_OVERLAY_BONE_SELECT
@ V3D_S3D_DISPCAMERAS
@ V3D_S3D_DISPPLANE
@ V3D_S3D_DISPVOLUME
@ V3D_GIZMO_SHOW_LIGHT_LOOK_AT
@ V3D_GIZMO_SHOW_LIGHT_SIZE
@ VIEWER_PATH_ELEM_TYPE_GROUP_NODE
@ VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE
@ VIEWER_PATH_ELEM_TYPE_FOREACH_GEOMETRY_ELEMENT_ZONE
@ VIEWER_PATH_ELEM_TYPE_VIEWER_NODE
@ VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE
@ VIEWER_PATH_ELEM_TYPE_MODIFIER
@ VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE
@ VIEWER_PATH_ELEM_TYPE_ID
void ED_drivers_editor_init(bContext *C, ScrArea *area)
#define ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS
int ED_buttons_search_string_length(SpaceProperties *sbuts)
void ED_buttons_search_string_set(SpaceProperties *sbuts, const char *value)
blender::Vector< eSpaceButtons_Context > ED_buttons_tabs_list(const SpaceProperties *sbuts, bool apply_filter=true)
const char * ED_buttons_search_string_get(SpaceProperties *sbuts)
bool ED_buttons_tab_has_search_result(SpaceProperties *sbuts, int index)
void ED_space_clip_set_clip(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *clip)
void ED_space_clip_set_mask(bContext *C, SpaceClip *sc, Mask *mask)
FSMenuEntry * ED_fsmenu_get_entry(FSMenu *fsmenu, FSMenuCategory category, int idx)
Definition fsmenu.cc:111
int ED_file_icon(const FileDirEntry *file)
Definition filelist.cc:397
int ED_fsmenu_get_nentries(FSMenu *fsmenu, FSMenuCategory category)
Definition fsmenu.cc:99
FSMenu * ED_fsmenu_get()
Definition fsmenu.cc:46
void ED_fsmenu_entry_set_name(FSMenuEntry *fsentry, const char *name)
Definition fsmenu.cc:189
FSMenuCategory
@ FS_CATEGORY_RECENT
@ FS_CATEGORY_BOOKMARKS
@ FS_CATEGORY_SYSTEM_BOOKMARKS
@ FS_CATEGORY_OTHER
@ FS_CATEGORY_SYSTEM
char * ED_fsmenu_entry_get_name(FSMenuEntry *fsentry)
Definition fsmenu.cc:175
FileSelectParams * ED_fileselect_get_active_params(const SpaceFile *sfile)
Definition filesel.cc:379
void ED_file_change_dir_ex(bContext *C, ScrArea *area)
Definition filesel.cc:1149
char * ED_fsmenu_entry_get_path(FSMenuEntry *fsentry)
Definition fsmenu.cc:124
void ED_fsmenu_entry_set_icon(FSMenuEntry *fsentry, int icon)
Definition fsmenu.cc:153
int ED_fsmenu_entry_get_icon(FSMenuEntry *fsentry)
Definition fsmenu.cc:148
FileSelectParams * ED_fileselect_get_file_params(const SpaceFile *sfile)
Definition filesel.cc:397
FSMenuEntry * ED_fsmenu_get_category(FSMenu *fsmenu, FSMenuCategory category)
Definition fsmenu.cc:54
FileAssetSelectParams * ED_fileselect_get_asset_params(const SpaceFile *sfile)
Definition filesel.cc:402
void ED_fsmenu_entry_set_path(FSMenuEntry *fsentry, const char *path)
Definition fsmenu.cc:129
void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
int ED_space_image_get_display_channel_mask(ImBuf *ibuf)
ImBuf * ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile)
bool ED_space_image_show_paint(const SpaceImage *sima)
bool ED_space_image_check_show_maskedit(SpaceImage *sima, Object *obedit)
bool ED_space_image_show_render(const SpaceImage *sima)
void ED_space_image_paint_update(Main *bmain, wmWindowManager *wm, Scene *scene)
void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic)
Definition image_edit.cc:46
bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit)
void ED_space_image_scopes_update(const bContext *C, SpaceImage *sima, ImBuf *ibuf, bool use_view_settings)
void ED_space_image_get_zoom(SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
bool ED_node_is_geometry(const SpaceNode *snode)
Definition node_edit.cc:502
void ED_node_set_tree_type(SpaceNode *snode, blender::bke::bNodeTreeType *typeinfo)
Definition node_edit.cc:473
void ED_node_tree_start(ARegion *region, SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from)
Definition space_node.cc:78
bool ED_node_is_compositor(const SpaceNode *snode)
Definition node_edit.cc:487
void ED_node_cursor_location_set(SpaceNode *snode, const float value[2])
void ED_node_tree_pop(ARegion *region, SpaceNode *snode)
void ED_node_tree_path_get(SpaceNode *snode, char *value)
void ED_node_tree_push(ARegion *region, SpaceNode *snode, bNodeTree *ntree, bNode *gnode)
int ED_node_tree_path_length(SpaceNode *snode)
void ED_node_cursor_location_get(const SpaceNode *snode, float value[2])
bool ED_node_supports_preview(SpaceNode *snode)
Definition node_edit.cc:507
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:693
wmWindow * ED_screen_window_find(const bScreen *screen, const wmWindowManager *wm)
Scene * ED_screen_scene_find(const bScreen *screen, const wmWindowManager *wm)
void ED_region_search_filter_update(const ScrArea *area, ARegion *region)
Definition area.cc:838
void ED_region_toggle_hidden(bContext *C, ARegion *region)
Definition area.cc:2373
void ED_region_visibility_change_update(bContext *C, ScrArea *area, ARegion *region)
Definition area.cc:2351
void ED_region_visibility_change_update_animated(bContext *C, ScrArea *area, ARegion *region)
void ED_area_tag_refresh(ScrArea *area)
Definition area.cc:722
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:618
void ED_area_type_hud_ensure(bContext *C, ScrArea *area)
int ED_space_text_visible_lines_get(const SpaceText *st)
Definition text_draw.cc:47
void ED_space_text_scroll_to_cursor(SpaceText *st, ARegion *region, bool center)
bool ED_text_is_syntax_highlight_supported(Text *text)
float ED_view3d_grid_scale(const Scene *scene, const View3D *v3d, const char **r_grid_unit)
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist)
bool ED_view3d_quat_to_axis_view_and_reset_quat(float quat[4], float epsilon, char *r_view, char *r_view_axis_roll)
bool ED_view3d_local_collections_set(const Main *bmain, View3D *v3d)
void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip)
void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area)
StructRNA * ID_code_to_RNA_type(short idcode)
#define RNA_MAX_ARRAY_DIMENSION
Definition RNA_define.hh:27
blender::bke::bNodeTreeType * rna_node_tree_type_from_enum(int value)
int rna_node_tree_idname_to_enum(const char *idname)
const EnumPropertyItem * rna_node_tree_type_itemf(void *data, bool(*poll)(void *data, blender::bke::bNodeTreeType *), bool *r_free)
const EnumPropertyItem * RNA_enum_node_tree_types_itemf_impl(bContext *C, bool *r_free)
ParameterFlag
Definition RNA_types.hh:544
@ PARM_RNAPTR
Definition RNA_types.hh:547
@ PARM_REQUIRED
Definition RNA_types.hh:545
@ FUNC_USE_CONTEXT
Definition RNA_types.hh:913
@ PROP_FLOAT
Definition RNA_types.hh:164
@ PROP_BOOLEAN
Definition RNA_types.hh:162
@ PROP_ENUM
Definition RNA_types.hh:166
@ PROP_INT
Definition RNA_types.hh:163
@ PROP_STRING
Definition RNA_types.hh:165
@ PROP_POINTER
Definition RNA_types.hh:167
@ PROP_COLLECTION
Definition RNA_types.hh:168
@ PROP_UNIT_CAMERA
Definition RNA_types.hh:183
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:224
PropertyFlag
Definition RNA_types.hh:300
@ PROP_DYNAMIC
Definition RNA_types.hh:428
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:407
@ PROP_ANIMATABLE
Definition RNA_types.hh:319
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:384
@ PROP_EDITABLE
Definition RNA_types.hh:306
@ PROP_ENUM_NO_CONTEXT
Definition RNA_types.hh:430
@ PROP_NEVER_NULL
Definition RNA_types.hh:377
@ PROP_TEXTEDIT_UPDATE
Definition RNA_types.hh:326
@ PROP_HIDDEN
Definition RNA_types.hh:338
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:364
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition RNA_types.hh:673
@ PROP_MATRIX
Definition RNA_types.hh:265
@ PROP_XYZ
Definition RNA_types.hh:269
@ PROP_DISTANCE
Definition RNA_types.hh:256
@ PROP_BYTESTRING
Definition RNA_types.hh:240
@ PROP_FILENAME
Definition RNA_types.hh:238
@ PROP_COLOR
Definition RNA_types.hh:260
@ PROP_PIXEL
Definition RNA_types.hh:248
@ PROP_ANGLE
Definition RNA_types.hh:252
@ PROP_NONE
Definition RNA_types.hh:233
@ PROP_PERCENTAGE
Definition RNA_types.hh:250
@ PROP_FACTOR
Definition RNA_types.hh:251
@ PROP_TRANSLATION
Definition RNA_types.hh:261
@ PROP_UNSIGNED
Definition RNA_types.hh:249
@ PROP_QUATERNION
Definition RNA_types.hh:267
@ PROP_FILEPATH
Definition RNA_types.hh:236
#define C
Definition RandGen.cpp:29
void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
Definition view2d.cc:865
#define V2D_LOCK_SET
Definition UI_view2d.hh:83
bool UI_view2d_area_supports_sync(ScrArea *area)
Definition view2d.cc:860
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
Definition view2d.cc:1668
#define ND_SEQUENCER
Definition WM_types.hh:437
#define NC_WORLD
Definition WM_types.hh:387
#define ND_SHADING
Definition WM_types.hh:477
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:535
#define NC_WINDOW
Definition WM_types.hh:375
#define NC_NODE
Definition WM_types.hh:394
#define NC_GEOM
Definition WM_types.hh:393
#define ND_DATA
Definition WM_types.hh:509
#define ND_SPACE_DOPESHEET
Definition WM_types.hh:533
#define ND_SPACE_NLA
Definition WM_types.hh:534
#define ND_SPACE_NODE
Definition WM_types.hh:526
#define ND_DISPLAY
Definition WM_types.hh:491
#define NC_MOVIECLIP
Definition WM_types.hh:397
#define ND_SPACE_PROPERTIES
Definition WM_types.hh:529
#define NC_SCENE
Definition WM_types.hh:378
#define ND_SPACE_NODE_VIEW
Definition WM_types.hh:536
#define ND_NODES
Definition WM_types.hh:436
#define ND_TOOLSETTINGS
Definition WM_types.hh:449
#define ND_SPACE_IMAGE
Definition WM_types.hh:522
#define NA_EDITED
Definition WM_types.hh:584
#define ND_SPACE_GRAPH
Definition WM_types.hh:532
#define NC_TEXT
Definition WM_types.hh:386
#define NC_MATERIAL
Definition WM_types.hh:380
#define NC_LAMP
Definition WM_types.hh:382
#define NC_IMAGE
Definition WM_types.hh:384
#define ND_SPACE_CLIP
Definition WM_types.hh:539
#define ND_SPACE_INFO_REPORT
Definition WM_types.hh:520
#define ND_SPACE_TIME
Definition WM_types.hh:531
#define NC_TEXTURE
Definition WM_types.hh:381
#define ND_SPACE_TEXT
Definition WM_types.hh:530
#define ND_SPACE_SPREADSHEET
Definition WM_types.hh:541
#define ND_SPACE_VIEW3D
Definition WM_types.hh:528
#define NS_VIEW3D_SHADING
Definition WM_types.hh:577
#define ND_SPACE_CONSOLE
Definition WM_types.hh:519
#define ND_SPACE_FILE_PARAMS
Definition WM_types.hh:523
#define NC_SPACE
Definition WM_types.hh:392
#define ND_SPACE_OUTLINER
Definition WM_types.hh:527
#define ND_SPACE_FILE_LIST
Definition WM_types.hh:524
void ANIM_frame_channel_y_extents(bContext *C, bAnimContext *ac)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
volatile int lock
#define U
BMesh const char void * data
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
constexpr const char * c_str() const
int64_t size() const
IndexRange index_range() const
nullptr float
#define offsetof(t, d)
#define GS(x)
#define main()
#define printf(...)
constexpr T clamp(T, U, U) RET
float length(VecOp< float, D >) RET
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
RenderEngineType * RE_engines_find(const char *idname)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
Definition mallocn.cc:133
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
#define G(x, y, z)
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:186
ID * get_current_id(const SpaceSpreadsheet *sspreadsheet)
SpreadsheetTable * get_active_table(SpaceSpreadsheet &sspreadsheet)
IMB_Proxy_Size rendersize_to_proxysize(eSpaceSeq_Proxy_RenderSize render_size)
Definition proxy.cc:72
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:286
bool proxy_rebuild_context(Main *bmain, Depsgraph *depsgraph, Scene *scene, Strip *strip, blender::Set< std::string > *processed_paths, ListBase *queue, bool build_only_on_bad_performance)
Definition proxy.cc:431
constexpr int MAX_CHANNELS
ProxyJob * ED_seq_proxy_job_get(const bContext *C, wmJob *wm_job)
Definition proxy_job.cc:70
void cache_cleanup(Scene *scene)
ListBase * active_seqbase_get(const Editing *ed)
Definition sequencer.cc:433
wmJob * ED_seq_proxy_wm_job_get(const bContext *C)
Definition proxy_job.cc:87
const char * name
const EnumPropertyItem rna_enum_id_type_items[]
Definition rna_ID.cc:29
const IDFilterEnumPropertyItem rna_enum_id_type_filter_items[]
Definition rna_ID.cc:116
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
const PointerRNA PointerRNA_NULL
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void * rna_iterator_listbase_get(CollectionPropertyIterator *iter)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
PropertyRNA * rna_def_asset_library_reference_common(StructRNA *srna, const char *get, const char *set)
Definition rna_asset.cc:687
const EnumPropertyItem rna_enum_attribute_domain_items[]
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_define_animate_sdna(bool animate)
void RNA_def_struct_system_idprops_func(StructRNA *srna, const char *system_idproperties)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_define_verify_sdna(bool verify)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
const int rna_matrix_dimsize_4x4[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_enum_default_func(PropertyRNA *prop, const char *get_default)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_collection(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item, int value)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void rna_def_object_type_visibility_flags_common(StructRNA *srna, int noteflag, const char *update_func)
void RNA_api_region_view3d(StructRNA *srna)
void RNA_api_space_filebrowser(StructRNA *srna)
void RNA_api_space_node(StructRNA *srna)
int rna_object_type_visibility_icon_get_common(int object_type_exclude_viewport, const int *object_type_exclude_select)
void RNA_api_space_text(StructRNA *srna)
int rna_AssetMetaData_editable(const PointerRNA *ptr, const char **r_info)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
Definition rna_rna.cc:26
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:32
const EnumPropertyItem rna_enum_transform_pivot_full_items[]
Definition rna_scene.cc:579
static void rna_def_spreadsheet_row_filter(BlenderRNA *brna)
static void rna_def_space_userpref(BlenderRNA *brna)
static void rna_def_space_node_overlay(BlenderRNA *brna)
static void rna_def_space_view3d_overlay(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_viewport_lighting_items[]
Definition rna_space.cc:451
#define SACT_ITEM_MASK
Definition rna_space.cc:231
static void rna_def_spreadsheet_table(BlenderRNA *brna)
static void rna_def_repeat_zone_viewer_path_elem(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_type_items[]
Definition rna_space.cc:73
static const EnumPropertyItem rna_enum_view3dshading_render_pass_type_items[]
Definition rna_space.cc:488
static const EnumPropertyItem spreadsheet_table_id_type_items[]
Definition rna_space.cc:616
static const EnumPropertyItem stereo3d_camera_items[]
Definition rna_space.cc:324
static void rna_def_space_node_path_api(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem rna_enum_studio_light_items[]
Definition rna_space.cc:483
static void rna_def_spreadsheet_table_id(BlenderRNA *brna)
static void rna_def_space_graph(BlenderRNA *brna)
static void rna_def_fileselect_entry(BlenderRNA *brna)
const EnumPropertyItem rna_enum_shading_type_items[]
Definition rna_space.cc:427
const EnumPropertyItem rna_enum_space_sequencer_view_type_items[]
Definition rna_space.cc:186
#define SI_ITEM_MASK
Definition rna_space.cc:289
static void rna_def_spreadsheet_column(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_shading_wire_color_type_items[]
Definition rna_space.cc:472
static void rna_def_space_filebrowser(BlenderRNA *brna)
static void rna_def_space_sequencer(BlenderRNA *brna)
static IDFilterEnumPropertyItem rna_enum_space_file_id_filter_categories[]
static const EnumPropertyItem rna_enum_asset_import_method_items[]
Definition rna_space.cc:366
static void rna_def_modifier_viewer_path_elem(BlenderRNA *brna)
#define SACT_ITEM_CACHEFILE
Definition rna_space.cc:233
static void rna_def_fileselect_params(BlenderRNA *brna)
#define DEF_SHOW_REGION_PROPERTY(identifier, label, description)
#define SACT_ITEM_SHAPEKEY
Definition rna_space.cc:219
static void rna_def_space_sequencer_preview_overlay(BlenderRNA *brna)
static void rna_def_viewer_path_elem(BlenderRNA *brna)
static void rna_def_foreach_geometry_element_zone_viewer_path_elem(BlenderRNA *brna)
static void rna_def_space_view3d(BlenderRNA *brna)
static void rna_def_spreadsheet_table_id_geometry(BlenderRNA *brna)
static const EnumPropertyItem fileselectparams_recursion_level_items[]
Definition rna_space.cc:562
#define SI_ITEM_VIEW(identifier, name, icon)
Definition rna_space.cc:285
static void rna_def_space_properties(BlenderRNA *brna)
static void rna_def_group_node_viewer_path_elem(BlenderRNA *brna)
#define SACT_ITEM_DOPESHEET
Definition rna_space.cc:211
static void rna_def_filemenu_entry(BlenderRNA *brna)
static EnumPropertyItem rna_enum_space_action_ui_mode_items[]
Definition rna_space.cc:260
static const EnumPropertyItem rna_enum_shading_color_type_items[]
Definition rna_space.cc:458
static void rna_def_space_properties_filter(StructRNA *srna)
#define SI_ITEM_PAINT
Definition rna_space.cc:288
static void rna_def_space_sequencer_timeline_overlay(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_image_mode_items[]
Definition rna_space.cc:306
static const EnumPropertyItem rna_enum_space_image_mode_ui_items[]
Definition rna_space.cc:299
static void rna_def_space_text(BlenderRNA *brna)
static void rna_def_space(BlenderRNA *brna)
static const EnumPropertyItem stereo3d_eye_items[]
Definition rna_space.cc:401
const EnumPropertyItem buttons_context_items[]
Definition rna_space.cc:526
static void rna_def_space_nla(BlenderRNA *brna)
static void rna_def_space_sequencer_cache_overlay(BlenderRNA *brna)
static void rna_def_space_info(BlenderRNA *brna)
static void rna_def_space_clip(BlenderRNA *brna)
static void rna_def_space_outliner(BlenderRNA *brna)
void RNA_def_space(BlenderRNA *brna)
static void rna_def_space_image(BlenderRNA *brna)
static void rna_def_space_dopesheet(BlenderRNA *brna)
static void rna_def_fileselect_idfilter(BlenderRNA *brna)
static const EnumPropertyItem spreadsheet_object_eval_state_items[]
Definition rna_space.cc:597
static const EnumPropertyItem rna_enum_curve_display_handle_items[]
Definition rna_space.cc:590
static void rna_def_space_dopesheet_overlays(BlenderRNA *brna)
static void rna_def_id_viewer_path_elem(BlenderRNA *brna)
#define SACT_ITEM_ACTION
Definition rna_space.cc:213
const EnumPropertyItem rna_enum_space_file_browse_mode_items[]
Definition rna_space.cc:197
const EnumPropertyItem rna_enum_clip_editor_mode_items[]
Definition rna_space.cc:518
#define SACT_ITEM_GPENCIL
Definition rna_space.cc:225
#define SACT_ITEM_TIMELINE
Definition rna_space.cc:239
#define V3D_S3D_CAMERA_LEFT
Definition rna_space.cc:317
static EnumPropertyItem rna_enum_space_action_mode_all_items[]
Definition rna_space.cc:250
static void rna_def_space_generic_show_region_toggles(StructRNA *srna, int region_type_mask)
static const EnumPropertyItem viewer_path_elem_type_items[]
const EnumPropertyItem rna_enum_geometry_component_type_items[]
Definition rna_space.cc:44
const EnumPropertyItem rna_enum_space_image_mode_all_items[]
Definition rna_space.cc:291
static void rna_def_spreadsheet_column_id(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_graph_mode_items[]
Definition rna_space.cc:172
static void rna_def_viewer_node_viewer_path_elem(BlenderRNA *brna)
static void rna_def_fileselect_asset_params(BlenderRNA *brna)
static const EnumPropertyItem dt_uv_items[]
static const EnumPropertyItem fileselectparams_display_type_items[]
Definition rna_space.cc:575
#define V3D_S3D_CAMERA_RIGHT
Definition rna_space.cc:318
static void rna_def_evaluate_closure_node_viewer_path_elem(BlenderRNA *brna)
const EnumPropertyItem rna_enum_fileselect_params_sort_items[]
Definition rna_space.cc:343
static void rna_def_fileselect_asset_idfilter(BlenderRNA *brna)
static void rna_def_space_spreadsheet(BlenderRNA *brna)
static void rna_def_viewer_path(BlenderRNA *brna)
static void rna_def_space_image_overlay(BlenderRNA *brna)
static void rna_def_spreadsheet_tables(BlenderRNA *brna)
static void rna_def_space_clip_overlay(BlenderRNA *brna)
#define SI_ITEM_UV
Definition rna_space.cc:287
static void rna_def_node_tree_path(BlenderRNA *brna)
static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *mask_set_func)
static const EnumPropertyItem display_channels_items[]
Definition rna_space.cc:408
#define V3D_S3D_CAMERA_S3D
Definition rna_space.cc:319
static void rna_def_space_node(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_action_mode_items[]
Definition rna_space.cc:271
static void rna_def_space_image_uv(BlenderRNA *brna)
static void rna_def_console_line(BlenderRNA *brna)
static void rna_def_simulation_zone_viewer_path_elem(BlenderRNA *brna)
static void rna_def_space_view3d_shading(BlenderRNA *brna)
static void rna_def_space_console(BlenderRNA *brna)
#define min(a, b)
Definition sort.cc:36
#define FLT_MAX
Definition stdcycles.h:14
void * regiondata
struct ARegion * prev
The meta-data of an asset. By creating and giving this for a data-block (ID.asset_data),...
union CollectionPropertyIterator::@220100362304005352221007113371015217044252346141 internal
ListBaseIterator listbase
Definition RNA_types.hh:606
const char * identifier
Definition RNA_types.hh:657
const char * name
Definition RNA_types.hh:661
const char * description
Definition RNA_types.hh:663
AssetRepresentationHandle * asset
const char * name
Definition DNA_ID.h:414
char name[258]
Definition DNA_ID.h:432
struct RenderResult * rr
IteratorSkipFunc skip
Definition RNA_types.hh:568
void * last
void * first
ListBase wm
Definition BKE_main.hh:307
ListBase objects
Definition BKE_main.hh:280
T * data_as() const
Definition RNA_types.hh:124
void * data
Definition RNA_types.hh:53
char engine[32]
void(* view_draw)(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
Definition RE_engine.h:103
struct RenderData r
struct Object * camera
ListBase spacedata
struct SpaceType * type
ListBase regionbase
SpaceAction_Runtime runtime
struct MovieClipScopes scopes
short system_bookmarknr
FileSelectParams * params
SpaceGraph_Runtime runtime
float cursor[2]
struct ImageUser iuser
struct Image * image
char tree_idname[64]
char node_tree_sub_type
short render_size
SpreadsheetTable ** tables
struct Text * text
char name[BKE_ST_MAXNAME]
Definition BKE_screen.hh:83
SpreadsheetColumn ** columns
int icon_id_matcap_flipped
char name[FILE_MAXFILE]
char studio_light[256]
char lookdev_light[256]
struct IDProperty * prop
View3DOverlay overlay
struct Object * camera
short scenelock
int object_type_exclude_select
int object_type_exclude_viewport
ListBase regionbase
View3DShading shading
ListBase aovs
ScrArea * area
char idname[64]
struct GeometryNodeAssetTraits * geometry_node_asset_traits
ListBase areabase
Universally Unique Identifier according to RFC4122.
bool(* poll)(const bContext *C, bNodeTreeType *ntreetype)
Definition BKE_node.hh:509
Depsgraph * depsgraph
Definition SEQ_proxy.hh:48
i
Definition text_draw.cc:230
max
Definition text_draw.cc:251
uint len
#define N_(msgid)
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4238
bool WM_jobs_is_running(const wmJob *wm_job)
Definition wm_jobs.cc:341
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition wm_jobs.cc:479
ViewLayer * WM_windows_view_layer_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
Scene * WM_windows_scene_get_from_screen(const wmWindowManager *wm, const bScreen *screen)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Scene * WM_window_get_active_scene(const wmWindow *win)
void WM_windows_scene_data_sync(const ListBase *win_lb, Scene *scene)
bScreen * WM_window_get_active_screen(const wmWindow *win)
uint8_t flag
Definition wm_window.cc:145
bool WM_xr_session_exists(const wmXrData *xr)