Blender V4.5
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_string_ref.hh"
13#include "BLT_translation.hh"
14
15#include "BKE_context.hh"
16#include "BKE_geometry_set.hh"
17#include "BKE_movieclip.h"
18
19#include "ED_asset.hh"
20#include "ED_buttons.hh"
21#include "ED_spreadsheet.hh"
22
23#include "BLI_string.h"
24#include "BLI_sys_types.h"
25
26#include "DNA_action_types.h"
27#include "DNA_mask_types.h"
28#include "DNA_object_types.h"
29#include "DNA_space_types.h"
30#include "DNA_view3d_types.h"
31
32#include "RNA_define.hh"
33
34#include "rna_internal.hh"
35
36#include "SEQ_sequencer.hh"
37
38#include "WM_api.hh"
39#include "WM_types.hh"
40
41#include "RNA_enum_types.hh"
42
45 "MESH",
46 ICON_MESH_DATA,
47 "Mesh",
48 "Mesh component containing point, corner, edge and face data"},
50 "POINTCLOUD",
51 ICON_POINTCLOUD_DATA,
52 "Point Cloud",
53 "Point cloud component containing only point data"},
55 "CURVE",
56 ICON_CURVE_DATA,
57 "Curve",
58 "Curve component containing spline and control point data"},
60 "INSTANCES",
61 ICON_EMPTY_AXIS,
62 "Instances",
63 "Instances of objects or collections"},
65 "GREASEPENCIL",
66 ICON_GREASEPENCIL,
67 "Grease Pencil",
68 "Grease Pencil component containing layers and curves data"},
69 {0, nullptr, 0, nullptr, nullptr},
70};
71
73 /* empty must be here for python, is skipped for UI */
74 {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""},
75
76 /* General. */
77 RNA_ENUM_ITEM_HEADING(N_("General"), nullptr),
79 "VIEW_3D",
80 ICON_VIEW3D,
81 "3D Viewport",
82 "Manipulate objects in a 3D environment"},
84 "IMAGE_EDITOR",
85 ICON_IMAGE,
86 "UV/Image Editor",
87 "View and edit images and UV Maps"},
89 "NODE_EDITOR",
90 ICON_NODETREE,
91 "Node Editor",
92 "Editor for node-based shading and compositing tools"},
93 {SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequencer", "Video editing tools"},
94 {SPACE_CLIP, "CLIP_EDITOR", ICON_TRACKER, "Movie Clip Editor", "Motion tracking tools"},
95
96 /* Animation. */
97 RNA_ENUM_ITEM_HEADING(N_("Animation"), nullptr),
98#if 0
100 "TIMELINE",
101 ICON_TIME,
102 "Timeline",
103 "Timeline and playback controls (NOTE: Switch to 'Timeline' mode)"}, /* XXX */
104#endif
105 {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", "Adjust timing of keyframes"},
107 "GRAPH_EDITOR",
108 ICON_GRAPH,
109 "Graph Editor",
110 "Edit drivers and keyframe interpolation"},
111 {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", "Combine and layer Actions"},
112
113 /* Scripting. */
114 RNA_ENUM_ITEM_HEADING(N_("Scripting"), nullptr),
115 {SPACE_TEXT,
116 "TEXT_EDITOR",
117 ICON_TEXT,
118 "Text Editor",
119 "Edit scripts and in-file documentation"},
121 "CONSOLE",
122 ICON_CONSOLE,
123 "Python Console",
124 "Interactive programmatic console for "
125 "advanced editing and script development"},
126 {SPACE_INFO, "INFO", ICON_INFO, "Info", "Log of operations, warnings and error messages"},
127 /* Special case: Top-bar and Status-bar aren't supposed to be a regular editor for the user. */
129 "TOPBAR",
130 ICON_NONE,
131 "Top Bar",
132 "Global bar at the top of the screen for "
133 "global per-window settings"},
135 "STATUSBAR",
136 ICON_NONE,
137 "Status Bar",
138 "Global bar at the bottom of the "
139 "screen for general status information"},
140
141 /* Data. */
142 RNA_ENUM_ITEM_HEADING(N_("Data"), nullptr),
144 "OUTLINER",
145 ICON_OUTLINER,
146 "Outliner",
147 "Overview of scene graph and all available data-blocks"},
149 "PROPERTIES",
150 ICON_PROPERTIES,
151 "Properties",
152 "Edit properties of active object and related data-blocks"},
153 {SPACE_FILE, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", "Browse for files and assets"},
155 "SPREADSHEET",
156 ICON_SPREADSHEET,
157 "Spreadsheet",
158 "Explore geometry data in a table"},
160 "PREFERENCES",
161 ICON_PREFERENCES,
162 "Preferences",
163 "Edit persistent configuration settings"},
164 {0, nullptr, 0, nullptr, nullptr},
165};
166
169 "FCURVES",
170 ICON_GRAPH,
171 "Graph Editor",
172 "Edit animation/keyframes displayed as 2D curves"},
173 {SIPO_MODE_DRIVERS, "DRIVERS", ICON_DRIVER, "Drivers", "Edit drivers"},
174 {0, nullptr, 0, nullptr, nullptr},
175};
176
178 {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
179 {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Preview", ""},
181 "SEQUENCER_PREVIEW",
182 ICON_SEQ_SPLITVIEW,
183 "Sequencer & Preview",
184 ""},
185 {0, nullptr, 0, nullptr, nullptr},
186};
187
189 {FILE_BROWSE_MODE_FILES, "FILES", ICON_FILEBROWSER, "File Browser", ""},
190 {FILE_BROWSE_MODE_ASSETS, "ASSETS", ICON_ASSET_MANAGER, "Asset Browser", ""},
191 {0, nullptr, 0, nullptr, nullptr},
192};
193
194#define SACT_ITEM_DOPESHEET \
195 { \
196 SACTCONT_DOPESHEET, "DOPESHEET", ICON_ACTION, "Dope Sheet", "Edit all keyframes in scene" \
197 }
198#define SACT_ITEM_TIMELINE \
199 { \
200 SACTCONT_TIMELINE, "TIMELINE", ICON_TIME, "Timeline", "Timeline and playback controls" \
201 }
202#define SACT_ITEM_ACTION \
203 { \
204 SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, "Action Editor", \
205 "Edit keyframes in active object's Object-level action" \
206 }
207#define SACT_ITEM_SHAPEKEY \
208 { \
209 SACTCONT_SHAPEKEY, "SHAPEKEY", ICON_SHAPEKEY_DATA, "Shape Key Editor", \
210 "Edit keyframes in active object's Shape Keys action" \
211 }
212#define SACT_ITEM_GPENCIL \
213 { \
214 SACTCONT_GPENCIL, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", \
215 "Edit timings for all Grease Pencil sketches in file" \
216 }
217#define SACT_ITEM_MASK \
218 { \
219 SACTCONT_MASK, "MASK", ICON_MOD_MASK, "Mask", "Edit timings for Mask Editor splines" \
220 }
221#define SACT_ITEM_CACHEFILE \
222 { \
223 SACTCONT_CACHEFILE, "CACHEFILE", ICON_FILE, "Cache File", \
224 "Edit timings for Cache File data-blocks" \
225 }
226
227#ifndef RNA_RUNTIME
228/* XXX: action-editor is currently for object-level only actions,
229 * so show that using object-icon hint */
242 /* SACT_ITEM_TIMELINE, */
248 {0, nullptr, 0, nullptr, nullptr},
249};
250#endif
251
252/* Expose as `ui_mode`. */
253
257 {0, nullptr, 0, nullptr, nullptr},
258};
259
260#undef SACT_ITEM_DOPESHEET
261#undef SACT_ITEM_TIMELINE
262#undef SACT_ITEM_ACTION
263#undef SACT_ITEM_SHAPEKEY
264#undef SACT_ITEM_GPENCIL
265#undef SACT_ITEM_MASK
266#undef SACT_ITEM_CACHEFILE
267
268#define SI_ITEM_VIEW(identifier, name, icon) \
269 { \
270 SI_MODE_VIEW, identifier, icon, name, "View the image" \
271 }
272#define SI_ITEM_UV \
273 { \
274 SI_MODE_UV, "UV", ICON_UV, "UV Editor", "UV edit in mesh editmode" \
275 }
276#define SI_ITEM_PAINT \
277 { \
278 SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "2D image painting mode" \
279 }
280#define SI_ITEM_MASK \
281 { \
282 SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing" \
283 }
284
286 SI_ITEM_VIEW("VIEW", "View", ICON_FILE_IMAGE),
290 {0, nullptr, 0, nullptr, nullptr},
291};
292
294 SI_ITEM_VIEW("VIEW", "View", ICON_FILE_IMAGE),
297 {0, nullptr, 0, nullptr, nullptr},
298};
299
301 SI_ITEM_VIEW("IMAGE_EDITOR", "Image Editor", ICON_IMAGE),
303 {0, nullptr, 0, nullptr, nullptr},
304};
305
306#undef SI_ITEM_VIEW
307#undef SI_ITEM_UV
308#undef SI_ITEM_PAINT
309#undef SI_ITEM_MASK
310
311#define V3D_S3D_CAMERA_LEFT {STEREO_LEFT_ID, "LEFT", ICON_RESTRICT_RENDER_OFF, "Left", ""},
312#define V3D_S3D_CAMERA_RIGHT {STEREO_RIGHT_ID, "RIGHT", ICON_RESTRICT_RENDER_OFF, "Right", ""},
313#define V3D_S3D_CAMERA_S3D {STEREO_3D_ID, "S3D", ICON_CAMERA_STEREO, "3D", ""},
314#ifdef RNA_RUNTIME
315# define V3D_S3D_CAMERA_VIEWS {STEREO_MONO_ID, "MONO", ICON_RESTRICT_RENDER_OFF, "Views", ""},
316#endif
317
319 V3D_S3D_CAMERA_LEFT V3D_S3D_CAMERA_RIGHT V3D_S3D_CAMERA_S3D{0, nullptr, 0, nullptr, nullptr},
320};
321
322#ifdef RNA_RUNTIME
323static const EnumPropertyItem multiview_camera_items[] = {
324 V3D_S3D_CAMERA_VIEWS V3D_S3D_CAMERA_S3D{0, nullptr, 0, nullptr, nullptr},
325};
326#endif
327
328#undef V3D_S3D_CAMERA_LEFT
329#undef V3D_S3D_CAMERA_RIGHT
330#undef V3D_S3D_CAMERA_S3D
331#undef V3D_S3D_CAMERA_VIEWS
332
338 {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_NONE, "Name", "Sort the file list alphabetically"},
340 "FILE_SORT_EXTENSION",
341 ICON_NONE,
342 "Extension",
343 "Sort the file list by extension/type"},
345 "FILE_SORT_TIME",
346 ICON_NONE,
347 "Modified Date",
348 "Sort files by modification time"},
349 {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_NONE, "Size", "Sort files by size"},
351 "ASSET_CATALOG",
352 0,
353 "Asset Catalog",
354 "Sort the asset list so that assets in the same catalog are kept together. Within a single "
355 "catalog, assets are ordered by name. The catalogs are in order of the flattened catalog "
356 "hierarchy."},
357 {0, nullptr, 0, nullptr, nullptr},
358};
359
360#ifndef RNA_RUNTIME
362 {STEREO_LEFT_ID, "LEFT_EYE", ICON_NONE, "Left Eye"},
363 {STEREO_RIGHT_ID, "RIGHT_EYE", ICON_NONE, "Right Eye"},
364 {0, nullptr, 0, nullptr, nullptr},
365};
366#endif
367
370 "COLOR_ALPHA",
371 ICON_IMAGE_RGB_ALPHA,
372 "Color & Alpha",
373 "Display image with RGB colors and alpha transparency"},
374 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
375 {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Display alpha transparency channel"},
377 "Z_BUFFER",
378 ICON_IMAGE_ZDEPTH,
379 "Z-Buffer",
380 "Display Z-buffer associated with image (mapped from camera clip start to end)"},
381 {SI_SHOW_R, "RED", ICON_RGB_RED, "Red", ""},
382 {SI_SHOW_G, "GREEN", ICON_RGB_GREEN, "Green", ""},
383 {SI_SHOW_B, "BLUE", ICON_RGB_BLUE, "Blue", ""},
384 {0, nullptr, 0, nullptr, nullptr},
385};
386
388 {OB_WIRE,
389 "WIREFRAME",
390 ICON_SHADING_WIRE,
391 "Wireframe",
392 "Display only edges of geometry without surface shading"},
393 {OB_SOLID,
394 "SOLID",
395 ICON_SHADING_SOLID,
396 "Solid",
397 "Display objects with flat lighting and basic surface shading"},
399 "MATERIAL",
400 ICON_SHADING_TEXTURE,
401 "Material Preview",
402 "Preview materials using predefined environment lights"},
403 {OB_RENDER,
404 "RENDERED",
405 ICON_SHADING_RENDERED,
406 "Rendered",
407 "Preview the final scene using the active render engine"},
408 {0, nullptr, 0, nullptr, nullptr},
409};
410
412 {V3D_LIGHTING_STUDIO, "STUDIO", 0, "Studio", "Display using studio lighting"},
413 {V3D_LIGHTING_MATCAP, "MATCAP", 0, "MatCap", "Display using matcap material and lighting"},
414 {V3D_LIGHTING_FLAT, "FLAT", 0, "Flat", "Display using flat lighting"},
415 {0, nullptr, 0, nullptr, nullptr},
416};
417
419 {V3D_SHADING_MATERIAL_COLOR, "MATERIAL", 0, "Material", "Show material color"},
420 {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color"},
421 {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color"},
422 {V3D_SHADING_VERTEX_COLOR, "VERTEX", 0, "Attribute", "Show active color attribute"},
424 "TEXTURE",
425 0,
426 "Texture",
427 "Show the texture from the active image texture node using the active UV map coordinates"},
428 {V3D_SHADING_SINGLE_COLOR, "SINGLE", 0, "Custom", "Show scene in a single custom color"},
429 {0, nullptr, 0, nullptr, nullptr},
430};
431
434 "THEME",
435 0,
436 "Theme",
437 "Show scene wireframes with the theme's wire color"},
438 {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color on wireframe"},
439 {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color on wireframe"},
440 {0, nullptr, 0, nullptr, nullptr},
441};
442
444 {0, "DEFAULT", 0, "Default", ""},
445 {0, nullptr, 0, nullptr, nullptr},
446};
447
450 {EEVEE_RENDER_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
451 {EEVEE_RENDER_PASS_EMIT, "EMISSION", 0, "Emission", ""},
452 {EEVEE_RENDER_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
453 {EEVEE_RENDER_PASS_AO, "AO", 0, "Ambient Occlusion", ""},
454 {EEVEE_RENDER_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
455 {EEVEE_RENDER_PASS_TRANSPARENT, "TRANSPARENT", 0, "Transparent", ""},
456
458 {EEVEE_RENDER_PASS_DIFFUSE_LIGHT, "DIFFUSE_LIGHT", 0, "Diffuse Light", ""},
459 {EEVEE_RENDER_PASS_DIFFUSE_COLOR, "DIFFUSE_COLOR", 0, "Diffuse Color", ""},
460 {EEVEE_RENDER_PASS_SPECULAR_LIGHT, "SPECULAR_LIGHT", 0, "Specular Light", ""},
461 {EEVEE_RENDER_PASS_SPECULAR_COLOR, "SPECULAR_COLOR", 0, "Specular Color", ""},
462 {EEVEE_RENDER_PASS_VOLUME_LIGHT, "VOLUME_LIGHT", 0, "Volume Light", ""},
463
465 {EEVEE_RENDER_PASS_POSITION, "POSITION", 0, "Position", ""},
466 {EEVEE_RENDER_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
467 {EEVEE_RENDER_PASS_MIST, "MIST", 0, "Mist", ""},
468 {EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT, "CryptoObject", 0, "CryptoObject", ""},
469 {EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET, "CryptoAsset", 0, "CryptoAsset", ""},
470 {EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL, "CryptoMaterial", 0, "CryptoMaterial", ""},
471
473 {EEVEE_RENDER_PASS_AOV, "AOV", 0, "AOV", ""},
474
475 {0, nullptr, 0, nullptr, nullptr},
476};
477
479 {SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"},
480 {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"},
481 {0, nullptr, 0, nullptr, nullptr},
482};
483
484/* Actually populated dynamically through a function,
485 * but helps for context-less access (e.g. doc, i18n...). */
487 {BCONTEXT_TOOL, "TOOL", ICON_TOOL_SETTINGS, "Tool", "Active Tool and Workspace settings"},
488 {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene Properties"},
489 {BCONTEXT_RENDER, "RENDER", ICON_SCENE, "Render", "Render Properties"},
490 {BCONTEXT_OUTPUT, "OUTPUT", ICON_OUTPUT, "Output", "Output Properties"},
491 {BCONTEXT_VIEW_LAYER, "VIEW_LAYER", ICON_RENDER_RESULT, "View Layer", "View Layer Properties"},
492 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World Properties"},
493 {BCONTEXT_COLLECTION, "COLLECTION", ICON_GROUP, "Collection", "Collection Properties"},
494 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object Properties"},
496 "CONSTRAINT",
497 ICON_CONSTRAINT,
498 "Constraints",
499 "Object Constraint Properties"},
500 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifier Properties"},
501 {BCONTEXT_DATA, "DATA", ICON_NONE, "Data", "Object Data Properties"},
502 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone Properties"},
504 "BONE_CONSTRAINT",
505 ICON_CONSTRAINT_BONE,
506 "Bone Constraints",
507 "Bone Constraint Properties"},
508 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material Properties"},
509 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture Properties"},
510 {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle Properties"},
511 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics Properties"},
512 {BCONTEXT_SHADERFX, "SHADERFX", ICON_SHADERFX, "Effects", "Visual Effects Properties"},
513 {0, nullptr, 0, nullptr, nullptr},
514};
515
517 {0, "NONE", 0, "None", "Only list current directory's content, with no recursion"},
518 {1, "BLEND", 0, "Blend File", "List .blend files' content"},
519 {2, "ALL_1", 0, "One Level", "List all sub-directories' content, one level of recursion"},
520 {3, "ALL_2", 0, "Two Levels", "List all sub-directories' content, two levels of recursion"},
521 {4,
522 "ALL_3",
523 0,
524 "Three Levels",
525 "List all sub-directories' content, three levels of recursion"},
526 {0, nullptr, 0, nullptr, nullptr},
527};
528
531 "LIST_VERTICAL",
532 ICON_LONGDISPLAY,
533 "Vertical List",
534 "Display files as a vertical list"},
536 "LIST_HORIZONTAL",
537 ICON_SHORTDISPLAY,
538 "Horizontal List",
539 "Display files as a horizontal list"},
540 {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
541 {0, nullptr, 0, nullptr, nullptr},
542};
543
545 {CURVE_HANDLE_NONE, "NONE", 0, "None", ""},
546 {CURVE_HANDLE_SELECTED, "SELECTED", 0, "Selected", ""},
547 {CURVE_HANDLE_ALL, "ALL", 0, "All", ""},
548 {0, nullptr, 0, nullptr, nullptr},
549};
550
553 "EVALUATED",
554 ICON_NONE,
555 "Evaluated",
556 "Use data from fully or partially evaluated object"},
558 "ORIGINAL",
559 ICON_NONE,
560 "Original",
561 "Use data from original object without any modifiers applied"},
563 "VIEWER_NODE",
564 ICON_NONE,
565 "Viewer Node",
566 "Use intermediate data from viewer node"},
567 {0, nullptr, 0, nullptr, nullptr},
568};
569
572 "GEOMETRY",
573 ICON_NONE,
574 "Geometry",
575 "Table contains geometry data"},
576 {0, nullptr, 0, nullptr, nullptr},
577
578};
579
580#ifdef RNA_RUNTIME
581
582# include <algorithm>
583# include <fmt/format.h>
584
586
587# include "DNA_anim_types.h"
588# include "DNA_asset_types.h"
589# include "DNA_key_types.h"
590# include "DNA_scene_types.h"
591# include "DNA_screen_types.h"
592# include "DNA_sequence_types.h"
593# include "DNA_userdef_types.h"
594
595# include "BLI_index_range.hh"
596# include "BLI_math_matrix.h"
597# include "BLI_math_rotation.h"
598# include "BLI_math_vector.h"
599# include "BLI_path_utils.hh"
600# include "BLI_string.h"
601
602# include "BKE_anim_data.hh"
603# include "BKE_brush.hh"
604# include "BKE_context.hh"
605# include "BKE_global.hh"
606# include "BKE_icons.h"
607# include "BKE_idprop.hh"
608# include "BKE_image.hh"
609# include "BKE_key.hh"
610# include "BKE_layer.hh"
611# include "BKE_nla.hh"
612# include "BKE_node.hh"
613# include "BKE_paint.hh"
614# include "BKE_preferences.h"
615# include "BKE_scene.hh"
616# include "BKE_screen.hh"
617# include "BKE_studiolight.h"
618# include "BKE_workspace.hh"
619
620# include "DEG_depsgraph.hh"
621# include "DEG_depsgraph_build.hh"
622
623# include "ED_anim_api.hh"
624# include "ED_asset.hh"
625# include "ED_buttons.hh"
626# include "ED_clip.hh"
627# include "ED_fileselect.hh"
628# include "ED_image.hh"
629# include "ED_node.hh"
630# include "ED_screen.hh"
631# include "ED_sequencer.hh"
632# include "ED_spreadsheet.hh"
633# include "ED_text.hh"
634# include "ED_transform.hh"
635# include "ED_view3d.hh"
636
637# include "GPU_material.hh"
638
639# include "IMB_imbuf_types.hh"
640
641# include "UI_interface.hh"
642# include "UI_view2d.hh"
643
644# include "SEQ_proxy.hh"
645# include "SEQ_relations.hh"
646
647# include "RE_engine.h"
648
649static StructRNA *rna_Space_refine(PointerRNA *ptr)
650{
651 SpaceLink *space = (SpaceLink *)ptr->data;
652
653 switch ((eSpace_Type)space->spacetype) {
654 case SPACE_VIEW3D:
655 return &RNA_SpaceView3D;
656 case SPACE_GRAPH:
657 return &RNA_SpaceGraphEditor;
658 case SPACE_OUTLINER:
659 return &RNA_SpaceOutliner;
660 case SPACE_PROPERTIES:
661 return &RNA_SpaceProperties;
662 case SPACE_FILE:
663 return &RNA_SpaceFileBrowser;
664 case SPACE_IMAGE:
665 return &RNA_SpaceImageEditor;
666 case SPACE_INFO:
667 return &RNA_SpaceInfo;
668 case SPACE_SEQ:
669 return &RNA_SpaceSequenceEditor;
670 case SPACE_TEXT:
671 return &RNA_SpaceTextEditor;
672 case SPACE_ACTION:
673 return &RNA_SpaceDopeSheetEditor;
674 case SPACE_NLA:
675 return &RNA_SpaceNLA;
676 case SPACE_NODE:
677 return &RNA_SpaceNodeEditor;
678 case SPACE_CONSOLE:
679 return &RNA_SpaceConsole;
680 case SPACE_USERPREF:
681 return &RNA_SpacePreferences;
682 case SPACE_CLIP:
683 return &RNA_SpaceClipEditor;
685 return &RNA_SpaceSpreadsheet;
686
687 /* Currently no type info. */
688 case SPACE_SCRIPT:
689 case SPACE_EMPTY:
690 case SPACE_TOPBAR:
691 case SPACE_STATUSBAR:
692 break;
693 }
694
695 return &RNA_Space;
696}
697
698static ScrArea *rna_area_from_space(PointerRNA *ptr)
699{
700 bScreen *screen = (bScreen *)ptr->owner_id;
701 SpaceLink *link = (SpaceLink *)ptr->data;
702 return BKE_screen_find_area_from_space(screen, link);
703}
704
705static void area_region_from_regiondata(bScreen *screen,
706 void *regiondata,
707 ScrArea **r_area,
708 ARegion **r_region)
709{
710 *r_area = nullptr;
711 *r_region = nullptr;
712
713 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
714 LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
715 if (region->regiondata == regiondata) {
716 *r_area = area;
717 *r_region = region;
718 return;
719 }
720 }
721 }
722}
723
724static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_area, ARegion **r_region)
725{
726 bScreen *screen = (bScreen *)ptr->owner_id;
727 void *regiondata = (ptr->data);
728
729 area_region_from_regiondata(screen, regiondata, r_area, r_region);
730}
731
732/* -------------------------------------------------------------------- */
735
736static bool rna_Space_bool_from_region_flag_get_by_type(PointerRNA *ptr,
737 const int region_type,
738 const int region_flag)
739{
740 ScrArea *area = rna_area_from_space(ptr);
741 ARegion *region = BKE_area_find_region_type(area, region_type);
742 if (region) {
743 return (region->flag & region_flag);
744 }
745 return false;
746}
747
748static void rna_Space_bool_from_region_flag_set_by_type(PointerRNA *ptr,
749 const int region_type,
750 const int region_flag,
751 bool value)
752{
753 ScrArea *area = rna_area_from_space(ptr);
754 ARegion *region = BKE_area_find_region_type(area, region_type);
755 if (region && (region->alignment != RGN_ALIGN_NONE)) {
756 SET_FLAG_FROM_TEST(region->flag, value, region_flag);
757 }
758 ED_region_tag_redraw(region);
759}
760
761static void rna_Space_bool_from_region_flag_update_by_type(bContext *C,
763 const int region_type,
764 const int region_flag)
765{
766 ScrArea *area = rna_area_from_space(ptr);
767 ARegion *region = BKE_area_find_region_type(area, region_type);
768 if (region) {
769 if (region_flag == RGN_FLAG_HIDDEN) {
770 /* Only support animation when the area is in the current context. */
771 if (region->overlap && (area == CTX_wm_area(C))) {
773 }
774 else {
776 }
777 }
778 else if (region_flag == RGN_FLAG_HIDDEN_BY_USER) {
779 if (!(region->flag & RGN_FLAG_HIDDEN_BY_USER) != !(region->flag & RGN_FLAG_HIDDEN)) {
780 ED_region_toggle_hidden(C, region);
781
782 if ((region->flag & RGN_FLAG_HIDDEN_BY_USER) == 0) {
784 }
785 }
786 }
787 }
788}
789
791
792/* -------------------------------------------------------------------- */
795
796/* Header Region. */
797static bool rna_Space_show_region_header_get(PointerRNA *ptr)
798{
799 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN);
800}
801static void rna_Space_show_region_header_set(PointerRNA *ptr, bool value)
802{
803 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN, !value);
804
805 /* Special case, never show the tool properties when the header is invisible. */
806 bool value_for_tool_header = value;
807 if (value == true) {
808 ScrArea *area = rna_area_from_space(ptr);
809 ARegion *region_tool_header = BKE_area_find_region_type(area, RGN_TYPE_TOOL_HEADER);
810 if (region_tool_header != nullptr) {
811 value_for_tool_header = !(region_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER);
812 }
813 }
814 rna_Space_bool_from_region_flag_set_by_type(
815 ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN, !value_for_tool_header);
816}
817static void rna_Space_show_region_header_update(bContext *C, PointerRNA *ptr)
818{
819 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN);
820}
821
822/* Footer Region. */
823static bool rna_Space_show_region_footer_get(PointerRNA *ptr)
824{
825 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN);
826}
827static void rna_Space_show_region_footer_set(PointerRNA *ptr, bool value)
828{
829 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN, !value);
830}
831static void rna_Space_show_region_footer_update(bContext *C, PointerRNA *ptr)
832{
833 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN);
834}
835
836/* Tool Header Region.
837 *
838 * This depends on the 'RGN_TYPE_TOOL_HEADER'
839 */
840static bool rna_Space_show_region_tool_header_get(PointerRNA *ptr)
841{
842 return !rna_Space_bool_from_region_flag_get_by_type(
844}
845static void rna_Space_show_region_tool_header_set(PointerRNA *ptr, bool value)
846{
847 rna_Space_bool_from_region_flag_set_by_type(
849 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN, !value);
850}
851static void rna_Space_show_region_tool_header_update(bContext *C, PointerRNA *ptr)
852{
853 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN);
854}
855
856/* Tools Region. */
857static bool rna_Space_show_region_toolbar_get(PointerRNA *ptr)
858{
859 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN);
860}
861static void rna_Space_show_region_toolbar_set(PointerRNA *ptr, bool value)
862{
863 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN, !value);
864}
865static void rna_Space_show_region_toolbar_update(bContext *C, PointerRNA *ptr)
866{
867 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN);
868}
869
870static bool rna_Space_show_region_tool_props_get(PointerRNA *ptr)
871{
872 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
873}
874static void rna_Space_show_region_tool_props_set(PointerRNA *ptr, bool value)
875{
876 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN, !value);
877}
878static void rna_Space_show_region_tool_props_update(bContext *C, PointerRNA *ptr)
879{
880 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
881}
882
883/* Channels Region. */
884static bool rna_Space_show_region_channels_get(PointerRNA *ptr)
885{
886 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN);
887}
888static void rna_Space_show_region_channels_set(PointerRNA *ptr, bool value)
889{
890 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN, !value);
891}
892static void rna_Space_show_region_channels_update(bContext *C, PointerRNA *ptr)
893{
894 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN);
895}
896
897/* UI Region */
898static bool rna_Space_show_region_ui_get(PointerRNA *ptr)
899{
900 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN);
901}
902static void rna_Space_show_region_ui_set(PointerRNA *ptr, bool value)
903{
904 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN, !value);
905}
906static void rna_Space_show_region_ui_update(bContext *C, PointerRNA *ptr)
907{
908 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN);
909}
910
911/* Redo (HUD) Region */
912static bool rna_Space_show_region_hud_get(PointerRNA *ptr)
913{
914 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER);
915}
916static void rna_Space_show_region_hud_set(PointerRNA *ptr, bool value)
917{
918 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER, !value);
919}
920static void rna_Space_show_region_hud_update(bContext *C, PointerRNA *ptr)
921{
922 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER);
923}
924
925/* Asset Shelf Regions */
926static bool rna_Space_show_region_asset_shelf_get(PointerRNA *ptr)
927{
928 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN);
929}
930static void rna_Space_show_region_asset_shelf_set(PointerRNA *ptr, bool value)
931{
932 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN, !value);
933}
934static void rna_Space_show_region_asset_shelf_update(bContext *C, PointerRNA *ptr)
935{
936 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN);
937}
938
940
941static bool rna_Space_view2d_sync_get(PointerRNA *ptr)
942{
943 ScrArea *area;
944 ARegion *region;
945
946 area = rna_area_from_space(ptr); /* can be nullptr */
947 if (area == nullptr) {
948 return false;
949 }
950
951 if (area->spacetype == SPACE_CLIP) {
953 }
954 else {
956 }
957 if (region) {
958 View2D *v2d = &region->v2d;
959 return (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME) != 0;
960 }
961
962 return false;
963}
964
965static void rna_Space_view2d_sync_set(PointerRNA *ptr, bool value)
966{
967 ScrArea *area;
968 ARegion *region;
969
970 area = rna_area_from_space(ptr); /* can be nullptr */
971 if (!area) {
972 return;
973 }
974
975 if (!UI_view2d_area_supports_sync(area)) {
976 BKE_reportf(nullptr,
977 RPT_ERROR,
978 "'show_locked_time' is not supported for the '%s' editor",
979 area->type->name);
980 return;
981 }
982
983 if (area->spacetype == SPACE_CLIP) {
985 }
986 else {
988 }
989 if (region) {
990 View2D *v2d = &region->v2d;
991 if (value) {
993 }
994 else {
996 }
997 }
998}
999
1000static void rna_Space_view2d_sync_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1001{
1002 ScrArea *area;
1003 ARegion *region;
1004
1005 area = rna_area_from_space(ptr); /* can be nullptr */
1006 if (area == nullptr) {
1007 return;
1008 }
1009
1010 if (area->spacetype == SPACE_CLIP) {
1012 }
1013 else {
1015 }
1016
1017 if (region) {
1018 bScreen *screen = (bScreen *)ptr->owner_id;
1019 View2D *v2d = &region->v2d;
1020
1021 UI_view2d_sync(screen, area, v2d, V2D_LOCK_SET);
1022 }
1023}
1024
1025/* Space 3D View */
1026static void rna_SpaceView3D_camera_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1027{
1028 View3D *v3d = (View3D *)(ptr->data);
1029 if (v3d->scenelock && scene != nullptr) {
1030 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
1031
1032 scene->camera = v3d->camera;
1034 }
1035}
1036
1037static void rna_SpaceView3D_use_local_camera_set(PointerRNA *ptr, bool value)
1038{
1039 View3D *v3d = (View3D *)(ptr->data);
1040 bScreen *screen = (bScreen *)ptr->owner_id;
1041
1042 v3d->scenelock = !value;
1043
1044 if (!value) {
1045 Scene *scene = ED_screen_scene_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1046 /* nullptr if the screen isn't in an active window (happens when setting from Python).
1047 * This could be moved to the update function, in that case the scene won't relate to the
1048 * screen so keep it working this way. */
1049 if (scene != nullptr) {
1050 v3d->camera = scene->camera;
1051 }
1052 }
1053}
1054
1055static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr)
1056{
1057 View3D *v3d = (View3D *)(ptr->data);
1058 bScreen *screen = (bScreen *)ptr->owner_id;
1059 Scene *scene = ED_screen_scene_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1060 if (scene != nullptr) {
1061 return ED_view3d_grid_scale(scene, v3d, nullptr);
1062 }
1063 else {
1064 /* When accessed from non-active screen. */
1065 return 1.0f;
1066 }
1067}
1068
1069static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
1070{
1071 View3D *v3d = (View3D *)(ptr->data);
1072 ScrArea *area = rna_area_from_space(ptr);
1073 void *regiondata = nullptr;
1074 if (area) {
1075 ListBase *regionbase = (area->spacedata.first == v3d) ? &area->regionbase : &v3d->regionbase;
1076 ARegion *region = static_cast<ARegion *>(regionbase->last); /* always last in list, weak. */
1077 regiondata = region->regiondata;
1078 }
1079
1080 return RNA_pointer_create_with_parent(*ptr, &RNA_RegionView3D, regiondata);
1081}
1082
1083static void rna_SpaceView3D_object_type_visibility_update(Main * /*bmain*/,
1084 Scene *scene,
1085 PointerRNA * /*ptr*/)
1086{
1088}
1089
1090static void rna_SpaceView3D_shading_use_compositor_update(Main * /*bmain*/,
1091 Scene * /*scene*/,
1092 PointerRNA * /*ptr*/)
1093{
1094 /* Nodes may display warnings when the compositor is enabled, so we need a redraw in that case,
1095 * and even when it gets disabled in order to potentially remove the warning. */
1097}
1098
1099static void rna_SpaceView3D_retopology_update(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
1100{
1101 /* Retopology can change the visibility of active object.
1102 * There is no actual data change but we just notify the viewport engine to refresh and pickup
1103 * the new visibility. */
1105}
1106
1107static void rna_SpaceView3D_show_overlay_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1108{
1109 /* If Retopology is enabled, toggling overlays can change the visibility of active object. */
1110 const View3D *v3d = static_cast<View3D *>(ptr->data);
1112 rna_SpaceView3D_retopology_update(bmain, scene, ptr);
1113 }
1114}
1115
1116static void rna_SpaceView3D_region_quadviews_begin(CollectionPropertyIterator *iter,
1117 PointerRNA *ptr)
1118{
1119 View3D *v3d = (View3D *)(ptr->data);
1120 ScrArea *area = rna_area_from_space(ptr);
1121 int i = 3;
1122
1123 ARegion *region = static_cast<ARegion *>(
1124 ((area && area->spacedata.first == v3d) ? &area->regionbase : &v3d->regionbase)->last);
1125 ListBase lb = {nullptr, nullptr};
1126
1127 if (region && region->alignment == RGN_ALIGN_QSPLIT) {
1128 while (i-- && region) {
1129 region = region->prev;
1130 }
1131
1132 if (i < 0) {
1133 lb.first = region;
1134 }
1135 }
1136
1137 rna_iterator_listbase_begin(iter, ptr, &lb, nullptr);
1138}
1139
1140static PointerRNA rna_SpaceView3D_region_quadviews_get(CollectionPropertyIterator *iter)
1141{
1142 void *regiondata = ((ARegion *)rna_iterator_listbase_get(iter))->regiondata;
1143
1144 return RNA_pointer_create_with_parent(iter->parent, &RNA_RegionView3D, regiondata);
1145}
1146
1147static void rna_RegionView3D_quadview_update(Main * /*main*/, Scene * /*scene*/, PointerRNA *ptr)
1148{
1149 ScrArea *area;
1150 ARegion *region;
1151
1152 rna_area_region_from_regiondata(ptr, &area, &region);
1153 if (area && region && region->alignment == RGN_ALIGN_QSPLIT) {
1154 ED_view3d_quadview_update(area, region, false);
1155 }
1156}
1157
1159static void rna_RegionView3D_quadview_clip_update(Main * /*main*/,
1160 Scene * /*scene*/,
1161 PointerRNA *ptr)
1162{
1163 ScrArea *area;
1164 ARegion *region;
1165
1166 rna_area_region_from_regiondata(ptr, &area, &region);
1167 if (area && region && region->alignment == RGN_ALIGN_QSPLIT) {
1168 ED_view3d_quadview_update(area, region, true);
1169 }
1170}
1171
1177static void rna_RegionView3D_view_rotation_set_validate_view_axis(RegionView3D *rv3d)
1178{
1179 /* Never rotate from a "User" view into an axis aligned view,
1180 * otherwise rotation could be aligned by accident - giving unexpected behavior. */
1181 if (!RV3D_VIEW_IS_AXIS(rv3d->view)) {
1182 return;
1183 }
1184 /* Keep this small as script authors wont expect the assigned value to change. */
1185 const float eps_quat = 1e-6f;
1187 rv3d->viewquat, eps_quat, &rv3d->view, &rv3d->view_axis_roll);
1188}
1189
1190static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
1191{
1192 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1193 negate_v3_v3(values, rv3d->ofs);
1194}
1195
1196static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
1197{
1198 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1199 negate_v3_v3(rv3d->ofs, values);
1200}
1201
1202static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
1203{
1204 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1205 invert_qt_qt(values, rv3d->viewquat);
1206}
1207
1208static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
1209{
1210 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1211 invert_qt_qt(rv3d->viewquat, values);
1212 rna_RegionView3D_view_rotation_set_validate_view_axis(rv3d);
1213}
1214
1215static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
1216{
1217 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1218 float mat[4][4];
1219 invert_m4_m4(mat, (float(*)[4])values);
1220 ED_view3d_from_m4(mat, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
1221 rna_RegionView3D_view_rotation_set_validate_view_axis(rv3d);
1222}
1223
1224static bool rna_RegionView3D_is_orthographic_side_view_get(PointerRNA *ptr)
1225{
1226 /* NOTE: only checks axis alignment, not orthographic,
1227 * we may deprecate the current name to reflect this. */
1228 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1229 return RV3D_VIEW_IS_AXIS(rv3d->view);
1230}
1231
1232static void rna_RegionView3D_is_orthographic_side_view_set(PointerRNA *ptr, bool value)
1233{
1234 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1235 const bool was_axis_view = RV3D_VIEW_IS_AXIS(rv3d->view);
1236 if (value) {
1237 /* Already axis aligned, nothing to do. */
1238 if (was_axis_view) {
1239 return;
1240 }
1241 /* Use a large value as we always want to set this to the closest axis. */
1242 const float eps_quat = FLT_MAX;
1244 rv3d->viewquat, eps_quat, &rv3d->view, &rv3d->view_axis_roll);
1245 }
1246 else {
1247 /* Only allow changing from axis-views to user view as camera view for example
1248 * doesn't make sense to update. */
1249 if (!was_axis_view) {
1250 return;
1251 }
1252 rv3d->view = RV3D_VIEW_USER;
1253 }
1254}
1255
1256static IDProperty **rna_View3DShading_idprops(PointerRNA *ptr)
1257{
1258 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1259 return &shading->prop;
1260}
1261
1262static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1263{
1264 ID *id = ptr->owner_id;
1265 if (GS(id->name) != ID_SCR) {
1266 return;
1267 }
1268
1269 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1270 if (shading->type == OB_MATERIAL ||
1271 (shading->type == OB_RENDER && !BKE_scene_uses_blender_workbench(scene)))
1272 {
1273 /* When switching from workbench to render or material mode the geometry of any
1274 * active sculpt session needs to be recalculated. */
1275 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1276 if (ob->sculpt) {
1278 }
1279 }
1280 }
1281
1282 bScreen *screen = (bScreen *)ptr->owner_id;
1283 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1284 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1285 if (sl->spacetype == SPACE_VIEW3D) {
1286 View3D *v3d = (View3D *)sl;
1287 if (&v3d->shading == shading) {
1288 ED_view3d_shade_update(bmain, v3d, area);
1289 return;
1290 }
1291 }
1292 }
1293 }
1294}
1295
1296static Scene *rna_3DViewShading_scene(PointerRNA *ptr)
1297{
1298 /* Get scene, depends if using 3D view or OpenGL render settings. */
1299 ID *id = ptr->owner_id;
1300 if (GS(id->name) == ID_SCE) {
1301 return (Scene *)id;
1302 }
1303 else {
1304 bScreen *screen = (bScreen *)ptr->owner_id;
1305 return WM_windows_scene_get_from_screen(static_cast<wmWindowManager *>(G_MAIN->wm.first),
1306 screen);
1307 }
1308}
1309
1310static ViewLayer *rna_3DViewShading_view_layer(PointerRNA *ptr)
1311{
1312 /* Get scene, depends if using 3D view or OpenGL render settings. */
1313 ID *id = ptr->owner_id;
1314 if (GS(id->name) == ID_SCE) {
1315 return nullptr;
1316 }
1317 else {
1318 bScreen *screen = (bScreen *)ptr->owner_id;
1319 return WM_windows_view_layer_get_from_screen(static_cast<wmWindowManager *>(G_MAIN->wm.first),
1320 screen);
1321 }
1322}
1323
1324static int rna_3DViewShading_type_get(PointerRNA *ptr)
1325{
1326 /* Available shading types depend on render engine. */
1327 Scene *scene = rna_3DViewShading_scene(ptr);
1328 RenderEngineType *type = (scene) ? RE_engines_find(scene->r.engine) : nullptr;
1329 View3DShading *shading = (View3DShading *)ptr->data;
1330
1331 if (scene == nullptr || BKE_scene_uses_blender_eevee(scene)) {
1332 return shading->type;
1333 }
1334 else if (BKE_scene_uses_blender_workbench(scene)) {
1335 return (shading->type == OB_MATERIAL) ? int(OB_SOLID) : shading->type;
1336 }
1337 else {
1338 if (shading->type == OB_RENDER && !(type && type->view_draw)) {
1339 return OB_MATERIAL;
1340 }
1341 else {
1342 return shading->type;
1343 }
1344 }
1345}
1346
1347static void rna_3DViewShading_type_set(PointerRNA *ptr, int value)
1348{
1349 View3DShading *shading = (View3DShading *)ptr->data;
1350 if (value != shading->type && value == OB_RENDER) {
1351 shading->prev_type = shading->type;
1352 }
1353 shading->type = value;
1354}
1355
1356static const EnumPropertyItem *rna_3DViewShading_type_itemf(bContext * /*C*/,
1357 PointerRNA *ptr,
1358 PropertyRNA * /*prop*/,
1359 bool *r_free)
1360{
1361 Scene *scene = rna_3DViewShading_scene(ptr);
1362 RenderEngineType *type = (scene) ? RE_engines_find(scene->r.engine) : nullptr;
1363
1364 EnumPropertyItem *item = nullptr;
1365 int totitem = 0;
1366
1369
1370 if (scene == nullptr || BKE_scene_uses_blender_eevee(scene)) {
1373 }
1374 else if (BKE_scene_uses_blender_workbench(scene)) {
1376 }
1377 else {
1379 if (type && type->view_draw) {
1381 }
1382 }
1383
1384 RNA_enum_item_end(&item, &totitem);
1385 *r_free = true;
1386
1387 return item;
1388}
1389
1390/* Shading.selected_studio_light */
1391static PointerRNA rna_View3DShading_selected_studio_light_get(PointerRNA *ptr)
1392{
1393 View3DShading *shading = (View3DShading *)ptr->data;
1394 StudioLight *sl;
1395 if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_MATCAP) {
1397 }
1398 else if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_STUDIO) {
1400 }
1401 else {
1402 /* OB_MATERIAL and OB_RENDER */
1404 }
1405 return RNA_pointer_create_with_parent(*ptr, &RNA_StudioLight, sl);
1406}
1407
1408/* shading.light */
1409static void rna_View3DShading_studio_light_get_storage(View3DShading *shading,
1410 char **dna_storage,
1411 int *flag)
1412{
1413 *dna_storage = shading->studio_light;
1414
1416 if (shading->type == OB_SOLID) {
1417 if (shading->light == V3D_LIGHTING_MATCAP) {
1419 *dna_storage = shading->matcap;
1420 }
1421 }
1422 else {
1424 *dna_storage = shading->lookdev_light;
1425 }
1426}
1427
1428static int rna_View3DShading_studio_light_get(PointerRNA *ptr)
1429{
1430 View3DShading *shading = (View3DShading *)ptr->data;
1431 char *dna_storage;
1432 int flag;
1433
1434 rna_View3DShading_studio_light_get_storage(shading, &dna_storage, &flag);
1435 StudioLight *sl = BKE_studiolight_find(dna_storage, flag);
1436 if (sl) {
1437 BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE);
1438 return sl->index;
1439 }
1440 else {
1441 return 0;
1442 }
1443}
1444
1445static void rna_View3DShading_studio_light_set(PointerRNA *ptr, int value)
1446{
1447 View3DShading *shading = (View3DShading *)ptr->data;
1448 char *dna_storage;
1449 int flag;
1450
1451 rna_View3DShading_studio_light_get_storage(shading, &dna_storage, &flag);
1453 if (sl) {
1454 BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE);
1455 }
1456}
1457
1458static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(bContext * /*C*/,
1459 PointerRNA *ptr,
1460 PropertyRNA * /*prop*/,
1461 bool *r_free)
1462{
1463 View3DShading *shading = (View3DShading *)ptr->data;
1464 EnumPropertyItem *item = nullptr;
1465 int totitem = 0;
1466
1467 if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_MATCAP) {
1469
1471 int icon_id = (shading->flag & V3D_SHADING_MATCAP_FLIP_X) ? sl->icon_id_matcap_flipped :
1472 sl->icon_id_matcap;
1473 if ((sl->flag & flags) == flags) {
1474 EnumPropertyItem tmp = {sl->index, sl->name, icon_id, sl->name, ""};
1475 RNA_enum_item_add(&item, &totitem, &tmp);
1476 }
1477 }
1478 }
1479 else {
1481 int icon_id = sl->icon_id_irradiance;
1482 bool show_studiolight = false;
1483
1484 if (sl->flag & STUDIOLIGHT_INTERNAL) {
1485 /* always show internal lights for solid */
1486 if (shading->type == OB_SOLID) {
1487 show_studiolight = true;
1488 }
1489 }
1490 else {
1491 switch (shading->type) {
1492 case OB_SOLID:
1493 case OB_TEXTURE:
1494 show_studiolight = ((sl->flag & STUDIOLIGHT_TYPE_STUDIO) != 0);
1495 break;
1496
1497 case OB_MATERIAL:
1498 case OB_RENDER:
1499 show_studiolight = ((sl->flag & STUDIOLIGHT_TYPE_WORLD) != 0);
1500 icon_id = sl->icon_id_radiance;
1501 break;
1502 }
1503 }
1504
1505 if (show_studiolight) {
1506 EnumPropertyItem tmp = {sl->index, sl->name, icon_id, sl->name, ""};
1507 RNA_enum_item_add(&item, &totitem, &tmp);
1508 }
1509 }
1510 }
1511
1512 RNA_enum_item_end(&item, &totitem);
1513 *r_free = true;
1514 return item;
1515}
1516
1517static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C,
1518 PointerRNA * /*ptr*/,
1519 PropertyRNA * /*prop*/,
1520 bool *r_free)
1521{
1522 Scene *scene = CTX_data_scene(C);
1523 ViewLayer *view_layer = CTX_data_view_layer(C);
1524
1525 const bool aov_available = BKE_view_layer_has_valid_aov(view_layer);
1526 const bool eevee_active = STREQ(scene->r.engine, "BLENDER_EEVEE_NEXT");
1527
1528 int totitem = 0;
1529 EnumPropertyItem *result = nullptr;
1530 EnumPropertyItem aov_template;
1531 for (int i = 0; rna_enum_view3dshading_render_pass_type_items[i].identifier != nullptr; i++) {
1533 if (item->value == EEVEE_RENDER_PASS_AOV) {
1534 aov_template.value = item->value;
1535 aov_template.icon = 0;
1536 aov_template.description = item->description;
1537 LISTBASE_FOREACH (ViewLayerAOV *, aov, &view_layer->aovs) {
1538 if ((aov->flag & AOV_CONFLICT) != 0) {
1539 continue;
1540 }
1541 aov_template.name = aov->name;
1542 aov_template.identifier = aov->name;
1543 RNA_enum_item_add(&result, &totitem, &aov_template);
1544 aov_template.value++;
1545 }
1546 }
1547 else if (ELEM(item->value,
1551 !eevee_active)
1552 {
1553 }
1554 else if (!aov_available && STREQ(item->name, "Shader AOV")) {
1555 /* Don't add Shader AOV submenu when there are no AOVs defined. */
1556 }
1557 else {
1558 RNA_enum_item_add(&result, &totitem, item);
1559 }
1560 }
1561
1562 RNA_enum_item_end(&result, &totitem);
1563 *r_free = true;
1564 return result;
1565}
1566static int rna_3DViewShading_render_pass_get(PointerRNA *ptr)
1567{
1568 View3DShading *shading = (View3DShading *)ptr->data;
1570 ViewLayer *view_layer = rna_3DViewShading_view_layer(ptr);
1571
1573 if (!view_layer) {
1575 }
1576 const int aov_index = BLI_findstringindex(
1577 &view_layer->aovs, shading->aov_name, offsetof(ViewLayerAOV, name));
1578 if (aov_index == -1) {
1580 }
1581 return result + aov_index;
1582 }
1583
1584 return result;
1585}
1586
1587static void rna_3DViewShading_render_pass_set(PointerRNA *ptr, int value)
1588{
1589 View3DShading *shading = (View3DShading *)ptr->data;
1590 ViewLayer *view_layer = rna_3DViewShading_view_layer(ptr);
1591 shading->aov_name[0] = 0;
1592
1593 if ((value & EEVEE_RENDER_PASS_AOV) != 0) {
1594 if (!view_layer) {
1596 return;
1597 }
1598 const int aov_index = value & ~EEVEE_RENDER_PASS_AOV;
1599 ViewLayerAOV *aov = static_cast<ViewLayerAOV *>(BLI_findlink(&view_layer->aovs, aov_index));
1600 if (!aov) {
1601 /* AOV not found, cannot select AOV. */
1603 return;
1604 }
1605
1607 STRNCPY(shading->aov_name, aov->name);
1608 }
1609 else {
1610 shading->render_pass = value;
1611 }
1612}
1613
1614static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA *ptr)
1615{
1616 Main *bmain = CTX_data_main(C);
1617 Scene *scene = CTX_data_scene(C);
1618 ViewLayer *view_layer = CTX_data_view_layer(C);
1619 View3D *v3d = (View3D *)ptr->data;
1620
1621 if (ED_view3d_local_collections_set(bmain, v3d)) {
1622 BKE_layer_collection_local_sync(scene, view_layer, v3d);
1624 }
1625}
1626
1627static const EnumPropertyItem *rna_SpaceView3D_stereo3d_camera_itemf(bContext *C,
1628 PointerRNA * /*ptr*/,
1629 PropertyRNA * /*prop*/,
1630 bool * /*r_free*/)
1631{
1632 Scene *scene = CTX_data_scene(C);
1633
1635 return multiview_camera_items;
1636 }
1637 else {
1638 return stereo3d_camera_items;
1639 }
1640}
1641
1642static void rna_SpaceView3D_mirror_xr_session_update(Main *main,
1643 Scene * /*scene*/,
1644 PointerRNA *ptr)
1645{
1646# ifdef WITH_XR_OPENXR
1647 const wmWindowManager *wm = static_cast<wmWindowManager *>(main->wm.first);
1648
1649 /* Handle mirror toggling while there is a session already. */
1650 if (WM_xr_session_exists(&wm->xr)) {
1651 const View3D *v3d = static_cast<const View3D *>(ptr->data);
1652 const ScrArea *area = rna_area_from_space(ptr);
1653 ED_view3d_xr_mirror_update(area, v3d, v3d->flag & V3D_XR_SESSION_MIRROR);
1654 }
1655
1656# else
1658# endif
1659}
1660
1661static int rna_SpaceView3D_icon_from_show_object_viewport_get(PointerRNA *ptr)
1662{
1663 const View3D *v3d = (View3D *)ptr->data;
1666}
1667
1668static std::optional<std::string> rna_View3DShading_path(const PointerRNA *ptr)
1669{
1670 if (GS(ptr->owner_id->name) == ID_SCE) {
1671 return "display.shading";
1672 }
1673 else if (GS(ptr->owner_id->name) == ID_SCR) {
1674 const bScreen *screen = reinterpret_cast<bScreen *>(ptr->owner_id);
1675 const View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1676 int area_index;
1677 int space_index;
1678 LISTBASE_FOREACH_INDEX (ScrArea *, area, &screen->areabase, area_index) {
1679 LISTBASE_FOREACH_INDEX (SpaceLink *, sl, &area->spacedata, space_index) {
1680 if (sl->spacetype == SPACE_VIEW3D) {
1681 View3D *v3d = reinterpret_cast<View3D *>(sl);
1682 if (&v3d->shading == shading) {
1683 return fmt::format("areas[{}].spaces[{}].shading", area_index, space_index);
1684 }
1685 }
1686 }
1687 }
1688 }
1689
1690 return "shading";
1691}
1692
1693static PointerRNA rna_SpaceView3D_overlay_get(PointerRNA *ptr)
1694{
1695 return RNA_pointer_create_with_parent(*ptr, &RNA_View3DOverlay, ptr->data);
1696}
1697
1698static std::optional<std::string> rna_View3DOverlay_path(const PointerRNA *ptr)
1699{
1700 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
1701 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
1702}
1703
1704/* Space Image Editor */
1705
1706static PointerRNA rna_SpaceImage_overlay_get(PointerRNA *ptr)
1707{
1708 return RNA_pointer_create_with_parent(*ptr, &RNA_SpaceImageOverlay, ptr->data);
1709}
1710
1711static std::optional<std::string> rna_SpaceImageOverlay_path(const PointerRNA *ptr)
1712{
1713 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
1714 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
1715}
1716
1717static std::optional<std::string> rna_SpaceUVEditor_path(const PointerRNA *ptr)
1718{
1719 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
1720 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "uv_editor");
1721}
1722
1723static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
1724{
1725 return RNA_pointer_create_with_parent(*ptr, &RNA_SpaceUVEditor, ptr->data);
1726}
1727
1728static void rna_SpaceImageEditor_mode_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
1729{
1730 if (scene != nullptr) {
1731 ED_space_image_paint_update(bmain, static_cast<wmWindowManager *>(bmain->wm.first), scene);
1732 }
1733}
1734
1735static void rna_SpaceImageEditor_show_stereo_set(PointerRNA *ptr, bool value)
1736{
1737 SpaceImage *sima = (SpaceImage *)(ptr->data);
1738
1739 if (value) {
1740 sima->iuser.flag |= IMA_SHOW_STEREO;
1741 }
1742 else {
1743 sima->iuser.flag &= ~IMA_SHOW_STEREO;
1744 }
1745}
1746
1747static bool rna_SpaceImageEditor_show_stereo_get(PointerRNA *ptr)
1748{
1749 SpaceImage *sima = (SpaceImage *)(ptr->data);
1750 return (sima->iuser.flag & IMA_SHOW_STEREO) != 0;
1751}
1752
1753static void rna_SpaceImageEditor_show_stereo_update(Main * /*bmain*/,
1754 Scene * /*scene*/,
1755 PointerRNA *ptr)
1756{
1757 SpaceImage *sima = (SpaceImage *)(ptr->data);
1758 Image *ima = sima->image;
1759
1760 if (ima) {
1761 if (ima->rr) {
1762 BKE_image_multilayer_index(ima->rr, &sima->iuser);
1763 }
1764 else {
1765 BKE_image_multiview_index(ima, &sima->iuser);
1766 }
1767 }
1768}
1769
1770static bool rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
1771{
1772 SpaceImage *sima = (SpaceImage *)(ptr->data);
1773 return ED_space_image_show_render(sima);
1774}
1775
1776static bool rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
1777{
1778 SpaceImage *sima = (SpaceImage *)(ptr->data);
1779 return ED_space_image_show_paint(sima);
1780}
1781
1782static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
1783{
1784 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
1785 bScreen *screen = (bScreen *)ptr->owner_id;
1786 Object *obedit = nullptr;
1787 wmWindow *win = ED_screen_window_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1788 if (win != nullptr) {
1789 Scene *scene = WM_window_get_active_scene(win);
1790 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
1791 BKE_view_layer_synced_ensure(scene, view_layer);
1792 obedit = BKE_view_layer_edit_object_get(view_layer);
1793 }
1794 return ED_space_image_show_uvedit(sima, obedit);
1795}
1796
1797static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
1798{
1799 SpaceImage *sima = (SpaceImage *)(ptr->data);
1800 bScreen *screen = (bScreen *)ptr->owner_id;
1801 Object *obedit = nullptr;
1802 wmWindow *win = ED_screen_window_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1803 if (win != nullptr) {
1804 Scene *scene = WM_window_get_active_scene(win);
1805 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
1806 BKE_view_layer_synced_ensure(scene, view_layer);
1807 obedit = BKE_view_layer_edit_object_get(view_layer);
1808 }
1809 return ED_space_image_check_show_maskedit(sima, obedit);
1810}
1811
1812static void rna_SpaceImageEditor_image_set(PointerRNA *ptr,
1813 PointerRNA value,
1814 ReportList * /*reports*/)
1815{
1816 BLI_assert(BKE_id_is_in_global_main(static_cast<ID *>(value.data)));
1817 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
1818 ED_space_image_set(G_MAIN, sima, (Image *)value.data, false);
1819}
1820
1821static void rna_SpaceImageEditor_mask_set(PointerRNA *ptr,
1822 PointerRNA value,
1823 ReportList * /*reports*/)
1824{
1825 SpaceImage *sima = (SpaceImage *)(ptr->data);
1826
1827 ED_space_image_set_mask(nullptr, sima, (Mask *)value.data);
1828}
1829
1830static const EnumPropertyItem *rna_SpaceImageEditor_display_channels_itemf(bContext * /*C*/,
1831 PointerRNA *ptr,
1832 PropertyRNA * /*prop*/,
1833 bool *r_free)
1834{
1835 SpaceImage *sima = (SpaceImage *)ptr->data;
1836 EnumPropertyItem *item = nullptr;
1837 ImBuf *ibuf;
1838 void *lock;
1839 int totitem = 0;
1840
1841 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
1844
1845 if (mask & SI_USE_ALPHA) {
1847 }
1849 if (mask & SI_SHOW_ALPHA) {
1851 }
1852 if (mask & SI_SHOW_ZBUF) {
1854 }
1855 if (mask & SI_SHOW_R) {
1857 }
1858 if (mask & SI_SHOW_G) {
1860 }
1861 if (mask & SI_SHOW_B) {
1863 }
1864
1865 RNA_enum_item_end(&item, &totitem);
1866 *r_free = true;
1867
1868 return item;
1869}
1870
1871static int rna_SpaceImageEditor_display_channels_get(PointerRNA *ptr)
1872{
1873 SpaceImage *sima = (SpaceImage *)ptr->data;
1874 ImBuf *ibuf;
1875 void *lock;
1876
1877 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
1880
1881 return sima->flag & mask;
1882}
1883
1884static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
1885{
1886 SpaceImage *sima = (SpaceImage *)ptr->data;
1887 ScrArea *area;
1888 ARegion *region;
1889
1890 values[0] = values[1] = 1;
1891
1892 /* Find #ARegion. */
1893 area = rna_area_from_space(ptr); /* can be nullptr */
1895 if (region) {
1896 ED_space_image_get_zoom(sima, region, &values[0], &values[1]);
1897 }
1898}
1899
1900static float rna_SpaceImageEditor_zoom_percentage_get(PointerRNA *ptr)
1901{
1902 SpaceImage *sima = (SpaceImage *)ptr->data;
1903 return sima->zoom * 100.0f;
1904}
1905
1906static void rna_SpaceImageEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
1907{
1908 SpaceImage *sima = (SpaceImage *)ptr->data;
1909 sima->zoom = value / 100.0f;
1910}
1911
1912static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
1913{
1914 SpaceImage *sima = (SpaceImage *)ptr->data;
1915
1916 if (sima->flag & SI_COORDFLOATS) {
1917 copy_v2_v2(values, sima->cursor);
1918 }
1919 else {
1920 int w, h;
1921 ED_space_image_get_size(sima, &w, &h);
1922
1923 values[0] = sima->cursor[0] * w;
1924 values[1] = sima->cursor[1] * h;
1925 }
1926}
1927
1928static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
1929{
1930 SpaceImage *sima = (SpaceImage *)ptr->data;
1931
1932 if (sima->flag & SI_COORDFLOATS) {
1933 copy_v2_v2(sima->cursor, values);
1934 }
1935 else {
1936 int w, h;
1937 ED_space_image_get_size(sima, &w, &h);
1938
1939 sima->cursor[0] = values[0] / w;
1940 sima->cursor[1] = values[1] / h;
1941 }
1942}
1943
1944static void rna_SpaceImageEditor_image_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1945{
1946 SpaceImage *sima = (SpaceImage *)ptr->data;
1947 Image *ima = sima->image;
1948
1949 /* make sure all the iuser settings are valid for the sima image */
1950 if (ima) {
1951 if (ima->rr) {
1952 if (BKE_image_multilayer_index(sima->image->rr, &sima->iuser) == nullptr) {
1953 BKE_image_init_imageuser(sima->image, &sima->iuser);
1954 }
1955 }
1956 else {
1957 BKE_image_multiview_index(ima, &sima->iuser);
1958 }
1959 }
1960}
1961
1962static void rna_SpaceImageEditor_scopes_update(bContext *C, PointerRNA *ptr)
1963{
1964 SpaceImage *sima = (SpaceImage *)ptr->data;
1965 ImBuf *ibuf;
1966 void *lock;
1967
1968 /* TODO(lukas): Support tiles in scopes? */
1969 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
1970 if (ibuf) {
1971 ED_space_image_scopes_update(C, sima, ibuf, true);
1973 }
1975}
1976
1977static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext * /*C*/,
1978 PointerRNA *ptr,
1979 PropertyRNA * /*prop*/,
1980 bool * /*r_free*/)
1981{
1982 static const EnumPropertyItem pivot_items[] = {
1983 {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
1984 {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
1985 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
1987 "INDIVIDUAL_ORIGINS",
1988 ICON_PIVOT_INDIVIDUAL,
1989 "Individual Origins",
1990 "Pivot around each selected island's own median point"},
1991 {0, nullptr, 0, nullptr, nullptr},
1992 };
1993
1994 SpaceImage *sima = (SpaceImage *)ptr->data;
1995
1996 if (sima->mode == SI_MODE_PAINT) {
1998 }
1999 else {
2000 return pivot_items;
2001 }
2002}
2003
2004static void rna_SpaceUVEditor_tile_grid_shape_set(PointerRNA *ptr, const int *values)
2005{
2006 SpaceImage *data = (SpaceImage *)(ptr->data);
2007
2008 int clamp[2] = {10, 100};
2009 for (int i = 0; i < 2; i++) {
2010 data->tile_grid_shape[i] = std::clamp(values[i], 1, clamp[i]);
2011 }
2012}
2013
2014static void rna_SpaceUVEditor_custom_grid_subdiv_set(PointerRNA *ptr, const int *values)
2015{
2016 SpaceImage *data = (SpaceImage *)(ptr->data);
2017
2018 for (int i = 0; i < 2; i++) {
2019 data->custom_grid_subdiv[i] = std::clamp(values[i], 1, 5000);
2020 }
2021}
2022
2023/* Space Text Editor */
2024
2025static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, bool value)
2026{
2027 SpaceText *st = (SpaceText *)(ptr->data);
2028
2029 st->wordwrap = value;
2030 st->left = 0;
2031}
2032
2033static void rna_SpaceTextEditor_text_set(PointerRNA *ptr,
2034 PointerRNA value,
2035 ReportList * /*reports*/)
2036{
2037 SpaceText *st = (SpaceText *)(ptr->data);
2038
2039 st->text = static_cast<Text *>(value.data);
2040 if (st->text != nullptr) {
2041 id_us_ensure_real((ID *)st->text);
2042 }
2043
2044 ScrArea *area = rna_area_from_space(ptr);
2045 if (area) {
2047 if (region) {
2048 ED_space_text_scroll_to_cursor(st, region, true);
2049 }
2050 }
2051}
2052
2053static bool rna_SpaceTextEditor_text_is_syntax_highlight_supported(SpaceText *space)
2054{
2056}
2057
2058static void rna_SpaceTextEditor_updateEdited(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2059{
2060 SpaceText *st = (SpaceText *)ptr->data;
2061
2062 if (st->text) {
2064 }
2065}
2066
2067static int rna_SpaceTextEditor_visible_lines_get(PointerRNA *ptr)
2068{
2069 const SpaceText *st = static_cast<SpaceText *>(ptr->data);
2071}
2072
2073/* Space Properties */
2074
2075/* NOTE: this function exists only to avoid id reference-counting. */
2076static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr,
2077 PointerRNA value,
2078 ReportList * /*reports*/)
2079{
2080 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2081 sbuts->pinid = static_cast<ID *>(value.data);
2082}
2083
2084static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
2085{
2086 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2087
2088 if (sbuts->pinid) {
2089 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
2090 }
2091
2092 return &RNA_ID;
2093}
2094
2095static void rna_SpaceProperties_pin_id_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2096{
2097 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2098 ID *id = sbuts->pinid;
2099
2100 if (id == nullptr) {
2101 sbuts->flag &= ~SB_PIN_CONTEXT;
2102 return;
2103 }
2104
2105 switch (GS(id->name)) {
2106 case ID_MA:
2108 break;
2109 case ID_TE:
2111 break;
2112 case ID_WO:
2114 break;
2115 case ID_LA:
2116 WM_main_add_notifier(NC_LAMP, nullptr);
2117 break;
2118 default:
2119 break;
2120 }
2121}
2122
2123static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
2124{
2125 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2126
2127 sbuts->mainb = value;
2128 sbuts->mainbuser = value;
2129}
2130
2131static const EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext * /*C*/,
2132 PointerRNA *ptr,
2133 PropertyRNA * /*prop*/,
2134 bool *r_free)
2135{
2136 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2137 EnumPropertyItem *item = nullptr;
2138
2139 /* Although it would never reach this amount, a theoretical maximum number of tabs
2140 * is BCONTEXT_TOT * 2, with every tab displayed and a spacer in every other item. */
2141 const blender::Vector<eSpaceButtons_Context> context_tabs_array = ED_buttons_tabs_list(sbuts);
2142
2143 int totitem_added = 0;
2144 bool add_separator = true;
2145 for (const eSpaceButtons_Context tab : context_tabs_array) {
2146 if (tab == -1) {
2147 if (add_separator) {
2148 RNA_enum_item_add_separator(&item, &totitem_added);
2149 add_separator = false;
2150 }
2151 continue;
2152 }
2153
2154 RNA_enum_items_add_value(&item, &totitem_added, buttons_context_items, tab);
2155 add_separator = true;
2156
2157 /* Add the object data icon dynamically for the data tab. */
2158 if (tab == BCONTEXT_DATA) {
2159 (item + totitem_added - 1)->icon = sbuts->dataicon;
2160 }
2161 }
2162
2163 RNA_enum_item_end(&item, &totitem_added);
2164 *r_free = true;
2165
2166 return item;
2167}
2168
2169static void rna_SpaceProperties_context_update(Main * /*bmain*/,
2170 Scene * /*scene*/,
2171 PointerRNA *ptr)
2172{
2173 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2174 /* XXX BCONTEXT_DATA is ugly, but required for lights... See #51318. */
2176 sbuts->preview = 1;
2177 }
2178}
2179
2180static int rna_SpaceProperties_tab_search_results_getlength(const PointerRNA *ptr,
2182{
2183 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2184
2185 const blender::Vector<eSpaceButtons_Context> context_tabs_array = ED_buttons_tabs_list(sbuts);
2186
2187 length[0] = context_tabs_array.size();
2188
2189 return length[0];
2190}
2191
2192static void rna_SpaceProperties_tab_search_results_get(PointerRNA *ptr, bool *values)
2193{
2194 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2195
2196 const blender::Vector<eSpaceButtons_Context> context_tabs_array = ED_buttons_tabs_list(sbuts);
2197
2198 for (const int i : context_tabs_array.index_range()) {
2199 values[i] = ED_buttons_tab_has_search_result(sbuts, i);
2200 }
2201}
2202
2203static void rna_SpaceProperties_search_filter_get(PointerRNA *ptr, char *value)
2204{
2205 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2206 const char *search_filter = ED_buttons_search_string_get(sbuts);
2207
2208 strcpy(value, search_filter);
2209}
2210
2211static int rna_SpaceProperties_search_filter_length(PointerRNA *ptr)
2212{
2213 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2214
2215 return ED_buttons_search_string_length(sbuts);
2216}
2217
2218static void rna_SpaceProperties_search_filter_set(PointerRNA *ptr, const char *value)
2219{
2220 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2221
2222 ED_buttons_search_string_set(sbuts, value);
2223}
2224
2225static void rna_SpaceProperties_search_filter_update(Main * /*bmain*/,
2226 Scene * /*scene*/,
2227 PointerRNA *ptr)
2228{
2229 ScrArea *area = rna_area_from_space(ptr);
2230
2231 /* Update the search filter flag for the main region with the panels. */
2233 BLI_assert(main_region != nullptr);
2234 ED_region_search_filter_update(area, main_region);
2235}
2236
2237/* Space Console */
2238static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
2239{
2240 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2241 memcpy(value, ci->line, ci->len + 1);
2242}
2243
2244static int rna_ConsoleLine_body_length(PointerRNA *ptr)
2245{
2246 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2247 return ci->len;
2248}
2249
2250static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
2251{
2252 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2253 size_t len = strlen(value);
2254
2255 if ((len >= size_t(ci->len_alloc)) || (len * 2 < size_t(ci->len_alloc)))
2256 { /* allocate a new string */
2257 MEM_freeN(ci->line);
2258 ci->line = MEM_malloc_arrayN<char>(len + 1, "rna_consoleline");
2259 ci->len_alloc = int(len + 1);
2260 }
2261 memcpy(ci->line, value, len + 1);
2262 ci->len = int(len);
2263
2264 if (size_t(ci->cursor) > len) {
2265 /* clamp the cursor */
2266 ci->cursor = int(len);
2267 }
2268}
2269
2270static int rna_ConsoleLine_current_character_get(PointerRNA *ptr)
2271{
2272 const ConsoleLine *ci = (ConsoleLine *)ptr->data;
2273 return BLI_str_utf8_offset_to_index(ci->line, ci->len, ci->cursor);
2274}
2275
2276static void rna_ConsoleLine_current_character_set(PointerRNA *ptr, const int index)
2277{
2278 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2279 ci->cursor = BLI_str_utf8_offset_from_index(ci->line, ci->len, index);
2280}
2281
2282/* Space Dope-sheet */
2283
2284static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr,
2285 PointerRNA value,
2286 ReportList * /*reports*/)
2287{
2288 SpaceAction *saction = (SpaceAction *)(ptr->data);
2289 bAction *act = (bAction *)value.data;
2290
2291 if ((act == nullptr) || (act->idroot == 0)) {
2292 /* just set if we're clearing the action or if the action is "amorphous" still */
2293 saction->action = act;
2294 }
2295 else {
2296 /* action to set must strictly meet the mode criteria... */
2297 if (saction->mode == SACTCONT_ACTION) {
2298 /* currently, this is "object-level" only, until we have some way of specifying this */
2299 if (act->idroot == ID_OB) {
2300 saction->action = act;
2301 }
2302 else {
2303 printf(
2304 "ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level "
2305 "animation\n",
2306 act->id.name + 2);
2307 }
2308 }
2309 else if (saction->mode == SACTCONT_SHAPEKEY) {
2310 /* As the name says, "shape-key level" only. */
2311 if (act->idroot == ID_KE) {
2312 saction->action = act;
2313 }
2314 else {
2315 printf(
2316 "ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate "
2317 "Shape Keys\n",
2318 act->id.name + 2);
2319 }
2320 }
2321 else {
2322 printf(
2323 "ACK: who's trying to set an action while not in a mode displaying a single Action "
2324 "only?\n");
2325 }
2326 }
2327}
2328
2329static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
2330{
2331 SpaceAction *saction = (SpaceAction *)(ptr->data);
2332 const Scene *scene = CTX_data_scene(C);
2333 ViewLayer *view_layer = CTX_data_view_layer(C);
2334 Main *bmain = CTX_data_main(C);
2335
2336 BKE_view_layer_synced_ensure(scene, view_layer);
2337 Object *obact = BKE_view_layer_active_object_get(view_layer);
2338 if (obact == nullptr) {
2339 return;
2340 }
2341
2342 AnimData *adt = nullptr;
2343 ID *id = nullptr;
2344 switch (saction->mode) {
2345 case SACTCONT_ACTION:
2346 /* TODO: context selector could help decide this with more control? */
2347 adt = BKE_animdata_ensure_id(&obact->id);
2348 id = &obact->id;
2349 break;
2350 case SACTCONT_SHAPEKEY: {
2351 Key *key = BKE_key_from_object(obact);
2352 if (key == nullptr) {
2353 return;
2354 }
2355 adt = BKE_animdata_ensure_id(&key->id);
2356 id = &key->id;
2357 break;
2358 }
2359 case SACTCONT_GPENCIL:
2360 case SACTCONT_DOPESHEET:
2361 case SACTCONT_MASK:
2362 case SACTCONT_CACHEFILE:
2363 case SACTCONT_TIMELINE:
2364 return;
2365 }
2366
2367 if (adt == nullptr) {
2368 /* No animdata was added, so the depsgraph also doesn't need tagging. */
2369 return;
2370 }
2371
2372 /* Don't do anything if old and new actions are the same... */
2373 if (adt->action == saction->action) {
2374 return;
2375 }
2376
2377 /* Exit editmode first - we cannot change actions while in tweak-mode. */
2378 BKE_nla_tweakmode_exit({*id, *adt});
2379
2380 /* To prevent data loss (i.e. if users flip between actions using the Browse menu),
2381 * stash this action if nothing else uses it.
2382 *
2383 * EXCEPTION:
2384 * This callback runs when unlinking actions. In that case, we don't want to
2385 * stash the action, as the user is signaling that they want to detach it.
2386 * This can be reviewed again later,
2387 * but it could get annoying if we keep these instead.
2388 */
2389 if (adt->action != nullptr && adt->action->id.us <= 0 && saction->action != nullptr) {
2390 /* XXX: Things here get dodgy if this action is only partially completed,
2391 * and the user then uses the browse menu to get back to this action,
2392 * assigning it as the active action (i.e. the stash strip gets out of sync)
2393 */
2395 }
2396
2397 BKE_animdata_set_action(nullptr, id, saction->action);
2398
2400
2401 /* Update relations as well, so new time source dependency is added. */
2403}
2404
2405static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr)
2406{
2407 SpaceAction *saction = (SpaceAction *)(ptr->data);
2408 ScrArea *area = CTX_wm_area(C);
2409 const Scene *scene = CTX_data_scene(C);
2410 ViewLayer *view_layer = CTX_data_view_layer(C);
2411 BKE_view_layer_synced_ensure(scene, view_layer);
2412 Object *obact = BKE_view_layer_active_object_get(view_layer);
2413
2414 /* special exceptions for ShapeKey Editor mode */
2415 if (saction->mode == SACTCONT_SHAPEKEY) {
2416 Key *key = BKE_key_from_object(obact);
2417
2418 /* 1) update the action stored for the editor */
2419 if (key) {
2420 saction->action = (key->adt) ? key->adt->action : nullptr;
2421 }
2422 else {
2423 saction->action = nullptr;
2424 }
2425 }
2426 /* make sure action stored is valid */
2427 else if (saction->mode == SACTCONT_ACTION) {
2428 /* 1) update the action stored for the editor */
2429 /* TODO: context selector could help decide this with more control? */
2430 if (obact) {
2431 saction->action = (obact->adt) ? obact->adt->action : nullptr;
2432 }
2433 else {
2434 saction->action = nullptr;
2435 }
2436 }
2437
2438 /* Collapse (and show) summary channel and hide channel list for timeline */
2439 if (saction->mode == SACTCONT_TIMELINE) {
2441 saction->ads.filterflag |= ADS_FILTER_SUMMARY;
2442 }
2443
2444 if (area && area->spacedata.first == saction) {
2445 ARegion *channels_region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS);
2446 if (channels_region) {
2447 if (saction->mode == SACTCONT_TIMELINE) {
2448 channels_region->flag |= RGN_FLAG_HIDDEN;
2449 }
2450 else {
2451 channels_region->flag &= ~RGN_FLAG_HIDDEN;
2452 }
2453 ED_region_visibility_change_update(C, area, channels_region);
2454 }
2455 }
2456
2457 /* recalculate extents of channel list */
2459
2460 /* store current mode as "old mode",
2461 * so that returning from other editors doesn't always reset to "Action Editor" */
2462 if (saction->mode != SACTCONT_TIMELINE) {
2463 saction->mode_prev = saction->mode;
2464 }
2465}
2466
2467/* Space Graph Editor */
2468
2469static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *ptr)
2470{
2471 ScrArea *area = rna_area_from_space(ptr);
2472 SpaceGraph *sipo = (SpaceGraph *)ptr->data;
2473
2474 /* for "Drivers" mode, enable all the necessary bits and pieces */
2475 if (sipo->mode == SIPO_MODE_DRIVERS) {
2477 ED_area_tag_redraw(area);
2478 }
2479
2480 /* after changing view mode, must force recalculation of F-Curve colors
2481 * which can only be achieved using refresh as opposed to redraw
2482 */
2483 ED_area_tag_refresh(area);
2484}
2485
2486static void rna_SpaceGraphEditor_normalize_update(bContext *C, PointerRNA * /*ptr*/)
2487{
2488 bAnimContext ac;
2489
2490 if (ANIM_animdata_get_context(C, &ac) == 0) {
2491 return;
2492 }
2493
2496}
2497
2498static bool rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
2499{
2500 SpaceGraph *sipo = (SpaceGraph *)(ptr->data);
2501 return (BLI_listbase_is_empty(&sipo->runtime.ghost_curves) == false);
2502}
2503
2504static void rna_SpaceConsole_rect_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2505{
2506 SpaceConsole *sc = static_cast<SpaceConsole *>(ptr->data);
2508}
2509
2510static void rna_SequenceEditor_update_cache(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
2511{
2513}
2514
2515static void seq_build_proxy(bContext *C, PointerRNA *ptr)
2516{
2517 if (U.sequencer_proxy_setup != USER_SEQ_PROXY_SETUP_AUTOMATIC) {
2518 return;
2519 }
2520
2521 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2522 Scene *scene = CTX_data_scene(C);
2524
2525 blender::Set<std::string> processed_paths;
2528
2529 LISTBASE_FOREACH (Strip *, strip, seqbase) {
2530 if (strip->type != STRIP_TYPE_MOVIE || strip->data == nullptr || strip->data->proxy == nullptr)
2531 {
2532 continue;
2533 }
2534
2535 /* Add new proxy size. */
2536 strip->data->proxy->build_size_flags |= blender::seq::rendersize_to_proxysize(
2537 sseq->render_size);
2538
2539 /* Build proxy. */
2541 pj->main, pj->depsgraph, pj->scene, strip, &processed_paths, &pj->queue, true);
2542 }
2543
2544 if (!WM_jobs_is_running(wm_job)) {
2545 G.is_break = false;
2546 WM_jobs_start(CTX_wm_manager(C), wm_job);
2547 }
2548
2550}
2551
2552static void rna_SequenceEditor_render_size_update(bContext *C, PointerRNA *ptr)
2553{
2554 seq_build_proxy(C, ptr);
2555 rna_SequenceEditor_update_cache(CTX_data_main(C), CTX_data_scene(C), ptr);
2556}
2557
2558static bool rna_SequenceEditor_clamp_view_get(PointerRNA *ptr)
2559{
2560 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2561 return (sseq->flag & SEQ_CLAMP_VIEW) != 0;
2562}
2563
2564static void rna_SequenceEditor_clamp_view_set(PointerRNA *ptr, bool value)
2565{
2566 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2567 ScrArea *area;
2568 ARegion *region;
2569
2570 area = rna_area_from_space(ptr); /* can be nullptr */
2571 if (area == nullptr) {
2572 return;
2573 }
2574
2576 if (region) {
2577 if (value) {
2578 sseq->flag |= SEQ_CLAMP_VIEW;
2579 region->v2d.align &= ~V2D_ALIGN_NO_NEG_Y;
2580 }
2581 else {
2582 sseq->flag &= ~SEQ_CLAMP_VIEW;
2583 region->v2d.align |= V2D_ALIGN_NO_NEG_Y;
2584 }
2585 }
2586}
2587
2588static void rna_Sequencer_view_type_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2589{
2590 ScrArea *area = rna_area_from_space(ptr);
2591 ED_area_tag_refresh(area);
2592}
2593
2594static PointerRNA rna_SpaceSequenceEditor_preview_overlay_get(PointerRNA *ptr)
2595{
2596 return RNA_pointer_create_with_parent(*ptr, &RNA_SequencerPreviewOverlay, ptr->data);
2597}
2598
2599static std::optional<std::string> rna_SpaceSequencerPreviewOverlay_path(const PointerRNA *ptr)
2600{
2601 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2602 return fmt::format(
2603 "{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "preview_overlay");
2604}
2605
2606static PointerRNA rna_SpaceSequenceEditor_timeline_overlay_get(PointerRNA *ptr)
2607{
2608 return RNA_pointer_create_with_parent(*ptr, &RNA_SequencerTimelineOverlay, ptr->data);
2609}
2610
2611static std::optional<std::string> rna_SpaceSequencerTimelineOverlay_path(const PointerRNA *ptr)
2612{
2613 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2614 return fmt::format(
2615 "{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "timeline_overlay");
2616}
2617
2618static PointerRNA rna_SpaceSequenceEditor_cache_overlay_get(PointerRNA *ptr)
2619{
2620 return RNA_pointer_create_with_parent(*ptr, &RNA_SequencerCacheOverlay, ptr->data);
2621}
2622
2623static std::optional<std::string> rna_SpaceSequencerCacheOverlay_path(const PointerRNA *ptr)
2624{
2625 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2626 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "cache_overlay");
2627}
2628
2629static float rna_SpaceSequenceEditor_zoom_percentage_get(PointerRNA *ptr)
2630{
2631 ScrArea *area = rna_area_from_space(ptr);
2632 if (area == nullptr) {
2633 return 100.0f;
2634 }
2636 if (region == nullptr) {
2637 return 100.0f;
2638 }
2639
2640 View2D *v2d = &region->v2d;
2641 const float zoom = 1.0f / (BLI_rctf_size_x(&v2d->cur) / float(BLI_rcti_size_x(&v2d->mask))) *
2642 +100.0f;
2643 return zoom;
2644}
2645
2646static void rna_SpaceSequenceEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
2647{
2648 ScrArea *area = rna_area_from_space(ptr);
2649 if (area == nullptr) {
2650 return;
2651 }
2653 if (region == nullptr) {
2654 return;
2655 }
2656
2657 View2D *v2d = &region->v2d;
2658 BLI_rctf_resize(&v2d->cur,
2659 float(BLI_rcti_size_x(&v2d->mask)) / (value / 100.0f),
2660 float(BLI_rcti_size_y(&v2d->mask)) / (value / 100.0f));
2661 ED_region_tag_redraw(region);
2662}
2663
2664/* Space Node Editor */
2665static PointerRNA rna_SpaceNode_overlay_get(PointerRNA *ptr)
2666{
2667 return RNA_pointer_create_with_parent(*ptr, &RNA_SpaceNodeOverlay, ptr->data);
2668}
2669
2670static bool rna_SpaceNode_supports_previews(PointerRNA *ptr)
2671{
2672 return ED_node_supports_preview(static_cast<SpaceNode *>(ptr->data));
2673}
2674
2675static std::optional<std::string> rna_SpaceNodeOverlay_path(const PointerRNA *ptr)
2676{
2677 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2678 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
2679}
2680
2681static void rna_SpaceNodeEditor_node_tree_set(PointerRNA *ptr,
2682 const PointerRNA value,
2683 ReportList * /*reports*/)
2684{
2685 SpaceNode *snode = ptr->data_as<SpaceNode>();
2686 ScrArea *area = BKE_screen_find_area_from_space(reinterpret_cast<const bScreen *>(ptr->owner_id),
2687 reinterpret_cast<const SpaceLink *>(snode));
2689 ED_node_tree_start(region, snode, (bNodeTree *)value.data, nullptr, nullptr);
2690}
2691
2692static bool rna_SpaceNodeEditor_geometry_nodes_tool_tree_poll(PointerRNA * /*ptr*/,
2693 const PointerRNA value)
2694{
2695 const bNodeTree &ntree = *static_cast<const bNodeTree *>(value.data);
2696 if (ntree.type != NTREE_GEOMETRY) {
2697 return false;
2698 }
2699 if (!ntree.geometry_node_asset_traits) {
2700 return false;
2701 }
2703 return false;
2704 }
2705 return true;
2706}
2707
2708static bool space_node_node_geometry_nodes_poll(const SpaceNode &snode, const bNodeTree &ntree)
2709{
2712 if (!ntree.geometry_node_asset_traits) {
2713 return false;
2714 }
2716 return false;
2717 }
2718 return true;
2720 if (!ntree.geometry_node_asset_traits) {
2721 return false;
2722 }
2724 return false;
2725 }
2726 return true;
2727 }
2728 return false;
2729}
2730
2731static bool rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, const PointerRNA value)
2732{
2733 SpaceNode *snode = (SpaceNode *)ptr->data;
2734 bNodeTree *ntree = (bNodeTree *)value.data;
2735
2736 /* node tree type must match the selected type in node editor */
2737 if (!STREQ(snode->tree_idname, ntree->idname)) {
2738 return false;
2739 }
2740 if (ntree->type == NTREE_GEOMETRY) {
2741 if (!space_node_node_geometry_nodes_poll(*snode, *ntree)) {
2742 return false;
2743 }
2744 }
2745 return true;
2746}
2747
2748static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA * /*ptr*/)
2749{
2751}
2752
2753static void rna_SpaceNodeEditor_geometry_nodes_type_update(Main * /*main*/,
2754 Scene * /*scene*/,
2755 PointerRNA *ptr)
2756{
2757 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
2759 snode->flag &= ~SNODE_PIN;
2760 }
2761}
2762
2763static int rna_SpaceNodeEditor_tree_type_get(PointerRNA *ptr)
2764{
2765 SpaceNode *snode = (SpaceNode *)ptr->data;
2767}
2768static void rna_SpaceNodeEditor_tree_type_set(PointerRNA *ptr, int value)
2769{
2770 SpaceNode *snode = (SpaceNode *)ptr->data;
2772}
2773static bool rna_SpaceNodeEditor_tree_type_poll(void *Cv, blender::bke::bNodeTreeType *type)
2774{
2775 bContext *C = (bContext *)Cv;
2776 if (type->poll) {
2777 return type->poll(C, type);
2778 }
2779 else {
2780 return true;
2781 }
2782}
2783
2784static void rna_SpaceNodeEditor_cursor_location_get(PointerRNA *ptr, float value[2])
2785{
2786 const SpaceNode *snode = (SpaceNode *)ptr->data;
2787
2788 ED_node_cursor_location_get(snode, value);
2789}
2790
2791static void rna_SpaceNodeEditor_cursor_location_set(PointerRNA *ptr, const float value[2])
2792{
2793 SpaceNode *snode = (SpaceNode *)ptr->data;
2794
2795 ED_node_cursor_location_set(snode, value);
2796}
2797
2799{
2800 return rna_node_tree_type_itemf(C, C ? rna_SpaceNodeEditor_tree_type_poll : nullptr, r_free);
2801}
2802
2803static const EnumPropertyItem *rna_SpaceNodeEditor_tree_type_itemf(bContext *C,
2804 PointerRNA * /*ptr*/,
2805 PropertyRNA * /*prop*/,
2806 bool *r_free)
2807{
2808 return RNA_enum_node_tree_types_itemf_impl(C, r_free);
2809}
2810
2811static void rna_SpaceNodeEditor_path_get(PointerRNA *ptr, char *value)
2812{
2813 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
2814 ED_node_tree_path_get(snode, value);
2815}
2816
2817static int rna_SpaceNodeEditor_path_length(PointerRNA *ptr)
2818{
2819 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
2820 return ED_node_tree_path_length(snode);
2821}
2822
2823static void rna_SpaceNodeEditor_path_clear(SpaceNode *snode, bContext *C)
2824{
2825 ED_node_tree_start(nullptr, snode, nullptr, nullptr, nullptr);
2827}
2828
2829static ARegion *find_snode_region(SpaceNode *snode, bContext *C)
2830{
2831 if (wmWindowManager *wm = CTX_wm_manager(C)) {
2832 LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
2833 bScreen *screen = WM_window_get_active_screen(win);
2835 reinterpret_cast<const SpaceLink *>(snode));
2836 if (ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW)) {
2837 return region;
2838 }
2839 }
2840 }
2841 return nullptr;
2842}
2843
2844static void rna_SpaceNodeEditor_path_start(SpaceNode *snode, bContext *C, PointerRNA *node_tree)
2845{
2846 ARegion *region = find_snode_region(snode, C);
2847 ED_node_tree_start(region, snode, (bNodeTree *)node_tree->data, nullptr, nullptr);
2849}
2850
2851static void rna_SpaceNodeEditor_path_append(SpaceNode *snode,
2852 bContext *C,
2853 PointerRNA *node_tree,
2854 PointerRNA *node)
2855{
2856 ARegion *region = find_snode_region(snode, C);
2858 region, snode, static_cast<bNodeTree *>(node_tree->data), static_cast<bNode *>(node->data));
2860}
2861
2862static void rna_SpaceNodeEditor_path_pop(SpaceNode *snode, bContext *C)
2863{
2864 ARegion *region = find_snode_region(snode, C);
2865 ED_node_tree_pop(region, snode);
2867}
2868
2869static void rna_SpaceNodeEditor_show_backdrop_update(Main * /*bmain*/,
2870 Scene * /*scene*/,
2871 PointerRNA * /*ptr*/)
2872{
2875}
2876
2877static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode,
2878 bContext *C,
2879 int x,
2880 int y)
2881{
2882 ARegion *region = CTX_wm_region(C);
2883
2884 float cursor_location[2];
2885
2886 UI_view2d_region_to_view(&region->v2d, x, y, &cursor_location[0], &cursor_location[1]);
2887 cursor_location[0] /= UI_SCALE_FAC;
2888 cursor_location[1] /= UI_SCALE_FAC;
2889
2890 ED_node_cursor_location_set(snode, cursor_location);
2891}
2892
2893static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr,
2894 PointerRNA value,
2895 ReportList * /*reports*/)
2896{
2897 SpaceClip *sc = (SpaceClip *)(ptr->data);
2898 bScreen *screen = (bScreen *)ptr->owner_id;
2899
2900 ED_space_clip_set_clip(nullptr, screen, sc, (MovieClip *)value.data);
2901}
2902
2903static void rna_SpaceClipEditor_mask_set(PointerRNA *ptr,
2904 PointerRNA value,
2905 ReportList * /*reports*/)
2906{
2907 SpaceClip *sc = (SpaceClip *)(ptr->data);
2908
2909 ED_space_clip_set_mask(nullptr, sc, (Mask *)value.data);
2910}
2911
2912static void rna_SpaceClipEditor_clip_mode_update(Main * /*bmain*/,
2913 Scene * /*scene*/,
2914 PointerRNA *ptr)
2915{
2916 SpaceClip *sc = (SpaceClip *)(ptr->data);
2917
2918 if (sc->mode == SC_MODE_MASKEDIT && sc->view != SC_VIEW_CLIP) {
2919 /* Make sure we are in the right view for mask editing */
2920 sc->view = SC_VIEW_CLIP;
2921 ScrArea *area = rna_area_from_space(ptr);
2922 ED_area_tag_refresh(area);
2923 }
2924
2925 sc->scopes.ok = 0;
2926}
2927
2928static void rna_SpaceClipEditor_lock_selection_update(Main * /*bmain*/,
2929 Scene * /*scene*/,
2930 PointerRNA *ptr)
2931{
2932 SpaceClip *sc = (SpaceClip *)(ptr->data);
2933
2934 sc->xlockof = 0.0f;
2935 sc->ylockof = 0.0f;
2936}
2937
2938static void rna_SpaceClipEditor_view_type_update(Main * /*bmain*/,
2939 Scene * /*scene*/,
2940 PointerRNA *ptr)
2941{
2942 ScrArea *area = rna_area_from_space(ptr);
2943 ED_area_tag_refresh(area);
2944}
2945
2946static float rna_SpaceClipEditor_zoom_percentage_get(PointerRNA *ptr)
2947{
2948 SpaceClip *sc = (SpaceClip *)ptr->data;
2949 return sc->zoom * 100.0f;
2950}
2951
2952static void rna_SpaceClipEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
2953{
2954 SpaceClip *sc = (SpaceClip *)ptr->data;
2955 sc->zoom = value / 100.0f;
2956}
2957
2958/* File browser. */
2959
2960static std::optional<std::string> rna_FileSelectParams_path(const PointerRNA * /*ptr*/)
2961{
2962 return "params";
2963}
2964
2965int rna_FileSelectParams_filename_editable(const PointerRNA *ptr, const char **r_info)
2966{
2967 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
2968
2969 if (params && (params->flag & FILE_DIRSEL_ONLY)) {
2970 *r_info = N_("Only directories can be chosen for the current operation.");
2971 return 0;
2972 }
2973
2974 return params ? int(PROP_EDITABLE) : 0;
2975}
2976
2977static bool rna_FileSelectParams_use_lib_get(PointerRNA *ptr)
2978{
2979 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
2980
2981 return params && (params->type == FILE_LOADLIB);
2982}
2983
2984static const EnumPropertyItem *rna_FileSelectParams_display_type_itemf(bContext * /*C*/,
2985 PointerRNA *ptr,
2986 PropertyRNA * /*prop*/,
2987 bool *r_free)
2988{
2989 if (RNA_struct_is_a(ptr->type, &RNA_FileAssetSelectParams)) {
2990 EnumPropertyItem *items = nullptr;
2991 int totitem = 0;
2992
2993 /* Only expose preview and column view for asset browsing. */
2998
2999 RNA_enum_item_end(&items, &totitem);
3000 *r_free = true;
3001
3002 return items;
3003 }
3004
3005 *r_free = false;
3007}
3008
3009static const EnumPropertyItem *rna_FileSelectParams_recursion_level_itemf(bContext * /*C*/,
3010 PointerRNA *ptr,
3011 PropertyRNA * /*prop*/,
3012 bool *r_free)
3013{
3014 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
3015
3016 if (params && params->type != FILE_LOADLIB) {
3017 EnumPropertyItem *item = nullptr;
3018 int totitem = 0;
3019
3024
3025 RNA_enum_item_end(&item, &totitem);
3026 *r_free = true;
3027
3028 return item;
3029 }
3030
3031 *r_free = false;
3033}
3034
3035static const EnumPropertyItem *rna_FileSelectParams_sort_method_itemf(bContext * /*C*/,
3036 PointerRNA *ptr,
3037 PropertyRNA * /*prop*/,
3038 bool *r_free)
3039{
3040 EnumPropertyItem *items = nullptr;
3041 int totitem = 0;
3042
3043 if (RNA_struct_is_a(ptr->type, &RNA_FileAssetSelectParams)) {
3044 /* Only expose sorting by name and asset catalog for asset browsing. */
3045
3048 /* Address small annoyance: Tooltip talks about "file list", override to be "asset list"
3049 * instead. */
3050 items[0].description = N_("Sort the asset list alphabetically");
3051
3054 }
3055 else {
3056 /* Remove asset catalog from the items. */
3058 item++)
3059 {
3060 if (item->value != FILE_SORT_ASSET_CATALOG) {
3061 RNA_enum_item_add(&items, &totitem, item);
3062 }
3063 }
3064 }
3065
3066 RNA_enum_item_end(&items, &totitem);
3067
3068 *r_free = true;
3069 return items;
3070}
3071
3072static void rna_FileSelectPrams_filter_glob_set(PointerRNA *ptr, const char *value)
3073{
3074 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
3075
3076 STRNCPY(params->filter_glob, value);
3077
3078 /* Remove stupid things like last group being a wildcard-only one. */
3080}
3081
3082static PointerRNA rna_FileSelectParams_filter_id_get(PointerRNA *ptr)
3083{
3084 return RNA_pointer_create_with_parent(*ptr, &RNA_FileSelectIDFilter, ptr->data);
3085}
3086
3087static int rna_FileAssetSelectParams_asset_library_get(PointerRNA *ptr)
3088{
3089 FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3090 /* Just an extra sanity check to ensure this isn't somehow called for RNA_FileSelectParams. */
3091 BLI_assert(ptr->type == &RNA_FileAssetSelectParams);
3092
3094}
3095
3096static void rna_FileAssetSelectParams_asset_library_set(PointerRNA *ptr, int value)
3097{
3098 FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3100}
3101
3102static PointerRNA rna_FileAssetSelectParams_filter_id_get(PointerRNA *ptr)
3103{
3104 return RNA_pointer_create_with_parent(*ptr, &RNA_FileAssetSelectIDFilter, ptr->data);
3105}
3106
3107static PointerRNA rna_FileBrowser_FileSelectEntry_asset_data_get_impl(const PointerRNA *ptr)
3108{
3109 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3110
3111 if (!entry->asset) {
3112 return PointerRNA_NULL;
3113 }
3114
3115 AssetMetaData *asset_data = &entry->asset->get_metadata();
3116
3117 /* Note that the owning ID of the RNA pointer (`ptr->owner_id`) has to be set carefully:
3118 * Local IDs (`entry->id`) own their asset metadata themselves. Asset metadata from other blend
3119 * files are owned by the file browser (`entry`). Only if this is set correctly, we can tell from
3120 * the metadata RNA pointer if the metadata is stored locally and can thus be edited or not. */
3121
3122 if (entry->asset->is_local_id()) {
3123 PointerRNA id_ptr = RNA_id_pointer_create(entry->id);
3124 return RNA_pointer_create_with_parent(id_ptr, &RNA_AssetMetaData, asset_data);
3125 }
3126
3127 return RNA_pointer_create_with_parent(*ptr, &RNA_AssetMetaData, asset_data);
3128}
3129
3130static int rna_FileBrowser_FileSelectEntry_name_editable(const PointerRNA *ptr,
3131 const char **r_info)
3132{
3133 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3134
3135 /* This actually always returns 0 (the name is never editable) but we want to get a disabled
3136 * message returned to `r_info` in some cases. */
3137
3138 if (entry->asset) {
3139 PointerRNA asset_data_ptr = rna_FileBrowser_FileSelectEntry_asset_data_get_impl(ptr);
3140 /* Get disabled hint from asset metadata polling. */
3141 rna_AssetMetaData_editable(&asset_data_ptr, r_info);
3142 }
3143
3144 return 0;
3145}
3146
3147static PointerRNA rna_FileBrowser_FileSelectEntry_asset_data_get(PointerRNA *ptr)
3148{
3149 return rna_FileBrowser_FileSelectEntry_asset_data_get_impl(ptr);
3150}
3151
3152static void rna_FileBrowser_FileSelectEntry_name_get(PointerRNA *ptr, char *value)
3153{
3154 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3155 strcpy(value, entry->name);
3156}
3157
3158static int rna_FileBrowser_FileSelectEntry_name_length(PointerRNA *ptr)
3159{
3160 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3161 return int(strlen(entry->name));
3162}
3163
3164static void rna_FileBrowser_FileSelectEntry_relative_path_get(PointerRNA *ptr, char *value)
3165{
3166 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3167 strcpy(value, entry->relpath);
3168}
3169
3170static int rna_FileBrowser_FileSelectEntry_relative_path_length(PointerRNA *ptr)
3171{
3172 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3173 return int(strlen(entry->relpath));
3174}
3175
3176static int rna_FileBrowser_FileSelectEntry_preview_icon_id_get(PointerRNA *ptr)
3177{
3178 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3179 return ED_file_icon(entry);
3180}
3181
3182static StructRNA *rna_FileBrowser_params_typef(PointerRNA *ptr)
3183{
3184 SpaceFile *sfile = static_cast<SpaceFile *>(ptr->data);
3186
3187 if (params == ED_fileselect_get_file_params(sfile)) {
3188 return &RNA_FileSelectParams;
3189 }
3190 if (params == (void *)ED_fileselect_get_asset_params(sfile)) {
3191 return &RNA_FileAssetSelectParams;
3192 }
3193
3194 BLI_assert_msg(0, "Could not identify file select parameters");
3195 return nullptr;
3196}
3197
3198static PointerRNA rna_FileBrowser_params_get(PointerRNA *ptr)
3199{
3200 SpaceFile *sfile = static_cast<SpaceFile *>(ptr->data);
3202 StructRNA *params_struct = rna_FileBrowser_params_typef(ptr);
3203
3204 if (params && params_struct) {
3205 return RNA_pointer_create_with_parent(*ptr, params_struct, params);
3206 }
3207
3208 return PointerRNA_NULL;
3209}
3210
3211static void rna_FileBrowser_FSMenuEntry_path_get(PointerRNA *ptr, char *value)
3212{
3213 char *path = ED_fsmenu_entry_get_path(static_cast<FSMenuEntry *>(ptr->data));
3214
3215 strcpy(value, path ? path : "");
3216}
3217
3218static int rna_FileBrowser_FSMenuEntry_path_length(PointerRNA *ptr)
3219{
3220 char *path = ED_fsmenu_entry_get_path(static_cast<FSMenuEntry *>(ptr->data));
3221
3222 return int(path ? strlen(path) : 0);
3223}
3224
3225static void rna_FileBrowser_FSMenuEntry_path_set(PointerRNA *ptr, const char *value)
3226{
3227 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3228
3229 /* NOTE: this will write to file immediately.
3230 * Not nice (and to be fixed ultimately), but acceptable in this case for now. */
3231 ED_fsmenu_entry_set_path(fsm, value);
3232}
3233
3234static void rna_FileBrowser_FSMenuEntry_name_get(PointerRNA *ptr, char *value)
3235{
3236 strcpy(value, ED_fsmenu_entry_get_name(static_cast<FSMenuEntry *>(ptr->data)));
3237}
3238
3239static int rna_FileBrowser_FSMenuEntry_name_length(PointerRNA *ptr)
3240{
3241 return int(strlen(ED_fsmenu_entry_get_name(static_cast<FSMenuEntry *>(ptr->data))));
3242}
3243
3244static void rna_FileBrowser_FSMenuEntry_name_set(PointerRNA *ptr, const char *value)
3245{
3246 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3247
3248 /* NOTE: this will write to file immediately.
3249 * Not nice (and to be fixed ultimately), but acceptable in this case for now. */
3250 ED_fsmenu_entry_set_name(fsm, value);
3251}
3252
3253static int rna_FileBrowser_FSMenuEntry_name_get_editable(const PointerRNA *ptr,
3254 const char ** /*r_info*/)
3255{
3256 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3257
3258 return fsm->save ? int(PROP_EDITABLE) : 0;
3259}
3260
3261static int rna_FileBrowser_FSMenuEntry_icon_get(PointerRNA *ptr)
3262{
3263 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3264 return ED_fsmenu_entry_get_icon(fsm);
3265}
3266
3267static void rna_FileBrowser_FSMenuEntry_icon_set(PointerRNA *ptr, int value)
3268{
3269 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3270 ED_fsmenu_entry_set_icon(fsm, value);
3271}
3272
3273static bool rna_FileBrowser_FSMenuEntry_use_save_get(PointerRNA *ptr)
3274{
3275 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3276 return fsm->save;
3277}
3278
3279static bool rna_FileBrowser_FSMenuEntry_is_valid_get(PointerRNA *ptr)
3280{
3281 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3282 return fsm->valid;
3283}
3284
3285static void rna_FileBrowser_FSMenu_next(CollectionPropertyIterator *iter)
3286{
3287 ListBaseIterator *internal = &iter->internal.listbase;
3288
3289 if (internal->skip) {
3290 do {
3291 internal->link = (Link *)(((FSMenuEntry *)(internal->link))->next);
3292 iter->valid = (internal->link != nullptr);
3293 } while (iter->valid && internal->skip(iter, internal->link));
3294 }
3295 else {
3296 internal->link = (Link *)(((FSMenuEntry *)(internal->link))->next);
3297 iter->valid = (internal->link != nullptr);
3298 }
3299}
3300
3301static void rna_FileBrowser_FSMenu_begin(CollectionPropertyIterator *iter, FSMenuCategory category)
3302{
3303 ListBaseIterator *internal = &iter->internal.listbase;
3304
3305 FSMenu *fsmenu = ED_fsmenu_get();
3306 FSMenuEntry *fsmentry = ED_fsmenu_get_category(fsmenu, category);
3307
3308 internal->link = (fsmentry) ? (Link *)fsmentry : nullptr;
3309 internal->skip = nullptr;
3310
3311 iter->valid = (internal->link != nullptr);
3312}
3313
3314static PointerRNA rna_FileBrowser_FSMenu_get(CollectionPropertyIterator *iter)
3315{
3316 ListBaseIterator *internal = &iter->internal.listbase;
3318 iter->parent, &RNA_FileBrowserFSMenuEntry, internal->link);
3319 return r_ptr;
3320}
3321
3322static void rna_FileBrowser_FSMenu_end(CollectionPropertyIterator * /*iter*/) {}
3323
3324static void rna_FileBrowser_FSMenuSystem_data_begin(CollectionPropertyIterator *iter,
3325 PointerRNA * /*ptr*/)
3326{
3327 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_SYSTEM);
3328}
3329
3330static int rna_FileBrowser_FSMenuSystem_data_length(PointerRNA * /*ptr*/)
3331{
3332 FSMenu *fsmenu = ED_fsmenu_get();
3333
3335}
3336
3337static void rna_FileBrowser_FSMenuSystemBookmark_data_begin(CollectionPropertyIterator *iter,
3338 PointerRNA * /*ptr*/)
3339{
3340 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_SYSTEM_BOOKMARKS);
3341}
3342
3343static int rna_FileBrowser_FSMenuSystemBookmark_data_length(PointerRNA * /*ptr*/)
3344{
3345 FSMenu *fsmenu = ED_fsmenu_get();
3346
3348}
3349
3350static void rna_FileBrowser_FSMenuBookmark_data_begin(CollectionPropertyIterator *iter,
3351 PointerRNA * /*ptr*/)
3352{
3353 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_BOOKMARKS);
3354}
3355
3356static int rna_FileBrowser_FSMenuBookmark_data_length(PointerRNA * /*ptr*/)
3357{
3358 FSMenu *fsmenu = ED_fsmenu_get();
3359
3361}
3362
3363static void rna_FileBrowser_FSMenuRecent_data_begin(CollectionPropertyIterator *iter,
3364 PointerRNA * /*ptr*/)
3365{
3366 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_RECENT);
3367}
3368
3369static int rna_FileBrowser_FSMenuRecent_data_length(PointerRNA * /*ptr*/)
3370{
3371 FSMenu *fsmenu = ED_fsmenu_get();
3372
3374}
3375
3376static int rna_FileBrowser_FSMenu_active_get(PointerRNA *ptr, const FSMenuCategory category)
3377{
3378 SpaceFile *sf = static_cast<SpaceFile *>(ptr->data);
3379 int actnr = -1;
3380
3381 switch (category) {
3382 case FS_CATEGORY_SYSTEM:
3383 actnr = sf->systemnr;
3384 break;
3386 actnr = sf->system_bookmarknr;
3387 break;
3389 actnr = sf->bookmarknr;
3390 break;
3391 case FS_CATEGORY_RECENT:
3392 actnr = sf->recentnr;
3393 break;
3394 case FS_CATEGORY_OTHER:
3395 /* pass. */
3396 break;
3397 }
3398
3399 return actnr;
3400}
3401
3402static void rna_FileBrowser_FSMenu_active_set(PointerRNA *ptr,
3403 int value,
3404 const FSMenuCategory category)
3405{
3406 SpaceFile *sf = static_cast<SpaceFile *>(ptr->data);
3407 FSMenu *fsmenu = ED_fsmenu_get();
3408 FSMenuEntry *fsm = ED_fsmenu_get_entry(fsmenu, category, value);
3409
3410 if (fsm && sf->params) {
3411 switch (category) {
3412 case FS_CATEGORY_SYSTEM:
3413 sf->systemnr = value;
3414 break;
3416 sf->system_bookmarknr = value;
3417 break;
3419 sf->bookmarknr = value;
3420 break;
3421 case FS_CATEGORY_RECENT:
3422 sf->recentnr = value;
3423 break;
3424 case FS_CATEGORY_OTHER:
3425 /* pass. */
3426 break;
3427 }
3428
3429 STRNCPY(sf->params->dir, fsm->path);
3430 }
3431}
3432
3433static void rna_FileBrowser_FSMenu_active_range(PointerRNA * /*ptr*/,
3434 int *min,
3435 int *max,
3436 int *softmin,
3437 int *softmax,
3438 const FSMenuCategory category)
3439{
3440 FSMenu *fsmenu = ED_fsmenu_get();
3441
3442 *min = *softmin = -1;
3443 *max = *softmax = ED_fsmenu_get_nentries(fsmenu, category) - 1;
3444}
3445
3446static void rna_FileBrowser_FSMenu_active_update(bContext *C, PointerRNA *ptr)
3447{
3448 ScrArea *area = rna_area_from_space(ptr);
3449 ED_file_change_dir_ex(C, area);
3450}
3451
3452static int rna_FileBrowser_FSMenuSystem_active_get(PointerRNA *ptr)
3453{
3454 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_SYSTEM);
3455}
3456
3457static void rna_FileBrowser_FSMenuSystem_active_set(PointerRNA *ptr, int value)
3458{
3459 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_SYSTEM);
3460}
3461
3462static void rna_FileBrowser_FSMenuSystem_active_range(
3463 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3464{
3465 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_SYSTEM);
3466}
3467
3468static int rna_FileBrowser_FSMenuSystemBookmark_active_get(PointerRNA *ptr)
3469{
3470 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_SYSTEM_BOOKMARKS);
3471}
3472
3473static void rna_FileBrowser_FSMenuSystemBookmark_active_set(PointerRNA *ptr, int value)
3474{
3475 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_SYSTEM_BOOKMARKS);
3476}
3477
3478static void rna_FileBrowser_FSMenuSystemBookmark_active_range(
3479 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3480{
3481 rna_FileBrowser_FSMenu_active_range(
3482 ptr, min, max, softmin, softmax, FS_CATEGORY_SYSTEM_BOOKMARKS);
3483}
3484
3485static int rna_FileBrowser_FSMenuBookmark_active_get(PointerRNA *ptr)
3486{
3487 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_BOOKMARKS);
3488}
3489
3490static void rna_FileBrowser_FSMenuBookmark_active_set(PointerRNA *ptr, int value)
3491{
3492 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_BOOKMARKS);
3493}
3494
3495static void rna_FileBrowser_FSMenuBookmark_active_range(
3496 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3497{
3498 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_BOOKMARKS);
3499}
3500
3501static int rna_FileBrowser_FSMenuRecent_active_get(PointerRNA *ptr)
3502{
3503 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_RECENT);
3504}
3505
3506static void rna_FileBrowser_FSMenuRecent_active_set(PointerRNA *ptr, int value)
3507{
3508 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_RECENT);
3509}
3510
3511static void rna_FileBrowser_FSMenuRecent_active_range(
3512 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3513{
3514 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_RECENT);
3515}
3516
3517static void rna_SpaceFileBrowser_browse_mode_update(Main * /*bmain*/,
3518 Scene * /*scene*/,
3519 PointerRNA *ptr)
3520{
3521 ScrArea *area = rna_area_from_space(ptr);
3522 ED_area_tag_refresh(area);
3523}
3524
3525static void rna_SpaceSpreadsheet_geometry_component_type_update(Main * /*bmain*/,
3526 Scene * /*scene*/,
3527 PointerRNA *ptr)
3528{
3529 using namespace blender;
3530 SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data;
3531 switch (sspreadsheet->geometry_id.geometry_component_type) {
3533 if (!ELEM(bke::AttrDomain(sspreadsheet->geometry_id.attribute_domain),
3538 {
3539 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Point);
3540 }
3541 break;
3542 }
3544 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Point);
3545 break;
3546 }
3548 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Instance);
3549 break;
3550 }
3552 break;
3553 }
3555 if (!ELEM(bke::AttrDomain(sspreadsheet->geometry_id.attribute_domain),
3558 {
3559 sspreadsheet->geometry_id.attribute_domain = uint8_t(bke::AttrDomain::Point);
3560 }
3561 break;
3562 }
3563 }
3564}
3565
3566const EnumPropertyItem *rna_SpaceSpreadsheet_attribute_domain_itemf(bContext * /*C*/,
3567 PointerRNA *ptr,
3568 PropertyRNA * /*prop*/,
3569 bool *r_free)
3570{
3571 using namespace blender;
3572 SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data;
3573 auto component_type = bke::GeometryComponent::Type(
3574 sspreadsheet->geometry_id.geometry_component_type);
3575 if (sspreadsheet->geometry_id.object_eval_state == SPREADSHEET_OBJECT_EVAL_STATE_ORIGINAL) {
3576 ID *used_id = ed::spreadsheet::get_current_id(sspreadsheet);
3577 if (used_id != nullptr) {
3578 if (GS(used_id->name) == ID_OB) {
3579 Object *used_object = (Object *)used_id;
3580 if (used_object->type == OB_POINTCLOUD) {
3582 }
3583 else {
3584 component_type = bke::GeometryComponent::Type::Mesh;
3585 }
3586 }
3587 }
3588 }
3589
3590 static EnumPropertyItem mesh_vertex_domain_item = {
3591 int(bke::AttrDomain::Point), "POINT", 0, "Vertex", "Attribute per point/vertex"};
3592
3593 EnumPropertyItem *item_array = nullptr;
3594 int items_len = 0;
3595 for (const EnumPropertyItem *item = rna_enum_attribute_domain_items; item->identifier != nullptr;
3596 item++)
3597 {
3598 if (component_type == bke::GeometryComponent::Type::Mesh) {
3599 if (!ELEM(bke::AttrDomain(item->value),
3604 {
3605 continue;
3606 }
3607 }
3608 if (component_type == bke::GeometryComponent::Type::PointCloud) {
3610 continue;
3611 }
3612 }
3613 if (component_type == bke::GeometryComponent::Type::Curve) {
3615 continue;
3616 }
3617 }
3619 component_type == bke::GeometryComponent::Type::Mesh)
3620 {
3621 RNA_enum_item_add(&item_array, &items_len, &mesh_vertex_domain_item);
3622 }
3623 else {
3624 RNA_enum_item_add(&item_array, &items_len, item);
3625 }
3626 }
3627 RNA_enum_item_end(&item_array, &items_len);
3628
3629 *r_free = true;
3630 return item_array;
3631}
3632
3633static StructRNA *rna_SpreadsheetTableID_refine(PointerRNA *ptr)
3634{
3635 SpreadsheetTableID *table_id = ptr->data_as<SpreadsheetTableID>();
3636 switch (eSpreadsheetTableIDType(table_id->type)) {
3638 return &RNA_SpreadsheetTableIDGeometry;
3639 }
3640 return &RNA_SpreadsheetTableID;
3641}
3642
3643static void rna_iterator_SpreadsheetTable_columns_begin(CollectionPropertyIterator *iter,
3644 PointerRNA *ptr)
3645{
3646 SpreadsheetTable *table = ptr->data_as<SpreadsheetTable>();
3648 iter, ptr, table->columns, sizeof(SpreadsheetTable *), table->num_columns, 0, nullptr);
3649}
3650
3651static int rna_iterator_SpreadsheetTable_columns_length(PointerRNA *ptr)
3652{
3653 SpreadsheetTable *table = ptr->data_as<SpreadsheetTable>();
3654 return table->num_columns;
3655}
3656
3657static void rna_iterator_SpaceSpreadsheet_tables_begin(CollectionPropertyIterator *iter,
3658 PointerRNA *ptr)
3659{
3660 SpaceSpreadsheet *sspreadsheet = ptr->data_as<SpaceSpreadsheet>();
3662 ptr,
3663 sspreadsheet->tables,
3664 sizeof(SpaceSpreadsheet *),
3665 sspreadsheet->num_tables,
3666 0,
3667 nullptr);
3668}
3669
3670static int rna_iterator_SpaceSpreadsheet_tables_length(PointerRNA *ptr)
3671{
3672 SpaceSpreadsheet *sspreadsheet = ptr->data_as<SpaceSpreadsheet>();
3673 return sspreadsheet->num_tables;
3674}
3675
3676static PointerRNA rna_SpreadsheetTables_active_get(PointerRNA *ptr)
3677{
3678 SpaceSpreadsheet *sspreadsheet = ptr->data_as<SpaceSpreadsheet>();
3680 return RNA_pointer_create_discrete(ptr->owner_id, &RNA_SpreadsheetTable, table);
3681}
3682
3683static StructRNA *rna_viewer_path_elem_refine(PointerRNA *ptr)
3684{
3685 ViewerPathElem *elem = static_cast<ViewerPathElem *>(ptr->data);
3686 switch (ViewerPathElemType(elem->type)) {
3688 return &RNA_IDViewerPathElem;
3690 return &RNA_ModifierViewerPathElem;
3692 return &RNA_GroupNodeViewerPathElem;
3694 return &RNA_SimulationZoneViewerPathElem;
3696 return &RNA_ViewerNodeViewerPathElem;
3698 return &RNA_RepeatZoneViewerPathElem;
3700 return &RNA_ForeachGeometryElementZoneViewerPathElem;
3702 return &RNA_EvaluateClosureNodeViewerPathElem;
3703 }
3705 return nullptr;
3706}
3707
3708static void rna_FileAssetSelectParams_catalog_id_get(PointerRNA *ptr, char *value)
3709{
3710 const FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3711 BLI_uuid_format(value, params->catalog_id);
3712}
3713
3714static int rna_FileAssetSelectParams_catalog_id_length(PointerRNA * /*ptr*/)
3715{
3716 return UUID_STRING_SIZE - 1;
3717}
3718
3719static void rna_FileAssetSelectParams_catalog_id_set(PointerRNA *ptr, const char *value)
3720{
3721 FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3722
3723 if (value[0] == '\0') {
3724 params->catalog_id = BLI_uuid_nil();
3725 params->asset_catalog_visibility = FILE_SHOW_ASSETS_ALL_CATALOGS;
3726 return;
3727 }
3728
3729 bUUID new_uuid;
3730 if (!BLI_uuid_parse_string(&new_uuid, value)) {
3731 printf("UUID %s not formatted correctly, ignoring new value\n", value);
3732 return;
3733 }
3734
3735 params->catalog_id = new_uuid;
3736 params->asset_catalog_visibility = FILE_SHOW_ASSETS_FROM_CATALOG;
3737}
3738
3739#else
3740
3742 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Display white edges with black outline"},
3743 {SI_UVDT_DASH, "DASH", 0, "Dash", "Display dashed black-white edges"},
3744 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Display black edges"},
3745 {SI_UVDT_WHITE, "WHITE", 0, "White", "Display white edges"},
3746 {0, nullptr, 0, nullptr, nullptr},
3747};
3748
3750 /* Categories */
3751 {FILTER_ID_SCE, "category_scene", ICON_SCENE_DATA, "Scenes", "Show scenes"},
3752 {FILTER_ID_AC, "category_animation", ICON_ANIM_DATA, "Animations", "Show animation data"},
3754 "category_object",
3755 ICON_OUTLINER_COLLECTION,
3756 "Objects & Collections",
3757 "Show objects and collections"},
3760 "category_geometry",
3761 ICON_GEOMETRY_NODES,
3762 "Geometry",
3763 "Show meshes, curves, lattice, armatures and metaballs data"},
3765 "category_shading",
3766 ICON_MATERIAL_DATA,
3767 "Shading",
3768 "Show materials, node-trees, textures and Freestyle's line-styles"},
3770 "category_image",
3771 ICON_IMAGE_DATA,
3772 "Images & Sounds",
3773 "Show images, movie clips, sounds and masks"},
3775 "category_environment",
3776 ICON_WORLD_DATA,
3777 "Environment",
3778 "Show worlds, lights, cameras and speakers"},
3781 "category_misc",
3782 ICON_GREASEPENCIL,
3783 "Miscellaneous",
3784 "Show other data types"},
3785 {0, nullptr, 0, nullptr, nullptr},
3786};
3787
3788static void rna_def_space_generic_show_region_toggles(StructRNA *srna, int region_type_mask)
3789{
3790 PropertyRNA *prop;
3791
3792# define DEF_SHOW_REGION_PROPERTY(identifier, label, description) \
3793 { \
3794 prop = RNA_def_property(srna, STRINGIFY(identifier), PROP_BOOLEAN, PROP_NONE); \
3795 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); \
3796 RNA_def_property_boolean_funcs(prop, \
3797 STRINGIFY(rna_Space_##identifier##_get), \
3798 STRINGIFY(rna_Space_##identifier##_set)); \
3799 RNA_def_property_ui_text(prop, label, description); \
3800 RNA_def_property_update(prop, 0, STRINGIFY(rna_Space_##identifier##_update)); \
3801 } \
3802 ((void)0)
3803
3804 if (region_type_mask & (1 << RGN_TYPE_TOOL_HEADER)) {
3805 region_type_mask &= ~(1 << RGN_TYPE_TOOL_HEADER);
3806 DEF_SHOW_REGION_PROPERTY(show_region_tool_header, "Tool Settings", "");
3807 }
3808 if (region_type_mask & (1 << RGN_TYPE_HEADER)) {
3809 region_type_mask &= ~(1 << RGN_TYPE_HEADER);
3810 DEF_SHOW_REGION_PROPERTY(show_region_header, "Header", "");
3811 }
3812 if (region_type_mask & (1 << RGN_TYPE_FOOTER)) {
3813 region_type_mask &= ~(1 << RGN_TYPE_FOOTER);
3814 DEF_SHOW_REGION_PROPERTY(show_region_footer, "Footer", "");
3815 }
3816 if (region_type_mask & (1 << RGN_TYPE_TOOLS)) {
3817 region_type_mask &= ~(1 << RGN_TYPE_TOOLS);
3818 DEF_SHOW_REGION_PROPERTY(show_region_toolbar, "Toolbar", "");
3819 }
3820 if (region_type_mask & (1 << RGN_TYPE_TOOL_PROPS)) {
3821 region_type_mask &= ~(1 << RGN_TYPE_TOOL_PROPS);
3822 DEF_SHOW_REGION_PROPERTY(show_region_tool_props, "Toolbar", "");
3823 }
3824 if (region_type_mask & (1 << RGN_TYPE_CHANNELS)) {
3825 region_type_mask &= ~(1 << RGN_TYPE_CHANNELS);
3826 DEF_SHOW_REGION_PROPERTY(show_region_channels, "Channels", "");
3827 }
3828 if (region_type_mask & (1 << RGN_TYPE_UI)) {
3829 region_type_mask &= ~(1 << RGN_TYPE_UI);
3830 DEF_SHOW_REGION_PROPERTY(show_region_ui, "Sidebar", "");
3831 }
3832 if (region_type_mask & (1 << RGN_TYPE_HUD)) {
3833 region_type_mask &= ~(1 << RGN_TYPE_HUD);
3834 DEF_SHOW_REGION_PROPERTY(show_region_hud, "Adjust Last Operation", "");
3835 }
3836 if (region_type_mask & ((1 << RGN_TYPE_ASSET_SHELF) | (1 << RGN_TYPE_ASSET_SHELF_HEADER))) {
3837 region_type_mask &= ~((1 << RGN_TYPE_ASSET_SHELF) | (1 << RGN_TYPE_ASSET_SHELF_HEADER));
3838 DEF_SHOW_REGION_PROPERTY(show_region_asset_shelf, "Asset Shelf", "");
3839 }
3840 BLI_assert(region_type_mask == 0);
3841}
3842
3843static void rna_def_space(BlenderRNA *brna)
3844{
3845 StructRNA *srna;
3846 PropertyRNA *prop;
3847
3848 srna = RNA_def_struct(brna, "Space", nullptr);
3849 RNA_def_struct_sdna(srna, "SpaceLink");
3850 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
3851 RNA_def_struct_path_func(srna, "BKE_screen_path_from_screen_to_space");
3852 RNA_def_struct_refine_func(srna, "rna_Space_refine");
3853
3854 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3855 RNA_def_property_enum_sdna(prop, nullptr, "spacetype");
3857 /* When making this editable, take care for the special case of global areas
3858 * (see rna_Area_type_set). */
3860 RNA_def_property_ui_text(prop, "Type", "Space data type");
3861
3862 /* Access to #V2D_VIEWSYNC_SCREEN_TIME. */
3863 prop = RNA_def_property(srna, "show_locked_time", PROP_BOOLEAN, PROP_NONE);
3864 RNA_def_property_boolean_funcs(prop, "rna_Space_view2d_sync_get", "rna_Space_view2d_sync_set");
3866 "Sync Visible Range",
3867 "Synchronize the visible timeline range with other time-based editors");
3868 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Space_view2d_sync_update");
3869
3871}
3872
3873/* for all spaces that use a mask */
3874static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *mask_set_func)
3875{
3876 PropertyRNA *prop;
3877
3878 static const EnumPropertyItem overlay_mode_items[] = {
3880 "ALPHACHANNEL",
3881 ICON_NONE,
3882 "Alpha Channel",
3883 "Show alpha channel of the mask"},
3885 "COMBINED",
3886 ICON_NONE,
3887 "Combined",
3888 "Combine space background image with the mask"},
3889 {0, nullptr, 0, nullptr, nullptr},
3890 };
3891
3892 prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
3893 RNA_def_property_pointer_sdna(prop, nullptr, "mask_info.mask");
3895 RNA_def_property_ui_text(prop, "Mask", "Mask displayed and edited in this space");
3896 RNA_def_property_pointer_funcs(prop, nullptr, mask_set_func, nullptr, nullptr);
3897 RNA_def_property_update(prop, noteflag, nullptr);
3898
3899 /* mask drawing */
3900 prop = RNA_def_property(srna, "mask_display_type", PROP_ENUM, PROP_NONE);
3901 RNA_def_property_enum_sdna(prop, nullptr, "mask_info.draw_type");
3903 RNA_def_property_ui_text(prop, "Edge Display Type", "Display type for mask splines");
3904 RNA_def_property_update(prop, noteflag, nullptr);
3905
3906 prop = RNA_def_property(srna, "show_mask_spline", PROP_BOOLEAN, PROP_NONE);
3907 RNA_def_property_boolean_sdna(prop, nullptr, "mask_info.draw_flag", MASK_DRAWFLAG_SPLINE);
3908 RNA_def_property_ui_text(prop, "Show Mask Spline", "");
3909 RNA_def_property_update(prop, noteflag, nullptr);
3910
3911 prop = RNA_def_property(srna, "show_mask_overlay", PROP_BOOLEAN, PROP_NONE);
3912 RNA_def_property_boolean_sdna(prop, nullptr, "mask_info.draw_flag", MASK_DRAWFLAG_OVERLAY);
3913 RNA_def_property_ui_text(prop, "Show Mask Overlay", "");
3914 RNA_def_property_update(prop, noteflag, nullptr);
3915
3916 prop = RNA_def_property(srna, "mask_overlay_mode", PROP_ENUM, PROP_NONE);
3917 RNA_def_property_enum_sdna(prop, nullptr, "mask_info.overlay_mode");
3918 RNA_def_property_enum_items(prop, overlay_mode_items);
3919 RNA_def_property_ui_text(prop, "Overlay Mode", "Overlay mode of rasterized mask");
3920 RNA_def_property_update(prop, noteflag, nullptr);
3921
3922 prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_FACTOR);
3923 RNA_def_property_float_sdna(prop, nullptr, "mask_info.blend_factor");
3924 RNA_def_property_range(prop, 0.0f, 1.0f);
3925 RNA_def_property_ui_range(prop, 0, 1., 0.1, 1);
3926 RNA_def_property_ui_text(prop, "Blending Factor", "Overlay blending factor of rasterized mask");
3927 RNA_def_property_update(prop, noteflag, nullptr);
3928}
3929
3931{
3932 StructRNA *srna;
3933 PropertyRNA *prop;
3934
3935 static const EnumPropertyItem dt_uvstretch_items[] = {
3936 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
3937 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
3938 {0, nullptr, 0, nullptr, nullptr},
3939 };
3940
3941 static const EnumPropertyItem pixel_round_mode_items[] = {
3942 {SI_PIXEL_ROUND_DISABLED, "DISABLED", 0, "Disabled", "Don't round to pixels"},
3943 {SI_PIXEL_ROUND_CORNER, "CORNER", 0, "Corner", "Round to pixel corners"},
3944 {SI_PIXEL_ROUND_CENTER, "CENTER", 0, "Center", "Round to pixel centers"},
3945 {0, nullptr, 0, nullptr, nullptr},
3946 };
3947
3948 static const EnumPropertyItem grid_shape_source_items[] = {
3949 {SI_GRID_SHAPE_DYNAMIC, "DYNAMIC", 0, "Dynamic", "Dynamic grid"},
3950 {SI_GRID_SHAPE_FIXED, "FIXED", 0, "Fixed", "Manually set grid divisions"},
3951 {SI_GRID_SHAPE_PIXEL, "PIXEL", 0, "Pixel", "Grid aligns with pixels from image"},
3952 {0, nullptr, 0, nullptr, nullptr},
3953 };
3954
3955 srna = RNA_def_struct(brna, "SpaceUVEditor", nullptr);
3956 RNA_def_struct_sdna(srna, "SpaceImage");
3957 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
3958 RNA_def_struct_path_func(srna, "rna_SpaceUVEditor_path");
3959 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
3960
3961 /* drawing */
3962 prop = RNA_def_property(srna, "edge_display_type", PROP_ENUM, PROP_NONE);
3963 RNA_def_property_enum_sdna(prop, nullptr, "dt_uv");
3965 RNA_def_property_ui_text(prop, "Display As", "Display style for UV edges");
3967
3968 prop = RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
3969 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_STRETCH);
3971 prop,
3972 "Display Stretch",
3973 "Display faces colored according to the difference in shape between UVs and "
3974 "their 3D coordinates (blue for low distortion, red for high distortion)");
3976
3977 prop = RNA_def_property(srna, "display_stretch_type", PROP_ENUM, PROP_NONE);
3978 RNA_def_property_enum_sdna(prop, nullptr, "dt_uvstretch");
3979 RNA_def_property_enum_items(prop, dt_uvstretch_items);
3980 RNA_def_property_ui_text(prop, "Display Stretch Type", "Type of stretch to display");
3983
3984 prop = RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
3985 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAWSHADOW);
3987 prop, "Display Modified Edges", "Display edges after modifiers are applied");
3989
3990 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
3991 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_METADATA);
3992 RNA_def_property_ui_text(prop, "Show Metadata", "Display metadata properties of the image");
3994
3995 prop = RNA_def_property(srna, "show_uv", PROP_BOOLEAN, PROP_NONE);
3997 RNA_def_property_ui_text(prop, "Display UVs", "Display overlay of UV layer");
3999
4000 prop = RNA_def_property(srna, "show_pixel_coords", PROP_BOOLEAN, PROP_NONE);
4003 prop, "Pixel Coordinates", "Display UV coordinates in pixels rather than from 0.0 to 1.0");
4005
4006 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
4008 RNA_def_property_ui_text(prop, "Display Faces", "Display faces over the image");
4010
4011 prop = RNA_def_property(srna, "tile_grid_shape", PROP_INT, PROP_XYZ);
4012 RNA_def_property_int_sdna(prop, nullptr, "tile_grid_shape");
4013 RNA_def_property_array(prop, 2);
4015 RNA_def_property_range(prop, 1, 100);
4016 RNA_def_property_int_funcs(prop, nullptr, "rna_SpaceUVEditor_tile_grid_shape_set", nullptr);
4018 prop, "Tile Grid Shape", "How many tiles will be shown in the background");
4020
4021 prop = RNA_def_property(srna, "show_grid_over_image", PROP_BOOLEAN, PROP_NONE);
4022 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_GRID_OVER_IMAGE);
4024 RNA_def_property_ui_text(prop, "Grid Over Image", "Show the grid over the image");
4026
4027 prop = RNA_def_property(srna, "grid_shape_source", PROP_ENUM, PROP_NONE);
4028 RNA_def_property_enum_items(prop, grid_shape_source_items);
4029 RNA_def_property_ui_text(prop, "Grid Shape Source", "Specify source for the grid shape");
4031
4032 prop = RNA_def_property(srna, "custom_grid_subdivisions", PROP_INT, PROP_XYZ);
4033 RNA_def_property_int_sdna(prop, nullptr, "custom_grid_subdiv");
4034 RNA_def_property_array(prop, 2);
4036 RNA_def_property_range(prop, 1, 5000);
4037 RNA_def_property_int_funcs(prop, nullptr, "rna_SpaceUVEditor_custom_grid_subdiv_set", nullptr);
4039 prop, "Dynamic Grid Size", "Number of grid units in UV space that make one UV Unit");
4041
4042 prop = RNA_def_property(srna, "uv_opacity", PROP_FLOAT, PROP_FACTOR);
4043 RNA_def_property_float_sdna(prop, nullptr, "uv_opacity");
4044 RNA_def_property_range(prop, 0.0f, 1.0f);
4045 RNA_def_property_ui_text(prop, "UV Opacity", "Opacity of UV overlays");
4047
4048 prop = RNA_def_property(srna, "uv_face_opacity", PROP_FLOAT, PROP_FACTOR);
4049 RNA_def_property_float_sdna(prop, nullptr, "uv_face_opacity");
4050 RNA_def_property_range(prop, 0.0f, 1.0f);
4051 RNA_def_property_ui_text(prop, "UV Face Opacity", "Opacity of faces in UV overlays");
4053
4054 prop = RNA_def_property(srna, "stretch_opacity", PROP_FLOAT, PROP_FACTOR);
4055 RNA_def_property_float_sdna(prop, nullptr, "stretch_opacity");
4056 RNA_def_property_range(prop, 0.0f, 1.0f);
4057 RNA_def_property_ui_text(prop, "Stretch Opacity", "Opacity of the UV Stretch overlay");
4059
4060 prop = RNA_def_property(srna, "pixel_round_mode", PROP_ENUM, PROP_NONE);
4061 RNA_def_property_enum_items(prop, pixel_round_mode_items);
4062 RNA_def_property_ui_text(prop, "Round to Pixels", "Round UVs to pixels while editing");
4064
4065 prop = RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
4066 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_CLIP_UV);
4068 "Constrain to Image Bounds",
4069 "Constraint to stay within the image bounds while editing");
4071
4072 prop = RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
4073 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_LIVE_UNWRAP);
4075 prop,
4076 "Live Unwrap",
4077 "Continuously unwrap the selected UV island while transforming pinned vertices");
4079}
4080
4082{
4083 StructRNA *srna;
4084 PropertyRNA *prop;
4085
4086 static const EnumPropertyItem display_mode_items[] = {
4087 {SO_SCENES,
4088 "SCENES",
4089 ICON_SCENE_DATA,
4090 "Scenes",
4091 "Display scenes and their view layers, collections and objects"},
4093 "VIEW_LAYER",
4094 ICON_RENDER_RESULT,
4095 "View Layer",
4096 "Display collections and objects in the view layer"},
4097 {SO_SEQUENCE,
4098 "SEQUENCE",
4099 ICON_SEQUENCE,
4100 "Video Sequencer",
4101 "Display data belonging to the Video Sequencer"},
4102 {SO_LIBRARIES,
4103 "LIBRARIES",
4104 ICON_FILE_BLEND,
4105 "Blender File",
4106 "Display data of current file and linked libraries"},
4107 {SO_DATA_API,
4108 "DATA_API",
4109 ICON_RNA,
4110 "Data API",
4111 "Display low level Blender data and its properties"},
4113 "LIBRARY_OVERRIDES",
4114 ICON_LIBRARY_DATA_OVERRIDE,
4115 "Library Overrides",
4116 "Display data-blocks with library overrides and list their overridden properties"},
4118 "ORPHAN_DATA",
4119 ICON_ORPHAN_DATA,
4120 "Unused Data",
4121 "Display data that is unused and/or will be lost when the file is reloaded"},
4122 {0, nullptr, 0, nullptr, nullptr},
4123 };
4124
4125 static const EnumPropertyItem lib_override_view_mode[] = {
4127 "PROPERTIES",
4128 ICON_NONE,
4129 "Properties",
4130 "Display all local override data-blocks with their overridden properties and buttons to "
4131 "edit them"},
4133 "HIERARCHIES",
4134 ICON_NONE,
4135 "Hierarchies",
4136 "Display library override relationships"},
4137 {0, nullptr, 0, nullptr, nullptr},
4138 };
4139
4140 static const EnumPropertyItem filter_state_items[] = {
4141 {SO_FILTER_OB_ALL, "ALL", 0, "All", "Show all objects in the view layer"},
4142 {SO_FILTER_OB_VISIBLE, "VISIBLE", 0, "Visible", "Show visible objects"},
4143 {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected", "Show selected objects"},
4144 {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active object"},
4145 {SO_FILTER_OB_SELECTABLE, "SELECTABLE", 0, "Selectable", "Show only selectable objects"},
4146 {0, nullptr, 0, nullptr, nullptr},
4147 };
4148
4149 srna = RNA_def_struct(brna, "SpaceOutliner", "Space");
4150 RNA_def_struct_sdna(srna, "SpaceOutliner");
4151 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
4152
4153 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
4154 RNA_def_property_enum_sdna(prop, nullptr, "outlinevis");
4155 RNA_def_property_enum_items(prop, display_mode_items);
4156 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
4158
4159 prop = RNA_def_property(srna, "lib_override_view_mode", PROP_ENUM, PROP_NONE);
4160 RNA_def_property_enum_items(prop, lib_override_view_mode);
4162 "Library Override View Mode",
4163 "Choose different visualizations of library override data");
4165
4166 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
4167 RNA_def_property_string_sdna(prop, nullptr, "search_string");
4168 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
4171
4172 prop = RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
4173 RNA_def_property_boolean_sdna(prop, nullptr, "search_flags", SO_FIND_CASE_SENSITIVE);
4175 prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
4177
4178 prop = RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
4179 RNA_def_property_boolean_sdna(prop, nullptr, "search_flags", SO_FIND_COMPLETE);
4181 prop, "Complete Matches Only", "Only use complete matches of search string");
4183
4184 prop = RNA_def_property(srna, "use_sort_alpha", PROP_BOOLEAN, PROP_NONE);
4186 RNA_def_property_ui_text(prop, "Sort Alphabetically", "");
4188
4189 prop = RNA_def_property(srna, "use_sync_select", PROP_BOOLEAN, PROP_NONE);
4190 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_SYNC_SELECT);
4192 prop, "Sync Outliner Selection", "Sync outliner selection with other editors");
4194
4195 prop = RNA_def_property(srna, "show_mode_column", PROP_BOOLEAN, PROP_NONE);
4196 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_MODE_COLUMN);
4198 prop, "Show Mode Column", "Show the mode column for mode toggle and activation");
4200
4201 /* Granular restriction column option. */
4202 prop = RNA_def_property(srna, "show_restrict_column_enable", PROP_BOOLEAN, PROP_NONE);
4203 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_ENABLE);
4204 RNA_def_property_ui_text(prop, "Exclude from View Layer", "Exclude from view layer");
4205 RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, 0);
4207
4208 prop = RNA_def_property(srna, "show_restrict_column_select", PROP_BOOLEAN, PROP_NONE);
4209 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_SELECT);
4210 RNA_def_property_ui_text(prop, "Selectable", "Selectable");
4211 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
4213
4214 prop = RNA_def_property(srna, "show_restrict_column_hide", PROP_BOOLEAN, PROP_NONE);
4215 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_HIDE);
4216 RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
4217 RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 0);
4219
4220 prop = RNA_def_property(srna, "show_restrict_column_viewport", PROP_BOOLEAN, PROP_NONE);
4221 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_VIEWPORT);
4222 RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
4223 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
4225
4226 prop = RNA_def_property(srna, "show_restrict_column_render", PROP_BOOLEAN, PROP_NONE);
4227 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_RENDER);
4228 RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");
4229 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 0);
4231
4232 prop = RNA_def_property(srna, "show_restrict_column_holdout", PROP_BOOLEAN, PROP_NONE);
4233 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_HOLDOUT);
4234 RNA_def_property_ui_text(prop, "Holdout", "Holdout");
4235 RNA_def_property_ui_icon(prop, ICON_HOLDOUT_ON, 0);
4237
4238 prop = RNA_def_property(srna, "show_restrict_column_indirect_only", PROP_BOOLEAN, PROP_NONE);
4239 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_INDIRECT_ONLY);
4240 RNA_def_property_ui_text(prop, "Indirect Only", "Indirect only");
4241 RNA_def_property_ui_icon(prop, ICON_INDIRECT_ONLY_ON, 0);
4243
4244 /* Filters. */
4245 prop = RNA_def_property(srna, "use_filter_object", PROP_BOOLEAN, PROP_NONE);
4247 RNA_def_property_ui_text(prop, "Filter Objects", "Show objects");
4249
4250 prop = RNA_def_property(srna, "use_filter_object_content", PROP_BOOLEAN, PROP_NONE);
4253 prop, "Show Object Contents", "Show what is inside the objects elements");
4255
4256 prop = RNA_def_property(srna, "use_filter_children", PROP_BOOLEAN, PROP_NONE);
4258 RNA_def_property_ui_text(prop, "Show Object Children", "Show children");
4260
4261 prop = RNA_def_property(srna, "use_filter_collection", PROP_BOOLEAN, PROP_NONE);
4263 RNA_def_property_ui_text(prop, "Show Collections", "Show collections");
4265
4266 prop = RNA_def_property(srna, "use_filter_view_layers", PROP_BOOLEAN, PROP_NONE);
4268 RNA_def_property_ui_text(prop, "Show All View Layers", "Show all the view layers");
4270
4271 /* Filters object state. */
4272 prop = RNA_def_property(srna, "filter_state", PROP_ENUM, PROP_NONE);
4273 RNA_def_property_enum_sdna(prop, nullptr, "filter_state");
4274 RNA_def_property_enum_items(prop, filter_state_items);
4275 RNA_def_property_ui_text(prop, "Object State Filter", "");
4277
4278 prop = RNA_def_property(srna, "filter_invert", PROP_BOOLEAN, PROP_NONE);
4280 RNA_def_property_ui_text(prop, "Invert", "Invert the object state filter");
4282
4283 /* Filters object type. */
4284 prop = RNA_def_property(srna, "use_filter_object_mesh", PROP_BOOLEAN, PROP_NONE);
4286 RNA_def_property_ui_text(prop, "Show Meshes", "Show mesh objects");
4288
4289 prop = RNA_def_property(srna, "use_filter_object_armature", PROP_BOOLEAN, PROP_NONE);
4291 RNA_def_property_ui_text(prop, "Show Armatures", "Show armature objects");
4293
4294 prop = RNA_def_property(srna, "use_filter_object_empty", PROP_BOOLEAN, PROP_NONE);
4296 RNA_def_property_ui_text(prop, "Show Empties", "Show empty objects");
4298
4299 prop = RNA_def_property(srna, "use_filter_object_light", PROP_BOOLEAN, PROP_NONE);
4301 RNA_def_property_ui_text(prop, "Show Lights", "Show light objects");
4303
4304 prop = RNA_def_property(srna, "use_filter_object_camera", PROP_BOOLEAN, PROP_NONE);
4306 RNA_def_property_ui_text(prop, "Show Cameras", "Show camera objects");
4308
4309 prop = RNA_def_property(srna, "use_filter_object_grease_pencil", PROP_BOOLEAN, PROP_NONE);
4311 RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show Grease Pencil objects");
4313
4314 prop = RNA_def_property(srna, "use_filter_object_others", PROP_BOOLEAN, PROP_NONE);
4317 prop, "Show Other Objects", "Show curves, lattices, light probes, fonts, ...");
4319
4320 /* Libraries filter. */
4321 prop = RNA_def_property(srna, "use_filter_id_type", PROP_BOOLEAN, PROP_NONE);
4322 RNA_def_property_boolean_sdna(prop, nullptr, "filter", SO_FILTER_ID_TYPE);
4323 RNA_def_property_ui_text(prop, "Filter by Type", "Show only data-blocks of one type");
4325
4326 prop = RNA_def_property(srna, "filter_id_type", PROP_ENUM, PROP_NONE);
4327 RNA_def_property_enum_sdna(prop, nullptr, "filter_id_type");
4329 RNA_def_property_ui_text(prop, "Filter by Type", "Data-block type to show");
4331
4332 prop = RNA_def_property(srna, "use_filter_lib_override_system", PROP_BOOLEAN, PROP_NONE);
4335 prop,
4336 "Show System Overrides",
4337 "For libraries with overrides created, show the overridden values that are "
4338 "defined/controlled automatically (e.g. to make users of an overridden data-block point to "
4339 "the override data, not the original linked data)");
4341}
4342
4344{
4345 StructRNA *srna;
4346 PropertyRNA *prop;
4347
4348 static const EnumPropertyItem background_type_items[] = {
4349 {V3D_SHADING_BACKGROUND_THEME, "THEME", 0, "Theme", "Use the theme for background color"},
4350 {V3D_SHADING_BACKGROUND_WORLD, "WORLD", 0, "World", "Use the world for background color"},
4352 "VIEWPORT",
4353 0,
4354 "Custom",
4355 "Use a custom color limited to this viewport only"},
4356 {0, nullptr, 0, nullptr, nullptr},
4357 };
4358
4359 static const EnumPropertyItem cavity_type_items[] = {
4361 "WORLD",
4362 0,
4363 "World",
4364 "Cavity shading computed in world space, useful for larger-scale occlusion"},
4366 "SCREEN",
4367 0,
4368 "Screen",
4369 "Curvature-based shading, useful for making fine details more visible"},
4370 {V3D_SHADING_CAVITY_BOTH, "BOTH", 0, "Both", "Use both effects simultaneously"},
4371 {0, nullptr, 0, nullptr, nullptr},
4372 };
4373
4374 static const EnumPropertyItem use_compositor_items[] = {
4376 "DISABLED",
4377 0,
4378 "Disabled",
4379 "The compositor is disabled"},
4381 "CAMERA",
4382 0,
4383 "Camera",
4384 "The compositor is enabled only in camera view"},
4386 "ALWAYS",
4387 0,
4388 "Always",
4389 "The compositor is always enabled regardless of the view"},
4390 {0, nullptr, 0, nullptr, nullptr},
4391 };
4392
4393 /* Note these settings are used for both 3D viewport and the OpenGL render
4394 * engine in the scene, so can't assume to always be part of a screen. */
4395 srna = RNA_def_struct(brna, "View3DShading", nullptr);
4396 RNA_def_struct_path_func(srna, "rna_View3DShading_path");
4398 srna, "3D View Shading Settings", "Settings for shading in the 3D viewport");
4399 RNA_def_struct_idprops_func(srna, "rna_View3DShading_idprops");
4400
4401 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4404 "rna_3DViewShading_type_get",
4405 "rna_3DViewShading_type_set",
4406 "rna_3DViewShading_type_itemf");
4408 prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
4410 prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, "rna_3DViewShading_type_update");
4411
4412 prop = RNA_def_property(srna, "light", PROP_ENUM, PROP_NONE);
4413 RNA_def_property_enum_sdna(prop, nullptr, "light");
4415 RNA_def_property_ui_text(prop, "Lighting", "Lighting Method for Solid/Texture Viewport Shading");
4417
4418 prop = RNA_def_property(srna, "show_object_outline", PROP_BOOLEAN, PROP_NONE);
4421 RNA_def_property_ui_text(prop, "Outline", "Show Object Outline");
4423
4424 prop = RNA_def_property(srna, "studio_light", PROP_ENUM, PROP_NONE);
4428 "rna_View3DShading_studio_light_get",
4429 "rna_View3DShading_studio_light_set",
4430 "rna_View3DShading_studio_light_itemf");
4431 RNA_def_property_ui_text(prop, "Studiolight", "Studio lighting setup");
4433
4434 prop = RNA_def_property(srna, "use_world_space_lighting", PROP_BOOLEAN, PROP_NONE);
4438 prop, "World Space Lighting", "Make the lighting fixed and not follow the camera");
4440
4441 prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE);
4444 prop, "Backface Culling", "Use back face culling to hide the back side of faces");
4446
4447 prop = RNA_def_property(srna, "show_cavity", PROP_BOOLEAN, PROP_NONE);
4448 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_CAVITY);
4450 RNA_def_property_ui_text(prop, "Cavity", "Show Cavity");
4452
4453 prop = RNA_def_property(srna, "cavity_type", PROP_ENUM, PROP_NONE);
4454 RNA_def_property_enum_items(prop, cavity_type_items);
4455 RNA_def_property_ui_text(prop, "Cavity Type", "Way to display the cavity shading");
4458
4459 prop = RNA_def_property(srna, "curvature_ridge_factor", PROP_FLOAT, PROP_FACTOR);
4460 RNA_def_property_float_sdna(prop, nullptr, "curvature_ridge_factor");
4461 RNA_def_property_ui_text(prop, "Curvature Ridge", "Factor for the curvature ridges");
4462 RNA_def_property_range(prop, 0.0f, 2.0f);
4465
4466 prop = RNA_def_property(srna, "curvature_valley_factor", PROP_FLOAT, PROP_FACTOR);
4467 RNA_def_property_float_sdna(prop, nullptr, "curvature_valley_factor");
4468 RNA_def_property_ui_text(prop, "Curvature Valley", "Factor for the curvature valleys");
4469 RNA_def_property_range(prop, 0.0f, 2.0f);
4472
4473 prop = RNA_def_property(srna, "cavity_ridge_factor", PROP_FLOAT, PROP_FACTOR);
4474 RNA_def_property_float_sdna(prop, nullptr, "cavity_ridge_factor");
4475 RNA_def_property_ui_text(prop, "Cavity Ridge", "Factor for the cavity ridges");
4476 RNA_def_property_range(prop, 0.0f, 250.0f);
4477 RNA_def_property_ui_range(prop, 0.00f, 2.5f, 1, 3);
4480
4481 prop = RNA_def_property(srna, "cavity_valley_factor", PROP_FLOAT, PROP_FACTOR);
4482 RNA_def_property_float_sdna(prop, nullptr, "cavity_valley_factor");
4483 RNA_def_property_ui_text(prop, "Cavity Valley", "Factor for the cavity valleys");
4484 RNA_def_property_range(prop, 0.0f, 250.0f);
4485 RNA_def_property_ui_range(prop, 0.00f, 2.5f, 1, 3);
4488
4489 prop = RNA_def_property(srna, "selected_studio_light", PROP_POINTER, PROP_NONE);
4490 RNA_def_property_struct_type(prop, "StudioLight");
4492 RNA_def_property_ui_text(prop, "Studio Light", "Selected StudioLight");
4494 prop, "rna_View3DShading_selected_studio_light_get", nullptr, nullptr, nullptr);
4497
4498 prop = RNA_def_property(srna, "studiolight_rotate_z", PROP_FLOAT, PROP_ANGLE);
4499 RNA_def_property_float_sdna(prop, nullptr, "studiolight_rot_z");
4501 prop, "Studiolight Rotation", "Rotation of the studiolight around the Z-Axis");
4505
4506 prop = RNA_def_property(srna, "studiolight_intensity", PROP_FLOAT, PROP_FACTOR);
4507 RNA_def_property_float_sdna(prop, nullptr, "studiolight_intensity");
4509 RNA_def_property_ui_text(prop, "Strength", "Strength of the studiolight");
4511 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4512 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
4514
4515 prop = RNA_def_property(srna, "studiolight_background_alpha", PROP_FLOAT, PROP_FACTOR);
4516 RNA_def_property_float_sdna(prop, nullptr, "studiolight_background");
4517 RNA_def_property_ui_text(prop, "World Opacity", "Show the studiolight in the background");
4518 RNA_def_property_range(prop, 0.0f, 1.0f);
4519 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
4522
4523 prop = RNA_def_property(srna, "studiolight_background_blur", PROP_FLOAT, PROP_FACTOR);
4524 RNA_def_property_float_sdna(prop, nullptr, "studiolight_blur");
4525 RNA_def_property_ui_text(prop, "Blur", "Blur the studiolight in the background");
4527 RNA_def_property_range(prop, 0.0f, 1.0f);
4528 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
4531
4532 prop = RNA_def_property(srna, "use_studiolight_view_rotation", PROP_BOOLEAN, PROP_NONE);
4534 prop, nullptr, "flag", V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION);
4537 prop, "World Space Lighting", "Make the HDR rotation fixed and not follow the camera");
4539
4540 prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE);
4541 RNA_def_property_enum_sdna(prop, nullptr, "color_type");
4543 RNA_def_property_ui_text(prop, "Color", "Color Type");
4546
4547 prop = RNA_def_property(srna, "wireframe_color_type", PROP_ENUM, PROP_NONE);
4548 RNA_def_property_enum_sdna(prop, nullptr, "wire_color_type");
4550 RNA_def_property_ui_text(prop, "Wire Color", "Wire Color Type");
4552
4553 prop = RNA_def_property(srna, "single_color", PROP_FLOAT, PROP_COLOR);
4554 RNA_def_property_float_sdna(prop, nullptr, "single_color");
4555 RNA_def_property_array(prop, 3);
4556 RNA_def_property_ui_text(prop, "Color", "Color for single color mode");
4557 RNA_def_property_range(prop, 0.0f, 1.0f);
4559
4560 prop = RNA_def_property(srna, "background_type", PROP_ENUM, PROP_NONE);
4561 RNA_def_property_enum_items(prop, background_type_items);
4562 RNA_def_property_ui_text(prop, "Background", "Way to display the background");
4565
4566 prop = RNA_def_property(srna, "background_color", PROP_FLOAT, PROP_COLOR);
4567 RNA_def_property_array(prop, 3);
4568 RNA_def_property_ui_text(prop, "Background Color", "Color for custom background color");
4569 RNA_def_property_range(prop, 0.0f, 1.0f);
4571
4572 prop = RNA_def_property(srna, "show_shadows", PROP_BOOLEAN, PROP_NONE);
4573 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_SHADOW);
4575 RNA_def_property_ui_text(prop, "Shadow", "Show Shadow");
4577
4578 prop = RNA_def_property(srna, "show_xray", PROP_BOOLEAN, PROP_NONE);
4579 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_XRAY);
4581 RNA_def_property_ui_text(prop, "Show X-Ray", "Show whole scene transparent");
4583
4584 prop = RNA_def_property(srna, "show_xray_wireframe", PROP_BOOLEAN, PROP_NONE);
4587 RNA_def_property_ui_text(prop, "Show X-Ray", "Show whole scene transparent");
4589
4590 prop = RNA_def_property(srna, "xray_alpha", PROP_FLOAT, PROP_FACTOR);
4591 RNA_def_property_float_sdna(prop, nullptr, "xray_alpha");
4592 RNA_def_property_ui_text(prop, "X-Ray Opacity", "Amount of opacity to use");
4593 RNA_def_property_range(prop, 0.0f, 1.0f);
4596
4597 prop = RNA_def_property(srna, "xray_alpha_wireframe", PROP_FLOAT, PROP_FACTOR);
4598 RNA_def_property_float_sdna(prop, nullptr, "xray_alpha_wire");
4599 RNA_def_property_ui_text(prop, "X-Ray Opacity", "Amount of opacity to use");
4600 RNA_def_property_range(prop, 0.0f, 1.0f);
4603
4604 prop = RNA_def_property(srna, "use_dof", PROP_BOOLEAN, PROP_NONE);
4608 prop,
4609 "Depth Of Field",
4610 "Use depth of field on viewport using the values from the active camera");
4612
4613 prop = RNA_def_property(srna, "use_scene_lights", PROP_BOOLEAN, PROP_NONE);
4617 RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene");
4619
4620 prop = RNA_def_property(srna, "use_scene_world", PROP_BOOLEAN, PROP_NONE);
4624 RNA_def_property_ui_text(prop, "Scene World", "Use scene world for lighting");
4626
4627 prop = RNA_def_property(srna, "use_scene_lights_render", PROP_BOOLEAN, PROP_NONE);
4630 RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene");
4632
4633 prop = RNA_def_property(srna, "use_scene_world_render", PROP_BOOLEAN, PROP_NONE);
4636 RNA_def_property_ui_text(prop, "Scene World", "Use scene world for lighting");
4638
4639 prop = RNA_def_property(srna, "show_specular_highlight", PROP_BOOLEAN, PROP_NONE);
4642 RNA_def_property_ui_text(prop, "Specular Highlights", "Render specular highlights");
4644
4645 prop = RNA_def_property(srna, "object_outline_color", PROP_FLOAT, PROP_COLOR);
4646 RNA_def_property_float_sdna(prop, nullptr, "object_outline_color");
4647 RNA_def_property_array(prop, 3);
4648 RNA_def_property_ui_text(prop, "Outline Color", "Color for object outline");
4649 RNA_def_property_range(prop, 0.0f, 1.0f);
4651
4652 prop = RNA_def_property(srna, "shadow_intensity", PROP_FLOAT, PROP_FACTOR);
4653 RNA_def_property_float_sdna(prop, nullptr, "shadow_intensity");
4654 RNA_def_property_ui_text(prop, "Shadow Intensity", "Darkness of shadows");
4655 RNA_def_property_range(prop, 0.0f, 1.0f);
4656 RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 3);
4659
4660 prop = RNA_def_property(srna, "render_pass", PROP_ENUM, PROP_NONE);
4661 RNA_def_property_enum_sdna(prop, nullptr, "render_pass");
4663 RNA_def_property_ui_text(prop, "Render Pass", "Render Pass to show in the viewport");
4666 "rna_3DViewShading_render_pass_get",
4667 "rna_3DViewShading_render_pass_set",
4668 "rna_3DViewShading_render_pass_itemf");
4670
4671 prop = RNA_def_property(srna, "aov_name", PROP_STRING, PROP_NONE);
4672 RNA_def_property_string_sdna(prop, nullptr, "aov_name");
4673 RNA_def_property_ui_text(prop, "Shader AOV Name", "Name of the active Shader AOV");
4676
4677 prop = RNA_def_property(srna, "use_compositor", PROP_ENUM, PROP_NONE);
4678 RNA_def_property_enum_sdna(prop, nullptr, "use_compositor");
4679 RNA_def_property_enum_items(prop, use_compositor_items);
4682 prop, "Compositor", "When to preview the compositor output inside the viewport");
4685 "rna_SpaceView3D_shading_use_compositor_update");
4686}
4687
4689{
4690 StructRNA *srna;
4691 PropertyRNA *prop;
4692
4693 srna = RNA_def_struct(brna, "View3DOverlay", nullptr);
4694 RNA_def_struct_sdna(srna, "View3D");
4695 RNA_def_struct_nested(brna, srna, "SpaceView3D");
4696 RNA_def_struct_path_func(srna, "rna_View3DOverlay_path");
4698 srna, "3D View Overlay Settings", "Settings for display of overlays in the 3D viewport");
4699
4700 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
4702 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like gizmos and outlines");
4703 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_show_overlay_update");
4704
4705 prop = RNA_def_property(srna, "show_ortho_grid", PROP_BOOLEAN, PROP_NONE);
4706 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_ORTHO_GRID);
4707 RNA_def_property_ui_text(prop, "Display Grid", "Show grid in orthographic side view");
4709
4710 prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
4711 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_FLOOR);
4712 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid");
4714
4715 prop = RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
4716 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_X);
4717 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line");
4719
4720 prop = RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
4721 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_Y);
4722 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line");
4724
4725 prop = RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
4726 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_Z);
4727 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line");
4729
4730 prop = RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
4731 RNA_def_property_float_sdna(prop, nullptr, "grid");
4733 prop, "Grid Scale", "Multiplier for the distance between 3D View grid lines");
4734 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4735 RNA_def_property_ui_range(prop, 0.001f, 1000.0f, 0.1f, 3);
4737
4738 prop = RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
4739 RNA_def_property_int_sdna(prop, nullptr, "gridlines");
4741 prop, "Grid Lines", "Number of grid lines to display in perspective view");
4742 RNA_def_property_range(prop, 0, 1024);
4744
4745 prop = RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
4746 RNA_def_property_int_sdna(prop, nullptr, "gridsubdiv");
4747 RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions between grid lines");
4748 RNA_def_property_range(prop, 1, 1024);
4750
4751 prop = RNA_def_property(srna, "grid_scale_unit", PROP_FLOAT, PROP_NONE);
4753 RNA_def_property_float_funcs(prop, "rna_View3DOverlay_GridScaleUnit_get", nullptr, nullptr);
4755 prop, "Grid Scale Unit", "Grid cell size scaled by scene unit system settings");
4756
4757 prop = RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
4758 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SELECT_OUTLINE);
4760 prop, "Outline Selected", "Show an outline highlight around selected objects");
4762
4763 prop = RNA_def_property(srna, "show_object_origins", PROP_BOOLEAN, PROP_NONE);
4765 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_OBJECT_ORIGINS);
4766 RNA_def_property_ui_text(prop, "Object Origins", "Show object center dots");
4768
4769 prop = RNA_def_property(srna, "show_object_origins_all", PROP_BOOLEAN, PROP_NONE);
4770 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_DRAW_CENTERS);
4772 prop,
4773 "All Object Origins",
4774 "Show the object origin center dot for all (selected and unselected) objects");
4776
4777 prop = RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
4780 "Relationship Lines",
4781 "Show dashed lines indicating parent or constraint relationships");
4783
4784 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
4786 RNA_def_property_ui_text(prop, "Show 3D Cursor", "Display 3D Cursor Overlay");
4788
4789 prop = RNA_def_property(srna, "show_text", PROP_BOOLEAN, PROP_NONE);
4790 RNA_def_property_boolean_negative_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_TEXT);
4791 RNA_def_property_ui_text(prop, "Show Text", "Display overlay text");
4793
4794 prop = RNA_def_property(srna, "show_stats", PROP_BOOLEAN, PROP_NONE);
4795 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_STATS);
4796 RNA_def_property_ui_text(prop, "Show Statistics", "Display scene statistics overlay text");
4798
4799 /* show camera composition guides */
4800 prop = RNA_def_property(srna, "show_camera_guides", PROP_BOOLEAN, PROP_NONE);
4802 RNA_def_property_ui_text(prop, "Show Camera Guides", "Show camera composition guides");
4804
4805 prop = RNA_def_property(srna, "show_camera_passepartout", PROP_BOOLEAN, PROP_NONE);
4807 RNA_def_property_ui_text(prop, "Show Passepartout", "Show camera passepartout");
4809
4810 prop = RNA_def_property(srna, "show_extras", PROP_BOOLEAN, PROP_NONE);
4812 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_OBJECT_XTRAS);
4814 prop, "Extras", "Object details, including empty wire, cameras and other visual guides");
4816
4817 prop = RNA_def_property(srna, "show_light_colors", PROP_BOOLEAN, PROP_NONE);
4818 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SHOW_LIGHT_COLORS);
4819 RNA_def_property_ui_text(prop, "Light Colors", "Show light colors");
4821
4822 prop = RNA_def_property(srna, "show_bones", PROP_BOOLEAN, PROP_NONE);
4823 RNA_def_property_boolean_negative_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_BONES);
4825 prop, "Show Bones", "Display bones (disable to show motion paths only)");
4827
4828 prop = RNA_def_property(srna, "show_face_orientation", PROP_BOOLEAN, PROP_NONE);
4829 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_FACE_ORIENTATION);
4831 RNA_def_property_ui_text(prop, "Face Orientation", "Show the Face Orientation Overlay");
4833
4834 prop = RNA_def_property(srna, "show_fade_inactive", PROP_BOOLEAN, PROP_NONE);
4835 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_FADE_INACTIVE);
4838 prop, "Fade Inactive Objects", "Fade inactive geometry using the viewport background color");
4840
4841 prop = RNA_def_property(srna, "fade_inactive_alpha", PROP_FLOAT, PROP_FACTOR);
4842 RNA_def_property_float_sdna(prop, nullptr, "overlay.fade_alpha");
4843 RNA_def_property_ui_text(prop, "Opacity", "Strength of the fade effect");
4844 RNA_def_property_range(prop, 0.0f, 1.0f);
4847
4848 prop = RNA_def_property(srna, "show_xray_bone", PROP_BOOLEAN, PROP_NONE);
4849 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_BONE_SELECT);
4851 RNA_def_property_ui_text(prop, "Show Bone X-Ray", "Show the bone selection overlay");
4853
4854 prop = RNA_def_property(srna, "xray_alpha_bone", PROP_FLOAT, PROP_FACTOR);
4855 RNA_def_property_float_sdna(prop, nullptr, "overlay.xray_alpha_bone");
4856 RNA_def_property_ui_text(prop, "Opacity", "Opacity to use for bone selection");
4857 RNA_def_property_range(prop, 0.0f, 1.0f);
4860
4861 prop = RNA_def_property(srna, "bone_wire_alpha", PROP_FLOAT, PROP_FACTOR);
4862 RNA_def_property_float_sdna(prop, nullptr, "overlay.bone_wire_alpha");
4864 prop, "Bone Wireframe Opacity", "Maximum opacity of bones in wireframe display mode");
4865 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4866 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
4869
4870 prop = RNA_def_property(srna, "show_motion_paths", PROP_BOOLEAN, PROP_NONE);
4872 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_MOTION_PATHS);
4874 RNA_def_property_ui_text(prop, "Motion Paths", "Show the Motion Paths Overlay");
4876
4877 prop = RNA_def_property(srna, "show_onion_skins", PROP_BOOLEAN, PROP_NONE);
4878 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_ONION_SKINS);
4880 RNA_def_property_ui_text(prop, "Onion Skins", "Show the Onion Skinning Overlay");
4882
4883 prop = RNA_def_property(srna, "show_look_dev", PROP_BOOLEAN, PROP_NONE);
4884 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_LOOK_DEV);
4886 RNA_def_property_ui_text(prop, "HDRI Preview", "Show HDRI preview spheres");
4888
4889 prop = RNA_def_property(srna, "show_wireframes", PROP_BOOLEAN, PROP_NONE);
4890 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_WIREFRAMES);
4892 RNA_def_property_ui_text(prop, "Wireframe", "Show face edges wires");
4894
4895 prop = RNA_def_property(srna, "wireframe_threshold", PROP_FLOAT, PROP_FACTOR);
4896 RNA_def_property_float_sdna(prop, nullptr, "overlay.wireframe_threshold");
4898 "Wireframe Threshold",
4899 "Adjust the angle threshold for displaying edges "
4900 "(1.0 for all)");
4901 RNA_def_property_range(prop, 0.0f, 1.0f);
4904
4905 prop = RNA_def_property(srna, "wireframe_opacity", PROP_FLOAT, PROP_FACTOR);
4906 RNA_def_property_float_sdna(prop, nullptr, "overlay.wireframe_opacity");
4908 "Wireframe Opacity",
4909 "Opacity of the displayed edges "
4910 "(1.0 for opaque)");
4911 RNA_def_property_range(prop, 0.0f, 1.0f);
4914
4915 prop = RNA_def_property(srna, "show_viewer_attribute", PROP_BOOLEAN, PROP_NONE);
4916 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_VIEWER_ATTRIBUTE);
4918 RNA_def_property_ui_text(prop, "Viewer Node", "Show attribute overlay for active viewer node");
4920
4921 prop = RNA_def_property(srna, "viewer_attribute_opacity", PROP_FLOAT, PROP_FACTOR);
4922 RNA_def_property_float_sdna(prop, nullptr, "overlay.viewer_attribute_opacity");
4924 prop, "Viewer Attribute Opacity", "Opacity of the attribute that is currently visualized");
4925 RNA_def_property_range(prop, 0.0f, 1.0f);
4928
4929 prop = RNA_def_property(srna, "show_viewer_text", PROP_BOOLEAN, PROP_NONE);
4933 prop, "View Attribute Text", "Show attribute values as text in viewport");
4935
4936 prop = RNA_def_property(srna, "show_paint_wire", PROP_BOOLEAN, PROP_NONE);
4937 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.paint_flag", V3D_OVERLAY_PAINT_WIRE);
4938 RNA_def_property_ui_text(prop, "Show Wire", "Use wireframe display in painting modes");
4940
4941 prop = RNA_def_property(srna, "show_wpaint_contours", PROP_BOOLEAN, PROP_NONE);
4942 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.wpaint_flag", V3D_OVERLAY_WPAINT_CONTOURS);
4944 prop,
4945 "Show Weight Contours",
4946 "Show contour lines formed by points with the same interpolated weight");
4948
4949 prop = RNA_def_property(srna, "show_weight", PROP_BOOLEAN, PROP_NONE);
4950 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_WEIGHT);
4951 RNA_def_property_ui_text(prop, "Show Weights", "Display weights in editmode");
4953
4954 prop = RNA_def_property(srna, "show_retopology", PROP_BOOLEAN, PROP_NONE);
4955 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_RETOPOLOGY);
4957 "Retopology",
4958 "Hide the solid mesh and offset the overlay towards the view. "
4959 "Selection is occluded by inactive geometry, unless X-Ray is enabled");
4961 prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, "rna_SpaceView3D_retopology_update");
4962
4963 prop = RNA_def_property(srna, "retopology_offset", PROP_FLOAT, PROP_DISTANCE);
4964 RNA_def_property_float_sdna(prop, nullptr, "overlay.retopology_offset");
4966 prop, "Retopology Offset", "Offset used to draw edit mesh in front of other geometry");
4967 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4968 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1f, 3);
4971
4972 prop = RNA_def_property(srna, "show_face_normals", PROP_BOOLEAN, PROP_NONE);
4973 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_NORMALS);
4974 RNA_def_property_ui_text(prop, "Display Normals", "Display face normals as lines");
4976
4977 prop = RNA_def_property(srna, "show_vertex_normals", PROP_BOOLEAN, PROP_NONE);
4978 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_VERT_NORMALS);
4979 RNA_def_property_ui_text(prop, "Display Vertex Normals", "Display vertex normals as lines");
4981
4982 prop = RNA_def_property(srna, "show_split_normals", PROP_BOOLEAN, PROP_NONE);
4983 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_LOOP_NORMALS);
4985 prop, "Display Split Normals", "Display vertex-per-face normals as lines");
4987
4988 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
4989 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACES);
4990 RNA_def_property_ui_text(prop, "Display Faces", "Display a face selection overlay");
4992
4993 prop = RNA_def_property(srna, "show_face_center", PROP_BOOLEAN, PROP_NONE);
4994 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_DOT);
4996 prop,
4997 "Display Face Center",
4998 "Display face center when face selection is enabled in solid shading modes");
5000
5001 prop = RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
5002 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CREASES);
5004 prop, "Display Creases", "Display creases created for Subdivision Surface modifier");
5006
5007 prop = RNA_def_property(srna, "show_edge_bevel_weight", PROP_BOOLEAN, PROP_NONE);
5008 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_BWEIGHTS);
5010 prop, "Display Bevel Weights", "Display weights created for the Bevel modifier");
5012
5013 prop = RNA_def_property(srna, "show_edge_seams", PROP_BOOLEAN, PROP_NONE);
5014 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_SEAMS);
5015 RNA_def_property_ui_text(prop, "Display Seams", "Display UV unwrapping seams");
5017
5018 prop = RNA_def_property(srna, "show_edge_sharp", PROP_BOOLEAN, PROP_NONE);
5019 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_SHARP);
5021 prop, "Display Sharp", "Display sharp edges, used with the Edge Split modifier");
5023
5024 prop = RNA_def_property(srna, "show_freestyle_edge_marks", PROP_BOOLEAN, PROP_NONE);
5026 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FREESTYLE_EDGE);
5028 "Display Freestyle Edge Marks",
5029 "Display Freestyle edge marks, used with the Freestyle renderer");
5031
5032 prop = RNA_def_property(srna, "show_freestyle_face_marks", PROP_BOOLEAN, PROP_NONE);
5034 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FREESTYLE_FACE);
5036 "Display Freestyle Face Marks",
5037 "Display Freestyle face marks, used with the Freestyle renderer");
5039
5040 prop = RNA_def_property(srna, "show_statvis", PROP_BOOLEAN, PROP_NONE);
5041 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_STATVIS);
5043 prop, "Mesh Analysis", "Display statistical information about the mesh");
5045
5046 prop = RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
5047 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_EDGE_LEN);
5049 prop,
5050 "Edge Length",
5051 "Display selected edge lengths, using global values when set in the transform panel");
5053
5054 prop = RNA_def_property(srna, "show_extra_edge_angle", PROP_BOOLEAN, PROP_NONE);
5055 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_EDGE_ANG);
5057 prop,
5058 "Edge Angle",
5059 "Display selected edge angle, using global values when set in the transform panel");
5061
5062 prop = RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
5063 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_ANG);
5065 "Face Angles",
5066 "Display the angles in the selected edges, "
5067 "using global values when set in the transform panel");
5069
5070 prop = RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
5071 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_AREA);
5073 "Face Area",
5074 "Display the area of selected faces, "
5075 "using global values when set in the transform panel");
5077
5078 prop = RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
5079 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_INDICES);
5081 prop, "Indices", "Display the index numbers of selected vertices, edges, and faces");
5083
5084 prop = RNA_def_property(srna, "display_handle", PROP_ENUM, PROP_NONE);
5085 RNA_def_property_enum_sdna(prop, nullptr, "overlay.handle_display");
5088 prop, "Display Handles", "Limit the display of curve handles in edit mode");
5090
5091 prop = RNA_def_property(srna, "show_curve_normals", PROP_BOOLEAN, PROP_NONE);
5092 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CU_NORMALS);
5093 RNA_def_property_ui_text(prop, "Draw Normals", "Display 3D curve normals in editmode");
5095
5096 prop = RNA_def_property(srna, "normals_length", PROP_FLOAT, PROP_FACTOR);
5097 RNA_def_property_float_sdna(prop, nullptr, "overlay.normals_length");
5098 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
5099 RNA_def_property_range(prop, 0.00001, 100000.0);
5100 RNA_def_property_ui_range(prop, 0.01, 2.0, 1, 2);
5102
5103 prop = RNA_def_property(srna, "normals_constant_screen_size", PROP_FLOAT, PROP_PIXEL);
5104 RNA_def_property_float_sdna(prop, nullptr, "overlay.normals_constant_screen_size");
5105 RNA_def_property_ui_text(prop, "Normal Screen Size", "Screen size for normals in the 3D view");
5106 RNA_def_property_range(prop, 0.0, 100000.0);
5107 RNA_def_property_ui_range(prop, 1.0, 100.0, 50, 0);
5109
5110 prop = RNA_def_property(srna, "use_normals_constant_screen_size", PROP_BOOLEAN, PROP_NONE);
5112 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS);
5114 "Constant Screen Size Normals",
5115 "Keep size of normals constant in relation to 3D view");
5117
5118 prop = RNA_def_property(srna, "texture_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
5119 RNA_def_property_float_sdna(prop, nullptr, "overlay.texture_paint_mode_opacity");
5121 prop, "Stencil Mask Opacity", "Opacity of the texture paint mode stencil mask overlay");
5122 RNA_def_property_range(prop, 0.0f, 1.0f);
5124
5125 prop = RNA_def_property(srna, "vertex_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
5126 RNA_def_property_float_sdna(prop, nullptr, "overlay.vertex_paint_mode_opacity");
5128 prop, "Stencil Mask Opacity", "Opacity of the texture paint mode stencil mask overlay");
5129 RNA_def_property_range(prop, 0.0f, 1.0f);
5131
5132 prop = RNA_def_property(srna, "weight_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
5133 RNA_def_property_float_sdna(prop, nullptr, "overlay.weight_paint_mode_opacity");
5135 prop, "Weight Paint Opacity", "Opacity of the weight paint mode overlay");
5136 RNA_def_property_range(prop, 0.0f, 1.0f);
5138
5139 prop = RNA_def_property(srna, "sculpt_mode_mask_opacity", PROP_FLOAT, PROP_FACTOR);
5140 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_mode_mask_opacity");
5141 RNA_def_property_ui_text(prop, "Sculpt Mask Opacity", "");
5142 RNA_def_property_range(prop, 0.0f, 1.0f);
5144
5145 prop = RNA_def_property(srna, "show_sculpt_curves_cage", PROP_BOOLEAN, PROP_NONE);
5146 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SCULPT_CURVES_CAGE);
5148 prop, "Sculpt Curves Cage", "Show original curves that are currently being edited");
5150
5151 prop = RNA_def_property(srna, "sculpt_curves_cage_opacity", PROP_FLOAT, PROP_FACTOR);
5152 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_curves_cage_opacity");
5154 prop, "Curves Sculpt Cage Opacity", "Opacity of the cage overlay in curves sculpt mode");
5155 RNA_def_property_range(prop, 0.0f, 1.0f);
5157
5158 prop = RNA_def_property(srna, "sculpt_mode_face_sets_opacity", PROP_FLOAT, PROP_FACTOR);
5159 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_mode_face_sets_opacity");
5160 RNA_def_property_ui_text(prop, "Sculpt Face Sets Opacity", "");
5161 RNA_def_property_range(prop, 0.0f, 1.0f);
5163
5164 prop = RNA_def_property(srna, "show_sculpt_mask", PROP_BOOLEAN, PROP_NONE);
5165 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SCULPT_SHOW_MASK);
5166 RNA_def_property_ui_text(prop, "Sculpt Show Mask", "");
5168
5169 prop = RNA_def_property(srna, "show_sculpt_face_sets", PROP_BOOLEAN, PROP_NONE);
5171 RNA_def_property_ui_text(prop, "Sculpt Show Face Sets", "");
5173
5174 /* grease pencil paper settings */
5175 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
5176 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_ANNOTATION);
5177 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
5179
5180 prop = RNA_def_property(srna, "use_gpencil_fade_objects", PROP_BOOLEAN, PROP_NONE);
5181 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_FADE_OBJECTS);
5183 prop,
5184 "Fade Objects",
5185 "Fade all viewport objects with a full color layer to improve visibility");
5187
5188 prop = RNA_def_property(srna, "use_gpencil_grid", PROP_BOOLEAN, PROP_NONE);
5189 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_GRID);
5190 RNA_def_property_ui_text(prop, "Use Grid", "Display a grid over Grease Pencil paper");
5192
5193 prop = RNA_def_property(srna, "use_gpencil_fade_layers", PROP_BOOLEAN, PROP_NONE);
5196 prop, "Fade Layers", "Toggle fading of Grease Pencil layers except the active one");
5198
5199 prop = RNA_def_property(srna, "use_gpencil_fade_gp_objects", PROP_BOOLEAN, PROP_NONE);
5202 prop, "Fade Grease Pencil Objects", "Fade Grease Pencil Objects, except the active one");
5204
5205 prop = RNA_def_property(srna, "use_gpencil_canvas_xray", PROP_BOOLEAN, PROP_NONE);
5206 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_GRID_XRAY);
5207 RNA_def_property_ui_text(prop, "Canvas X-Ray", "Show Canvas grid in front");
5209
5210 prop = RNA_def_property(srna, "use_gpencil_show_directions", PROP_BOOLEAN, PROP_NONE);
5213 "Stroke Direction",
5214 "Show stroke drawing direction with a bigger green dot (start) "
5215 "and smaller red dot (end) points");
5217
5218 prop = RNA_def_property(srna, "use_gpencil_show_material_name", PROP_BOOLEAN, PROP_NONE);
5221 prop, "Stroke Material Name", "Show material name assigned to each stroke");
5223
5224 prop = RNA_def_property(srna, "gpencil_grid_opacity", PROP_FLOAT, PROP_NONE);
5225 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_opacity");
5226 RNA_def_property_range(prop, 0.1f, 1.0f);
5227 RNA_def_property_ui_text(prop, "Opacity", "Canvas grid opacity");
5229
5230 prop = RNA_def_property(srna, "gpencil_grid_color", PROP_FLOAT, PROP_COLOR);
5231 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_color");
5232 RNA_def_property_array(prop, 3);
5233 RNA_def_property_ui_text(prop, "Grid Color", "Canvas grid color");
5234 RNA_def_property_range(prop, 0.0f, 1.0f);
5236
5237 prop = RNA_def_property(srna, "gpencil_grid_scale", PROP_FLOAT, PROP_XYZ);
5238 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_scale");
5239 RNA_def_property_array(prop, 2);
5240 RNA_def_property_ui_text(prop, "Scale", "Canvas grid scale");
5241 RNA_def_property_range(prop, 0.0f, FLT_MAX);
5243
5244 prop = RNA_def_property(srna, "gpencil_grid_offset", PROP_FLOAT, PROP_DISTANCE);
5245 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_offset");
5246 RNA_def_property_array(prop, 2);
5247 RNA_def_property_ui_text(prop, "Offset", "Canvas grid offset");
5249
5250 prop = RNA_def_property(srna, "gpencil_grid_subdivisions", PROP_INT, PROP_NONE);
5251 RNA_def_property_int_sdna(prop, nullptr, "overlay.gpencil_grid_subdivisions");
5252 RNA_def_property_range(prop, 1, 100);
5253 RNA_def_property_ui_text(prop, "Subdivisions", "Canvas grid subdivisions");
5255
5256 /* Paper opacity factor */
5257 prop = RNA_def_property(srna, "gpencil_fade_objects", PROP_FLOAT, PROP_NONE);
5258 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_paper_opacity");
5259 RNA_def_property_range(prop, 0.0f, 1.0f);
5260 RNA_def_property_ui_text(prop, "Opacity", "Fade factor");
5262
5263 /* Paper opacity factor */
5264 prop = RNA_def_property(srna, "gpencil_fade_layer", PROP_FLOAT, PROP_NONE);
5265 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_fade_layer");
5266 RNA_def_property_range(prop, 0.0f, 1.0f);
5269 prop, "Opacity", "Fade layer opacity for Grease Pencil layers except the active one");
5271
5272 /* show edit lines */
5273 prop = RNA_def_property(srna, "use_gpencil_edit_lines", PROP_BOOLEAN, PROP_NONE);
5274 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_EDIT_LINES);
5275 RNA_def_property_ui_text(prop, "Show Edit Lines", "Show Edit Lines when editing strokes");
5277
5278 prop = RNA_def_property(srna, "use_gpencil_multiedit_line_only", PROP_BOOLEAN, PROP_NONE);
5280 RNA_def_property_ui_text(prop, "Lines Only", "Show Edit Lines only in multiframe");
5282
5283 /* main grease pencil onion switch */
5284 prop = RNA_def_property(srna, "use_gpencil_onion_skin", PROP_BOOLEAN, PROP_NONE);
5285 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_ONION_SKIN);
5287 prop, "Onion Skins", "Show ghosts of the keyframes before and after the current frame");
5289
5290 /* Show onion skin for active object only. */
5291 prop = RNA_def_property(srna, "use_gpencil_onion_skin_active_object", PROP_BOOLEAN, PROP_NONE);
5294 prop, "Active Object Only", "Show only the onion skins of the active object");
5296
5297 /* vertex opacity */
5298 prop = RNA_def_property(srna, "vertex_opacity", PROP_FLOAT, PROP_FACTOR);
5299 RNA_def_property_float_sdna(prop, nullptr, "vertex_opacity");
5300 RNA_def_property_range(prop, 0.0f, 1.0f);
5301 RNA_def_property_ui_text(prop, "Vertex Opacity", "Opacity for edit vertices");
5304
5305 /* Vertex Paint opacity factor */
5306 prop = RNA_def_property(srna, "gpencil_vertex_paint_opacity", PROP_FLOAT, PROP_FACTOR);
5307 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_vertex_paint_opacity");
5308 RNA_def_property_range(prop, 0.0f, 1.0f);
5309 RNA_def_property_ui_text(prop, "Opacity", "Vertex Paint mix factor");
5311
5312 /* Developer Debug overlay */
5313
5314 prop = RNA_def_property(srna, "use_debug_freeze_view_culling", PROP_BOOLEAN, PROP_NONE);
5315 RNA_def_property_boolean_sdna(prop, nullptr, "debug_flag", V3D_DEBUG_FREEZE_CULLING);
5316 RNA_def_property_ui_text(prop, "Freeze Culling", "Freeze view culling bounds");
5318}
5319
5321{
5322 StructRNA *srna;
5323 PropertyRNA *prop;
5324
5325 static const EnumPropertyItem rv3d_persp_items[] = {
5326 {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
5327 {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
5328 {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
5329 {0, nullptr, 0, nullptr, nullptr},
5330 };
5331
5332 static const EnumPropertyItem bundle_drawtype_items[] = {
5333 {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
5334 {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
5335 {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
5336 {OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
5337 {OB_CUBE, "CUBE", 0, "Cube", ""},
5338 {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
5339 {OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
5340 {0, nullptr, 0, nullptr, nullptr},
5341 };
5342
5343 srna = RNA_def_struct(brna, "SpaceView3D", "Space");
5344 RNA_def_struct_sdna(srna, "View3D");
5345 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
5346
5348 ((1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_TOOLS) |
5349 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) |
5350 (1 << RGN_TYPE_ASSET_SHELF)));
5351
5352 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
5354 RNA_def_property_pointer_sdna(prop, nullptr, "camera");
5356 prop,
5357 "Camera",
5358 "Active camera used in this view (when unlocked from the scene's active camera)");
5359 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_camera_update");
5360
5361 /* render border */
5362 prop = RNA_def_property(srna, "use_render_border", PROP_BOOLEAN, PROP_NONE);
5363 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_RENDER_BORDER);
5366 "Render Region",
5367 "Use a region within the frame size for rendered viewport "
5368 "(when not viewing through the camera)");
5370
5371 prop = RNA_def_property(srna, "render_border_min_x", PROP_FLOAT, PROP_NONE);
5372 RNA_def_property_float_sdna(prop, nullptr, "render_border.xmin");
5373 RNA_def_property_range(prop, 0.0f, 1.0f);
5374 RNA_def_property_ui_text(prop, "Region Minimum X", "Minimum X value for the render region");
5376
5377 prop = RNA_def_property(srna, "render_border_min_y", PROP_FLOAT, PROP_NONE);
5378 RNA_def_property_float_sdna(prop, nullptr, "render_border.ymin");
5379 RNA_def_property_range(prop, 0.0f, 1.0f);
5380 RNA_def_property_ui_text(prop, "Region Minimum Y", "Minimum Y value for the render region");
5382
5383 prop = RNA_def_property(srna, "render_border_max_x", PROP_FLOAT, PROP_NONE);
5384 RNA_def_property_float_sdna(prop, nullptr, "render_border.xmax");
5385 RNA_def_property_range(prop, 0.0f, 1.0f);
5386 RNA_def_property_ui_text(prop, "Region Maximum X", "Maximum X value for the render region");
5388
5389 prop = RNA_def_property(srna, "render_border_max_y", PROP_FLOAT, PROP_NONE);
5390 RNA_def_property_float_sdna(prop, nullptr, "render_border.ymax");
5391 RNA_def_property_range(prop, 0.0f, 1.0f);
5392 RNA_def_property_ui_text(prop, "Region Maximum Y", "Maximum Y value for the render region");
5394
5395 prop = RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
5397 RNA_def_property_pointer_sdna(prop, nullptr, "ob_center");
5399 prop, "Lock to Object", "3D View center is locked to this object's position");
5401
5402 prop = RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
5403 RNA_def_property_string_sdna(prop, nullptr, "ob_center_bone");
5405 prop, "Lock to Bone", "3D View center is locked to this bone's position");
5407
5408 prop = RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
5409 RNA_def_property_boolean_sdna(prop, nullptr, "ob_center_cursor", 1);
5411 prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
5413
5414 prop = RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
5415 RNA_def_property_pointer_sdna(prop, nullptr, "localvd");
5417 prop,
5418 "Local View",
5419 "Display an isolated subset of objects, apart from the scene visibility");
5420
5421 prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_UNIT_CAMERA);
5422 RNA_def_property_float_sdna(prop, nullptr, "lens");
5423 RNA_def_property_ui_text(prop, "Lens", "Viewport lens angle");
5424 RNA_def_property_range(prop, 1.0f, 250.0f);
5426
5427 prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
5428 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
5429 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
5431 prop, "Clip Start", "3D View near clipping distance (perspective view only)");
5433
5434 prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
5435 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
5436 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
5437 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
5439
5440 prop = RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
5441 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_LOCK_CAMERA);
5443 prop, "Lock Camera to View", "Enable view navigation within the camera view");
5445
5446 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
5447 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", V3D_GIZMO_HIDE);
5448 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
5450
5451 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
5453 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
5455
5456 prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE);
5458 RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item");
5460
5461 prop = RNA_def_property(srna, "show_gizmo_modifier", PROP_BOOLEAN, PROP_NONE);
5463 RNA_def_property_ui_text(prop, "Modifier Gizmo", "Gizmos for the active modifier");
5465
5466 prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE);
5467 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", V3D_GIZMO_HIDE_TOOL);
5468 RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo");
5470
5471 /* Per object type gizmo display flags. */
5472
5473 prop = RNA_def_property(srna, "show_gizmo_object_translate", PROP_BOOLEAN, PROP_NONE);
5475 prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_TRANSLATE);
5476 RNA_def_property_ui_text(prop, "Show Object Location", "Gizmo to adjust location");
5478
5479 prop = RNA_def_property(srna, "show_gizmo_object_rotate", PROP_BOOLEAN, PROP_NONE);
5480 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_ROTATE);
5481 RNA_def_property_ui_text(prop, "Show Object Rotation", "Gizmo to adjust rotation");
5483
5484 prop = RNA_def_property(srna, "show_gizmo_object_scale", PROP_BOOLEAN, PROP_NONE);
5485 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_SCALE);
5486 RNA_def_property_ui_text(prop, "Show Object Scale", "Gizmo to adjust scale");
5488
5489 /* Empty Object Data. */
5490 prop = RNA_def_property(srna, "show_gizmo_empty_image", PROP_BOOLEAN, PROP_NONE);
5491 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_empty", V3D_GIZMO_SHOW_EMPTY_IMAGE);
5492 RNA_def_property_ui_text(prop, "Show Empty Image", "Gizmo to adjust image size and position");
5494
5495 prop = RNA_def_property(srna, "show_gizmo_empty_force_field", PROP_BOOLEAN, PROP_NONE);
5497 prop, nullptr, "gizmo_show_empty", V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD);
5498 RNA_def_property_ui_text(prop, "Show Empty Force Field", "Gizmo to adjust the force field");
5500
5501 /* Light Object Data. */
5502 prop = RNA_def_property(srna, "show_gizmo_light_size", PROP_BOOLEAN, PROP_NONE);
5503 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_light", V3D_GIZMO_SHOW_LIGHT_SIZE);
5504 RNA_def_property_ui_text(prop, "Show Light Size", "Gizmo to adjust spot and area size");
5506
5507 prop = RNA_def_property(srna, "show_gizmo_light_look_at", PROP_BOOLEAN, PROP_NONE);
5508 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_light", V3D_GIZMO_SHOW_LIGHT_LOOK_AT);
5510 prop, "Show Light Look-At", "Gizmo to adjust the direction of the light");
5512
5513 /* Camera Object Data. */
5514 prop = RNA_def_property(srna, "show_gizmo_camera_lens", PROP_BOOLEAN, PROP_NONE);
5515 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_camera", V3D_GIZMO_SHOW_CAMERA_LENS);
5517 prop, "Show Camera Lens", "Gizmo to adjust camera focal length or orthographic scale");
5519
5520 prop = RNA_def_property(srna, "show_gizmo_camera_dof_distance", PROP_BOOLEAN, PROP_NONE);
5522 prop, nullptr, "gizmo_show_camera", V3D_GIZMO_SHOW_CAMERA_DOF_DIST);
5524 "Show Camera Focus Distance",
5525 "Gizmo to adjust camera focus distance "
5526 "(depends on limits display)");
5528
5529 prop = RNA_def_property(srna, "use_local_camera", PROP_BOOLEAN, PROP_NONE);
5530 RNA_def_property_boolean_negative_sdna(prop, nullptr, "scenelock", 1);
5531 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SpaceView3D_use_local_camera_set");
5533 "Use Local Camera",
5534 "Use a local camera in this view, rather than scene's active camera");
5536
5537 prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
5538 RNA_def_property_struct_type(prop, "RegionView3D");
5539 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", nullptr, nullptr, nullptr);
5541 prop,
5542 "3D Region",
5543 "3D region for this space. When the space is in quad view, the camera region");
5544
5545 prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE);
5546 RNA_def_property_struct_type(prop, "RegionView3D");
5548 "rna_SpaceView3D_region_quadviews_begin",
5549 "rna_iterator_listbase_next",
5550 "rna_iterator_listbase_end",
5551 "rna_SpaceView3D_region_quadviews_get",
5552 nullptr,
5553 nullptr,
5554 nullptr,
5555 nullptr);
5557 "Quad View Regions",
5558 "3D regions (the third one defines quad view settings, "
5559 "the fourth one is same as 'region_3d')");
5560
5561 prop = RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
5564 prop, "Show Reconstruction", "Display reconstruction data from active movie clip");
5566
5567 prop = RNA_def_property(srna, "tracks_display_size", PROP_FLOAT, PROP_NONE);
5568 RNA_def_property_range(prop, 0.0, FLT_MAX);
5569 RNA_def_property_ui_range(prop, 0, 5, 1, 3);
5570 RNA_def_property_float_sdna(prop, nullptr, "bundle_size");
5571 RNA_def_property_ui_text(prop, "Tracks Size", "Display size of tracks from reconstructed data");
5573
5574 prop = RNA_def_property(srna, "tracks_display_type", PROP_ENUM, PROP_NONE);
5575 RNA_def_property_enum_sdna(prop, nullptr, "bundle_drawtype");
5576 RNA_def_property_enum_items(prop, bundle_drawtype_items);
5577 RNA_def_property_ui_text(prop, "Tracks Display Type", "Viewport display style for tracks");
5579
5580 prop = RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE);
5581 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_CAMERAPATH);
5582 RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed camera path");
5584
5585 prop = RNA_def_property(srna, "show_bundle_names", PROP_BOOLEAN, PROP_NONE);
5586 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_BUNDLENAME);
5588 prop, "Show 3D Marker Names", "Show names for reconstructed tracks objects");
5590
5591 prop = RNA_def_property(srna, "use_local_collections", PROP_BOOLEAN, PROP_NONE);
5594 prop, "Local Collections", "Display a different set of collections in this viewport");
5597 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_use_local_collections_update");
5598
5599 /* Stereo Settings */
5600 prop = RNA_def_property(srna, "stereo_3d_eye", PROP_ENUM, PROP_NONE);
5601 RNA_def_property_enum_sdna(prop, nullptr, "multiview_eye");
5603 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceView3D_stereo3d_camera_itemf");
5604 RNA_def_property_ui_text(prop, "Stereo Eye", "Current stereo eye being displayed");
5606
5607 prop = RNA_def_property(srna, "stereo_3d_camera", PROP_ENUM, PROP_NONE);
5608 RNA_def_property_enum_sdna(prop, nullptr, "stereo3d_camera");
5610 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceView3D_stereo3d_camera_itemf");
5611 RNA_def_property_ui_text(prop, "Camera", "");
5613
5614 prop = RNA_def_property(srna, "show_stereo_3d_cameras", PROP_BOOLEAN, PROP_NONE);
5615 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPCAMERAS);
5616 RNA_def_property_ui_text(prop, "Cameras", "Show the left and right cameras");
5618
5619 prop = RNA_def_property(srna, "show_stereo_3d_convergence_plane", PROP_BOOLEAN, PROP_NONE);
5620 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPPLANE);
5621 RNA_def_property_ui_text(prop, "Plane", "Show the stereo 3D convergence plane");
5623
5624 prop = RNA_def_property(srna, "stereo_3d_convergence_plane_alpha", PROP_FLOAT, PROP_FACTOR);
5625 RNA_def_property_float_sdna(prop, nullptr, "stereo3d_convergence_alpha");
5626 RNA_def_property_ui_text(prop, "Plane Alpha", "Opacity (alpha) of the convergence plane");
5628
5629 prop = RNA_def_property(srna, "show_stereo_3d_volume", PROP_BOOLEAN, PROP_NONE);
5630 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPVOLUME);
5631 RNA_def_property_ui_text(prop, "Volume", "Show the stereo 3D frustum volume");
5633
5634 prop = RNA_def_property(srna, "stereo_3d_volume_alpha", PROP_FLOAT, PROP_FACTOR);
5635 RNA_def_property_float_sdna(prop, nullptr, "stereo3d_volume_alpha");
5636 RNA_def_property_ui_text(prop, "Volume Alpha", "Opacity (alpha) of the cameras' frustum volume");
5638
5639 prop = RNA_def_property(srna, "mirror_xr_session", PROP_BOOLEAN, PROP_NONE);
5642 prop,
5643 "Mirror VR Session",
5644 "Synchronize the viewer perspective of virtual reality sessions with this 3D viewport");
5646 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_mirror_xr_session_update");
5647
5650 "rna_SpaceView3D_object_type_visibility_update");
5651
5652 /* Helper for drawing the icon. */
5653 prop = RNA_def_property(srna, "icon_from_show_object_viewport", PROP_INT, PROP_NONE);
5655 prop, "rna_SpaceView3D_icon_from_show_object_viewport_get", nullptr, nullptr);
5657 RNA_def_property_ui_text(prop, "Visibility Icon", "");
5658
5659 prop = RNA_def_property(srna, "show_viewer", PROP_BOOLEAN, PROP_NONE);
5660 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_VIEWER);
5661 RNA_def_property_ui_text(prop, "Show Viewer", "Display non-final geometry from viewer nodes");
5663
5664 /* Nested Structs */
5665 prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
5667 RNA_def_property_struct_type(prop, "View3DShading");
5668 RNA_def_property_ui_text(prop, "Shading Settings", "Settings for shading in the 3D viewport");
5669
5670 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
5672 RNA_def_property_struct_type(prop, "View3DOverlay");
5673 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_overlay_get", nullptr, nullptr, nullptr);
5675 prop, "Overlay Settings", "Settings for display of overlays in the 3D viewport");
5676
5679
5680 /* *** Animated *** */
5682 /* region */
5683
5684 srna = RNA_def_struct(brna, "RegionView3D", nullptr);
5685 RNA_def_struct_sdna(srna, "RegionView3D");
5686 RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
5687
5688 prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
5689 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_LOCK_ROTATION);
5691 prop, "Lock Rotation", "Lock view rotation of side views to Top/Front/Right");
5692 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
5693
5694 prop = RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
5695 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_BOXVIEW);
5696 RNA_def_property_ui_text(prop, "Sync Zoom/Pan", "Sync view position between side views");
5697 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
5698
5699 prop = RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
5700 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_BOXCLIP);
5702 prop, "Clip Contents", "Clip view contents based on what is visible in other side views");
5704 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
5705
5706 prop = RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
5707 RNA_def_property_float_sdna(prop, nullptr, "persmat");
5709 prop, PROP_EDITABLE); /* XXX: for now, it's too risky for users to do this */
5712 prop, "Perspective Matrix", "Current perspective matrix (``window_matrix * view_matrix``)");
5713
5714 prop = RNA_def_property(srna, "window_matrix", PROP_FLOAT, PROP_MATRIX);
5715 RNA_def_property_float_sdna(prop, nullptr, "winmat");
5718 RNA_def_property_ui_text(prop, "Window Matrix", "Current window matrix");
5719
5720 prop = RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
5721 RNA_def_property_float_sdna(prop, nullptr, "viewmat");
5723 RNA_def_property_float_funcs(prop, nullptr, "rna_RegionView3D_view_matrix_set", nullptr);
5724 RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix");
5726
5727 prop = RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
5728 RNA_def_property_enum_sdna(prop, nullptr, "persp");
5729 RNA_def_property_enum_items(prop, rv3d_persp_items);
5730 RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
5732
5733 prop = RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
5734 RNA_def_property_boolean_sdna(prop, nullptr, "is_persp", 1);
5735 RNA_def_property_ui_text(prop, "Is Perspective", "");
5737
5738 /* WARNING: Using "orthographic" in this name isn't correct and could be changed. */
5739 prop = RNA_def_property(srna, "is_orthographic_side_view", PROP_BOOLEAN, PROP_NONE);
5740 RNA_def_property_boolean_sdna(prop, nullptr, "view", 0);
5742 "rna_RegionView3D_is_orthographic_side_view_get",
5743 "rna_RegionView3D_is_orthographic_side_view_set");
5745 prop,
5746 "Is Axis Aligned",
5747 "Whether the current view is aligned to an axis "
5748 "(does not check whether the view is orthographic, use \"is_perspective\" for that). "
5749 "Setting this will rotate the view to the closest axis");
5750
5751 /* This isn't directly accessible from the UI, only an operator. */
5752 prop = RNA_def_property(srna, "use_clip_planes", PROP_BOOLEAN, PROP_NONE);
5753 RNA_def_property_boolean_sdna(prop, nullptr, "rflag", RV3D_CLIPPING);
5754 RNA_def_property_ui_text(prop, "Use Clip Planes", "");
5755
5756 const int default_value[] = {6, 4};
5757 prop = RNA_def_property(srna, "clip_planes", PROP_FLOAT, PROP_NONE);
5758 RNA_def_property_float_sdna(prop, nullptr, "clip");
5759 RNA_def_property_multi_array(prop, 2, default_value);
5760 RNA_def_property_ui_text(prop, "Clip Planes", "");
5761
5762 prop = RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
5763# if 0
5764 RNA_def_property_float_sdna(prop, nullptr, "ofs"); /* can't use because it's negated */
5765# else
5766 RNA_def_property_array(prop, 3);
5768 prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", nullptr);
5769# endif
5770 RNA_def_property_ui_text(prop, "View Location", "View pivot location");
5771 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT);
5772 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5773
5774 prop = RNA_def_property(
5775 srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); /* can't use because it's inverted */
5776# if 0
5777 RNA_def_property_float_sdna(prop, nullptr, "viewquat");
5778# else
5779 RNA_def_property_array(prop, 4);
5781 prop, "rna_RegionView3D_view_rotation_get", "rna_RegionView3D_view_rotation_set", nullptr);
5782# endif
5783 RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
5785
5786 /* not sure we need rna access to these but adding anyway */
5787 prop = RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
5788 RNA_def_property_float_sdna(prop, nullptr, "dist");
5789 RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
5791
5792 prop = RNA_def_property(srna, "view_camera_zoom", PROP_FLOAT, PROP_UNSIGNED);
5793 RNA_def_property_float_sdna(prop, nullptr, "camzoom");
5794 RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view");
5797
5798 prop = RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE);
5799 RNA_def_property_float_sdna(prop, nullptr, "camdx");
5800 RNA_def_property_array(prop, 2);
5801 RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view");
5803
5805}
5806
5808{
5809 /* Order must follow `buttons_context_items`. */
5810 constexpr std::array<blender::StringRefNull, BCONTEXT_TOT> filter_items = {
5811 "show_properties_tool",
5812 "show_properties_scene",
5813 "show_properties_render",
5814 "show_properties_output",
5815 "show_properties_view_layer",
5816 "show_properties_world",
5817 "show_properties_collection",
5818 "show_properties_object",
5819 "show_properties_constraints",
5820 "show_properties_modifiers",
5821 "show_properties_data",
5822 "show_properties_bone",
5823 "show_properties_bone_constraints",
5824 "show_properties_material",
5825 "show_properties_texture",
5826 "show_properties_particles",
5827 "show_properties_physics",
5828 "show_properties_effects",
5829 };
5830
5831 for (const int i : blender::IndexRange(BCONTEXT_TOT)) {
5833 const int value = (1 << item.value);
5834 blender::StringRefNull prop_name = filter_items[i];
5835
5836 PropertyRNA *prop = RNA_def_property(srna, prop_name.c_str(), PROP_BOOLEAN, PROP_NONE);
5837 RNA_def_property_boolean_sdna(prop, nullptr, "visible_tabs", value);
5838 RNA_def_property_ui_text(prop, item.name, "");
5840 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update");
5841 }
5842}
5843
5845{
5846 StructRNA *srna;
5847 PropertyRNA *prop;
5848
5849 static const EnumPropertyItem tab_sync_items[] = {
5851 "ALWAYS",
5852 0,
5853 "Always",
5854 "Always change tabs when clicking an icon in an outliner"},
5856 "NEVER",
5857 0,
5858 "Never",
5859 "Never change tabs when clicking an icon in an outliner"},
5861 "AUTO",
5862 0,
5863 "Auto",
5864 "Change tabs only when this editor shares a border with an outliner"},
5865 {0, nullptr, 0, nullptr, nullptr},
5866 };
5867
5868 srna = RNA_def_struct(brna, "SpaceProperties", "Space");
5869 RNA_def_struct_sdna(srna, "SpaceProperties");
5870 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
5871
5872 prop = RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
5873 RNA_def_property_enum_sdna(prop, nullptr, "mainb");
5876 prop, nullptr, "rna_SpaceProperties_context_set", "rna_SpaceProperties_context_itemf");
5877 RNA_def_property_ui_text(prop, "", "");
5880 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update");
5881
5883
5884 /* pinned data */
5885 prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
5886 RNA_def_property_pointer_sdna(prop, nullptr, "pinid");
5887 RNA_def_property_struct_type(prop, "ID");
5888 /* NOTE: custom set function is ONLY to avoid rna setting a user for this. */
5890 nullptr,
5891 "rna_SpaceProperties_pin_id_set",
5892 "rna_SpaceProperties_pin_id_typef",
5893 nullptr);
5896 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
5897
5898 prop = RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
5899 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SB_PIN_CONTEXT);
5900 RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
5901
5902 /* Property search. */
5903
5904 prop = RNA_def_property(srna, "tab_search_results", PROP_BOOLEAN, PROP_NONE);
5905 RNA_def_property_array(prop, 0); /* Dynamic length, see next line. */
5908 RNA_def_property_boolean_funcs(prop, "rna_SpaceProperties_tab_search_results_get", nullptr);
5909 RNA_def_property_dynamic_array_funcs(prop, "rna_SpaceProperties_tab_search_results_getlength");
5911 prop, "Tab Search Results", "Whether or not each visible tab has a search result");
5912
5913 prop = RNA_def_property(srna, "search_filter", PROP_STRING, PROP_NONE);
5914 /* The search filter is stored in the property editor's runtime which
5915 * is only defined in an internal header, so use the getter / setter here. */
5917 "rna_SpaceProperties_search_filter_get",
5918 "rna_SpaceProperties_search_filter_length",
5919 "rna_SpaceProperties_search_filter_set");
5920 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
5923 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_search_filter_update");
5924
5925 /* Outliner sync. */
5926 prop = RNA_def_property(srna, "outliner_sync", PROP_ENUM, PROP_NONE);
5927 RNA_def_property_enum_sdna(prop, nullptr, "outliner_sync");
5928 RNA_def_property_enum_items(prop, tab_sync_items);
5930 "Outliner Sync",
5931 "Change to the corresponding tab when outliner data icons are clicked");
5933}
5934
5936{
5937 StructRNA *srna;
5938 PropertyRNA *prop;
5939
5940 srna = RNA_def_struct(brna, "SpaceImageOverlay", nullptr);
5941 RNA_def_struct_sdna(srna, "SpaceImage");
5942 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
5943 RNA_def_struct_path_func(srna, "rna_SpaceImageOverlay_path");
5945 srna, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
5946
5947 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
5948 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_SHOW_OVERLAYS);
5949 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like UV Maps and Metadata");
5951
5952 prop = RNA_def_property(srna, "show_grid_background", PROP_BOOLEAN, PROP_NONE);
5953 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_SHOW_GRID_BACKGROUND);
5954 RNA_def_property_ui_text(prop, "Display Background", "Show the grid background and borders");
5956
5957 prop = RNA_def_property(srna, "show_render_size", PROP_BOOLEAN, PROP_NONE);
5958 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_DRAW_RENDER_REGION);
5959 RNA_def_property_ui_text(prop, "Render Region", "Display the region of the final render");
5961
5962 prop = RNA_def_property(srna, "show_text_info", PROP_BOOLEAN, PROP_NONE);
5963 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_DRAW_TEXT_INFO);
5964 RNA_def_property_ui_text(prop, "Text Info", "Display overlay text");
5966
5967 prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
5968 RNA_def_property_float_sdna(prop, nullptr, "overlay.passepartout_alpha");
5971 prop, "Passepartout Alpha", "Opacity of the darkened overlay outside the render region");
5973}
5974
5976{
5977 StructRNA *srna;
5978 PropertyRNA *prop;
5979
5980 srna = RNA_def_struct(brna, "SpaceImageEditor", "Space");
5981 RNA_def_struct_sdna(srna, "SpaceImage");
5982 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
5983
5985 ((1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_TOOLS) |
5986 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) |
5987 (1 << RGN_TYPE_ASSET_SHELF)));
5988
5989 /* image */
5990 prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
5992 prop, nullptr, "rna_SpaceImageEditor_image_set", nullptr, nullptr);
5993 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
5996 prop,
5997 NC_GEOM | ND_DATA,
5998 "rna_SpaceImageEditor_image_update"); /* is handled in image editor too */
5999
6000 prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
6002 RNA_def_property_pointer_sdna(prop, nullptr, "iuser");
6004 prop,
6005 "Image User",
6006 "Parameters defining which layer, pass and frame of the image is displayed");
6008
6009 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
6010 RNA_def_property_pointer_sdna(prop, nullptr, "scopes");
6011 RNA_def_property_struct_type(prop, "Scopes");
6012 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics");
6014 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
6015
6016 prop = RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
6017 RNA_def_property_boolean_sdna(prop, nullptr, "pin", 0);
6019 prop, "Image Pin", "Display current image regardless of object selection");
6020 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
6022
6023 prop = RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
6024 RNA_def_property_pointer_sdna(prop, nullptr, "sample_line_hist");
6025 RNA_def_property_struct_type(prop, "Histogram");
6026 RNA_def_property_ui_text(prop, "Line Sample", "Sampled colors along line");
6027
6028 prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
6029 RNA_def_property_array(prop, 2);
6031 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", nullptr, nullptr);
6032 RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
6033
6034 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
6036 "rna_SpaceImageEditor_zoom_percentage_get",
6037 "rna_SpaceImageEditor_zoom_percentage_set",
6038 nullptr);
6039 RNA_def_property_float_default(prop, 100.0);
6040 RNA_def_property_range(prop, .4, 80000);
6041 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
6042 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
6043
6044 /* image draw */
6045 prop = RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
6046 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_TILE);
6048 prop, "Display Repeated", "Display the image repeated outside of the main view");
6050
6051 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
6052 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_SHOW_GPENCIL);
6053 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
6055
6056 prop = RNA_def_property(srna, "display_channels", PROP_ENUM, PROP_NONE);
6057 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
6060 "rna_SpaceImageEditor_display_channels_get",
6061 nullptr,
6062 "rna_SpaceImageEditor_display_channels_itemf");
6063 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to display");
6065
6066 prop = RNA_def_property(srna, "show_stereo_3d", PROP_BOOLEAN, PROP_NONE);
6068 prop, "rna_SpaceImageEditor_show_stereo_get", "rna_SpaceImageEditor_show_stereo_set");
6069 RNA_def_property_ui_text(prop, "Show Stereo", "Display the image in Stereo 3D");
6070 RNA_def_property_ui_icon(prop, ICON_CAMERA_STEREO, 0);
6072 prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_show_stereo_update");
6073
6074 /* uv */
6075 prop = RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
6077 RNA_def_property_struct_type(prop, "SpaceUVEditor");
6079 prop, "rna_SpaceImageEditor_uvedit_get", nullptr, nullptr, nullptr);
6080 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
6081
6082 /* mode (hidden in the UI, see 'ui_mode') */
6083 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6084 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6086 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6087 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
6088
6089 prop = RNA_def_property(srna, "ui_mode", PROP_ENUM, PROP_NONE);
6090 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6092 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6093 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
6094
6095 /* transform */
6096 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
6097 RNA_def_property_array(prop, 2);
6099 "rna_SpaceImageEditor_cursor_location_get",
6100 "rna_SpaceImageEditor_cursor_location_set",
6101 nullptr);
6102 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
6104
6105 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
6106 RNA_def_property_enum_sdna(prop, nullptr, "around");
6108 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceImageEditor_pivot_itemf");
6109 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
6111
6112 /* grease pencil */
6113 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
6114 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
6115 RNA_def_property_struct_type(prop, "GreasePencil");
6117 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
6119 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil data for this space");
6121
6122 /* update */
6123 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
6124 RNA_def_property_boolean_sdna(prop, nullptr, "lock", 0);
6126 "Update Automatically",
6127 "Update other affected window spaces automatically to reflect changes "
6128 "during interactive operations such as transform");
6129
6130 /* state */
6131 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
6132 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", nullptr);
6134 RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
6135
6136 prop = RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
6137 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", nullptr);
6139 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
6140
6141 prop = RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
6142 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", nullptr);
6144 RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
6145
6146 prop = RNA_def_property(srna, "show_maskedit", PROP_BOOLEAN, PROP_NONE);
6147 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_maskedit_get", nullptr);
6149 RNA_def_property_ui_text(prop, "Show Mask Editor", "Show Mask editing related properties");
6150
6151 /* Gizmo Toggles. */
6152 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
6153 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SI_GIZMO_HIDE);
6154 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
6156
6157 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
6159 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
6161
6162 /* Overlays */
6163 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
6165 RNA_def_property_struct_type(prop, "SpaceImageOverlay");
6166 RNA_def_property_pointer_funcs(prop, "rna_SpaceImage_overlay_get", nullptr, nullptr, nullptr);
6168 prop, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
6169
6172
6173 /* mask */
6174 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mask_set");
6175}
6176
6178{
6179 StructRNA *srna;
6180 PropertyRNA *prop;
6181
6182 srna = RNA_def_struct(brna, "SequencerPreviewOverlay", nullptr);
6183 RNA_def_struct_sdna(srna, "SpaceSeq");
6184 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6185 RNA_def_struct_path_func(srna, "rna_SpaceSequencerPreviewOverlay_path");
6186 RNA_def_struct_ui_text(srna, "Preview Overlay Settings", "");
6187
6188 prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE);
6190 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_SAFE_MARGINS);
6192 prop, "Safe Areas", "Show TV title safe and action safe areas in preview");
6194
6195 prop = RNA_def_property(srna, "show_safe_center", PROP_BOOLEAN, PROP_NONE);
6197 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_SAFE_CENTER);
6199 prop, "Center-Cut Safe Areas", "Show safe areas to fit content in a different aspect ratio");
6201
6202 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
6203 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_METADATA);
6204 RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of first visible strip");
6206
6207 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
6208 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_GPENCIL);
6209 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
6211
6212 prop = RNA_def_property(srna, "show_image_outline", PROP_BOOLEAN, PROP_NONE);
6214 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_OUTLINE_SELECTED);
6215 RNA_def_property_ui_text(prop, "Image Outline", "");
6217
6218 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
6219 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_2D_CURSOR);
6220 RNA_def_property_ui_text(prop, "2D Cursor", "");
6222}
6223
6225{
6226 StructRNA *srna;
6227 PropertyRNA *prop;
6228
6229 srna = RNA_def_struct(brna, "SequencerTimelineOverlay", nullptr);
6230 RNA_def_struct_sdna(srna, "SpaceSeq");
6231 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6232 RNA_def_struct_path_func(srna, "rna_SpaceSequencerTimelineOverlay_path");
6233 RNA_def_struct_ui_text(srna, "Timeline Overlay Settings", "");
6234
6235 static const EnumPropertyItem waveform_type_display_items[] = {
6237 "ALL_WAVEFORMS",
6238 0,
6239 "On",
6240 "Display waveforms for all sound strips"},
6241 {0, "DEFAULT_WAVEFORMS", 0, "Strip", "Display waveforms depending on strip setting"},
6243 "NO_WAVEFORMS",
6244 0,
6245 "Off",
6246 "Don't display waveforms for any sound strips"},
6247 {0, nullptr, 0, nullptr, nullptr},
6248 };
6249
6250 prop = RNA_def_property(srna, "waveform_display_type", PROP_ENUM, PROP_NONE);
6251 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "timeline_overlay.flag");
6252 RNA_def_property_enum_items(prop, waveform_type_display_items);
6253 RNA_def_property_ui_text(prop, "Waveform Display", "How Waveforms are displayed");
6255
6256 static const EnumPropertyItem waveform_style_display_items[] = {
6257 {0, "FULL_WAVEFORMS", 0, "Full", "Display full waveform"},
6259 "HALF_WAVEFORMS",
6260 0,
6261 "Half",
6262 "Display upper half of the absolute value waveform"},
6263 {0, nullptr, 0, nullptr, nullptr},
6264 };
6265
6266 prop = RNA_def_property(srna, "waveform_display_style", PROP_ENUM, PROP_NONE);
6267 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "timeline_overlay.flag");
6268 RNA_def_property_enum_items(prop, waveform_style_display_items);
6269 RNA_def_property_ui_text(prop, "Waveform Style", "How Waveforms are displayed");
6271
6272 prop = RNA_def_property(srna, "show_fcurves", PROP_BOOLEAN, PROP_NONE);
6273 RNA_def_property_boolean_sdna(prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_FCURVES);
6274 RNA_def_property_ui_text(prop, "Show F-Curves", "Display strip opacity/volume curve");
6276
6277 prop = RNA_def_property(srna, "show_strip_name", PROP_BOOLEAN, PROP_NONE);
6279 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_NAME);
6280 RNA_def_property_ui_text(prop, "Show Name", "");
6282
6283 prop = RNA_def_property(srna, "show_strip_source", PROP_BOOLEAN, PROP_NONE);
6285 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_SOURCE);
6287 prop, "Show Source", "Display path to source file, or name of source datablock");
6289
6290 prop = RNA_def_property(srna, "show_strip_duration", PROP_BOOLEAN, PROP_NONE);
6292 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_DURATION);
6293 RNA_def_property_ui_text(prop, "Show Duration", "");
6295
6296 prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
6297 RNA_def_property_boolean_sdna(prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_GRID);
6298 RNA_def_property_ui_text(prop, "Show Grid", "Show vertical grid lines");
6300
6301 prop = RNA_def_property(srna, "show_strip_offset", PROP_BOOLEAN, PROP_NONE);
6303 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_OFFSETS);
6304 RNA_def_property_ui_text(prop, "Show Offsets", "Display strip in/out offsets");
6306
6307 prop = RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
6309 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_THUMBNAILS);
6310 RNA_def_property_ui_text(prop, "Show Thumbnails", "Show strip thumbnails");
6312
6313 prop = RNA_def_property(srna, "show_strip_tag_color", PROP_BOOLEAN, PROP_NONE);
6315 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG);
6317 prop, "Show Color Tags", "Display the strip color tags in the sequencer");
6319
6320 prop = RNA_def_property(srna, "show_strip_retiming", PROP_BOOLEAN, PROP_NONE);
6322 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_RETIMING);
6323 RNA_def_property_ui_text(prop, "Show Retiming Keys", "Display retiming keys on top of strips");
6325}
6326
6328{
6329 StructRNA *srna;
6330 PropertyRNA *prop;
6331
6332 srna = RNA_def_struct(brna, "SequencerCacheOverlay", nullptr);
6333 RNA_def_struct_sdna(srna, "SpaceSeq");
6334 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6335 RNA_def_struct_path_func(srna, "rna_SpaceSequencerCacheOverlay_path");
6336 RNA_def_struct_ui_text(srna, "Cache Overlay Settings", "");
6337
6338 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
6339 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW);
6340 RNA_def_property_ui_text(prop, "Show Cache", "Visualize cached images on the timeline");
6342
6343 prop = RNA_def_property(srna, "show_cache_final_out", PROP_BOOLEAN, PROP_NONE);
6344 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_FINAL_OUT);
6345 RNA_def_property_ui_text(prop, "Final Images", "Visualize cached complete frames");
6347
6348 prop = RNA_def_property(srna, "show_cache_raw", PROP_BOOLEAN, PROP_NONE);
6349 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_RAW);
6350 RNA_def_property_ui_text(prop, "Raw Images", "Visualize cached raw images");
6352}
6353
6355{
6356 StructRNA *srna;
6357 PropertyRNA *prop;
6358
6359 static const EnumPropertyItem display_mode_items[] = {
6360 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
6361 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
6362 {SEQ_DRAW_IMG_RGBPARADE, "RGB_PARADE", ICON_RENDERLAYERS, "RGB Parade", ""},
6363 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
6364 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
6365 {0, nullptr, 0, nullptr, nullptr},
6366 };
6367
6368 static const EnumPropertyItem proxy_render_size_items[] = {
6369 {SEQ_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
6370 {SEQ_RENDER_SIZE_SCENE, "SCENE", 0, "Scene size", ""},
6371 {SEQ_RENDER_SIZE_PROXY_25, "PROXY_25", 0, "25%", ""},
6372 {SEQ_RENDER_SIZE_PROXY_50, "PROXY_50", 0, "50%", ""},
6373 {SEQ_RENDER_SIZE_PROXY_75, "PROXY_75", 0, "75%", ""},
6374 {SEQ_RENDER_SIZE_PROXY_100, "PROXY_100", 0, "100%", ""},
6375 {0, nullptr, 0, nullptr, nullptr},
6376 };
6377
6378 static const EnumPropertyItem overlay_frame_type_items[] = {
6379 {SEQ_OVERLAY_FRAME_TYPE_RECT, "RECTANGLE", 0, "Rectangle", "Show rectangle area overlay"},
6380 {SEQ_OVERLAY_FRAME_TYPE_REFERENCE, "REFERENCE", 0, "Reference", "Show reference frame only"},
6381 {SEQ_OVERLAY_FRAME_TYPE_CURRENT, "CURRENT", 0, "Current", "Show current frame only"},
6382 {0, nullptr, 0, nullptr, nullptr},
6383 };
6384
6385 static const EnumPropertyItem preview_channels_items[] = {
6387 "COLOR_ALPHA",
6388 ICON_IMAGE_RGB_ALPHA,
6389 "Color & Alpha",
6390 "Display image with RGB colors and alpha transparency"},
6391 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
6392 {0, nullptr, 0, nullptr, nullptr},
6393 };
6394
6395 srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
6396 RNA_def_struct_sdna(srna, "SpaceSeq");
6397 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
6398
6400 (1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_UI) |
6401 (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_HUD) |
6402 (1 << RGN_TYPE_CHANNELS));
6403
6404 /* view type, fairly important */
6405 prop = RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
6406 RNA_def_property_enum_sdna(prop, nullptr, "view");
6409 prop, "View Type", "Type of the Sequencer view (sequencer, preview or both)");
6410 RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
6411
6412 /* display type, fairly important */
6413 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
6414 RNA_def_property_enum_sdna(prop, nullptr, "mainb");
6415 RNA_def_property_enum_items(prop, display_mode_items);
6417 prop, "Display Mode", "View mode to use for displaying sequencer output");
6419
6420 /* flags */
6421 prop = RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
6422 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_DRAWFRAMES);
6423 RNA_def_property_ui_text(prop, "Display Frames", "Display frames rather than seconds");
6425
6426 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
6427 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_MARKER_TRANS);
6428 RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips");
6430
6431 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
6433 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
6435
6436 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
6437 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_SHOW_MARKERS);
6439 prop,
6440 "Show Markers",
6441 "If any exists, show markers in a separate row at the bottom of the editor");
6443
6444 prop = RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
6445 RNA_def_property_int_sdna(prop, nullptr, "chanshown");
6447 prop,
6448 "Display Channel",
6449 "Preview all channels less than or equal to this value. 0 shows every channel, and negative "
6450 "values climb that many metastrip levels if applicable, showing every channel there.");
6452 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
6453
6454 prop = RNA_def_property(srna, "preview_channels", PROP_ENUM, PROP_NONE);
6455 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
6456 RNA_def_property_enum_items(prop, preview_channels_items);
6457 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the preview to display");
6458 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
6459
6460 prop = RNA_def_property(srna, "use_zoom_to_fit", PROP_BOOLEAN, PROP_NONE);
6461 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_ZOOM_TO_FIT);
6463 prop, "Zoom to Fit", "Automatically zoom preview image to make it fully fit the region");
6465
6466 prop = RNA_def_property(srna, "show_overexposed", PROP_INT, PROP_NONE);
6467 RNA_def_property_int_sdna(prop, nullptr, "zebra");
6468 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
6469 RNA_def_property_range(prop, 0, 110);
6471
6472 prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
6473 RNA_def_property_enum_sdna(prop, nullptr, "render_size");
6474 RNA_def_property_enum_items(prop, proxy_render_size_items);
6476 "Proxy Render Size",
6477 "Display preview using full resolution or different proxy resolutions");
6480 prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_render_size_update");
6481
6482 prop = RNA_def_property(srna, "use_proxies", PROP_BOOLEAN, PROP_NONE);
6483 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_USE_PROXIES);
6485 prop, "Use Proxies", "Use optimized files for faster scrubbing when available");
6486 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
6487
6488 prop = RNA_def_property(srna, "use_clamp_view", PROP_BOOLEAN, PROP_NONE);
6489 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_CLAMP_VIEW);
6491 prop, "rna_SequenceEditor_clamp_view_get", "rna_SequenceEditor_clamp_view_set");
6493 prop, "Limit View to Contents", "Limit timeline height to maximum used channel slot");
6495
6496 /* grease pencil */
6497 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
6498 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
6499 RNA_def_property_struct_type(prop, "GreasePencil");
6501 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
6503 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil data for this Preview region");
6505
6506 prop = RNA_def_property(srna, "overlay_frame_type", PROP_ENUM, PROP_NONE);
6507 RNA_def_property_enum_sdna(prop, nullptr, "overlay_frame_type");
6508 RNA_def_property_enum_items(prop, overlay_frame_type_items);
6509 RNA_def_property_ui_text(prop, "Overlay Type", "Overlay display method");
6511
6512 prop = RNA_def_property(srna, "show_transform_preview", PROP_BOOLEAN, PROP_NONE);
6513 RNA_def_property_boolean_sdna(prop, nullptr, "draw_flag", SEQ_DRAW_TRANSFORM_PREVIEW);
6515 "Transform Preview",
6516 "Show a preview of the start or end frame of a strip while "
6517 "transforming its respective handle");
6519
6520 /* Gizmo toggles. */
6521 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
6522 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SEQ_GIZMO_HIDE);
6523 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
6525
6526 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
6528 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
6530
6531 prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE);
6533 RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item");
6535
6536 prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE);
6537 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SEQ_GIZMO_HIDE_TOOL);
6538 RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo");
6540
6541 /* Overlay settings. */
6542 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
6543 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_SHOW_OVERLAY);
6544 RNA_def_property_ui_text(prop, "Show Overlays", "");
6546
6547 prop = RNA_def_property(srna, "preview_overlay", PROP_POINTER, PROP_NONE);
6549 RNA_def_property_struct_type(prop, "SequencerPreviewOverlay");
6551 prop, "rna_SpaceSequenceEditor_preview_overlay_get", nullptr, nullptr, nullptr);
6552 RNA_def_property_ui_text(prop, "Preview Overlay Settings", "Settings for display of overlays");
6553
6554 prop = RNA_def_property(srna, "timeline_overlay", PROP_POINTER, PROP_NONE);
6556 RNA_def_property_struct_type(prop, "SequencerTimelineOverlay");
6558 prop, "rna_SpaceSequenceEditor_timeline_overlay_get", nullptr, nullptr, nullptr);
6559 RNA_def_property_ui_text(prop, "Timeline Overlay Settings", "Settings for display of overlays");
6560
6561 prop = RNA_def_property(srna, "cache_overlay", PROP_POINTER, PROP_NONE);
6563 RNA_def_property_struct_type(prop, "SequencerCacheOverlay");
6565 prop, "rna_SpaceSequenceEditor_cache_overlay_get", nullptr, nullptr, nullptr);
6566 RNA_def_property_ui_text(prop, "Cache Overlay Settings", "Settings for display of overlays");
6570
6571 /* transform */
6572 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
6573 RNA_def_property_float_sdna(prop, nullptr, "cursor");
6574 RNA_def_property_array(prop, 2);
6575 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
6577
6578 /* Zoom. */
6579 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
6581 "rna_SpaceSequenceEditor_zoom_percentage_get",
6582 "rna_SpaceSequenceEditor_zoom_percentage_set",
6583 nullptr);
6584 RNA_def_property_float_default(prop, 100.0);
6585 RNA_def_property_range(prop, .4, 80000);
6586 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
6587 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
6588}
6589
6591{
6592 StructRNA *srna;
6593 PropertyRNA *prop;
6594 FunctionRNA *func;
6595
6596 srna = RNA_def_struct(brna, "SpaceTextEditor", "Space");
6597 RNA_def_struct_sdna(srna, "SpaceText");
6598 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
6599
6601
6602 /* text */
6603 prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
6605 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
6606 RNA_def_property_pointer_funcs(prop, nullptr, "rna_SpaceTextEditor_text_set", nullptr, nullptr);
6608
6609 /* display */
6610 prop = RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
6611 RNA_def_property_boolean_sdna(prop, nullptr, "wordwrap", 0);
6612 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SpaceTextEditor_word_wrap_set");
6614 prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
6615 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_ON, 0);
6617
6618 prop = RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
6619 RNA_def_property_boolean_sdna(prop, nullptr, "showlinenrs", 0);
6620 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
6621 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_ON, 0);
6623
6624 func = RNA_def_function(srna,
6625 "is_syntax_highlight_supported",
6626 "rna_SpaceTextEditor_text_is_syntax_highlight_supported");
6628 RNA_def_boolean(func, "is_syntax_highlight_supported", false, "", ""));
6630 "Returns True if the editor supports syntax highlighting "
6631 "for the current text datablock");
6632
6633 prop = RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
6634 RNA_def_property_boolean_sdna(prop, nullptr, "showsyntax", 0);
6635 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
6636 RNA_def_property_ui_icon(prop, ICON_SYNTAX_ON, 0);
6638
6639 prop = RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
6640 RNA_def_property_boolean_sdna(prop, nullptr, "line_hlight", 0);
6641 RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
6643
6644 prop = RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
6645 RNA_def_property_int_sdna(prop, nullptr, "tabnumber");
6646 RNA_def_property_range(prop, 2, 8);
6647 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
6648 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
6649
6650 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
6651 RNA_def_property_int_sdna(prop, nullptr, "lheight");
6652 RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */
6653 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
6655
6656 prop = RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
6657 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_SHOW_MARGIN);
6658 RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
6660
6661 prop = RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
6662 RNA_def_property_int_sdna(prop, nullptr, "margin_column");
6663 RNA_def_property_range(prop, 0, 1024);
6664 RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
6666
6667 prop = RNA_def_property(srna, "top", PROP_INT, PROP_NONE);
6668 RNA_def_property_int_sdna(prop, nullptr, "top");
6669 RNA_def_property_range(prop, 0, INT_MAX);
6670 RNA_def_property_ui_text(prop, "Top Line", "Top line visible");
6672
6673 prop = RNA_def_property(srna, "visible_lines", PROP_INT, PROP_NONE);
6675 RNA_def_property_int_funcs(prop, "rna_SpaceTextEditor_visible_lines_get", nullptr, nullptr);
6677 prop, "Visible Lines", "Amount of lines that can be visible in current editor");
6678
6679 /* functionality options */
6680 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
6681 RNA_def_property_boolean_sdna(prop, nullptr, "overwrite", 1);
6683 prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
6685
6686 prop = RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
6687 RNA_def_property_boolean_sdna(prop, nullptr, "live_edit", 1);
6688 RNA_def_property_ui_text(prop, "Live Edit", "Run Python while editing");
6690
6691 /* find */
6692 prop = RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
6693 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_FIND_ALL);
6695 prop, "Find All", "Search in all text data-blocks, instead of only the active one");
6697
6698 prop = RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
6699 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_FIND_WRAP);
6701 prop, "Find Wrap", "Search again from the start of the file when reaching the end");
6703
6704 prop = RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
6705 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_MATCH_CASE);
6707 prop, "Match Case", "Search string is sensitive to uppercase and lowercase letters");
6709
6710 prop = RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
6711 RNA_def_property_string_sdna(prop, nullptr, "findstr");
6712 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
6714
6715 prop = RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
6716 RNA_def_property_string_sdna(prop, nullptr, "replacestr");
6718 prop, "Replace Text", "Text to replace selected text with using the replace tool");
6720
6721 RNA_api_space_text(srna);
6722}
6723
6725{
6726 StructRNA *srna;
6727 PropertyRNA *prop;
6728
6729 srna = RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
6730 RNA_def_struct_sdna(srna, "SpaceAction");
6731 RNA_def_struct_ui_text(srna, "Space Dope Sheet Editor", "Dope Sheet space data");
6732
6734 srna, (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
6735
6736 /* data */
6737 prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
6740 nullptr,
6741 "rna_SpaceDopeSheetEditor_action_set",
6742 nullptr,
6743 "rna_Action_actedit_assign_poll");
6744 RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
6747 prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
6748
6749 /* mode (hidden in the UI, see 'ui_mode') */
6750 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6751 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6753 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6756 prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
6757
6758 prop = RNA_def_property(srna, "ui_mode", PROP_ENUM, PROP_NONE);
6759 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6761 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6764 prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
6765
6766 /* display */
6767 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
6768 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SACTION_DRAWTIME);
6769 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
6771
6772 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
6773 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SACTION_SLIDERS);
6774 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
6776
6777 prop = RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
6780 "Show Pose Markers",
6781 "Show markers belonging to the active action instead of Scene markers "
6782 "(Action and Shape Key Editors only)");
6784
6785 prop = RNA_def_property(srna, "show_interpolation", PROP_BOOLEAN, PROP_NONE);
6788 "Show Handles and Interpolation",
6789 "Display keyframe handle types and non-Bézier interpolation modes");
6791
6792 prop = RNA_def_property(srna, "show_extremes", PROP_BOOLEAN, PROP_NONE);
6795 "Show Curve Extremes",
6796 "Mark keyframes where the key value flow changes direction, based on "
6797 "comparison with adjacent keys");
6799
6800 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
6803 prop,
6804 "Show Markers",
6805 "If any exists, show markers in a separate row at the bottom of the editor");
6807
6808 /* editing */
6809 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
6811 RNA_def_property_ui_text(prop, "Auto-Merge Keyframes", "Automatically merge nearby keyframes");
6813
6814 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
6817 prop,
6818 "Realtime Updates",
6819 "When transforming keyframes, changes to the animation data are flushed to other views");
6821
6822 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
6824 RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
6825
6826 /* dopesheet */
6827 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
6828 RNA_def_property_struct_type(prop, "DopeSheet");
6829 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
6830 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
6831
6832 /* displaying cache status */
6833 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
6834 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_DISPLAY);
6835 RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");
6837
6838 prop = RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
6839 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SOFTBODY);
6840 RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
6842
6843 prop = RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
6844 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_PARTICLES);
6845 RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");
6847
6848 prop = RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
6849 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_CLOTH);
6850 RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");
6852
6853 prop = RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
6854 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SMOKE);
6855 RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");
6857
6858 prop = RNA_def_property(srna, "cache_simulation_nodes", PROP_BOOLEAN, PROP_NONE);
6859 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SIMULATION_NODES);
6861 prop, "Simulation Nodes", "Show the active object's simulation nodes cache and bake data");
6863
6864 prop = RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE);
6865 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_DYNAMICPAINT);
6866 RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");
6868
6869 prop = RNA_def_property(srna, "cache_rigidbody", PROP_BOOLEAN, PROP_NONE);
6870 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_RIGIDBODY);
6871 RNA_def_property_ui_text(prop, "Rigid Body", "Show the active object's Rigid Body cache");
6873}
6874
6876{
6877 StructRNA *srna;
6878 PropertyRNA *prop;
6879
6880 /* this is basically the same as the one for the 3D-View, but with some entries omitted */
6881 static const EnumPropertyItem gpivot_items[] = {
6883 "BOUNDING_BOX_CENTER",
6884 ICON_PIVOT_BOUNDBOX,
6885 "Bounding Box Center",
6886 ""},
6887 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
6889 "INDIVIDUAL_ORIGINS",
6890 ICON_PIVOT_INDIVIDUAL,
6891 "Individual Centers",
6892 ""},
6893 /*{V3D_AROUND_CENTER_MEDIAN, "MEDIAN_POINT", 0, "Median Point", ""}, */
6894 /*{V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""}, */
6895 {0, nullptr, 0, nullptr, nullptr},
6896 };
6897
6898 srna = RNA_def_struct(brna, "SpaceGraphEditor", "Space");
6899 RNA_def_struct_sdna(srna, "SpaceGraph");
6900 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
6901
6903 srna, (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
6904
6905 /* mode */
6906 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6907 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6909 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6912 prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
6913
6914 /* display */
6915 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
6916 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_DRAWTIME);
6917 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
6919
6920 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
6921 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_SLIDERS);
6922 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
6924
6925 prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
6927 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bézier control points");
6929
6930 prop = RNA_def_property(srna, "use_auto_lock_translation_axis", PROP_BOOLEAN, PROP_NONE);
6931 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_AUTOLOCK_AXIS);
6933 "Auto-Lock Key Axis",
6934 "Automatically locks the movement of keyframes to the dominant axis");
6936
6937 prop = RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
6940 prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
6942
6943 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
6944 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_SHOW_MARKERS);
6946 prop,
6947 "Show Markers",
6948 "If any exists, show markers in a separate row at the bottom of the editor");
6950
6951 prop = RNA_def_property(srna, "show_extrapolation", PROP_BOOLEAN, PROP_NONE);
6953 RNA_def_property_ui_text(prop, "Show Extrapolation", "");
6955
6956 /* editing */
6957 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
6959 RNA_def_property_ui_text(prop, "Auto-Merge Keyframes", "Automatically merge nearby keyframes");
6961
6962 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
6965 prop,
6966 "Realtime Updates",
6967 "When transforming keyframes, changes to the animation data are flushed to other views");
6969
6970 /* cursor */
6971 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
6973 RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
6975
6976 prop = RNA_def_property(srna, "cursor_position_x", PROP_FLOAT, PROP_NONE);
6977 RNA_def_property_float_sdna(prop, nullptr, "cursorTime");
6979 prop, "Cursor X-Value", "Graph Editor 2D-Value cursor - X-Value component");
6981
6982 prop = RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
6983 RNA_def_property_float_sdna(prop, nullptr, "cursorVal");
6985 prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
6987
6988 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
6989 RNA_def_property_enum_sdna(prop, nullptr, "around");
6990 RNA_def_property_enum_items(prop, gpivot_items);
6991 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
6993
6994 /* Dope-sheet. */
6995 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
6996 RNA_def_property_struct_type(prop, "DopeSheet");
6997 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
6998 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
6999
7000 /* Read-only state info. */
7001 prop = RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
7002 RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", nullptr);
7005 prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
7006
7007 /* Normalize curves. */
7008 prop = RNA_def_property(srna, "use_normalization", PROP_BOOLEAN, PROP_NONE);
7009 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_NORMALIZE);
7011 "Use Normalization",
7012 "Display curves in normalized range from -1 to 1, "
7013 "for easier editing of multiple curves with different ranges");
7016 prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_normalize_update");
7017
7018 prop = RNA_def_property(srna, "use_auto_normalization", PROP_BOOLEAN, PROP_NONE);
7021 "Auto Normalization",
7022 "Automatically recalculate curve normalization on every curve edit");
7024}
7025
7027{
7028 StructRNA *srna;
7029 PropertyRNA *prop;
7030
7031 srna = RNA_def_struct(brna, "SpaceNLA", "Space");
7032 RNA_def_struct_sdna(srna, "SpaceNla");
7033 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
7034
7036 srna, (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
7037
7038 /* display */
7039 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
7040 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNLA_DRAWTIME);
7041 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
7043
7044 prop = RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
7046 RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips");
7048
7049 prop = RNA_def_property(srna, "show_local_markers", PROP_BOOLEAN, PROP_NONE);
7052 prop,
7053 "Show Local Markers",
7054 "Show action-local markers on the strips, useful when synchronizing timing across strips");
7056
7057 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
7058 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNLA_SHOW_MARKERS);
7060 prop,
7061 "Show Markers",
7062 "If any exists, show markers in a separate row at the bottom of the editor");
7064
7065 /* editing */
7066 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
7069 prop,
7070 "Realtime Updates",
7071 "When transforming strips, changes to the animation data are flushed to other views");
7073
7074 /* dopesheet */
7075 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
7076 RNA_def_property_struct_type(prop, "DopeSheet");
7077 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
7078 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
7079}
7080
7082{
7083 static const EnumPropertyItem console_line_type_items[] = {
7084 {CONSOLE_LINE_OUTPUT, "OUTPUT", 0, "Output", ""},
7085 {CONSOLE_LINE_INPUT, "INPUT", 0, "Input", ""},
7086 {CONSOLE_LINE_INFO, "INFO", 0, "Info", ""},
7087 {CONSOLE_LINE_ERROR, "ERROR", 0, "Error", ""},
7088 {0, nullptr, 0, nullptr, nullptr},
7089 };
7090
7091 StructRNA *srna;
7092 PropertyRNA *prop;
7093
7094 srna = RNA_def_struct(brna, "ConsoleLine", nullptr);
7095 RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
7096
7097 prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
7099 prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
7100 RNA_def_property_ui_text(prop, "Line", "Text in the line");
7103
7104 prop = RNA_def_property(
7105 srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
7107 "rna_ConsoleLine_current_character_get",
7108 "rna_ConsoleLine_current_character_set",
7109 nullptr);
7111
7112 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
7113 RNA_def_property_enum_sdna(prop, nullptr, "type");
7114 RNA_def_property_enum_items(prop, console_line_type_items);
7115 RNA_def_property_ui_text(prop, "Type", "Console line type when used in scrollback");
7116}
7117
7119{
7120 StructRNA *srna;
7121 PropertyRNA *prop;
7122
7123 srna = RNA_def_struct(brna, "SpaceConsole", "Space");
7124 RNA_def_struct_sdna(srna, "SpaceConsole");
7125 RNA_def_struct_ui_text(srna, "Space Console", "Interactive Python console");
7126
7127 /* display */
7128 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
7129 RNA_def_property_int_sdna(prop, nullptr, "lheight");
7130 RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */
7131 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
7132 RNA_def_property_update(prop, 0, "rna_SpaceConsole_rect_update");
7133
7134 prop = RNA_def_property(
7135 srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
7136 RNA_def_property_int_sdna(prop, nullptr, "sel_start");
7138
7139 prop = RNA_def_property(
7140 srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
7141 RNA_def_property_int_sdna(prop, nullptr, "sel_end");
7143
7144 prop = RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
7145 RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
7146
7147 prop = RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
7148 RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
7150
7151 prop = RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
7152 RNA_def_property_collection_sdna(prop, nullptr, "history", nullptr);
7153 RNA_def_property_struct_type(prop, "ConsoleLine");
7154 RNA_def_property_ui_text(prop, "History", "Command history");
7155
7156 prop = RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
7157 RNA_def_property_collection_sdna(prop, nullptr, "scrollback", nullptr);
7158 RNA_def_property_struct_type(prop, "ConsoleLine");
7159 RNA_def_property_ui_text(prop, "Output", "Command output");
7160}
7161
7162/* Filter for datablock types in link/append. */
7164{
7165
7166 StructRNA *srna = RNA_def_struct(brna, "FileSelectIDFilter", nullptr);
7167 RNA_def_struct_sdna(srna, "FileSelectParams");
7168 RNA_def_struct_nested(brna, srna, "FileSelectParams");
7170 srna, "File Select ID Filter", "Which ID types to show/hide, when browsing a library");
7171
7172 const IDFilterEnumPropertyItem *individual_ids_and_categories[] = {
7175 nullptr,
7176 };
7177 for (uint i = 0; individual_ids_and_categories[i]; i++) {
7178 for (int j = 0; individual_ids_and_categories[i][j].identifier; j++) {
7180 srna, individual_ids_and_categories[i][j].identifier, PROP_BOOLEAN, PROP_NONE);
7182 prop, nullptr, "filter_id", individual_ids_and_categories[i][j].flag);
7184 individual_ids_and_categories[i][j].name,
7185 individual_ids_and_categories[i][j].description);
7186 RNA_def_property_ui_icon(prop, individual_ids_and_categories[i][j].icon, 0);
7188 }
7189 }
7190}
7191
7192/* Filter for datablock types in the Asset Browser. */
7194{
7195 StructRNA *srna = RNA_def_struct(brna, "FileAssetSelectIDFilter", nullptr);
7196 RNA_def_struct_sdna(srna, "FileSelectParams");
7197 RNA_def_struct_nested(brna, srna, "FileSelectParams");
7199 "File Select Asset Filter",
7200 "Which asset types to show/hide, when browsing an asset library");
7201
7202 static char experimental_prop_names[INDEX_ID_MAX][MAX_NAME];
7203
7204 for (uint i = 0; rna_enum_id_type_filter_items[i].identifier; i++) {
7206 const bool is_experimental = (ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS & item->flag) == 0;
7207
7208 const char *identifier = rna_enum_id_type_filter_items[i].identifier;
7209 if (is_experimental) {
7210 /* Create name for experimental property and store in static buffer. */
7211 SNPRINTF(experimental_prop_names[i], "experimental_%s", identifier);
7212 identifier = experimental_prop_names[i];
7213 }
7214
7215 PropertyRNA *prop = RNA_def_property(srna, identifier, PROP_BOOLEAN, PROP_NONE);
7216 RNA_def_property_boolean_sdna(prop, nullptr, "filter_id", item->flag);
7217 RNA_def_property_ui_text(prop, item->name, item->description);
7218 RNA_def_property_ui_icon(prop, item->icon, 0);
7220 }
7221}
7222
7224{
7225 PropertyRNA *prop;
7226 StructRNA *srna = RNA_def_struct(brna, "FileSelectEntry", nullptr);
7227 RNA_def_struct_sdna(srna, "FileDirEntry");
7228 RNA_def_struct_ui_text(srna, "File Select Entry", "A file viewable in the File Browser");
7229
7230 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
7231 RNA_def_property_editable_func(prop, "rna_FileBrowser_FileSelectEntry_name_editable");
7234 "rna_FileBrowser_FileSelectEntry_name_get",
7235 "rna_FileBrowser_FileSelectEntry_name_length",
7236 nullptr);
7237 RNA_def_property_ui_text(prop, "Name", "");
7238 RNA_def_struct_name_property(srna, prop);
7239
7240 prop = RNA_def_property(srna, "relative_path", PROP_STRING, PROP_FILEPATH);
7242 "rna_FileBrowser_FileSelectEntry_relative_path_get",
7243 "rna_FileBrowser_FileSelectEntry_relative_path_length",
7244 nullptr);
7246 "Relative Path",
7247 "Path relative to the directory currently displayed in the File "
7248 "Browser (includes the file name)");
7250
7251 prop = RNA_def_int(
7252 srna,
7253 "preview_icon_id",
7254 0,
7255 INT_MIN,
7256 INT_MAX,
7257 "Icon ID",
7258 "Unique integer identifying the preview of this file as an icon (zero means invalid)",
7259 INT_MIN,
7260 INT_MAX);
7263 prop, "rna_FileBrowser_FileSelectEntry_preview_icon_id_get", nullptr, nullptr);
7264
7265 prop = RNA_def_property(srna, "asset_data", PROP_POINTER, PROP_NONE);
7266 RNA_def_property_struct_type(prop, "AssetMetaData");
7268 prop, "rna_FileBrowser_FileSelectEntry_asset_data_get", nullptr, nullptr, nullptr);
7270 prop, "Asset Data", "Asset data, valid if the file represents an asset");
7271}
7272
7274{
7275 StructRNA *srna;
7276 PropertyRNA *prop;
7277
7278 static const EnumPropertyItem display_size_items[] = {
7279 {32, "TINY", 0, "Tiny", ""},
7280 {64, "SMALL", 0, "Small", ""},
7281 {96, "NORMAL", 0, "Medium", ""},
7282 {128, "BIG", 0, "Big", ""},
7283 {192, "LARGE", 0, "Large", ""},
7284 {0, nullptr, 0, nullptr, nullptr},
7285 };
7286
7287 srna = RNA_def_struct(brna, "FileSelectParams", nullptr);
7288 RNA_def_struct_path_func(srna, "rna_FileSelectParams_path");
7289 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
7290
7291 prop = RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
7292 RNA_def_property_string_sdna(prop, nullptr, "title");
7293 RNA_def_property_ui_text(prop, "Title", "Title for the file browser");
7295
7296 /* Use BYTESTRING rather than DIRPATH as sub-type so UI code doesn't add OT_directory_browse
7297 * button when displaying this prop in the file browser (it would just open a file browser). That
7298 * should be the only effective difference between the two. */
7299 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_BYTESTRING);
7300 RNA_def_property_string_sdna(prop, nullptr, "dir");
7301 RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
7303
7304 prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
7305 RNA_def_property_string_sdna(prop, nullptr, "file");
7306 RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
7307 RNA_def_property_editable_func(prop, "rna_FileSelectParams_filename_editable");
7309
7310 prop = RNA_def_property(srna, "use_library_browsing", PROP_BOOLEAN, PROP_NONE);
7312 prop, "Library Browser", "Whether we may browse Blender files' content or not");
7314 RNA_def_property_boolean_funcs(prop, "rna_FileSelectParams_use_lib_get", nullptr);
7315
7316 prop = RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
7317 RNA_def_property_enum_sdna(prop, nullptr, "display");
7319 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_FileSelectParams_display_type_itemf");
7320 RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
7322
7323 prop = RNA_def_property(srna, "recursion_level", PROP_ENUM, PROP_NONE);
7326 prop, nullptr, nullptr, "rna_FileSelectParams_recursion_level_itemf");
7327 RNA_def_property_ui_text(prop, "Recursion", "Numbers of dirtree levels to show simultaneously");
7329
7330 prop = RNA_def_property(srna, "show_details_size", PROP_BOOLEAN, PROP_NONE);
7331 RNA_def_property_boolean_sdna(prop, nullptr, "details_flags", FILE_DETAILS_SIZE);
7332 RNA_def_property_ui_text(prop, "File Size", "Show a column listing the size of each file");
7334
7335 prop = RNA_def_property(srna, "show_details_datetime", PROP_BOOLEAN, PROP_NONE);
7336 RNA_def_property_boolean_sdna(prop, nullptr, "details_flags", FILE_DETAILS_DATETIME);
7338 prop,
7339 "File Modification Date",
7340 "Show a column listing the date and time of modification for each file");
7342
7343 prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
7344 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_FILTER);
7345 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
7347
7348 prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
7350 RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
7352
7353 prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
7354 RNA_def_property_enum_sdna(prop, nullptr, "sort");
7356 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_FileSelectParams_sort_method_itemf");
7357 RNA_def_property_ui_text(prop, "Sort", "");
7359
7360 prop = RNA_def_property(srna, "use_sort_invert", PROP_BOOLEAN, PROP_NONE);
7361 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_SORT_INVERT);
7363 prop, "Reverse Sorting", "Sort items descending, from highest value to lowest");
7365
7366 prop = RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
7367 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_IMAGE);
7368 RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
7369 RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
7371
7372 prop = RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
7373 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_BLENDER);
7374 RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
7375 RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
7377
7378 prop = RNA_def_property(srna, "use_filter_backup", PROP_BOOLEAN, PROP_NONE);
7381 prop, "Filter Blender Backup Files", "Show .blend1, .blend2, etc. files");
7382 RNA_def_property_ui_icon(prop, ICON_FILE_BACKUP, 0);
7384
7385 prop = RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
7386 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_MOVIE);
7387 RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
7388 RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
7390
7391 prop = RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
7392 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_PYSCRIPT);
7393 RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
7394 RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
7396
7397 prop = RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
7398 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_FTFONT);
7399 RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
7400 RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
7402
7403 prop = RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
7404 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_SOUND);
7405 RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
7406 RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
7408
7409 prop = RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
7410 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_TEXT);
7411 RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
7412 RNA_def_property_ui_icon(prop, ICON_FILE_TEXT, 0);
7414
7415 prop = RNA_def_property(srna, "use_filter_volume", PROP_BOOLEAN, PROP_NONE);
7416 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_VOLUME);
7417 RNA_def_property_ui_text(prop, "Filter Volume", "Show 3D volume files");
7418 RNA_def_property_ui_icon(prop, ICON_FILE_VOLUME, 0);
7420
7421 prop = RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
7422 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_FOLDER);
7423 RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
7424 RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
7426
7427 prop = RNA_def_property(srna, "use_filter_blendid", PROP_BOOLEAN, PROP_NONE);
7428 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_BLENDERLIB);
7430 prop, "Filter Blender IDs", "Show .blend files items (objects, materials, etc.)");
7431 RNA_def_property_ui_icon(prop, ICON_BLENDER, 0);
7433
7434 prop = RNA_def_property(srna, "use_filter_asset_only", PROP_BOOLEAN, PROP_NONE);
7435 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_ASSETS_ONLY);
7437 prop, "Only Assets", "Hide .blend files items that are not data-blocks with asset metadata");
7439
7440 prop = RNA_def_property(srna, "filter_id", PROP_POINTER, PROP_NONE);
7442 RNA_def_property_struct_type(prop, "FileSelectIDFilter");
7444 prop, "rna_FileSelectParams_filter_id_get", nullptr, nullptr, nullptr);
7446 prop, "Filter ID Types", "Which ID types to show/hide, when browsing a library");
7447
7448 prop = RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
7449 RNA_def_property_string_sdna(prop, nullptr, "filter_glob");
7451 "Extension Filter",
7452 "UNIX shell-like filename patterns matching, supports wildcards ('*') "
7453 "and list of patterns separated by ';'");
7454 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_FileSelectPrams_filter_glob_set");
7456
7457 prop = RNA_def_property(srna, "filter_search", PROP_STRING, PROP_NONE);
7458 RNA_def_property_string_sdna(prop, nullptr, "filter_search");
7460 prop, "Name or Tag Filter", "Filter by name or tag, supports '*' wildcard");
7463
7464 prop = RNA_def_property(srna, "display_size", PROP_INT, PROP_NONE);
7465 RNA_def_property_int_sdna(prop, nullptr, "thumbnail_size");
7466 RNA_def_property_ui_text(prop, "Display Size", "Change the size of thumbnails");
7469 RNA_def_property_range(prop, 16, 256);
7470 RNA_def_property_ui_range(prop, 24, 256, 1, 0);
7471
7472 prop = RNA_def_property(srna, "display_size_discrete", PROP_ENUM, PROP_NONE);
7473 RNA_def_property_enum_sdna(prop, nullptr, "thumbnail_size");
7474 RNA_def_property_enum_items(prop, display_size_items);
7476 prop, "Display Size", "Change the size of thumbnails in discrete steps");
7478
7479 prop = RNA_def_property(srna, "list_display_size", PROP_INT, PROP_NONE);
7480 RNA_def_property_int_sdna(prop, nullptr, "list_thumbnail_size");
7481 RNA_def_property_ui_text(prop, "Display Size", "Change the size of thumbnails in list views");
7484 RNA_def_property_range(prop, 16, 128);
7485 RNA_def_property_ui_range(prop, 16, 128, 1, 0);
7486
7487 prop = RNA_def_property(srna, "list_column_size", PROP_INT, PROP_NONE);
7488 RNA_def_property_ui_text(prop, "Columns Size", "The width of columns in horizontal list views");
7491 RNA_def_property_range(prop, 32, 750);
7492 RNA_def_property_ui_range(prop, 32, 750, 1, 0);
7493}
7494
7496{
7497 StructRNA *srna;
7498 PropertyRNA *prop;
7499
7500 static const EnumPropertyItem asset_import_method_items[] = {
7502 "FOLLOW_PREFS",
7503 0,
7504 "Follow Preferences",
7505 "Use the import method set in the Preferences for this asset library, don't override it "
7506 "for this Asset Browser"},
7507 {FILE_ASSET_IMPORT_LINK, "LINK", 0, "Link", "Import the assets as linked data-block"},
7509 "APPEND",
7510 0,
7511 "Append",
7512 "Import the assets as copied data-block, with no link to the original asset data-block"},
7514 "APPEND_REUSE",
7515 0,
7516 "Append (Reuse Data)",
7517 "Import the assets as copied data-block while avoiding multiple copies of nested, "
7518 "typically heavy data. For example the textures of a material asset, or the mesh of an "
7519 "object asset, don't have to be copied every time this asset is imported. The instances of "
7520 "the asset share the data instead"},
7521 {0, nullptr, 0, nullptr, nullptr},
7522 };
7523
7524 srna = RNA_def_struct(brna, "FileAssetSelectParams", "FileSelectParams");
7526 srna, "Asset Select Parameters", "Settings for the file selection in Asset Browser mode");
7527
7529 "rna_FileAssetSelectParams_asset_library_get",
7530 "rna_FileAssetSelectParams_asset_library_set");
7531 RNA_def_property_ui_text(prop, "Asset Library", "");
7533
7534 prop = RNA_def_property(srna, "catalog_id", PROP_STRING, PROP_NONE);
7536 "rna_FileAssetSelectParams_catalog_id_get",
7537 "rna_FileAssetSelectParams_catalog_id_length",
7538 "rna_FileAssetSelectParams_catalog_id_set");
7539 RNA_def_property_ui_text(prop, "Catalog UUID", "The UUID of the catalog shown in the browser");
7541
7542 prop = RNA_def_property(srna, "filter_asset_id", PROP_POINTER, PROP_NONE);
7544 RNA_def_property_struct_type(prop, "FileAssetSelectIDFilter");
7546 prop, "rna_FileAssetSelectParams_filter_id_get", nullptr, nullptr, nullptr);
7548 "Filter Asset Types",
7549 "Which asset types to show/hide, when browsing an asset library");
7550
7551 prop = RNA_def_property(srna, "import_method", PROP_ENUM, PROP_NONE);
7552 RNA_def_property_enum_items(prop, asset_import_method_items);
7553 RNA_def_property_ui_text(prop, "Import Method", "Determine how the asset will be imported");
7554 /* Asset drag info saved by buttons stores the import method, so the space must redraw when
7555 * import method changes. */
7557
7558 prop = RNA_def_property(srna, "instance_collections_on_link", PROP_BOOLEAN, PROP_NONE);
7560 prop, nullptr, "import_flags", FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_LINK);
7562 "Instance Collections on Linking",
7563 "Create instances for collections when linking, rather than adding "
7564 "them directly to the scene");
7566
7567 prop = RNA_def_property(srna, "instance_collections_on_append", PROP_BOOLEAN, PROP_NONE);
7569 prop, nullptr, "import_flags", FILE_ASSET_IMPORT_INSTANCE_COLLECTIONS_ON_APPEND);
7571 "Instance Collections on Appending",
7572 "Create instances for collections when appending, rather than adding "
7573 "them directly to the scene");
7575}
7576
7578{
7579 StructRNA *srna;
7580 PropertyRNA *prop;
7581
7582 srna = RNA_def_struct(brna, "FileBrowserFSMenuEntry", nullptr);
7583 RNA_def_struct_sdna(srna, "FSMenuEntry");
7584 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
7585
7586 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_FILEPATH);
7588 "rna_FileBrowser_FSMenuEntry_path_get",
7589 "rna_FileBrowser_FSMenuEntry_path_length",
7590 "rna_FileBrowser_FSMenuEntry_path_set");
7591 RNA_def_property_ui_text(prop, "Path", "");
7593
7594 /* Use #PROP_FILENAME sub-type so the UI can manipulate non-UTF8 names. */
7595 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
7597 "rna_FileBrowser_FSMenuEntry_name_get",
7598 "rna_FileBrowser_FSMenuEntry_name_length",
7599 "rna_FileBrowser_FSMenuEntry_name_set");
7600 RNA_def_property_editable_func(prop, "rna_FileBrowser_FSMenuEntry_name_get_editable");
7601 RNA_def_property_ui_text(prop, "Name", "");
7602 RNA_def_struct_name_property(srna, prop);
7603
7604 prop = RNA_def_property(srna, "icon", PROP_INT, PROP_NONE);
7606 "rna_FileBrowser_FSMenuEntry_icon_get",
7607 "rna_FileBrowser_FSMenuEntry_icon_set",
7608 nullptr);
7609 RNA_def_property_ui_text(prop, "Icon", "");
7610
7611 prop = RNA_def_property(srna, "use_save", PROP_BOOLEAN, PROP_NONE);
7612 RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_use_save_get", nullptr);
7614 prop, "Save", "Whether this path is saved in bookmarks, or generated from OS");
7616
7617 prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
7618 RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_is_valid_get", nullptr);
7619 RNA_def_property_ui_text(prop, "Valid", "Whether this path is currently reachable");
7621}
7622
7624{
7625 StructRNA *srna;
7626 PropertyRNA *prop;
7627
7628 srna = RNA_def_struct(brna, "SpaceFileBrowser", "Space");
7629 RNA_def_struct_sdna(srna, "SpaceFile");
7630 RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
7631
7633 srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_TOOL_PROPS));
7634
7635 prop = RNA_def_property(srna, "browse_mode", PROP_ENUM, PROP_NONE);
7638 prop,
7639 "Browsing Mode",
7640 "Type of the File Editor view (regular file browsing or asset browsing)");
7641 RNA_def_property_update(prop, 0, "rna_SpaceFileBrowser_browse_mode_update");
7642
7643 prop = RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
7644 RNA_def_property_struct_type(prop, "FileSelectParams");
7646 prop, "rna_FileBrowser_params_get", nullptr, "rna_FileBrowser_params_typef", nullptr);
7648 prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser");
7649
7650 prop = RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE);
7651 RNA_def_property_pointer_sdna(prop, nullptr, "op");
7652 RNA_def_property_ui_text(prop, "Active Operator", "");
7653
7654 /* Keep this for compatibility with existing presets,
7655 * not exposed in c++ API because of keyword conflict. */
7656 prop = RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
7657 RNA_def_property_pointer_sdna(prop, nullptr, "op");
7658 RNA_def_property_ui_text(prop, "Active Operator", "");
7659
7660 /* bookmarks, recent files etc. */
7661 prop = RNA_def_collection(srna,
7662 "system_folders",
7663 "FileBrowserFSMenuEntry",
7664 "System Folders",
7665 "System's folders (usually root, available hard drives, etc)");
7667 "rna_FileBrowser_FSMenuSystem_data_begin",
7668 "rna_FileBrowser_FSMenu_next",
7669 "rna_FileBrowser_FSMenu_end",
7670 "rna_FileBrowser_FSMenu_get",
7671 "rna_FileBrowser_FSMenuSystem_data_length",
7672 nullptr,
7673 nullptr,
7674 nullptr);
7676
7677 prop = RNA_def_int(srna,
7678 "system_folders_active",
7679 -1,
7680 -1,
7681 INT_MAX,
7682 "Active System Folder",
7683 "Index of active system folder (-1 if none)",
7684 -1,
7685 INT_MAX);
7686 RNA_def_property_int_sdna(prop, nullptr, "systemnr");
7688 "rna_FileBrowser_FSMenuSystem_active_get",
7689 "rna_FileBrowser_FSMenuSystem_active_set",
7690 "rna_FileBrowser_FSMenuSystem_active_range");
7693 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7694
7695 prop = RNA_def_collection(srna,
7696 "system_bookmarks",
7697 "FileBrowserFSMenuEntry",
7698 "System Bookmarks",
7699 "System's bookmarks");
7701 "rna_FileBrowser_FSMenuSystemBookmark_data_begin",
7702 "rna_FileBrowser_FSMenu_next",
7703 "rna_FileBrowser_FSMenu_end",
7704 "rna_FileBrowser_FSMenu_get",
7705 "rna_FileBrowser_FSMenuSystemBookmark_data_length",
7706 nullptr,
7707 nullptr,
7708 nullptr);
7710
7711 prop = RNA_def_int(srna,
7712 "system_bookmarks_active",
7713 -1,
7714 -1,
7715 INT_MAX,
7716 "Active System Bookmark",
7717 "Index of active system bookmark (-1 if none)",
7718 -1,
7719 INT_MAX);
7720 RNA_def_property_int_sdna(prop, nullptr, "system_bookmarknr");
7722 "rna_FileBrowser_FSMenuSystemBookmark_active_get",
7723 "rna_FileBrowser_FSMenuSystemBookmark_active_set",
7724 "rna_FileBrowser_FSMenuSystemBookmark_active_range");
7727 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7728
7729 prop = RNA_def_collection(
7730 srna, "bookmarks", "FileBrowserFSMenuEntry", "Bookmarks", "User's bookmarks");
7732 "rna_FileBrowser_FSMenuBookmark_data_begin",
7733 "rna_FileBrowser_FSMenu_next",
7734 "rna_FileBrowser_FSMenu_end",
7735 "rna_FileBrowser_FSMenu_get",
7736 "rna_FileBrowser_FSMenuBookmark_data_length",
7737 nullptr,
7738 nullptr,
7739 nullptr);
7741
7742 prop = RNA_def_int(srna,
7743 "bookmarks_active",
7744 -1,
7745 -1,
7746 INT_MAX,
7747 "Active Bookmark",
7748 "Index of active bookmark (-1 if none)",
7749 -1,
7750 INT_MAX);
7751 RNA_def_property_int_sdna(prop, nullptr, "bookmarknr");
7753 "rna_FileBrowser_FSMenuBookmark_active_get",
7754 "rna_FileBrowser_FSMenuBookmark_active_set",
7755 "rna_FileBrowser_FSMenuBookmark_active_range");
7758 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7759
7760 prop = RNA_def_collection(
7761 srna, "recent_folders", "FileBrowserFSMenuEntry", "Recent Folders", "");
7763 "rna_FileBrowser_FSMenuRecent_data_begin",
7764 "rna_FileBrowser_FSMenu_next",
7765 "rna_FileBrowser_FSMenu_end",
7766 "rna_FileBrowser_FSMenu_get",
7767 "rna_FileBrowser_FSMenuRecent_data_length",
7768 nullptr,
7769 nullptr,
7770 nullptr);
7772
7773 prop = RNA_def_int(srna,
7774 "recent_folders_active",
7775 -1,
7776 -1,
7777 INT_MAX,
7778 "Active Recent Folder",
7779 "Index of active recent folder (-1 if none)",
7780 -1,
7781 INT_MAX);
7782 RNA_def_property_int_sdna(prop, nullptr, "recentnr");
7784 "rna_FileBrowser_FSMenuRecent_active_get",
7785 "rna_FileBrowser_FSMenuRecent_active_set",
7786 "rna_FileBrowser_FSMenuRecent_active_range");
7789 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7790
7792}
7793
7795{
7796 StructRNA *srna;
7797 PropertyRNA *prop;
7798
7799 srna = RNA_def_struct(brna, "SpaceInfo", "Space");
7800 RNA_def_struct_sdna(srna, "SpaceInfo");
7801 RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
7802
7803 /* reporting display */
7804 prop = RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
7805 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_DEBUG);
7806 RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
7808
7809 prop = RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
7810 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_INFO);
7811 RNA_def_property_ui_text(prop, "Show Info", "Display general information");
7813
7814 prop = RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
7815 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_OP);
7816 RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
7818
7819 prop = RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
7820 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_WARN);
7821 RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
7823
7824 prop = RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
7825 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_ERR);
7826 RNA_def_property_ui_text(prop, "Show Error", "Display error text");
7828}
7829
7831{
7832 static const EnumPropertyItem filter_type_items[] = {
7833 {0, "NAME", 0, "Name", "Filter based on the operator name"},
7834 {1, "KEY", 0, "Key-Binding", "Filter based on key bindings"},
7835 {0, nullptr, 0, nullptr, nullptr},
7836 };
7837
7838 StructRNA *srna;
7839 PropertyRNA *prop;
7840
7841 srna = RNA_def_struct(brna, "SpacePreferences", "Space");
7842 RNA_def_struct_sdna(srna, "SpaceUserPref");
7843 RNA_def_struct_ui_text(srna, "Space Preferences", "Blender preferences space data");
7844
7845 prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
7846 RNA_def_property_enum_sdna(prop, nullptr, "filter_type");
7847 RNA_def_property_enum_items(prop, filter_type_items);
7848 RNA_def_property_ui_text(prop, "Filter Type", "Filter method");
7850
7851 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
7852 RNA_def_property_string_sdna(prop, nullptr, "filter");
7854 RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
7855}
7856
7858{
7859 StructRNA *srna;
7860 PropertyRNA *prop;
7861
7862 srna = RNA_def_struct(brna, "NodeTreePath", nullptr);
7863 RNA_def_struct_sdna(srna, "bNodeTreePath");
7864 RNA_def_struct_ui_text(srna, "Node Tree Path", "Element of the node space tree path");
7865
7866 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
7867 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
7869 RNA_def_property_ui_text(prop, "Node Tree", "Base node tree from context");
7870}
7871
7873{
7874 StructRNA *srna;
7875 PropertyRNA *prop, *parm;
7876 FunctionRNA *func;
7877
7878 RNA_def_property_srna(cprop, "SpaceNodeEditorPath");
7879 srna = RNA_def_struct(brna, "SpaceNodeEditorPath", nullptr);
7880 RNA_def_struct_sdna(srna, "SpaceNode");
7881 RNA_def_struct_ui_text(srna, "Space Node Editor Path", "History of node trees in the editor");
7882
7883 prop = RNA_def_property(srna, "to_string", PROP_STRING, PROP_NONE);
7885 prop, "rna_SpaceNodeEditor_path_get", "rna_SpaceNodeEditor_path_length", nullptr);
7887 RNA_def_struct_ui_text(srna, "Path", "Get the node tree path as a string");
7889
7890 func = RNA_def_function(srna, "clear", "rna_SpaceNodeEditor_path_clear");
7891 RNA_def_function_ui_description(func, "Reset the node tree path");
7893
7894 func = RNA_def_function(srna, "start", "rna_SpaceNodeEditor_path_start");
7895 RNA_def_function_ui_description(func, "Set the root node tree");
7897 parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", "");
7899
7900 func = RNA_def_function(srna, "append", "rna_SpaceNodeEditor_path_append");
7901 RNA_def_function_ui_description(func, "Append a node group tree to the path");
7903 parm = RNA_def_pointer(
7904 func, "node_tree", "NodeTree", "Node Tree", "Node tree to append to the node editor path");
7906 parm = RNA_def_pointer(func, "node", "Node", "Node", "Group node linking to this node tree");
7908
7909 func = RNA_def_function(srna, "pop", "rna_SpaceNodeEditor_path_pop");
7910 RNA_def_function_ui_description(func, "Remove the last node tree from the path");
7912}
7913
7915{
7916 StructRNA *srna;
7917 PropertyRNA *prop;
7918
7919 static const EnumPropertyItem preview_shapes[] = {
7920 {SN_OVERLAY_PREVIEW_FLAT, "FLAT", ICON_MESH_PLANE, "Flat", "Use the default flat previews"},
7922 "3D",
7923 ICON_SPHERE,
7924 "3D",
7925 "Use the material preview scene for the node previews"},
7926 {0, nullptr, 0, nullptr, nullptr},
7927 };
7928
7929 srna = RNA_def_struct(brna, "SpaceNodeOverlay", nullptr);
7930 RNA_def_struct_sdna(srna, "SpaceNode");
7931 RNA_def_struct_nested(brna, srna, "SpaceNodeEditor");
7932 RNA_def_struct_path_func(srna, "rna_SpaceNodeOverlay_path");
7934 srna, "Overlay Settings", "Settings for display of overlays in the Node Editor");
7935
7936 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
7937 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_OVERLAYS);
7939 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like colored or dashed wires");
7941
7942 prop = RNA_def_property(srna, "show_wire_color", PROP_BOOLEAN, PROP_NONE);
7943 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_WIRE_COLORS);
7946 prop, "Show Wire Colors", "Color node links based on their connected sockets");
7948
7949 prop = RNA_def_property(srna, "show_reroute_auto_labels", PROP_BOOLEAN, PROP_NONE);
7951 prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_REROUTE_AUTO_LABELS);
7954 "Show Reroute Auto Labels",
7955 "Label reroute nodes based on the label of connected reroute nodes");
7957
7958 prop = RNA_def_property(srna, "show_timing", PROP_BOOLEAN, PROP_NONE);
7959 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_TIMINGS);
7961 RNA_def_property_ui_text(prop, "Show Timing", "Display each node's last execution time");
7963
7964 prop = RNA_def_property(srna, "show_context_path", PROP_BOOLEAN, PROP_NONE);
7965 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_PATH);
7967 RNA_def_property_ui_text(prop, "Show Tree Path", "Display breadcrumbs for the editor's context");
7969
7970 prop = RNA_def_property(srna, "show_named_attributes", PROP_BOOLEAN, PROP_NONE);
7974 prop, "Show Named Attributes", "Show when nodes are using named attributes");
7976
7977 prop = RNA_def_property(srna, "show_previews", PROP_BOOLEAN, PROP_NONE);
7978 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_PREVIEWS);
7981 prop, "Show Node Previews", "Display each node's preview if node is toggled");
7983
7984 prop = RNA_def_property(srna, "preview_shape", PROP_ENUM, PROP_NONE);
7985 RNA_def_property_enum_sdna(prop, nullptr, "overlay.preview_shape");
7986 RNA_def_property_enum_items(prop, preview_shapes);
7988 RNA_def_property_ui_text(prop, "Preview Shape", "Preview shape used by the node previews");
7990}
7991
7993{
7994 StructRNA *srna;
7995 PropertyRNA *prop;
7996
7997 static const EnumPropertyItem texture_id_type_items[] = {
7998 {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World"},
7999 {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"},
8000# ifdef WITH_FREESTYLE
8002 "LINESTYLE",
8003 ICON_LINE_DATA,
8004 "Line Style",
8005 "Edit texture nodes from Line Style"},
8006# endif
8007 {0, nullptr, 0, nullptr, nullptr},
8008 };
8009
8010 static const EnumPropertyItem shader_type_items[] = {
8011 {SNODE_SHADER_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit shader nodes from Object"},
8012 {SNODE_SHADER_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit shader nodes from World"},
8013# ifdef WITH_FREESTYLE
8015 "LINESTYLE",
8016 ICON_LINE_DATA,
8017 "Line Style",
8018 "Edit shader nodes from Line Style"},
8019# endif
8020 {0, nullptr, 0, nullptr, nullptr},
8021 };
8022
8023 static const EnumPropertyItem geometry_nodes_type_items[] = {
8025 "MODIFIER",
8026 0,
8027 "Modifier",
8028 "Edit node group from active object's active modifier"},
8030 "TOOL",
8031 0,
8032 "Tool",
8033 "Edit any geometry node group for use as an operator"},
8034 {0, nullptr, 0, nullptr, nullptr},
8035 };
8036
8037 static const EnumPropertyItem backdrop_channels_items[] = {
8039 "COLOR_ALPHA",
8040 ICON_IMAGE_RGB_ALPHA,
8041 "Color & Alpha",
8042 "Display image with RGB colors and alpha transparency"},
8043 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
8044 {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Display alpha transparency channel"},
8045 {SNODE_SHOW_R, "RED", ICON_RGB_RED, "Red", ""},
8046 {SNODE_SHOW_G, "GREEN", ICON_RGB_GREEN, "Green", ""},
8047 {SNODE_SHOW_B, "BLUE", ICON_RGB_BLUE, "Blue", ""},
8048 {0, nullptr, 0, nullptr, nullptr},
8049 };
8050
8051 static const EnumPropertyItem insert_ofs_dir_items[] = {
8052 {SNODE_INSERTOFS_DIR_RIGHT, "RIGHT", 0, "Right"},
8053 {SNODE_INSERTOFS_DIR_LEFT, "LEFT", 0, "Left"},
8054 {0, nullptr, 0, nullptr, nullptr},
8055 };
8056
8057 srna = RNA_def_struct(brna, "SpaceNodeEditor", "Space");
8058 RNA_def_struct_sdna(srna, "SpaceNode");
8059 RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data");
8060
8062
8063 prop = RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
8066 "rna_SpaceNodeEditor_tree_type_get",
8067 "rna_SpaceNodeEditor_tree_type_set",
8068 "rna_SpaceNodeEditor_tree_type_itemf");
8070 RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit");
8072
8073 prop = RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
8074 RNA_def_property_enum_sdna(prop, nullptr, "texfrom");
8075 RNA_def_property_enum_items(prop, texture_id_type_items);
8076 RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from");
8079
8080 prop = RNA_def_property(srna, "shader_type", PROP_ENUM, PROP_NONE);
8081 RNA_def_property_enum_sdna(prop, nullptr, "shaderfrom");
8082 RNA_def_property_enum_items(prop, shader_type_items);
8083 RNA_def_property_ui_text(prop, "Shader Type", "Type of data to take shader from");
8086
8087 prop = RNA_def_property(srna, "geometry_nodes_type", PROP_ENUM, PROP_NONE);
8088 RNA_def_property_enum_sdna(prop, nullptr, "geometry_nodes_type");
8089 RNA_def_property_enum_items(prop, geometry_nodes_type_items);
8090 RNA_def_property_ui_text(prop, "Geometry Nodes Type", "");
8093 prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_geometry_nodes_type_update");
8094
8095 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8097 RNA_def_property_ui_text(prop, "ID", "Data-block whose nodes are being edited");
8098
8099 prop = RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
8100 RNA_def_property_pointer_sdna(prop, nullptr, "from");
8103 prop, "ID From", "Data-block from which the edited data-block is linked");
8104
8105 prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE);
8106 RNA_def_property_collection_sdna(prop, nullptr, "treepath", nullptr);
8107 RNA_def_property_struct_type(prop, "NodeTreePath");
8109 prop, "Node Tree Path", "Path from the data-block to the currently edited node tree");
8110 rna_def_space_node_path_api(brna, prop);
8111
8112 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
8114 nullptr,
8115 "rna_SpaceNodeEditor_node_tree_set",
8116 nullptr,
8117 "rna_SpaceNodeEditor_node_tree_poll");
8118 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
8120 RNA_def_property_ui_text(prop, "Node Tree", "Base node tree from context");
8121 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
8122
8123 prop = RNA_def_property(srna, "edit_tree", PROP_POINTER, PROP_NONE);
8124 RNA_def_property_pointer_sdna(prop, nullptr, "edittree");
8126 RNA_def_property_ui_text(prop, "Edit Tree", "Node tree being displayed and edited");
8127
8128 prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
8129 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_PIN);
8130 RNA_def_property_ui_text(prop, "Pinned", "Use the pinned node tree");
8131 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
8133
8134 prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
8135 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_BACKDRAW);
8137 prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
8139 prop, NC_SPACE | ND_SPACE_NODE_VIEW, "rna_SpaceNodeEditor_show_backdrop_update");
8140
8141 prop = RNA_def_property(srna, "geometry_nodes_tool_tree", PROP_POINTER, PROP_NONE);
8143 prop, nullptr, nullptr, nullptr, "rna_SpaceNodeEditor_geometry_nodes_tool_tree_poll");
8145 RNA_def_property_ui_text(prop, "Node Tool Tree", "Node group to edit as node tool");
8146 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
8147
8148 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
8149 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_SHOW_GPENCIL);
8150 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
8152
8153 prop = RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
8154 RNA_def_property_float_sdna(prop, nullptr, "zoom");
8156 RNA_def_property_range(prop, 0.01f, FLT_MAX);
8157 RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
8158 RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor");
8160
8161 prop = RNA_def_property(srna, "backdrop_offset", PROP_FLOAT, PROP_NONE);
8162 RNA_def_property_float_sdna(prop, nullptr, "xof");
8163 RNA_def_property_array(prop, 2);
8164 RNA_def_property_ui_text(prop, "Backdrop Offset", "Backdrop offset");
8166
8167 prop = RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
8168 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
8169 RNA_def_property_enum_items(prop, backdrop_channels_items);
8170 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to draw");
8172 /* the mx/my "cursor" in the node editor is used only by operators to store the mouse position */
8173 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
8174 RNA_def_property_array(prop, 2);
8176 "rna_SpaceNodeEditor_cursor_location_get",
8177 "rna_SpaceNodeEditor_cursor_location_set",
8178 nullptr);
8179 RNA_def_property_ui_text(prop, "Cursor Location", "Location for adding new nodes");
8181
8182 prop = RNA_def_property(srna, "insert_offset_direction", PROP_ENUM, PROP_NONE);
8183 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "insert_ofs_dir");
8184 RNA_def_property_enum_items(prop, insert_ofs_dir_items);
8186 prop, "Auto-offset Direction", "Direction to offset nodes on insertion");
8188
8189 /* Gizmo Toggles. */
8190 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
8191 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SNODE_GIZMO_HIDE);
8192 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
8194
8195 prop = RNA_def_property(srna, "show_gizmo_active_node", PROP_BOOLEAN, PROP_NONE);
8197 prop, nullptr, "gizmo_flag", SNODE_GIZMO_HIDE_ACTIVE_NODE);
8198 RNA_def_property_ui_text(prop, "Active Node", "Context sensitive gizmo for the active node");
8201
8202 /* Overlays */
8203 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
8205 RNA_def_property_struct_type(prop, "SpaceNodeOverlay");
8206 RNA_def_property_pointer_funcs(prop, "rna_SpaceNode_overlay_get", nullptr, nullptr, nullptr);
8208 prop, "Overlay Settings", "Settings for display of overlays in the Node Editor");
8209
8210 prop = RNA_def_property(srna, "supports_previews", PROP_BOOLEAN, PROP_NONE);
8211 RNA_def_property_boolean_funcs(prop, "rna_SpaceNode_supports_previews", nullptr);
8214 "Supports Previews",
8215 "Whether the node editor's type supports displaying node previews");
8216
8218 RNA_api_space_node(srna);
8219}
8220
8222{
8223 StructRNA *srna;
8224 PropertyRNA *prop;
8225
8226 static const EnumPropertyItem view_items[] = {
8227 {SC_VIEW_CLIP, "CLIP", ICON_SEQUENCE, "Clip", "Show editing clip preview"},
8228 {SC_VIEW_GRAPH, "GRAPH", ICON_GRAPH, "Graph", "Show graph view for active element"},
8230 "DOPESHEET",
8231 ICON_ACTION,
8232 "Dope Sheet",
8233 "Dope Sheet view for tracking data"},
8234 {0, nullptr, 0, nullptr, nullptr},
8235 };
8236
8237 static const EnumPropertyItem annotation_source_items[] = {
8239 "CLIP",
8240 0,
8241 "Clip",
8242 "Show annotation data-block which belongs to movie clip"},
8244 "TRACK",
8245 0,
8246 "Track",
8247 "Show annotation data-block which belongs to active track"},
8248 {0, nullptr, 0, nullptr, nullptr},
8249 };
8250
8251 static const EnumPropertyItem pivot_items[] = {
8253 "BOUNDING_BOX_CENTER",
8254 ICON_PIVOT_BOUNDBOX,
8255 "Bounding Box Center",
8256 "Pivot around bounding box center of selected object(s)"},
8257 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
8259 "INDIVIDUAL_ORIGINS",
8260 ICON_PIVOT_INDIVIDUAL,
8261 "Individual Origins",
8262 "Pivot around each object's own origin"},
8264 "MEDIAN_POINT",
8265 ICON_PIVOT_MEDIAN,
8266 "Median Point",
8267 "Pivot around the median point of selected objects"},
8268 {0, nullptr, 0, nullptr, nullptr},
8269 };
8270
8271 srna = RNA_def_struct(brna, "SpaceClipEditor", "Space");
8272 RNA_def_struct_sdna(srna, "SpaceClip");
8273 RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data");
8274
8276 (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) |
8277 (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
8278
8279 /* movieclip */
8280 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
8282 RNA_def_property_ui_text(prop, "Movie Clip", "Movie clip displayed and edited in this space");
8283 RNA_def_property_pointer_funcs(prop, nullptr, "rna_SpaceClipEditor_clip_set", nullptr, nullptr);
8285
8286 /* clip user */
8287 prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
8289 RNA_def_property_struct_type(prop, "MovieClipUser");
8290 RNA_def_property_pointer_sdna(prop, nullptr, "user");
8292 prop, "Movie Clip User", "Parameters defining which frame of the movie clip is displayed");
8294
8295 /* mask */
8296 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_mask_set");
8297
8298 /* mode */
8299 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
8300 RNA_def_property_enum_sdna(prop, nullptr, "mode");
8302 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
8304 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_clip_mode_update");
8305
8306 /* view */
8307 prop = RNA_def_property(srna, "view", PROP_ENUM, PROP_NONE);
8308 RNA_def_property_enum_sdna(prop, nullptr, "view");
8309 RNA_def_property_enum_items(prop, view_items);
8310 RNA_def_property_ui_text(prop, "View", "Type of the clip editor view");
8312 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_view_type_update");
8313
8314 /* show pattern */
8315 prop = RNA_def_property(srna, "show_marker_pattern", PROP_BOOLEAN, PROP_NONE);
8316 RNA_def_property_ui_text(prop, "Show Marker Pattern", "Show pattern boundbox for markers");
8319
8320 /* show search */
8321 prop = RNA_def_property(srna, "show_marker_search", PROP_BOOLEAN, PROP_NONE);
8322 RNA_def_property_ui_text(prop, "Show Marker Search", "Show search boundbox for markers");
8325
8326 /* lock to selection */
8327 prop = RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE);
8329 prop, "Lock to Selection", "Lock viewport to selected markers during playback");
8330 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_LOCK_SELECTION);
8332 prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_lock_selection_update");
8333
8334 /* lock to time cursor */
8335 prop = RNA_def_property(srna, "lock_time_cursor", PROP_BOOLEAN, PROP_NONE);
8337 prop, "Lock to Time Cursor", "Lock curves view to time cursor during playback and tracking");
8338 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_LOCK_TIMECURSOR);
8340
8341 /* show markers paths */
8342 prop = RNA_def_property(srna, "show_track_path", PROP_BOOLEAN, PROP_NONE);
8343 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_TRACK_PATH);
8344 RNA_def_property_ui_text(prop, "Show Track Path", "Show path of how track moves");
8346
8347 /* path length */
8348 prop = RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
8349 RNA_def_property_int_sdna(prop, nullptr, "path_length");
8350 RNA_def_property_range(prop, 0, INT_MAX);
8351 RNA_def_property_ui_text(prop, "Path Length", "Length of displaying path, in frames");
8353
8354 /* show tiny markers */
8355 prop = RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE);
8356 RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers in a more compact manner");
8357 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_TINY_MARKER);
8359
8360 /* show bundles */
8361 prop = RNA_def_property(srna, "show_bundles", PROP_BOOLEAN, PROP_NONE);
8362 RNA_def_property_ui_text(prop, "Show Bundles", "Show projection of 3D markers into footage");
8363 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_BUNDLES);
8365
8366 /* mute footage */
8367 prop = RNA_def_property(srna, "use_mute_footage", PROP_BOOLEAN, PROP_NONE);
8368 RNA_def_property_ui_text(prop, "Mute Footage", "Mute footage and show black background instead");
8369 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_MUTE_FOOTAGE);
8371
8372 /* hide disabled */
8373 prop = RNA_def_property(srna, "show_disabled", PROP_BOOLEAN, PROP_NONE);
8374 RNA_def_property_ui_text(prop, "Show Disabled", "Show disabled tracks from the footage");
8377
8378 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
8379 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_METADATA);
8380 RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of clip");
8382
8383 /* scopes */
8384 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
8385 RNA_def_property_pointer_sdna(prop, nullptr, "scopes");
8386 RNA_def_property_struct_type(prop, "MovieClipScopes");
8387 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize movie clip statistics");
8388
8389 /* show names */
8390 prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
8391 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_NAMES);
8392 RNA_def_property_ui_text(prop, "Show Names", "Show track names and status");
8394
8395 /* show grid */
8396 prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
8397 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_GRID);
8398 RNA_def_property_ui_text(prop, "Show Grid", "Show grid showing lens distortion");
8400
8401 /* show stable */
8402 prop = RNA_def_property(srna, "show_stable", PROP_BOOLEAN, PROP_NONE);
8403 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_STABLE);
8405 prop, "Show Stable", "Show stable footage in editor (if stabilization is enabled)");
8407
8408 /* manual calibration */
8409 prop = RNA_def_property(srna, "use_manual_calibration", PROP_BOOLEAN, PROP_NONE);
8411 RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers");
8413
8414 /* show annotation */
8415 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
8416 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_ANNOTATION);
8417 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
8419
8420 /* show filters */
8421 prop = RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE);
8422 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_FILTERS);
8423 RNA_def_property_ui_text(prop, "Show Filters", "Show filters for graph editor");
8425
8426 /* show graph_frames */
8427 prop = RNA_def_property(srna, "show_graph_frames", PROP_BOOLEAN, PROP_NONE);
8430 prop,
8431 "Show Frames",
8432 "Show curve for per-frame average error (camera motion should be solved first)");
8434
8435 /* show graph tracks motion */
8436 prop = RNA_def_property(srna, "show_graph_tracks_motion", PROP_BOOLEAN, PROP_NONE);
8439 prop,
8440 "Show Tracks Motion",
8441 "Display the speed curves (in \"x\" direction red, in \"y\" direction green) "
8442 "for the selected tracks");
8444
8445 /* show graph tracks motion */
8446 prop = RNA_def_property(srna, "show_graph_tracks_error", PROP_BOOLEAN, PROP_NONE);
8449 prop, "Show Tracks Error", "Display the reprojection error curve for selected tracks");
8451
8452 /* show_only_selected */
8453 prop = RNA_def_property(srna, "show_graph_only_selected", PROP_BOOLEAN, PROP_NONE);
8456 prop, "Only Show Selected", "Only include channels relating to selected objects and data");
8457 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
8459
8460 /* show_hidden */
8461 prop = RNA_def_property(srna, "show_graph_hidden", PROP_BOOLEAN, PROP_NONE);
8464 prop, "Display Hidden", "Include channels from objects/bone that are not visible");
8465 RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
8467
8468 /* ** channels ** */
8469
8470 /* show_red_channel */
8471 prop = RNA_def_property(srna, "show_red_channel", PROP_BOOLEAN, PROP_NONE);
8472 RNA_def_property_boolean_negative_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_DISABLE_RED);
8473 RNA_def_property_ui_text(prop, "Show Red Channel", "Show red channel in the frame");
8475
8476 /* show_green_channel */
8477 prop = RNA_def_property(srna, "show_green_channel", PROP_BOOLEAN, PROP_NONE);
8478 RNA_def_property_boolean_negative_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_DISABLE_GREEN);
8479 RNA_def_property_ui_text(prop, "Show Green Channel", "Show green channel in the frame");
8481
8482 /* show_blue_channel */
8483 prop = RNA_def_property(srna, "show_blue_channel", PROP_BOOLEAN, PROP_NONE);
8484 RNA_def_property_boolean_negative_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_DISABLE_BLUE);
8485 RNA_def_property_ui_text(prop, "Show Blue Channel", "Show blue channel in the frame");
8487
8488 /* preview_grayscale */
8489 prop = RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
8490 RNA_def_property_boolean_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_PREVIEW_GRAYSCALE);
8491 RNA_def_property_ui_text(prop, "Grayscale", "Display frame in grayscale mode");
8493
8494 /* timeline */
8495 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
8496 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_SECONDS);
8497 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
8499
8500 /* grease pencil source */
8501 prop = RNA_def_property(srna, "annotation_source", PROP_ENUM, PROP_NONE);
8502 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_src");
8503 RNA_def_property_enum_items(prop, annotation_source_items);
8504 RNA_def_property_ui_text(prop, "Annotation Source", "Where the annotation comes from");
8507
8508 /* transform */
8509 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
8510 RNA_def_property_float_sdna(prop, nullptr, "cursor");
8511 RNA_def_property_array(prop, 2);
8512 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
8514
8515 /* pivot point */
8516 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
8517 RNA_def_property_enum_sdna(prop, nullptr, "around");
8518 RNA_def_property_enum_items(prop, pivot_items);
8519 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
8521
8522 /* Gizmo Toggles. */
8523 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
8524 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SCLIP_GIZMO_HIDE);
8525 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
8527
8528 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
8530 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
8532
8533 /* Zoom. */
8534 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
8536 "rna_SpaceClipEditor_zoom_percentage_get",
8537 "rna_SpaceClipEditor_zoom_percentage_set",
8538 nullptr);
8539 RNA_def_property_float_default(prop, 100.0);
8540 RNA_def_property_range(prop, .4f, 80000);
8541 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
8542 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
8543}
8544
8546{
8547 StructRNA *srna;
8548 PropertyRNA *prop;
8549
8550 srna = RNA_def_struct(brna, "SpreadsheetColumnID", nullptr);
8551 RNA_def_struct_sdna(srna, "SpreadsheetColumnID");
8553 srna, "Spreadsheet Column ID", "Data used to identify a spreadsheet column");
8554
8555 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
8556 RNA_def_property_ui_text(prop, "Column Name", "");
8558}
8559
8561{
8562 StructRNA *srna;
8563 PropertyRNA *prop;
8564
8565 static const EnumPropertyItem data_type_items[] = {
8566 {SPREADSHEET_VALUE_TYPE_INT32, "INT32", ICON_NONE, "Integer", ""},
8567 {SPREADSHEET_VALUE_TYPE_FLOAT, "FLOAT", ICON_NONE, "Float", ""},
8568 {SPREADSHEET_VALUE_TYPE_BOOL, "BOOLEAN", ICON_NONE, "Boolean", ""},
8569 {SPREADSHEET_VALUE_TYPE_INSTANCES, "INSTANCES", ICON_NONE, "Instances", ""},
8570 {0, nullptr, 0, nullptr, nullptr},
8571 };
8572
8573 srna = RNA_def_struct(brna, "SpreadsheetColumn", nullptr);
8574 RNA_def_struct_sdna(srna, "SpreadsheetColumn");
8576 srna, "Spreadsheet Column", "Persistent data associated with a spreadsheet column");
8577
8578 prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);
8579 RNA_def_property_enum_sdna(prop, nullptr, "data_type");
8580 RNA_def_property_enum_items(prop, data_type_items);
8582 prop, "Data Type", "The data type of the corresponding column visible in the spreadsheet");
8585
8587
8588 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8589 RNA_def_property_struct_type(prop, "SpreadsheetColumnID");
8591 prop, "ID", "Data used to identify the corresponding data from the data source");
8592}
8593
8595{
8596 StructRNA *srna;
8597 PropertyRNA *prop;
8598
8599 srna = RNA_def_struct(brna, "SpreadsheetTableID", nullptr);
8601 srna, "Spreadsheet Table ID", "Data used to identify a spreadsheet table");
8602 RNA_def_struct_refine_func(srna, "rna_SpreadsheetTableID_refine");
8603
8604 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
8607 RNA_def_property_ui_text(prop, "Type", "The type of the table identifier");
8608}
8609
8611{
8612 StructRNA *srna;
8613 PropertyRNA *prop;
8614
8615 /* The properties below are read-only, because they are used as key for a table. */
8616 srna = RNA_def_struct(brna, "SpreadsheetTableIDGeometry", "SpreadsheetTableID");
8617
8618 prop = RNA_def_property(srna, "object_eval_state", PROP_ENUM, PROP_NONE);
8621 RNA_def_property_ui_text(prop, "Object Evaluation State", "");
8622
8623 prop = RNA_def_property(srna, "geometry_component_type", PROP_ENUM, PROP_NONE);
8627 prop, "Geometry Component", "Part of the geometry to display data from");
8628
8629 prop = RNA_def_property(srna, "attribute_domain", PROP_ENUM, PROP_NONE);
8632 RNA_def_property_ui_text(prop, "Attribute Domain", "Attribute domain to display");
8633
8634 prop = RNA_def_property(srna, "viewer_path", PROP_POINTER, PROP_NONE);
8635 RNA_def_property_ui_text(prop, "Viewer Path", "Path to the data that is displayed");
8636
8637 prop = RNA_def_property(srna, "layer_index", PROP_INT, PROP_NONE);
8639 RNA_def_property_ui_text(prop, "Layer Index", "Index of the Grease Pencil layer");
8640}
8641
8643{
8644 StructRNA *srna;
8645 PropertyRNA *prop;
8646
8650
8651 srna = RNA_def_struct(brna, "SpreadsheetTable", nullptr);
8652 RNA_def_struct_ui_text(srna, "Spreadsheet Table", "Persistent data associated with a table");
8653
8654 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8655 RNA_def_property_struct_type(prop, "SpreadsheetTableID");
8656 RNA_def_property_ui_text(prop, "ID", "Data used to identify the table");
8657
8658 prop = RNA_def_property(srna, "columns", PROP_COLLECTION, PROP_NONE);
8659 RNA_def_property_struct_type(prop, "SpreadsheetColumn");
8661 "rna_iterator_SpreadsheetTable_columns_begin",
8662 "rna_iterator_array_next",
8663 "rna_iterator_array_end",
8664 "rna_iterator_array_dereference_get",
8665 "rna_iterator_SpreadsheetTable_columns_length",
8666 nullptr,
8667 nullptr,
8668 nullptr);
8669 RNA_def_property_ui_text(prop, "Columns", "Columns within the table");
8670}
8671
8673{
8674 StructRNA *srna;
8675 PropertyRNA *prop;
8676
8677 srna = RNA_def_struct(brna, "SpreadsheetTables", nullptr);
8678 RNA_def_struct_sdna(srna, "SpaceSpreadsheet");
8680 "Spreadsheet Tables",
8681 "Active table and persisted state of previously displayed tables");
8682
8683 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
8684 RNA_def_property_struct_type(prop, "SpreadsheetTable");
8686 prop, "rna_SpreadsheetTables_active_get", nullptr, nullptr, nullptr);
8687 RNA_def_property_ui_text(prop, "Active Table", "");
8688}
8689
8691{
8692 StructRNA *srna;
8693 PropertyRNA *prop;
8694
8695 static const EnumPropertyItem rule_operation_items[] = {
8696 {SPREADSHEET_ROW_FILTER_EQUAL, "EQUAL", ICON_NONE, "Equal To", ""},
8697 {SPREADSHEET_ROW_FILTER_GREATER, "GREATER", ICON_NONE, "Greater Than", ""},
8698 {SPREADSHEET_ROW_FILTER_LESS, "LESS", ICON_NONE, "Less Than", ""},
8699 {0, nullptr, 0, nullptr, nullptr},
8700 };
8701
8702 srna = RNA_def_struct(brna, "SpreadsheetRowFilter", nullptr);
8703 RNA_def_struct_sdna(srna, "SpreadsheetRowFilter");
8704 RNA_def_struct_ui_text(srna, "Spreadsheet Row Filter", "");
8705
8706 prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
8708 RNA_def_property_ui_text(prop, "Enabled", "");
8709 RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1);
8711
8712 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
8714 RNA_def_property_ui_text(prop, "Show Expanded", "");
8715 RNA_def_property_ui_icon(prop, ICON_RIGHTARROW, 1);
8717
8718 prop = RNA_def_property(srna, "column_name", PROP_STRING, PROP_NONE);
8719 RNA_def_property_ui_text(prop, "Column Name", "");
8721
8722 prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
8723 RNA_def_property_enum_items(prop, rule_operation_items);
8724 RNA_def_property_ui_text(prop, "Operation", "");
8726
8727 prop = RNA_def_property(srna, "value_float", PROP_FLOAT, PROP_NONE);
8728 RNA_def_property_ui_text(prop, "Float Value", "");
8730
8731 prop = RNA_def_property(srna, "value_float2", PROP_FLOAT, PROP_NONE);
8732 RNA_def_property_array(prop, 2);
8733 RNA_def_property_ui_text(prop, "2D Vector Value", "");
8735
8736 prop = RNA_def_property(srna, "value_float3", PROP_FLOAT, PROP_NONE);
8737 RNA_def_property_array(prop, 3);
8738 RNA_def_property_ui_text(prop, "Vector Value", "");
8740
8741 prop = RNA_def_property(srna, "value_color", PROP_FLOAT, PROP_NONE);
8742 RNA_def_property_array(prop, 4);
8743 RNA_def_property_ui_text(prop, "Color Value", "");
8745
8746 prop = RNA_def_property(srna, "value_string", PROP_STRING, PROP_NONE);
8747 RNA_def_property_ui_text(prop, "Text Value", "");
8749
8750 prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
8751 RNA_def_property_ui_text(prop, "Threshold", "How close float values need to be to be equal");
8752 RNA_def_property_range(prop, 0.0, FLT_MAX);
8754
8755 prop = RNA_def_property(srna, "value_int", PROP_INT, PROP_NONE);
8756 RNA_def_property_int_sdna(prop, nullptr, "value_int");
8757 RNA_def_property_ui_text(prop, "Integer Value", "");
8759
8760 prop = RNA_def_property(srna, "value_int8", PROP_INT, PROP_NONE);
8761 RNA_def_property_int_sdna(prop, nullptr, "value_int");
8762 RNA_def_property_range(prop, -128, 127);
8763 RNA_def_property_ui_text(prop, "8-Bit Integer Value", "");
8765
8766 prop = RNA_def_property(srna, "value_int2", PROP_INT, PROP_NONE);
8767 RNA_def_property_array(prop, 2);
8768 RNA_def_property_ui_text(prop, "2D Vector Value", "");
8770
8771 prop = RNA_def_property(srna, "value_boolean", PROP_BOOLEAN, PROP_NONE);
8773 RNA_def_property_ui_text(prop, "Boolean Value", "");
8775}
8776
8778 {VIEWER_PATH_ELEM_TYPE_ID, "ID", ICON_NONE, "ID", ""},
8779 {VIEWER_PATH_ELEM_TYPE_MODIFIER, "MODIFIER", ICON_NONE, "Modifier", ""},
8780 {VIEWER_PATH_ELEM_TYPE_GROUP_NODE, "GROUP_NODE", ICON_NONE, "Group Node", ""},
8781 {VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE, "SIMULATION_ZONE", ICON_NONE, "Simulation Zone", ""},
8782 {VIEWER_PATH_ELEM_TYPE_VIEWER_NODE, "VIEWER_NODE", ICON_NONE, "Viewer Node", ""},
8783 {VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE, "REPEAT_ZONE", ICON_NONE, "Repeat", ""},
8785 "FOREACH_GEOMETRY_ELEMENT_ZONE",
8786 ICON_NONE,
8787 "For Each Geometry Element",
8788 ""},
8789 {VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE, "EVALUATE_CLOSURE", ICON_NONE, "EvaluateClosure", ""},
8790 {0, nullptr, 0, nullptr, nullptr},
8791};
8792
8794{
8795 StructRNA *srna;
8796 PropertyRNA *prop;
8797
8798 srna = RNA_def_struct(brna, "ViewerPathElem", nullptr);
8799 RNA_def_struct_ui_text(srna, "Viewer Path Element", "Element of a viewer path");
8800 RNA_def_struct_refine_func(srna, "rna_viewer_path_elem_refine");
8801
8802 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
8804 RNA_def_property_ui_text(prop, "Type", "Type of the path element");
8806
8807 prop = RNA_def_property(srna, "ui_name", PROP_STRING, PROP_NONE);
8809 prop, "UI Name", "Name that can be displayed in the UI for this element");
8811}
8812
8814{
8815 StructRNA *srna;
8816 PropertyRNA *prop;
8817
8818 srna = RNA_def_struct(brna, "IDViewerPathElem", "ViewerPathElem");
8819
8820 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8821 RNA_def_property_ui_text(prop, "ID", "");
8822}
8823
8825{
8826 StructRNA *srna;
8827 PropertyRNA *prop;
8828
8829 srna = RNA_def_struct(brna, "ModifierViewerPathElem", "ViewerPathElem");
8830
8831 prop = RNA_def_property(srna, "modifier_uid", PROP_INT, PROP_NONE);
8832 RNA_def_property_ui_text(prop, "Modifier UID", "The persistent UID of the modifier");
8833}
8834
8836{
8837 StructRNA *srna;
8838 PropertyRNA *prop;
8839
8840 srna = RNA_def_struct(brna, "GroupNodeViewerPathElem", "ViewerPathElem");
8841
8842 prop = RNA_def_property(srna, "node_id", PROP_INT, PROP_NONE);
8843 RNA_def_property_ui_text(prop, "Node ID", "");
8844}
8845
8847{
8848 StructRNA *srna;
8849 PropertyRNA *prop;
8850
8851 srna = RNA_def_struct(brna, "SimulationZoneViewerPathElem", "ViewerPathElem");
8852
8853 prop = RNA_def_property(srna, "sim_output_node_id", PROP_INT, PROP_NONE);
8854 RNA_def_property_ui_text(prop, "Simulation Output Node ID", "");
8855}
8856
8858{
8859 StructRNA *srna;
8860 PropertyRNA *prop;
8861
8862 srna = RNA_def_struct(brna, "RepeatZoneViewerPathElem", "ViewerPathElem");
8863
8864 prop = RNA_def_property(srna, "repeat_output_node_id", PROP_INT, PROP_NONE);
8865 RNA_def_property_ui_text(prop, "Repeat Output Node ID", "");
8866}
8867
8869{
8870 StructRNA *srna;
8871 PropertyRNA *prop;
8872
8873 srna = RNA_def_struct(brna, "ForeachGeometryElementZoneViewerPathElem", "ViewerPathElem");
8874
8875 prop = RNA_def_property(srna, "zone_output_node_id", PROP_INT, PROP_NONE);
8876 RNA_def_property_ui_text(prop, "Zone Output Node ID", "");
8877}
8878
8880{
8881 StructRNA *srna;
8882 PropertyRNA *prop;
8883
8884 srna = RNA_def_struct(brna, "EvaluateClosureNodeViewerPathElem", "ViewerPathElem");
8885
8886 prop = RNA_def_property(srna, "evaluate_node_id", PROP_INT, PROP_NONE);
8887 RNA_def_property_ui_text(prop, "Evaluate Node ID", "");
8888
8889 prop = RNA_def_property(srna, "source_output_node_id", PROP_INT, PROP_NONE);
8890 RNA_def_property_ui_text(prop, "Closure Node ID", "");
8891
8892 prop = RNA_def_property(srna, "source_node_tree", PROP_POINTER, PROP_NONE);
8893 RNA_def_property_ui_text(prop, "Source Tree", "");
8894}
8895
8897{
8898 StructRNA *srna;
8899 PropertyRNA *prop;
8900
8901 srna = RNA_def_struct(brna, "ViewerNodeViewerPathElem", "ViewerPathElem");
8902
8903 prop = RNA_def_property(srna, "node_id", PROP_INT, PROP_NONE);
8904 RNA_def_property_ui_text(prop, "Node ID", "");
8905}
8906
8908{
8909 StructRNA *srna;
8910 PropertyRNA *prop;
8911
8921
8922 srna = RNA_def_struct(brna, "ViewerPath", nullptr);
8923 RNA_def_struct_ui_text(srna, "Viewer Path", "Path to data that is viewed");
8924
8925 prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE);
8926 RNA_def_property_struct_type(prop, "ViewerPathElem");
8927 RNA_def_property_ui_text(prop, "Viewer Path", nullptr);
8928}
8929
8931{
8932 PropertyRNA *prop;
8933 StructRNA *srna;
8934
8937
8938 srna = RNA_def_struct(brna, "SpaceSpreadsheet", "Space");
8939 RNA_def_struct_ui_text(srna, "Space Spreadsheet", "Spreadsheet space data");
8940
8942 (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) |
8943 (1 << RGN_TYPE_CHANNELS) | (1 << RGN_TYPE_FOOTER));
8944
8945 prop = RNA_def_property(srna, "is_pinned", PROP_BOOLEAN, PROP_NONE);
8947 RNA_def_property_ui_text(prop, "Is Pinned", "Context path is pinned");
8949
8950 prop = RNA_def_property(srna, "show_internal_attributes", PROP_BOOLEAN, PROP_NONE);
8953 prop,
8954 "Show Internal Attributes",
8955 "Display attributes with names starting with a period that are meant for internal use");
8957
8958 prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
8959 RNA_def_property_boolean_sdna(prop, nullptr, "filter_flag", SPREADSHEET_FILTER_ENABLE);
8960 RNA_def_property_ui_text(prop, "Use Filter", "");
8962
8963 prop = RNA_def_property(srna, "viewer_path", PROP_POINTER, PROP_NONE);
8964 RNA_def_property_pointer_sdna(prop, nullptr, "geometry_id.viewer_path");
8966 prop, "Viewer Path", "Path to the data that is displayed in the spreadsheet");
8967
8968 prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
8971 prop, "Show Only Selected", "Only include rows that correspond to selected elements");
8972 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
8974
8975 prop = RNA_def_property(srna, "geometry_component_type", PROP_ENUM, PROP_NONE);
8976 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.geometry_component_type");
8979 prop, "Geometry Component", "Part of the geometry to display data from");
8982 "rna_SpaceSpreadsheet_geometry_component_type_update");
8983
8984 prop = RNA_def_property(srna, "attribute_domain", PROP_ENUM, PROP_NONE);
8985 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.attribute_domain");
8988 prop, nullptr, nullptr, "rna_SpaceSpreadsheet_attribute_domain_itemf");
8989 RNA_def_property_ui_text(prop, "Attribute Domain", "Attribute domain to display");
8991
8992 prop = RNA_def_property(srna, "object_eval_state", PROP_ENUM, PROP_NONE);
8993 RNA_def_property_enum_sdna(prop, nullptr, "geometry_id.object_eval_state");
8995 RNA_def_property_ui_text(prop, "Object Evaluation State", "");
8997
8998 prop = RNA_def_property(srna, "tables", PROP_COLLECTION, PROP_NONE);
8999 RNA_def_property_struct_type(prop, "SpreadsheetTable");
9000 RNA_def_property_srna(prop, "SpreadsheetTables");
9002 "rna_iterator_SpaceSpreadsheet_tables_begin",
9003 "rna_iterator_array_next",
9004 "rna_iterator_array_end",
9005 "rna_iterator_array_dereference_get",
9006 "rna_iterator_SpaceSpreadsheet_tables_length",
9007 nullptr,
9008 nullptr,
9009 nullptr);
9011 prop, "Tables", "Persistent data for the tables shown in this spreadsheet editor");
9012
9014
9015 prop = RNA_def_property(srna, "row_filters", PROP_COLLECTION, PROP_NONE);
9016 RNA_def_property_collection_sdna(prop, nullptr, "row_filters", nullptr);
9017 RNA_def_property_struct_type(prop, "SpreadsheetRowFilter");
9018 RNA_def_property_ui_text(prop, "Row Filters", "Filters to remove rows from the displayed data");
9020}
9021
9051
9052#endif
Main runtime representation of an asset.
AnimData * BKE_animdata_ensure_id(ID *id)
Definition anim_data.cc:96
bool BKE_animdata_set_action(ReportList *reports, ID *id, bAction *act)
Definition anim_data.cc:124
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)
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)
Key * BKE_key_from_object(Object *ob)
Definition key.cc:1824
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_active_object_get(const ViewLayer *view_layer)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
void id_us_ensure_real(ID *id)
Definition lib_id.cc:308
bool BKE_id_is_in_global_main(ID *id)
Definition lib_id.cc:2480
#define MOVIECLIP_PREVIEW_GRAYSCALE
#define MOVIECLIP_DISABLE_BLUE
#define MOVIECLIP_DISABLE_RED
#define MOVIECLIP_DISABLE_GREEN
void BKE_nla_tweakmode_exit(OwnedAnimData owned_adt)
bool BKE_nla_action_stash(OwnedAnimData owned_adt, bool is_liboverride)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bool BKE_scene_uses_blender_workbench(const Scene *scene)
Definition scene.cc:2827
bool BKE_scene_uses_blender_eevee(const Scene *scene)
Definition scene.cc:2821
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:918
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:840
@ 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:599
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
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)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_TRANSFORM
Definition DNA_ID.h:962
@ ID_RECALC_ANIMATION
Definition DNA_ID.h:985
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:982
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1012
@ ID_TE
@ ID_LA
@ ID_KE
@ ID_SCE
@ ID_WO
@ ID_MA
@ ID_SCR
@ ID_OB
@ ADS_FILTER_SUMMARY
@ 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
@ ADS_FLAG_SUMMARY_COLLAPSED
@ SACTCONT_GPENCIL
@ SACTCONT_ACTION
@ SACTCONT_TIMELINE
@ SACTCONT_DOPESHEET
@ SACTCONT_SHAPEKEY
@ SACTCONT_MASK
@ SACTCONT_CACHEFILE
@ 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
@ 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_DRAWFLAG_SPLINE
@ MASK_DRAWFLAG_OVERLAY
@ MASK_OVERLAY_COMBINED
@ MASK_OVERLAY_ALPHACHANNEL
@ NTREE_GEOMETRY
@ GEO_NODE_ASSET_MODIFIER
@ GEO_NODE_ASSET_TOOL
@ 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
@ SCE_VIEWS_FORMAT_MULTIVIEW
@ STEREO_LEFT_ID
@ STEREO_RIGHT_ID
@ RGN_FLAG_HIDDEN
@ RGN_FLAG_HIDDEN_BY_USER
@ 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_ALIGN_NONE
@ RGN_ALIGN_QSPLIT
@ 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
@ SNODE_INSERTOFS_DIR_RIGHT
@ SNODE_INSERTOFS_DIR_LEFT
@ 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
@ 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
@ 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
@ SI_GIZMO_HIDE
@ SI_GIZMO_HIDE_NAVIGATE
@ 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
@ FILE_ASSET_IMPORT_APPEND_REUSE
@ 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
@ 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
@ SNODE_GIZMO_HIDE_ACTIVE_NODE
@ SNODE_GIZMO_HIDE
@ 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
@ 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
@ SCLIP_GIZMO_HIDE
@ SCLIP_GIZMO_HIDE_NAVIGATE
@ SEQ_DRAW_IMG_VECTORSCOPE
@ SEQ_DRAW_IMG_RGBPARADE
@ SEQ_DRAW_IMG_HISTOGRAM
@ SEQ_DRAW_IMG_IMBUF
@ SEQ_DRAW_IMG_WAVEFORM
@ 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
@ 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
@ SEQ_GIZMO_HIDE
@ SEQ_GIZMO_HIDE_NAVIGATE
@ SEQ_GIZMO_HIDE_CONTEXT
@ SEQ_GIZMO_HIDE_TOOL
@ SPREADSHEET_FLAG_SHOW_INTERNAL_ATTRIBUTES
@ SPREADSHEET_FLAG_PINNED
eSpaceButtons_Context
@ 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_TEXTURE
@ BCONTEXT_TOOL
@ BCONTEXT_PARTICLE
#define UI_SCALE_FAC
@ USER_SEQ_PROXY_SETUP_AUTOMATIC
#define UUID_STRING_SIZE
@ V2D_ALIGN_NO_NEG_Y
@ V2D_VIEWSYNC_SCREEN_TIME
@ 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
#define RV3D_VIEW_IS_AXIS(view)
@ V3D_DEBUG_FREEZE_CULLING
@ RV3D_CAMOB
@ RV3D_PERSP
@ RV3D_ORTHO
@ V3D_GIZMO_SHOW_CAMERA_DOF_DIST
@ V3D_GIZMO_SHOW_CAMERA_LENS
#define RV3D_CAMZOOM_MAX
@ V3D_OVERLAY_PAINT_WIRE
@ V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD
@ V3D_GIZMO_SHOW_EMPTY_IMAGE
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CURSOR
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_OVERLAY_WPAINT_CONTOURS
@ V3D_LOCAL_COLLECTIONS
@ V3D_DRAW_CENTERS
@ V3D_SELECT_OUTLINE
@ V3D_XR_SESSION_MIRROR
@ V3D_HIDE_HELPLINES
@ 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_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
@ RV3D_LOCK_ROTATION
@ RV3D_BOXVIEW
@ RV3D_BOXCLIP
@ V3D_SHADING_CAVITY_BOTH
@ V3D_SHADING_CAVITY_SSAO
@ V3D_SHADING_CAVITY_CURVATURE
@ RV3D_VIEW_USER
@ 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_GIZMO_SHOW_OBJECT_ROTATE
@ V3D_GIZMO_SHOW_OBJECT_SCALE
@ V3D_GIZMO_SHOW_OBJECT_TRANSLATE
@ V3D_S3D_DISPCAMERAS
@ V3D_S3D_DISPPLANE
@ V3D_S3D_DISPVOLUME
@ V3D_GIZMO_SHOW_LIGHT_LOOK_AT
@ V3D_GIZMO_SHOW_LIGHT_SIZE
@ V3D_GIZMO_HIDE_TOOL
@ V3D_GIZMO_HIDE_MODIFIER
@ V3D_GIZMO_HIDE
@ V3D_GIZMO_HIDE_NAVIGATE
@ V3D_GIZMO_HIDE_CONTEXT
#define RV3D_CAMZOOM_MIN
@ RV3D_CLIPPING
@ CURVE_HANDLE_NONE
@ CURVE_HANDLE_ALL
@ CURVE_HANDLE_SELECTED
@ 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_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_SHOW_FLOOR
@ V3D_SHOW_Z
@ V3D_SHOW_X
@ V3D_SHOW_Y
@ V3D_SHOW_ORTHO_GRID
@ 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:1348
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:382
void ED_file_change_dir_ex(bContext *C, ScrArea *area)
Definition filesel.cc:1157
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:400
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:405
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)
void ED_node_set_tree_type(SpaceNode *snode, blender::bke::bNodeTreeType *typeinfo)
Definition node_edit.cc:538
void ED_node_tree_start(ARegion *region, SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from)
Definition space_node.cc:76
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:568
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:714
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:859
void ED_region_toggle_hidden(bContext *C, ARegion *region)
Definition area.cc:2377
void ED_region_visibility_change_update(bContext *C, ScrArea *area, ARegion *region)
Definition area.cc:2355
void ED_region_visibility_change_update_animated(bContext *C, ScrArea *area, ARegion *region)
void ED_area_tag_refresh(ScrArea *area)
Definition area.cc:743
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:639
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:26
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:510
@ PARM_RNAPTR
Definition RNA_types.hh:513
@ PARM_REQUIRED
Definition RNA_types.hh:511
@ FUNC_USE_CONTEXT
Definition RNA_types.hh:804
@ PROP_FLOAT
Definition RNA_types.hh:152
@ PROP_BOOLEAN
Definition RNA_types.hh:150
@ PROP_ENUM
Definition RNA_types.hh:154
@ PROP_INT
Definition RNA_types.hh:151
@ PROP_STRING
Definition RNA_types.hh:153
@ PROP_POINTER
Definition RNA_types.hh:155
@ PROP_COLLECTION
Definition RNA_types.hh:156
@ PROP_UNIT_CAMERA
Definition RNA_types.hh:171
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:212
PropertyFlag
Definition RNA_types.hh:286
@ PROP_DYNAMIC
Definition RNA_types.hh:402
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:381
@ PROP_ANIMATABLE
Definition RNA_types.hh:305
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:358
@ PROP_EDITABLE
Definition RNA_types.hh:292
@ PROP_ENUM_NO_CONTEXT
Definition RNA_types.hh:404
@ PROP_NEVER_NULL
Definition RNA_types.hh:351
@ PROP_TEXTEDIT_UPDATE
Definition RNA_types.hh:312
@ PROP_HIDDEN
Definition RNA_types.hh:324
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:338
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition RNA_types.hh:639
@ PROP_MATRIX
Definition RNA_types.hh:253
@ PROP_XYZ
Definition RNA_types.hh:257
@ PROP_DISTANCE
Definition RNA_types.hh:244
@ PROP_BYTESTRING
Definition RNA_types.hh:228
@ PROP_FILENAME
Definition RNA_types.hh:226
@ PROP_COLOR
Definition RNA_types.hh:248
@ PROP_PIXEL
Definition RNA_types.hh:236
@ PROP_ANGLE
Definition RNA_types.hh:240
@ PROP_NONE
Definition RNA_types.hh:221
@ PROP_PERCENTAGE
Definition RNA_types.hh:238
@ PROP_FACTOR
Definition RNA_types.hh:239
@ PROP_TRANSLATION
Definition RNA_types.hh:249
@ PROP_UNSIGNED
Definition RNA_types.hh:237
@ PROP_QUATERNION
Definition RNA_types.hh:255
@ PROP_FILEPATH
Definition RNA_types.hh:224
#define C
Definition RandGen.cpp:29
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:1667
#define ND_SEQUENCER
Definition WM_types.hh:434
#define NC_WORLD
Definition WM_types.hh:384
#define ND_SHADING
Definition WM_types.hh:474
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:532
#define NC_WINDOW
Definition WM_types.hh:372
#define NC_NODE
Definition WM_types.hh:391
#define NC_GEOM
Definition WM_types.hh:390
#define ND_DATA
Definition WM_types.hh:506
#define ND_SPACE_DOPESHEET
Definition WM_types.hh:530
#define NC_ANIMATION
Definition WM_types.hh:385
#define ND_SPACE_NLA
Definition WM_types.hh:531
#define ND_SPACE_NODE
Definition WM_types.hh:523
#define ND_DISPLAY
Definition WM_types.hh:488
#define NC_MOVIECLIP
Definition WM_types.hh:394
#define ND_SPACE_PROPERTIES
Definition WM_types.hh:526
#define NC_SCENE
Definition WM_types.hh:375
#define ND_SPACE_NODE_VIEW
Definition WM_types.hh:533
#define ND_NODES
Definition WM_types.hh:433
#define ND_TOOLSETTINGS
Definition WM_types.hh:446
#define ND_SPACE_IMAGE
Definition WM_types.hh:519
#define NA_EDITED
Definition WM_types.hh:581
#define ND_SPACE_GRAPH
Definition WM_types.hh:529
#define NC_TEXT
Definition WM_types.hh:383
#define NC_MATERIAL
Definition WM_types.hh:377
#define NC_LAMP
Definition WM_types.hh:379
#define NC_IMAGE
Definition WM_types.hh:381
#define ND_SPACE_CLIP
Definition WM_types.hh:536
#define ND_SPACE_INFO_REPORT
Definition WM_types.hh:517
#define ND_SPACE_TIME
Definition WM_types.hh:528
#define NC_TEXTURE
Definition WM_types.hh:378
#define ND_SPACE_TEXT
Definition WM_types.hh:527
#define ND_SPACE_SPREADSHEET
Definition WM_types.hh:538
#define ND_SPACE_VIEW3D
Definition WM_types.hh:525
#define ND_KEYFRAME
Definition WM_types.hh:491
#define NS_VIEW3D_SHADING
Definition WM_types.hh:574
#define ND_SPACE_CONSOLE
Definition WM_types.hh:516
#define ND_SPACE_FILE_PARAMS
Definition WM_types.hh:520
#define NC_SPACE
Definition WM_types.hh:389
#define ND_SPACE_OUTLINER
Definition WM_types.hh:524
#define ND_SPACE_FILE_LIST
Definition WM_types.hh:521
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
#define offsetof(t, d)
#define main()
#define printf(...)
constexpr T clamp(T, U, U) RET
float length(VecOp< float, D >) RET
#define FILTER_ID_GD_LEGACY
#define FILTER_ID_OB
#define FILTER_ID_MC
#define FILTER_ID_SPK
#define FILTER_ID_CF
#define FILTER_ID_AC
#define FILTER_ID_MA
#define FILTER_ID_CA
#define FILTER_ID_SO
#define FILTER_ID_PT
#define FILTER_ID_CU_LEGACY
#define FILTER_ID_BR
#define FILTER_ID_WS
#define FILTER_ID_MB
#define FILTER_ID_VF
#define FILTER_ID_LA
#define FILTER_ID_GR
#define FILTER_ID_TE
#define FILTER_ID_LT
#define FILTER_ID_LS
#define FILTER_ID_PA
#define FILTER_ID_CV
#define FILTER_ID_ME
#define FILTER_ID_AR
#define FILTER_ID_MSK
#define INDEX_ID_MAX
#define FILTER_ID_PC
#define MAX_NAME
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define FILTER_ID_PAL
#define FILTER_ID_IM
#define FILTER_ID_SCE
#define GS(a)
#define FILTER_ID_LP
#define FILTER_ID_VO
#define FILTER_ID_WO
#define FILTER_ID_NT
#define FILTER_ID_TXT
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:169
ID * get_current_id(const SpaceSpreadsheet *sspreadsheet)
SpreadsheetTable * get_active_table(SpaceSpreadsheet &sspreadsheet)
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:272
int rendersize_to_proxysize(int render_size)
Definition proxy.cc:72
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:426
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:420
wmJob * ED_seq_proxy_wm_job_get(const bContext *C)
Definition proxy_job.cc:87
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)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
const PointerRNA PointerRNA_NULL
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, 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:723
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_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_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_struct_idprops_func(StructRNA *srna, const char *idproperties)
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_DEFAULT_items[]
Definition rna_rna.cc:32
const EnumPropertyItem rna_enum_transform_pivot_full_items[]
Definition rna_scene.cc:561
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:411
#define SACT_ITEM_MASK
Definition rna_space.cc:217
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:72
static const EnumPropertyItem rna_enum_view3dshading_render_pass_type_items[]
Definition rna_space.cc:448
static const EnumPropertyItem spreadsheet_table_id_type_items[]
Definition rna_space.cc:570
static const EnumPropertyItem stereo3d_camera_items[]
Definition rna_space.cc:318
static void rna_def_space_node_path_api(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem rna_enum_studio_light_items[]
Definition rna_space.cc:443
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:387
const EnumPropertyItem rna_enum_space_sequencer_view_type_items[]
Definition rna_space.cc:177
#define SI_ITEM_MASK
Definition rna_space.cc:280
static void rna_def_spreadsheet_column(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_shading_wire_color_type_items[]
Definition rna_space.cc:432
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 void rna_def_modifier_viewer_path_elem(BlenderRNA *brna)
#define SACT_ITEM_CACHEFILE
Definition rna_space.cc:221
static void rna_def_fileselect_params(BlenderRNA *brna)
#define DEF_SHOW_REGION_PROPERTY(identifier, label, description)
#define SACT_ITEM_SHAPEKEY
Definition rna_space.cc:207
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:516
#define SI_ITEM_VIEW(identifier, name, icon)
Definition rna_space.cc:268
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:194
static void rna_def_filemenu_entry(BlenderRNA *brna)
static EnumPropertyItem rna_enum_space_action_ui_mode_items[]
Definition rna_space.cc:240
static const EnumPropertyItem rna_enum_shading_color_type_items[]
Definition rna_space.cc:418
static void rna_def_space_properties_filter(StructRNA *srna)
#define SI_ITEM_PAINT
Definition rna_space.cc:276
static void rna_def_space_sequencer_timeline_overlay(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_image_mode_items[]
Definition rna_space.cc:300
static const EnumPropertyItem rna_enum_space_image_mode_ui_items[]
Definition rna_space.cc:293
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:361
const EnumPropertyItem buttons_context_items[]
Definition rna_space.cc:486
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:551
static const EnumPropertyItem rna_enum_curve_display_handle_items[]
Definition rna_space.cc:544
static void rna_def_id_viewer_path_elem(BlenderRNA *brna)
#define SACT_ITEM_ACTION
Definition rna_space.cc:202
const EnumPropertyItem rna_enum_space_file_browse_mode_items[]
Definition rna_space.cc:188
const EnumPropertyItem rna_enum_clip_editor_mode_items[]
Definition rna_space.cc:478
#define SACT_ITEM_GPENCIL
Definition rna_space.cc:212
#define SACT_ITEM_TIMELINE
Definition rna_space.cc:198
#define V3D_S3D_CAMERA_LEFT
Definition rna_space.cc:311
static EnumPropertyItem rna_enum_space_action_mode_all_items[]
Definition rna_space.cc:230
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:43
const EnumPropertyItem rna_enum_space_image_mode_all_items[]
Definition rna_space.cc:285
static void rna_def_spreadsheet_column_id(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_graph_mode_items[]
Definition rna_space.cc:167
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:529
#define V3D_S3D_CAMERA_RIGHT
Definition rna_space.cc:312
static void rna_def_evaluate_closure_node_viewer_path_elem(BlenderRNA *brna)
const EnumPropertyItem rna_enum_fileselect_params_sort_items[]
Definition rna_space.cc:337
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)
#define SI_ITEM_UV
Definition rna_space.cc:272
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:368
#define V3D_S3D_CAMERA_S3D
Definition rna_space.cc:313
static void rna_def_space_node(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_action_mode_items[]
Definition rna_space.cc:254
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
bAction * action
The meta-data of an asset. By creating and giving this for a data-block (ID.asset_data),...
ListBaseIterator listbase
Definition RNA_types.hh:572
union CollectionPropertyIterator::@277172262001176145116102322066145204253046376362 internal
const char * identifier
Definition RNA_types.hh:623
const char * name
Definition RNA_types.hh:627
const char * description
Definition RNA_types.hh:629
AssetRepresentationHandle * asset
const char * name
Definition DNA_ID.h:404
int us
Definition DNA_ID.h:425
char name[66]
Definition DNA_ID.h:415
struct RenderResult * rr
struct AnimData * adt
IteratorSkipFunc skip
Definition RNA_types.hh:534
void * last
void * first
ListBase wm
Definition BKE_main.hh:276
ListBase objects
Definition BKE_main.hh:247
struct AnimData * adt
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:104
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 geometry_nodes_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:495
Depsgraph * depsgraph
Definition SEQ_proxy.hh:45
i
Definition text_draw.cc:230
max
Definition text_draw.cc:251
uint len
#define N_(msgid)
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4226
bool WM_jobs_is_running(const wmJob *wm_job)
Definition wm_jobs.cc:318
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition wm_jobs.cc:456
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:139
bool WM_xr_session_exists(const wmXrData *xr)