Blender V4.3
rna_space.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdlib>
10#include <cstring>
11
12#include "MEM_guardedalloc.h"
13
14#include "BLT_translation.hh"
15
16#include "BKE_attribute.hh"
17#include "BKE_context.hh"
18#include "BKE_geometry_set.hh"
19#include "BKE_image.hh"
20#include "BKE_key.hh"
21#include "BKE_movieclip.h"
22#include "BKE_node.hh"
23#include "BKE_studiolight.h"
24#include "BKE_viewer_path.hh"
25
26#include "ED_asset.hh"
27#include "ED_spreadsheet.hh"
28#include "ED_text.hh"
29
30#include "BLI_listbase.h"
31#include "BLI_math_matrix.h"
32#include "BLI_math_rotation.h"
33#include "BLI_math_vector.h"
34#include "BLI_string.h"
35#include "BLI_sys_types.h"
36#include "BLI_uuid.h"
37
38#include "DNA_action_types.h"
40#include "DNA_key_types.h"
41#include "DNA_mask_types.h"
42#include "DNA_material_types.h"
43#include "DNA_node_types.h"
44#include "DNA_object_types.h"
45#include "DNA_sequence_types.h"
46#include "DNA_space_types.h"
47#include "DNA_view3d_types.h"
48#include "DNA_workspace_types.h"
49
50#include "RNA_access.hh"
51#include "RNA_define.hh"
52
53#include "rna_internal.hh"
54
55#include "SEQ_proxy.hh"
56#include "SEQ_relations.hh"
57#include "SEQ_sequencer.hh"
59
60#include "WM_api.hh"
61#include "WM_types.hh"
62
63#include "RE_engine.h"
64#include "RE_pipeline.h"
65
66#include "RNA_enum_types.hh"
67
70 "MESH",
71 ICON_MESH_DATA,
72 "Mesh",
73 "Mesh component containing point, corner, edge and face data"},
75 "POINTCLOUD",
76 ICON_POINTCLOUD_DATA,
77 "Point Cloud",
78 "Point cloud component containing only point data"},
80 "CURVE",
81 ICON_CURVE_DATA,
82 "Curve",
83 "Curve component containing spline and control point data"},
85 "INSTANCES",
86 ICON_EMPTY_AXIS,
87 "Instances",
88 "Instances of objects or collections"},
90 "GREASEPENCIL",
91 ICON_GREASEPENCIL,
92 "Grease Pencil",
93 "Grease Pencil component containing layers and curves data"},
94 {0, nullptr, 0, nullptr, nullptr},
95};
96
98 /* empty must be here for python, is skipped for UI */
99 {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""},
100
101 /* General. */
102 RNA_ENUM_ITEM_HEADING(N_("General"), nullptr),
104 "VIEW_3D",
105 ICON_VIEW3D,
106 "3D Viewport",
107 "Manipulate objects in a 3D environment"},
109 "IMAGE_EDITOR",
110 ICON_IMAGE,
111 "UV/Image Editor",
112 "View and edit images and UV Maps"},
113 {SPACE_NODE,
114 "NODE_EDITOR",
115 ICON_NODETREE,
116 "Node Editor",
117 "Editor for node-based shading and compositing tools"},
118 {SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequencer", "Video editing tools"},
119 {SPACE_CLIP, "CLIP_EDITOR", ICON_TRACKER, "Movie Clip Editor", "Motion tracking tools"},
120
121 /* Animation. */
122 RNA_ENUM_ITEM_HEADING(N_("Animation"), nullptr),
123#if 0
125 "TIMELINE",
126 ICON_TIME,
127 "Timeline",
128 "Timeline and playback controls (NOTE: Switch to 'Timeline' mode)"}, /* XXX */
129#endif
130 {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", "Adjust timing of keyframes"},
132 "GRAPH_EDITOR",
133 ICON_GRAPH,
134 "Graph Editor",
135 "Edit drivers and keyframe interpolation"},
136 {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", "Combine and layer Actions"},
137
138 /* Scripting. */
139 RNA_ENUM_ITEM_HEADING(N_("Scripting"), nullptr),
140 {SPACE_TEXT,
141 "TEXT_EDITOR",
142 ICON_TEXT,
143 "Text Editor",
144 "Edit scripts and in-file documentation"},
146 "CONSOLE",
147 ICON_CONSOLE,
148 "Python Console",
149 "Interactive programmatic console for "
150 "advanced editing and script development"},
151 {SPACE_INFO, "INFO", ICON_INFO, "Info", "Log of operations, warnings and error messages"},
152 /* Special case: Top-bar and Status-bar aren't supposed to be a regular editor for the user. */
154 "TOPBAR",
155 ICON_NONE,
156 "Top Bar",
157 "Global bar at the top of the screen for "
158 "global per-window settings"},
160 "STATUSBAR",
161 ICON_NONE,
162 "Status Bar",
163 "Global bar at the bottom of the "
164 "screen for general status information"},
165
166 /* Data. */
167 RNA_ENUM_ITEM_HEADING(N_("Data"), nullptr),
169 "OUTLINER",
170 ICON_OUTLINER,
171 "Outliner",
172 "Overview of scene graph and all available data-blocks"},
174 "PROPERTIES",
175 ICON_PROPERTIES,
176 "Properties",
177 "Edit properties of active object and related data-blocks"},
178 {SPACE_FILE, "FILE_BROWSER", ICON_FILEBROWSER, "File Browser", "Browse for files and assets"},
180 "SPREADSHEET",
181 ICON_SPREADSHEET,
182 "Spreadsheet",
183 "Explore geometry data in a table"},
185 "PREFERENCES",
186 ICON_PREFERENCES,
187 "Preferences",
188 "Edit persistent configuration settings"},
189 {0, nullptr, 0, nullptr, nullptr},
190};
191
194 "FCURVES",
195 ICON_GRAPH,
196 "Graph Editor",
197 "Edit animation/keyframes displayed as 2D curves"},
198 {SIPO_MODE_DRIVERS, "DRIVERS", ICON_DRIVER, "Drivers", "Edit drivers"},
199 {0, nullptr, 0, nullptr, nullptr},
200};
201
203 {SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
204 {SEQ_VIEW_PREVIEW, "PREVIEW", ICON_SEQ_PREVIEW, "Preview", ""},
206 "SEQUENCER_PREVIEW",
207 ICON_SEQ_SPLITVIEW,
208 "Sequencer & Preview",
209 ""},
210 {0, nullptr, 0, nullptr, nullptr},
211};
212
214 {FILE_BROWSE_MODE_FILES, "FILES", ICON_FILEBROWSER, "File Browser", ""},
215 {FILE_BROWSE_MODE_ASSETS, "ASSETS", ICON_ASSET_MANAGER, "Asset Browser", ""},
216 {0, nullptr, 0, nullptr, nullptr},
217};
218
219#define SACT_ITEM_DOPESHEET \
220 { \
221 SACTCONT_DOPESHEET, "DOPESHEET", ICON_ACTION, "Dope Sheet", "Edit all keyframes in scene" \
222 }
223#define SACT_ITEM_TIMELINE \
224 { \
225 SACTCONT_TIMELINE, "TIMELINE", ICON_TIME, "Timeline", "Timeline and playback controls" \
226 }
227#define SACT_ITEM_ACTION \
228 { \
229 SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, "Action Editor", \
230 "Edit keyframes in active object's Object-level action" \
231 }
232#define SACT_ITEM_SHAPEKEY \
233 { \
234 SACTCONT_SHAPEKEY, "SHAPEKEY", ICON_SHAPEKEY_DATA, "Shape Key Editor", \
235 "Edit keyframes in active object's Shape Keys action" \
236 }
237#define SACT_ITEM_GPENCIL \
238 { \
239 SACTCONT_GPENCIL, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", \
240 "Edit timings for all Grease Pencil sketches in file" \
241 }
242#define SACT_ITEM_MASK \
243 { \
244 SACTCONT_MASK, "MASK", ICON_MOD_MASK, "Mask", "Edit timings for Mask Editor splines" \
245 }
246#define SACT_ITEM_CACHEFILE \
247 { \
248 SACTCONT_CACHEFILE, "CACHEFILE", ICON_FILE, "Cache File", \
249 "Edit timings for Cache File data-blocks" \
250 }
251
252#ifndef RNA_RUNTIME
253/* XXX: action-editor is currently for object-level only actions,
254 * so show that using object-icon hint */
267 /* SACT_ITEM_TIMELINE, */
273 {0, nullptr, 0, nullptr, nullptr},
274};
275#endif
276
277/* Expose as `ui_mode`. */
278
282 {0, nullptr, 0, nullptr, nullptr},
283};
284
285#undef SACT_ITEM_DOPESHEET
286#undef SACT_ITEM_TIMELINE
287#undef SACT_ITEM_ACTION
288#undef SACT_ITEM_SHAPEKEY
289#undef SACT_ITEM_GPENCIL
290#undef SACT_ITEM_MASK
291#undef SACT_ITEM_CACHEFILE
292
293#define SI_ITEM_VIEW(identifier, name, icon) \
294 { \
295 SI_MODE_VIEW, identifier, icon, name, "View the image" \
296 }
297#define SI_ITEM_UV \
298 { \
299 SI_MODE_UV, "UV", ICON_UV, "UV Editor", "UV edit in mesh editmode" \
300 }
301#define SI_ITEM_PAINT \
302 { \
303 SI_MODE_PAINT, "PAINT", ICON_TPAINT_HLT, "Paint", "2D image painting mode" \
304 }
305#define SI_ITEM_MASK \
306 { \
307 SI_MODE_MASK, "MASK", ICON_MOD_MASK, "Mask", "Mask editing" \
308 }
309
311 SI_ITEM_VIEW("VIEW", "View", ICON_FILE_IMAGE),
315 {0, nullptr, 0, nullptr, nullptr},
316};
317
319 SI_ITEM_VIEW("VIEW", "View", ICON_FILE_IMAGE),
322 {0, nullptr, 0, nullptr, nullptr},
323};
324
326 SI_ITEM_VIEW("IMAGE_EDITOR", "Image Editor", ICON_IMAGE),
328 {0, nullptr, 0, nullptr, nullptr},
329};
330
331#undef SI_ITEM_VIEW
332#undef SI_ITEM_UV
333#undef SI_ITEM_PAINT
334#undef SI_ITEM_MASK
335
336#define V3D_S3D_CAMERA_LEFT {STEREO_LEFT_ID, "LEFT", ICON_RESTRICT_RENDER_OFF, "Left", ""},
337#define V3D_S3D_CAMERA_RIGHT {STEREO_RIGHT_ID, "RIGHT", ICON_RESTRICT_RENDER_OFF, "Right", ""},
338#define V3D_S3D_CAMERA_S3D {STEREO_3D_ID, "S3D", ICON_CAMERA_STEREO, "3D", ""},
339#ifdef RNA_RUNTIME
340# define V3D_S3D_CAMERA_VIEWS {STEREO_MONO_ID, "MONO", ICON_RESTRICT_RENDER_OFF, "Views", ""},
341#endif
342
344 V3D_S3D_CAMERA_LEFT V3D_S3D_CAMERA_RIGHT V3D_S3D_CAMERA_S3D{0, nullptr, 0, nullptr, nullptr},
345};
346
347#ifdef RNA_RUNTIME
348static const EnumPropertyItem multiview_camera_items[] = {
349 V3D_S3D_CAMERA_VIEWS V3D_S3D_CAMERA_S3D{0, nullptr, 0, nullptr, nullptr},
350};
351#endif
352
353#undef V3D_S3D_CAMERA_LEFT
354#undef V3D_S3D_CAMERA_RIGHT
355#undef V3D_S3D_CAMERA_S3D
356#undef V3D_S3D_CAMERA_VIEWS
357
359 {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_NONE, "Name", "Sort the file list alphabetically"},
361 "FILE_SORT_EXTENSION",
362 ICON_NONE,
363 "Extension",
364 "Sort the file list by extension/type"},
366 "FILE_SORT_TIME",
367 ICON_NONE,
368 "Modified Date",
369 "Sort files by modification time"},
370 {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_NONE, "Size", "Sort files by size"},
371 {0, nullptr, 0, nullptr, nullptr},
372};
373
374#ifndef RNA_RUNTIME
376 {STEREO_LEFT_ID, "LEFT_EYE", ICON_NONE, "Left Eye"},
377 {STEREO_RIGHT_ID, "RIGHT_EYE", ICON_NONE, "Right Eye"},
378 {0, nullptr, 0, nullptr, nullptr},
379};
380#endif
381
384 "COLOR_ALPHA",
385 ICON_IMAGE_RGB_ALPHA,
386 "Color & Alpha",
387 "Display image with RGB colors and alpha transparency"},
388 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
389 {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Display alpha transparency channel"},
391 "Z_BUFFER",
392 ICON_IMAGE_ZDEPTH,
393 "Z-Buffer",
394 "Display Z-buffer associated with image (mapped from camera clip start to end)"},
395 {SI_SHOW_R, "RED", ICON_COLOR_RED, "Red", ""},
396 {SI_SHOW_G, "GREEN", ICON_COLOR_GREEN, "Green", ""},
397 {SI_SHOW_B, "BLUE", ICON_COLOR_BLUE, "Blue", ""},
398 {0, nullptr, 0, nullptr, nullptr},
399};
400
402 {OB_WIRE, "WIREFRAME", ICON_SHADING_WIRE, "Wireframe", "Display the object as wire edges"},
403 {OB_SOLID, "SOLID", ICON_SHADING_SOLID, "Solid", "Display in solid mode"},
405 "MATERIAL",
406 ICON_SHADING_TEXTURE,
407 "Material Preview",
408 "Display in Material Preview mode"},
409 {OB_RENDER, "RENDERED", ICON_SHADING_RENDERED, "Rendered", "Display render preview"},
410 {0, nullptr, 0, nullptr, nullptr},
411};
412
414 {V3D_LIGHTING_STUDIO, "STUDIO", 0, "Studio", "Display using studio lighting"},
415 {V3D_LIGHTING_MATCAP, "MATCAP", 0, "MatCap", "Display using matcap material and lighting"},
416 {V3D_LIGHTING_FLAT, "FLAT", 0, "Flat", "Display using flat lighting"},
417 {0, nullptr, 0, nullptr, nullptr},
418};
419
421 {V3D_SHADING_MATERIAL_COLOR, "MATERIAL", 0, "Material", "Show material color"},
422 {V3D_SHADING_SINGLE_COLOR, "SINGLE", 0, "Single", "Show scene in a single color"},
423 {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color"},
424 {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color"},
425 {V3D_SHADING_VERTEX_COLOR, "VERTEX", 0, "Attribute", "Show active color attribute"},
427 "TEXTURE",
428 0,
429 "Texture",
430 "Show the texture from the active image texture node using the active UV map coordinates"},
431 {0, nullptr, 0, nullptr, nullptr},
432};
433
436 "THEME",
437 0,
438 "Theme",
439 "Show scene wireframes with the theme's wire color"},
440 {V3D_SHADING_OBJECT_COLOR, "OBJECT", 0, "Object", "Show object color on wireframe"},
441 {V3D_SHADING_RANDOM_COLOR, "RANDOM", 0, "Random", "Show random object color on wireframe"},
442 {0, nullptr, 0, nullptr, nullptr},
443};
444
446 {0, "DEFAULT", 0, "Default", ""},
447 {0, nullptr, 0, nullptr, nullptr},
448};
449
451 RNA_ENUM_ITEM_HEADING(N_("General"), nullptr),
452 {EEVEE_RENDER_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
453 {EEVEE_RENDER_PASS_EMIT, "EMISSION", 0, "Emission", ""},
454 {EEVEE_RENDER_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
455 {EEVEE_RENDER_PASS_AO, "AO", 0, "Ambient Occlusion", ""},
456 {EEVEE_RENDER_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
457 {EEVEE_RENDER_PASS_TRANSPARENT, "TRANSPARENT", 0, "Transparent", ""},
458
459 RNA_ENUM_ITEM_HEADING(N_("Light"), nullptr),
460 {EEVEE_RENDER_PASS_DIFFUSE_LIGHT, "DIFFUSE_LIGHT", 0, "Diffuse Light", ""},
461 {EEVEE_RENDER_PASS_DIFFUSE_COLOR, "DIFFUSE_COLOR", 0, "Diffuse Color", ""},
462 {EEVEE_RENDER_PASS_SPECULAR_LIGHT, "SPECULAR_LIGHT", 0, "Specular Light", ""},
463 {EEVEE_RENDER_PASS_SPECULAR_COLOR, "SPECULAR_COLOR", 0, "Specular Color", ""},
464 {EEVEE_RENDER_PASS_VOLUME_LIGHT, "VOLUME_LIGHT", 0, "Volume Light", ""},
465
466 RNA_ENUM_ITEM_HEADING(N_("Data"), nullptr),
467 {EEVEE_RENDER_PASS_POSITION, "POSITION", 0, "Position", ""},
468 {EEVEE_RENDER_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
469 {EEVEE_RENDER_PASS_MIST, "MIST", 0, "Mist", ""},
470 {EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT, "CryptoObject", 0, "CryptoObject", ""},
471 {EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET, "CryptoAsset", 0, "CryptoAsset", ""},
472 {EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL, "CryptoMaterial", 0, "CryptoMaterial", ""},
473
474 RNA_ENUM_ITEM_HEADING(N_("Shader AOV"), nullptr),
475 {EEVEE_RENDER_PASS_AOV, "AOV", 0, "AOV", ""},
476
477 {0, nullptr, 0, nullptr, nullptr},
478};
479
481 {SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"},
482 {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"},
483 {0, nullptr, 0, nullptr, nullptr},
484};
485
486/* Actually populated dynamically through a function,
487 * but helps for context-less access (e.g. doc, i18n...). */
489 {BCONTEXT_TOOL, "TOOL", ICON_TOOL_SETTINGS, "Tool", "Active Tool and Workspace settings"},
490 {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene Properties"},
491 {BCONTEXT_RENDER, "RENDER", ICON_SCENE, "Render", "Render Properties"},
492 {BCONTEXT_OUTPUT, "OUTPUT", ICON_OUTPUT, "Output", "Output Properties"},
493 {BCONTEXT_VIEW_LAYER, "VIEW_LAYER", ICON_RENDER_RESULT, "View Layer", "View Layer Properties"},
494 {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World Properties"},
495 {BCONTEXT_COLLECTION, "COLLECTION", ICON_GROUP, "Collection", "Collection Properties"},
496 {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object Properties"},
498 "CONSTRAINT",
499 ICON_CONSTRAINT,
500 "Constraints",
501 "Object Constraint Properties"},
502 {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifiers", "Modifier Properties"},
503 {BCONTEXT_DATA, "DATA", ICON_NONE, "Data", "Object Data Properties"},
504 {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone Properties"},
506 "BONE_CONSTRAINT",
507 ICON_CONSTRAINT_BONE,
508 "Bone Constraints",
509 "Bone Constraint Properties"},
510 {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material Properties"},
511 {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture Properties"},
512 {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle Properties"},
513 {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics Properties"},
514 {BCONTEXT_SHADERFX, "SHADERFX", ICON_SHADERFX, "Effects", "Visual Effects Properties"},
515 {0, nullptr, 0, nullptr, nullptr},
516};
517
519 {0, "NONE", 0, "None", "Only list current directory's content, with no recursion"},
520 {1, "BLEND", 0, "Blend File", "List .blend files' content"},
521 {2, "ALL_1", 0, "One Level", "List all sub-directories' content, one level of recursion"},
522 {3, "ALL_2", 0, "Two Levels", "List all sub-directories' content, two levels of recursion"},
523 {4,
524 "ALL_3",
525 0,
526 "Three Levels",
527 "List all sub-directories' content, three levels of recursion"},
528 {0, nullptr, 0, nullptr, nullptr},
529};
530
532 {CURVE_HANDLE_NONE, "NONE", 0, "None", ""},
533 {CURVE_HANDLE_SELECTED, "SELECTED", 0, "Selected", ""},
534 {CURVE_HANDLE_ALL, "ALL", 0, "All", ""},
535 {0, nullptr, 0, nullptr, nullptr},
536};
537
538#ifdef RNA_RUNTIME
539
540# include <algorithm>
541# include <fmt/format.h>
542
544
545# include "DNA_anim_types.h"
546# include "DNA_asset_types.h"
547# include "DNA_scene_types.h"
548# include "DNA_screen_types.h"
549# include "DNA_userdef_types.h"
550
551# include "BLI_path_utils.hh"
552# include "BLI_string.h"
553
554# include "BKE_anim_data.hh"
555# include "BKE_brush.hh"
556# include "BKE_context.hh"
557# include "BKE_global.hh"
558# include "BKE_icons.h"
559# include "BKE_idprop.hh"
560# include "BKE_layer.hh"
561# include "BKE_nla.hh"
562# include "BKE_paint.hh"
563# include "BKE_preferences.h"
564# include "BKE_scene.hh"
565# include "BKE_screen.hh"
566# include "BKE_workspace.hh"
567
568# include "DEG_depsgraph.hh"
569# include "DEG_depsgraph_build.hh"
570
571# include "ED_anim_api.hh"
572# include "ED_asset.hh"
573# include "ED_buttons.hh"
574# include "ED_clip.hh"
575# include "ED_fileselect.hh"
576# include "ED_image.hh"
577# include "ED_node.hh"
578# include "ED_screen.hh"
579# include "ED_sequencer.hh"
580# include "ED_transform.hh"
581# include "ED_view3d.hh"
582
583# include "GPU_material.hh"
584
585# include "IMB_imbuf_types.hh"
586
587# include "UI_interface.hh"
588# include "UI_view2d.hh"
589
590static StructRNA *rna_Space_refine(PointerRNA *ptr)
591{
592 SpaceLink *space = (SpaceLink *)ptr->data;
593
594 switch ((eSpace_Type)space->spacetype) {
595 case SPACE_VIEW3D:
596 return &RNA_SpaceView3D;
597 case SPACE_GRAPH:
598 return &RNA_SpaceGraphEditor;
599 case SPACE_OUTLINER:
600 return &RNA_SpaceOutliner;
601 case SPACE_PROPERTIES:
602 return &RNA_SpaceProperties;
603 case SPACE_FILE:
604 return &RNA_SpaceFileBrowser;
605 case SPACE_IMAGE:
606 return &RNA_SpaceImageEditor;
607 case SPACE_INFO:
608 return &RNA_SpaceInfo;
609 case SPACE_SEQ:
610 return &RNA_SpaceSequenceEditor;
611 case SPACE_TEXT:
612 return &RNA_SpaceTextEditor;
613 case SPACE_ACTION:
614 return &RNA_SpaceDopeSheetEditor;
615 case SPACE_NLA:
616 return &RNA_SpaceNLA;
617 case SPACE_NODE:
618 return &RNA_SpaceNodeEditor;
619 case SPACE_CONSOLE:
620 return &RNA_SpaceConsole;
621 case SPACE_USERPREF:
622 return &RNA_SpacePreferences;
623 case SPACE_CLIP:
624 return &RNA_SpaceClipEditor;
626 return &RNA_SpaceSpreadsheet;
627
628 /* Currently no type info. */
629 case SPACE_SCRIPT:
630 case SPACE_EMPTY:
631 case SPACE_TOPBAR:
632 case SPACE_STATUSBAR:
633 break;
634 }
635
636 return &RNA_Space;
637}
638
639static ScrArea *rna_area_from_space(PointerRNA *ptr)
640{
641 bScreen *screen = (bScreen *)ptr->owner_id;
642 SpaceLink *link = (SpaceLink *)ptr->data;
643 return BKE_screen_find_area_from_space(screen, link);
644}
645
646static void area_region_from_regiondata(bScreen *screen,
647 void *regiondata,
648 ScrArea **r_area,
649 ARegion **r_region)
650{
651 *r_area = nullptr;
652 *r_region = nullptr;
653
654 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
655 LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
656 if (region->regiondata == regiondata) {
657 *r_area = area;
658 *r_region = region;
659 return;
660 }
661 }
662 }
663}
664
665static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_area, ARegion **r_region)
666{
667 bScreen *screen = (bScreen *)ptr->owner_id;
668 void *regiondata = (ptr->data);
669
670 area_region_from_regiondata(screen, regiondata, r_area, r_region);
671}
672
673/* -------------------------------------------------------------------- */
677static bool rna_Space_bool_from_region_flag_get_by_type(PointerRNA *ptr,
678 const int region_type,
679 const int region_flag)
680{
681 ScrArea *area = rna_area_from_space(ptr);
682 ARegion *region = BKE_area_find_region_type(area, region_type);
683 if (region) {
684 return (region->flag & region_flag);
685 }
686 return false;
687}
688
689static void rna_Space_bool_from_region_flag_set_by_type(PointerRNA *ptr,
690 const int region_type,
691 const int region_flag,
692 bool value)
693{
694 ScrArea *area = rna_area_from_space(ptr);
695 ARegion *region = BKE_area_find_region_type(area, region_type);
696 if (region && (region->alignment != RGN_ALIGN_NONE)) {
697 SET_FLAG_FROM_TEST(region->flag, value, region_flag);
698 }
699 ED_region_tag_redraw(region);
700}
701
702static void rna_Space_bool_from_region_flag_update_by_type(bContext *C,
704 const int region_type,
705 const int region_flag)
706{
707 ScrArea *area = rna_area_from_space(ptr);
708 ARegion *region = BKE_area_find_region_type(area, region_type);
709 if (region) {
710 if (region_flag == RGN_FLAG_HIDDEN) {
711 /* Only support animation when the area is in the current context. */
712 if (region->overlap && (area == CTX_wm_area(C))) {
714 }
715 else {
716 ED_region_visibility_change_update(C, area, region);
717 }
718 }
719 else if (region_flag == RGN_FLAG_HIDDEN_BY_USER) {
720 if (!(region->flag & RGN_FLAG_HIDDEN_BY_USER) != !(region->flag & RGN_FLAG_HIDDEN)) {
721 ED_region_toggle_hidden(C, region);
722
723 if ((region->flag & RGN_FLAG_HIDDEN_BY_USER) == 0) {
725 }
726 }
727 }
728 }
729}
730
733/* -------------------------------------------------------------------- */
737/* Header Region. */
738static bool rna_Space_show_region_header_get(PointerRNA *ptr)
739{
740 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN);
741}
742static void rna_Space_show_region_header_set(PointerRNA *ptr, bool value)
743{
744 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN, !value);
745
746 /* Special case, never show the tool properties when the header is invisible. */
747 bool value_for_tool_header = value;
748 if (value == true) {
749 ScrArea *area = rna_area_from_space(ptr);
750 ARegion *region_tool_header = BKE_area_find_region_type(area, RGN_TYPE_TOOL_HEADER);
751 if (region_tool_header != nullptr) {
752 value_for_tool_header = !(region_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER);
753 }
754 }
755 rna_Space_bool_from_region_flag_set_by_type(
756 ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN, !value_for_tool_header);
757}
758static void rna_Space_show_region_header_update(bContext *C, PointerRNA *ptr)
759{
760 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_HEADER, RGN_FLAG_HIDDEN);
761}
762
763/* Footer Region. */
764static bool rna_Space_show_region_footer_get(PointerRNA *ptr)
765{
766 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN);
767}
768static void rna_Space_show_region_footer_set(PointerRNA *ptr, bool value)
769{
770 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN, !value);
771}
772static void rna_Space_show_region_footer_update(bContext *C, PointerRNA *ptr)
773{
774 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_FOOTER, RGN_FLAG_HIDDEN);
775}
776
777/* Tool Header Region.
778 *
779 * This depends on the 'RGN_TYPE_TOOL_HEADER'
780 */
781static bool rna_Space_show_region_tool_header_get(PointerRNA *ptr)
782{
783 return !rna_Space_bool_from_region_flag_get_by_type(
785}
786static void rna_Space_show_region_tool_header_set(PointerRNA *ptr, bool value)
787{
788 rna_Space_bool_from_region_flag_set_by_type(
790 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN, !value);
791}
792static void rna_Space_show_region_tool_header_update(bContext *C, PointerRNA *ptr)
793{
794 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_HEADER, RGN_FLAG_HIDDEN);
795}
796
797/* Tools Region. */
798static bool rna_Space_show_region_toolbar_get(PointerRNA *ptr)
799{
800 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN);
801}
802static void rna_Space_show_region_toolbar_set(PointerRNA *ptr, bool value)
803{
804 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN, !value);
805}
806static void rna_Space_show_region_toolbar_update(bContext *C, PointerRNA *ptr)
807{
808 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN);
809}
810
811static bool rna_Space_show_region_tool_props_get(PointerRNA *ptr)
812{
813 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
814}
815static void rna_Space_show_region_tool_props_set(PointerRNA *ptr, bool value)
816{
817 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN, !value);
818}
819static void rna_Space_show_region_tool_props_update(bContext *C, PointerRNA *ptr)
820{
821 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
822}
823
824/* Channels Region. */
825static bool rna_Space_show_region_channels_get(PointerRNA *ptr)
826{
827 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN);
828}
829static void rna_Space_show_region_channels_set(PointerRNA *ptr, bool value)
830{
831 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN, !value);
832}
833static void rna_Space_show_region_channels_update(bContext *C, PointerRNA *ptr)
834{
835 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_CHANNELS, RGN_FLAG_HIDDEN);
836}
837
838/* UI Region */
839static bool rna_Space_show_region_ui_get(PointerRNA *ptr)
840{
841 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN);
842}
843static void rna_Space_show_region_ui_set(PointerRNA *ptr, bool value)
844{
845 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN, !value);
846}
847static void rna_Space_show_region_ui_update(bContext *C, PointerRNA *ptr)
848{
849 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_UI, RGN_FLAG_HIDDEN);
850}
851
852/* Redo (HUD) Region */
853static bool rna_Space_show_region_hud_get(PointerRNA *ptr)
854{
855 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER);
856}
857static void rna_Space_show_region_hud_set(PointerRNA *ptr, bool value)
858{
859 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER, !value);
860}
861static void rna_Space_show_region_hud_update(bContext *C, PointerRNA *ptr)
862{
863 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_HUD, RGN_FLAG_HIDDEN_BY_USER);
864}
865
866/* Asset Shelf Regions */
867static bool rna_Space_show_region_asset_shelf_get(PointerRNA *ptr)
868{
869 return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN);
870}
871static void rna_Space_show_region_asset_shelf_set(PointerRNA *ptr, bool value)
872{
873 rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN, !value);
874}
875static void rna_Space_show_region_asset_shelf_update(bContext *C, PointerRNA *ptr)
876{
877 rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_ASSET_SHELF, RGN_FLAG_HIDDEN);
878}
879
882static bool rna_Space_view2d_sync_get(PointerRNA *ptr)
883{
884 ScrArea *area;
885 ARegion *region;
886
887 area = rna_area_from_space(ptr); /* can be nullptr */
888 if (area->spacetype == SPACE_CLIP) {
890 }
891 else {
893 }
894 if (region) {
895 View2D *v2d = &region->v2d;
896 return (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME) != 0;
897 }
898
899 return false;
900}
901
902static void rna_Space_view2d_sync_set(PointerRNA *ptr, bool value)
903{
904 ScrArea *area;
905 ARegion *region;
906
907 area = rna_area_from_space(ptr); /* can be nullptr */
908 if ((area != nullptr) && !UI_view2d_area_supports_sync(area)) {
909 BKE_reportf(nullptr,
910 RPT_ERROR,
911 "'show_locked_time' is not supported for the '%s' editor",
912 area->type->name);
913 return;
914 }
915
916 if (area->spacetype == SPACE_CLIP) {
918 }
919 else {
921 }
922 if (region) {
923 View2D *v2d = &region->v2d;
924 if (value) {
926 }
927 else {
928 v2d->flag &= ~V2D_VIEWSYNC_SCREEN_TIME;
929 }
930 }
931}
932
933static void rna_Space_view2d_sync_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
934{
935 ScrArea *area;
936 ARegion *region;
937
938 area = rna_area_from_space(ptr); /* can be nullptr */
939 if (area->spacetype == SPACE_CLIP) {
941 }
942 else {
944 }
945
946 if (region) {
947 bScreen *screen = (bScreen *)ptr->owner_id;
948 View2D *v2d = &region->v2d;
949
950 UI_view2d_sync(screen, area, v2d, V2D_LOCK_SET);
951 }
952}
953
954static void rna_GPencil_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
955{
956 bool changed = false;
957 /* need set all caches as dirty to recalculate onion skinning */
958 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
959 if (ob->type == OB_GPENCIL_LEGACY) {
960 bGPdata *gpd = (bGPdata *)ob->data;
962 changed = true;
963 }
964 }
965 if (changed) {
967 }
968}
969
970/* Space 3D View */
971static void rna_SpaceView3D_camera_update(Main *bmain, Scene *scene, PointerRNA *ptr)
972{
973 View3D *v3d = (View3D *)(ptr->data);
974 if (v3d->scenelock && scene != nullptr) {
975 wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first);
976
977 scene->camera = v3d->camera;
979 }
980}
981
982static void rna_SpaceView3D_use_local_camera_set(PointerRNA *ptr, bool value)
983{
984 View3D *v3d = (View3D *)(ptr->data);
985 bScreen *screen = (bScreen *)ptr->owner_id;
986
987 v3d->scenelock = !value;
988
989 if (!value) {
990 Scene *scene = ED_screen_scene_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
991 /* nullptr if the screen isn't in an active window (happens when setting from Python).
992 * This could be moved to the update function, in that case the scene won't relate to the
993 * screen so keep it working this way. */
994 if (scene != nullptr) {
995 v3d->camera = scene->camera;
996 }
997 }
998}
999
1000static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr)
1001{
1002 View3D *v3d = (View3D *)(ptr->data);
1003 bScreen *screen = (bScreen *)ptr->owner_id;
1004 Scene *scene = ED_screen_scene_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1005 if (scene != nullptr) {
1006 return ED_view3d_grid_scale(scene, v3d, nullptr);
1007 }
1008 else {
1009 /* When accessed from non-active screen. */
1010 return 1.0f;
1011 }
1012}
1013
1014static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
1015{
1016 View3D *v3d = (View3D *)(ptr->data);
1017 ScrArea *area = rna_area_from_space(ptr);
1018 void *regiondata = nullptr;
1019 if (area) {
1020 ListBase *regionbase = (area->spacedata.first == v3d) ? &area->regionbase : &v3d->regionbase;
1021 ARegion *region = static_cast<ARegion *>(regionbase->last); /* always last in list, weak. */
1022 regiondata = region->regiondata;
1023 }
1024
1025 return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
1026}
1027
1028static void rna_SpaceView3D_object_type_visibility_update(Main * /*bmain*/,
1029 Scene *scene,
1030 PointerRNA * /*ptr*/)
1031{
1033}
1034
1035static void rna_SpaceView3D_shading_use_compositor_update(Main * /*bmain*/,
1036 Scene * /*scene*/,
1037 PointerRNA * /*ptr*/)
1038{
1039 /* Nodes may display warnings when the compositor is enabled, so we need a redraw in that case,
1040 * and even when it gets disabled in order to potentially remove the warning. */
1042}
1043
1044static void rna_SpaceView3D_region_quadviews_begin(CollectionPropertyIterator *iter,
1045 PointerRNA *ptr)
1046{
1047 View3D *v3d = (View3D *)(ptr->data);
1048 ScrArea *area = rna_area_from_space(ptr);
1049 int i = 3;
1050
1051 ARegion *region = static_cast<ARegion *>(
1052 ((area && area->spacedata.first == v3d) ? &area->regionbase : &v3d->regionbase)->last);
1053 ListBase lb = {nullptr, nullptr};
1054
1055 if (region && region->alignment == RGN_ALIGN_QSPLIT) {
1056 while (i-- && region) {
1057 region = region->prev;
1058 }
1059
1060 if (i < 0) {
1061 lb.first = region;
1062 }
1063 }
1064
1065 rna_iterator_listbase_begin(iter, &lb, nullptr);
1066}
1067
1068static PointerRNA rna_SpaceView3D_region_quadviews_get(CollectionPropertyIterator *iter)
1069{
1070 void *regiondata = ((ARegion *)rna_iterator_listbase_get(iter))->regiondata;
1071
1072 return rna_pointer_inherit_refine(&iter->parent, &RNA_RegionView3D, regiondata);
1073}
1074
1075static void rna_RegionView3D_quadview_update(Main * /*main*/, Scene * /*scene*/, PointerRNA *ptr)
1076{
1077 ScrArea *area;
1078 ARegion *region;
1079
1080 rna_area_region_from_regiondata(ptr, &area, &region);
1081 if (area && region && region->alignment == RGN_ALIGN_QSPLIT) {
1082 ED_view3d_quadview_update(area, region, false);
1083 }
1084}
1085
1087static void rna_RegionView3D_quadview_clip_update(Main * /*main*/,
1088 Scene * /*scene*/,
1089 PointerRNA *ptr)
1090{
1091 ScrArea *area;
1092 ARegion *region;
1093
1094 rna_area_region_from_regiondata(ptr, &area, &region);
1095 if (area && region && region->alignment == RGN_ALIGN_QSPLIT) {
1096 ED_view3d_quadview_update(area, region, true);
1097 }
1098}
1099
1105static void rna_RegionView3D_view_rotation_set_validate_view_axis(RegionView3D *rv3d)
1106{
1107 /* Never rotate from a "User" view into an axis aligned view,
1108 * otherwise rotation could be aligned by accident - giving unexpected behavior. */
1109 if (!RV3D_VIEW_IS_AXIS(rv3d->view)) {
1110 return;
1111 }
1112 /* Keep this small as script authors wont expect the assigned value to change. */
1113 const float eps_quat = 1e-6f;
1115 rv3d->viewquat, eps_quat, &rv3d->view, &rv3d->view_axis_roll);
1116}
1117
1118static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
1119{
1120 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1121 negate_v3_v3(values, rv3d->ofs);
1122}
1123
1124static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
1125{
1126 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1127 negate_v3_v3(rv3d->ofs, values);
1128}
1129
1130static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values)
1131{
1132 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1133 invert_qt_qt(values, rv3d->viewquat);
1134}
1135
1136static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values)
1137{
1138 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1139 invert_qt_qt(rv3d->viewquat, values);
1140 rna_RegionView3D_view_rotation_set_validate_view_axis(rv3d);
1141}
1142
1143static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values)
1144{
1145 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1146 float mat[4][4];
1147 invert_m4_m4(mat, (float(*)[4])values);
1148 ED_view3d_from_m4(mat, rv3d->ofs, rv3d->viewquat, &rv3d->dist);
1149 rna_RegionView3D_view_rotation_set_validate_view_axis(rv3d);
1150}
1151
1152static bool rna_RegionView3D_is_orthographic_side_view_get(PointerRNA *ptr)
1153{
1154 /* NOTE: only checks axis alignment, not orthographic,
1155 * we may deprecate the current name to reflect this. */
1156 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1157 return RV3D_VIEW_IS_AXIS(rv3d->view);
1158}
1159
1160static void rna_RegionView3D_is_orthographic_side_view_set(PointerRNA *ptr, bool value)
1161{
1162 RegionView3D *rv3d = (RegionView3D *)(ptr->data);
1163 const bool was_axis_view = RV3D_VIEW_IS_AXIS(rv3d->view);
1164 if (value) {
1165 /* Already axis aligned, nothing to do. */
1166 if (was_axis_view) {
1167 return;
1168 }
1169 /* Use a large value as we always want to set this to the closest axis. */
1170 const float eps_quat = FLT_MAX;
1172 rv3d->viewquat, eps_quat, &rv3d->view, &rv3d->view_axis_roll);
1173 }
1174 else {
1175 /* Only allow changing from axis-views to user view as camera view for e.g.
1176 * doesn't make sense to update. */
1177 if (!was_axis_view) {
1178 return;
1179 }
1180 rv3d->view = RV3D_VIEW_USER;
1181 }
1182}
1183
1184static IDProperty **rna_View3DShading_idprops(PointerRNA *ptr)
1185{
1186 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1187 return &shading->prop;
1188}
1189
1190static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1191{
1192 ID *id = ptr->owner_id;
1193 if (GS(id->name) != ID_SCR) {
1194 return;
1195 }
1196
1197 View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1198 if (shading->type == OB_MATERIAL ||
1199 (shading->type == OB_RENDER && !BKE_scene_uses_blender_workbench(scene)))
1200 {
1201 /* When switching from workbench to render or material mode the geometry of any
1202 * active sculpt session needs to be recalculated. */
1203 LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
1204 if (ob->sculpt) {
1206 }
1207 }
1208 }
1209
1210 /* Update Gpencil. */
1211 rna_GPencil_update(bmain, scene, ptr);
1212
1213 bScreen *screen = (bScreen *)ptr->owner_id;
1214 LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
1215 LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
1216 if (sl->spacetype == SPACE_VIEW3D) {
1217 View3D *v3d = (View3D *)sl;
1218 if (&v3d->shading == shading) {
1219 ED_view3d_shade_update(bmain, v3d, area);
1220 return;
1221 }
1222 }
1223 }
1224 }
1225}
1226
1227static Scene *rna_3DViewShading_scene(PointerRNA *ptr)
1228{
1229 /* Get scene, depends if using 3D view or OpenGL render settings. */
1230 ID *id = ptr->owner_id;
1231 if (GS(id->name) == ID_SCE) {
1232 return (Scene *)id;
1233 }
1234 else {
1235 bScreen *screen = (bScreen *)ptr->owner_id;
1236 return WM_windows_scene_get_from_screen(static_cast<wmWindowManager *>(G_MAIN->wm.first),
1237 screen);
1238 }
1239}
1240
1241static ViewLayer *rna_3DViewShading_view_layer(PointerRNA *ptr)
1242{
1243 /* Get scene, depends if using 3D view or OpenGL render settings. */
1244 ID *id = ptr->owner_id;
1245 if (GS(id->name) == ID_SCE) {
1246 return nullptr;
1247 }
1248 else {
1249 bScreen *screen = (bScreen *)ptr->owner_id;
1250 return WM_windows_view_layer_get_from_screen(static_cast<wmWindowManager *>(G_MAIN->wm.first),
1251 screen);
1252 }
1253}
1254
1255static int rna_3DViewShading_type_get(PointerRNA *ptr)
1256{
1257 /* Available shading types depend on render engine. */
1258 Scene *scene = rna_3DViewShading_scene(ptr);
1259 RenderEngineType *type = (scene) ? RE_engines_find(scene->r.engine) : nullptr;
1260 View3DShading *shading = (View3DShading *)ptr->data;
1261
1262 if (scene == nullptr || BKE_scene_uses_blender_eevee(scene)) {
1263 return shading->type;
1264 }
1265 else if (BKE_scene_uses_blender_workbench(scene)) {
1266 return (shading->type == OB_MATERIAL) ? int(OB_SOLID) : shading->type;
1267 }
1268 else {
1269 if (shading->type == OB_RENDER && !(type && type->view_draw)) {
1270 return OB_MATERIAL;
1271 }
1272 else {
1273 return shading->type;
1274 }
1275 }
1276}
1277
1278static void rna_3DViewShading_type_set(PointerRNA *ptr, int value)
1279{
1280 View3DShading *shading = (View3DShading *)ptr->data;
1281 if (value != shading->type && value == OB_RENDER) {
1282 shading->prev_type = shading->type;
1283 }
1284 shading->type = value;
1285}
1286
1287static const EnumPropertyItem *rna_3DViewShading_type_itemf(bContext * /*C*/,
1288 PointerRNA *ptr,
1289 PropertyRNA * /*prop*/,
1290 bool *r_free)
1291{
1292 Scene *scene = rna_3DViewShading_scene(ptr);
1293 RenderEngineType *type = (scene) ? RE_engines_find(scene->r.engine) : nullptr;
1294
1295 EnumPropertyItem *item = nullptr;
1296 int totitem = 0;
1297
1300
1301 if (scene == nullptr || BKE_scene_uses_blender_eevee(scene)) {
1304 }
1305 else if (BKE_scene_uses_blender_workbench(scene)) {
1307 }
1308 else {
1310 if (type && type->view_draw) {
1312 }
1313 }
1314
1315 RNA_enum_item_end(&item, &totitem);
1316 *r_free = true;
1317
1318 return item;
1319}
1320
1321/* Shading.selected_studio_light */
1322static PointerRNA rna_View3DShading_selected_studio_light_get(PointerRNA *ptr)
1323{
1324 View3DShading *shading = (View3DShading *)ptr->data;
1325 StudioLight *sl;
1326 if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_MATCAP) {
1327 sl = BKE_studiolight_find(shading->matcap, STUDIOLIGHT_TYPE_MATCAP);
1328 }
1329 else if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_STUDIO) {
1330 sl = BKE_studiolight_find(shading->studio_light, STUDIOLIGHT_TYPE_STUDIO);
1331 }
1332 else {
1333 /* OB_MATERIAL and OB_RENDER */
1334 sl = BKE_studiolight_find(shading->lookdev_light, STUDIOLIGHT_TYPE_WORLD);
1335 }
1336 return rna_pointer_inherit_refine(ptr, &RNA_StudioLight, sl);
1337}
1338
1339/* shading.light */
1340static void rna_View3DShading_studio_light_get_storage(View3DShading *shading,
1341 char **dna_storage,
1342 int *flag)
1343{
1344 *dna_storage = shading->studio_light;
1345
1347 if (shading->type == OB_SOLID) {
1348 if (shading->light == V3D_LIGHTING_MATCAP) {
1350 *dna_storage = shading->matcap;
1351 }
1352 }
1353 else {
1355 *dna_storage = shading->lookdev_light;
1356 }
1357}
1358
1359static int rna_View3DShading_studio_light_get(PointerRNA *ptr)
1360{
1361 View3DShading *shading = (View3DShading *)ptr->data;
1362 char *dna_storage;
1363 int flag;
1364
1365 rna_View3DShading_studio_light_get_storage(shading, &dna_storage, &flag);
1366 StudioLight *sl = BKE_studiolight_find(dna_storage, flag);
1367 if (sl) {
1368 BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE);
1369 return sl->index;
1370 }
1371 else {
1372 return 0;
1373 }
1374}
1375
1376static void rna_View3DShading_studio_light_set(PointerRNA *ptr, int value)
1377{
1378 View3DShading *shading = (View3DShading *)ptr->data;
1379 char *dna_storage;
1380 int flag;
1381
1382 rna_View3DShading_studio_light_get_storage(shading, &dna_storage, &flag);
1384 if (sl) {
1385 BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE);
1386 }
1387}
1388
1389static const EnumPropertyItem *rna_View3DShading_studio_light_itemf(bContext * /*C*/,
1390 PointerRNA *ptr,
1391 PropertyRNA * /*prop*/,
1392 bool *r_free)
1393{
1394 View3DShading *shading = (View3DShading *)ptr->data;
1395 EnumPropertyItem *item = nullptr;
1396 int totitem = 0;
1397
1398 if (shading->type == OB_SOLID && shading->light == V3D_LIGHTING_MATCAP) {
1400
1402 int icon_id = (shading->flag & V3D_SHADING_MATCAP_FLIP_X) ? sl->icon_id_matcap_flipped :
1403 sl->icon_id_matcap;
1404 if ((sl->flag & flags) == flags) {
1405 EnumPropertyItem tmp = {sl->index, sl->name, icon_id, sl->name, ""};
1406 RNA_enum_item_add(&item, &totitem, &tmp);
1407 }
1408 }
1409 }
1410 else {
1412 int icon_id = sl->icon_id_irradiance;
1413 bool show_studiolight = false;
1414
1415 if (sl->flag & STUDIOLIGHT_INTERNAL) {
1416 /* always show internal lights for solid */
1417 if (shading->type == OB_SOLID) {
1418 show_studiolight = true;
1419 }
1420 }
1421 else {
1422 switch (shading->type) {
1423 case OB_SOLID:
1424 case OB_TEXTURE:
1425 show_studiolight = ((sl->flag & STUDIOLIGHT_TYPE_STUDIO) != 0);
1426 break;
1427
1428 case OB_MATERIAL:
1429 case OB_RENDER:
1430 show_studiolight = ((sl->flag & STUDIOLIGHT_TYPE_WORLD) != 0);
1431 icon_id = sl->icon_id_radiance;
1432 break;
1433 }
1434 }
1435
1436 if (show_studiolight) {
1437 EnumPropertyItem tmp = {sl->index, sl->name, icon_id, sl->name, ""};
1438 RNA_enum_item_add(&item, &totitem, &tmp);
1439 }
1440 }
1441 }
1442
1443 RNA_enum_item_end(&item, &totitem);
1444 *r_free = true;
1445 return item;
1446}
1447
1448static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C,
1449 PointerRNA * /*ptr*/,
1450 PropertyRNA * /*prop*/,
1451 bool *r_free)
1452{
1453 Scene *scene = CTX_data_scene(C);
1454 ViewLayer *view_layer = CTX_data_view_layer(C);
1455
1456 const bool aov_available = BKE_view_layer_has_valid_aov(view_layer);
1457 const bool eevee_next_active = STREQ(scene->r.engine, "BLENDER_EEVEE_NEXT");
1458
1459 int totitem = 0;
1460 EnumPropertyItem *result = nullptr;
1461 EnumPropertyItem aov_template;
1462 for (int i = 0; rna_enum_view3dshading_render_pass_type_items[i].identifier != nullptr; i++) {
1464 if (item->value == EEVEE_RENDER_PASS_AOV) {
1465 aov_template.value = item->value;
1466 aov_template.icon = 0;
1467 aov_template.description = item->description;
1468 LISTBASE_FOREACH (ViewLayerAOV *, aov, &view_layer->aovs) {
1469 if ((aov->flag & AOV_CONFLICT) != 0) {
1470 continue;
1471 }
1472 aov_template.name = aov->name;
1473 aov_template.identifier = aov->name;
1474 RNA_enum_item_add(&result, &totitem, &aov_template);
1475 aov_template.value++;
1476 }
1477 }
1478 else if (ELEM(item->value,
1482 !eevee_next_active)
1483 {
1484 }
1485 else if (!aov_available && STREQ(item->name, "Shader AOV")) {
1486 /* Don't add Shader AOV submenu when there are no AOVs defined. */
1487 }
1488 else {
1489 RNA_enum_item_add(&result, &totitem, item);
1490 }
1491 }
1492
1493 RNA_enum_item_end(&result, &totitem);
1494 *r_free = true;
1495 return result;
1496}
1497static int rna_3DViewShading_render_pass_get(PointerRNA *ptr)
1498{
1499 View3DShading *shading = (View3DShading *)ptr->data;
1500 eViewLayerEEVEEPassType result = eViewLayerEEVEEPassType(shading->render_pass);
1501 ViewLayer *view_layer = rna_3DViewShading_view_layer(ptr);
1502
1503 if (result == EEVEE_RENDER_PASS_AOV) {
1504 if (!view_layer) {
1506 }
1507 const int aov_index = BLI_findstringindex(
1508 &view_layer->aovs, shading->aov_name, offsetof(ViewLayerAOV, name));
1509 if (aov_index == -1) {
1511 }
1512 return result + aov_index;
1513 }
1514
1515 return result;
1516}
1517
1518static void rna_3DViewShading_render_pass_set(PointerRNA *ptr, int value)
1519{
1520 View3DShading *shading = (View3DShading *)ptr->data;
1521 ViewLayer *view_layer = rna_3DViewShading_view_layer(ptr);
1522 shading->aov_name[0] = 0;
1523
1524 if ((value & EEVEE_RENDER_PASS_AOV) != 0) {
1525 if (!view_layer) {
1526 shading->render_pass = EEVEE_RENDER_PASS_COMBINED;
1527 return;
1528 }
1529 const int aov_index = value & ~EEVEE_RENDER_PASS_AOV;
1530 ViewLayerAOV *aov = static_cast<ViewLayerAOV *>(BLI_findlink(&view_layer->aovs, aov_index));
1531 if (!aov) {
1532 /* AOV not found, cannot select AOV. */
1533 shading->render_pass = EEVEE_RENDER_PASS_COMBINED;
1534 return;
1535 }
1536
1537 shading->render_pass = EEVEE_RENDER_PASS_AOV;
1538 STRNCPY(shading->aov_name, aov->name);
1539 }
1540 else {
1541 shading->render_pass = value;
1542 }
1543}
1544
1545static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA *ptr)
1546{
1547 Main *bmain = CTX_data_main(C);
1548 Scene *scene = CTX_data_scene(C);
1549 ViewLayer *view_layer = CTX_data_view_layer(C);
1550 View3D *v3d = (View3D *)ptr->data;
1551
1552 if (ED_view3d_local_collections_set(bmain, v3d)) {
1553 BKE_layer_collection_local_sync(scene, view_layer, v3d);
1555 }
1556}
1557
1558static const EnumPropertyItem *rna_SpaceView3D_stereo3d_camera_itemf(bContext *C,
1559 PointerRNA * /*ptr*/,
1560 PropertyRNA * /*prop*/,
1561 bool * /*r_free*/)
1562{
1563 Scene *scene = CTX_data_scene(C);
1564
1565 if (scene->r.views_format == SCE_VIEWS_FORMAT_MULTIVIEW) {
1566 return multiview_camera_items;
1567 }
1568 else {
1569 return stereo3d_camera_items;
1570 }
1571}
1572
1573static void rna_SpaceView3D_mirror_xr_session_update(Main *main,
1574 Scene * /*scene*/,
1575 PointerRNA *ptr)
1576{
1577# ifdef WITH_XR_OPENXR
1578 const wmWindowManager *wm = static_cast<wmWindowManager *>(main->wm.first);
1579
1580 /* Handle mirror toggling while there is a session already. */
1581 if (WM_xr_session_exists(&wm->xr)) {
1582 const View3D *v3d = static_cast<const View3D *>(ptr->data);
1583 const ScrArea *area = rna_area_from_space(ptr);
1584 ED_view3d_xr_mirror_update(area, v3d, v3d->flag & V3D_XR_SESSION_MIRROR);
1585 }
1586
1587# else
1589# endif
1590}
1591
1592static int rna_SpaceView3D_icon_from_show_object_viewport_get(PointerRNA *ptr)
1593{
1594 const View3D *v3d = (View3D *)ptr->data;
1597}
1598
1599static std::optional<std::string> rna_View3DShading_path(const PointerRNA *ptr)
1600{
1601 if (GS(ptr->owner_id->name) == ID_SCE) {
1602 return "display.shading";
1603 }
1604 else if (GS(ptr->owner_id->name) == ID_SCR) {
1605 const bScreen *screen = reinterpret_cast<bScreen *>(ptr->owner_id);
1606 const View3DShading *shading = static_cast<View3DShading *>(ptr->data);
1607 int area_index;
1608 int space_index;
1609 LISTBASE_FOREACH_INDEX (ScrArea *, area, &screen->areabase, area_index) {
1610 LISTBASE_FOREACH_INDEX (SpaceLink *, sl, &area->spacedata, space_index) {
1611 if (sl->spacetype == SPACE_VIEW3D) {
1612 View3D *v3d = reinterpret_cast<View3D *>(sl);
1613 if (&v3d->shading == shading) {
1614 return fmt::format("areas[{}].spaces[{}].shading", area_index, space_index);
1615 }
1616 }
1617 }
1618 }
1619 }
1620
1621 return "shading";
1622}
1623
1624static PointerRNA rna_SpaceView3D_overlay_get(PointerRNA *ptr)
1625{
1626 return rna_pointer_inherit_refine(ptr, &RNA_View3DOverlay, ptr->data);
1627}
1628
1629static std::optional<std::string> rna_View3DOverlay_path(const PointerRNA *ptr)
1630{
1631 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
1632 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
1633}
1634
1635/* Space Image Editor */
1636
1637static PointerRNA rna_SpaceImage_overlay_get(PointerRNA *ptr)
1638{
1639 return rna_pointer_inherit_refine(ptr, &RNA_SpaceImageOverlay, ptr->data);
1640}
1641
1642static std::optional<std::string> rna_SpaceImageOverlay_path(const PointerRNA *ptr)
1643{
1644 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
1645 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
1646}
1647
1648static std::optional<std::string> rna_SpaceUVEditor_path(const PointerRNA *ptr)
1649{
1650 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
1651 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "uv_editor");
1652}
1653
1654static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
1655{
1656 return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
1657}
1658
1659static void rna_SpaceImageEditor_mode_update(Main *bmain, Scene *scene, PointerRNA * /*ptr*/)
1660{
1661 if (scene != nullptr) {
1662 ED_space_image_paint_update(bmain, static_cast<wmWindowManager *>(bmain->wm.first), scene);
1663 }
1664}
1665
1666static void rna_SpaceImageEditor_show_stereo_set(PointerRNA *ptr, bool value)
1667{
1668 SpaceImage *sima = (SpaceImage *)(ptr->data);
1669
1670 if (value) {
1671 sima->iuser.flag |= IMA_SHOW_STEREO;
1672 }
1673 else {
1674 sima->iuser.flag &= ~IMA_SHOW_STEREO;
1675 }
1676}
1677
1678static bool rna_SpaceImageEditor_show_stereo_get(PointerRNA *ptr)
1679{
1680 SpaceImage *sima = (SpaceImage *)(ptr->data);
1681 return (sima->iuser.flag & IMA_SHOW_STEREO) != 0;
1682}
1683
1684static void rna_SpaceImageEditor_show_stereo_update(Main * /*bmain*/,
1685 Scene * /*scene*/,
1686 PointerRNA *ptr)
1687{
1688 SpaceImage *sima = (SpaceImage *)(ptr->data);
1689 Image *ima = sima->image;
1690
1691 if (ima) {
1692 if (ima->rr) {
1693 BKE_image_multilayer_index(ima->rr, &sima->iuser);
1694 }
1695 else {
1696 BKE_image_multiview_index(ima, &sima->iuser);
1697 }
1698 }
1699}
1700
1701static bool rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
1702{
1703 SpaceImage *sima = (SpaceImage *)(ptr->data);
1704 return ED_space_image_show_render(sima);
1705}
1706
1707static bool rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
1708{
1709 SpaceImage *sima = (SpaceImage *)(ptr->data);
1710 return ED_space_image_show_paint(sima);
1711}
1712
1713static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
1714{
1715 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
1716 bScreen *screen = (bScreen *)ptr->owner_id;
1717 Object *obedit = nullptr;
1718 wmWindow *win = ED_screen_window_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1719 if (win != nullptr) {
1720 Scene *scene = WM_window_get_active_scene(win);
1721 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
1722 BKE_view_layer_synced_ensure(scene, view_layer);
1723 obedit = BKE_view_layer_edit_object_get(view_layer);
1724 }
1725 return ED_space_image_show_uvedit(sima, obedit);
1726}
1727
1728static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
1729{
1730 SpaceImage *sima = (SpaceImage *)(ptr->data);
1731 bScreen *screen = (bScreen *)ptr->owner_id;
1732 Object *obedit = nullptr;
1733 wmWindow *win = ED_screen_window_find(screen, static_cast<wmWindowManager *>(G_MAIN->wm.first));
1734 if (win != nullptr) {
1735 Scene *scene = WM_window_get_active_scene(win);
1736 ViewLayer *view_layer = WM_window_get_active_view_layer(win);
1737 BKE_view_layer_synced_ensure(scene, view_layer);
1738 obedit = BKE_view_layer_edit_object_get(view_layer);
1739 }
1740 return ED_space_image_check_show_maskedit(sima, obedit);
1741}
1742
1743static void rna_SpaceImageEditor_image_set(PointerRNA *ptr,
1744 PointerRNA value,
1745 ReportList * /*reports*/)
1746{
1747 BLI_assert(BKE_id_is_in_global_main(static_cast<ID *>(value.data)));
1748 SpaceImage *sima = static_cast<SpaceImage *>(ptr->data);
1749 ED_space_image_set(G_MAIN, sima, (Image *)value.data, false);
1750}
1751
1752static void rna_SpaceImageEditor_mask_set(PointerRNA *ptr,
1753 PointerRNA value,
1754 ReportList * /*reports*/)
1755{
1756 SpaceImage *sima = (SpaceImage *)(ptr->data);
1757
1758 ED_space_image_set_mask(nullptr, sima, (Mask *)value.data);
1759}
1760
1761static const EnumPropertyItem *rna_SpaceImageEditor_display_channels_itemf(bContext * /*C*/,
1762 PointerRNA *ptr,
1763 PropertyRNA * /*prop*/,
1764 bool *r_free)
1765{
1766 SpaceImage *sima = (SpaceImage *)ptr->data;
1767 EnumPropertyItem *item = nullptr;
1768 ImBuf *ibuf;
1769 void *lock;
1770 int totitem = 0;
1771
1772 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
1775
1776 if (mask & SI_USE_ALPHA) {
1778 }
1780 if (mask & SI_SHOW_ALPHA) {
1782 }
1783 if (mask & SI_SHOW_ZBUF) {
1785 }
1786 if (mask & SI_SHOW_R) {
1788 }
1789 if (mask & SI_SHOW_G) {
1791 }
1792 if (mask & SI_SHOW_B) {
1794 }
1795
1796 RNA_enum_item_end(&item, &totitem);
1797 *r_free = true;
1798
1799 return item;
1800}
1801
1802static int rna_SpaceImageEditor_display_channels_get(PointerRNA *ptr)
1803{
1804 SpaceImage *sima = (SpaceImage *)ptr->data;
1805 ImBuf *ibuf;
1806 void *lock;
1807
1808 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
1811
1812 return sima->flag & mask;
1813}
1814
1815static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values)
1816{
1817 SpaceImage *sima = (SpaceImage *)ptr->data;
1818 ScrArea *area;
1819 ARegion *region;
1820
1821 values[0] = values[1] = 1;
1822
1823 /* Find #ARegion. */
1824 area = rna_area_from_space(ptr); /* can be nullptr */
1826 if (region) {
1827 ED_space_image_get_zoom(sima, region, &values[0], &values[1]);
1828 }
1829}
1830
1831static float rna_SpaceImageEditor_zoom_percentage_get(PointerRNA *ptr)
1832{
1833 SpaceImage *sima = (SpaceImage *)ptr->data;
1834 return sima->zoom * 100.0f;
1835}
1836
1837static void rna_SpaceImageEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
1838{
1839 SpaceImage *sima = (SpaceImage *)ptr->data;
1840 sima->zoom = value / 100.0f;
1841}
1842
1843static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
1844{
1845 SpaceImage *sima = (SpaceImage *)ptr->data;
1846
1847 if (sima->flag & SI_COORDFLOATS) {
1848 copy_v2_v2(values, sima->cursor);
1849 }
1850 else {
1851 int w, h;
1852 ED_space_image_get_size(sima, &w, &h);
1853
1854 values[0] = sima->cursor[0] * w;
1855 values[1] = sima->cursor[1] * h;
1856 }
1857}
1858
1859static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
1860{
1861 SpaceImage *sima = (SpaceImage *)ptr->data;
1862
1863 if (sima->flag & SI_COORDFLOATS) {
1864 copy_v2_v2(sima->cursor, values);
1865 }
1866 else {
1867 int w, h;
1868 ED_space_image_get_size(sima, &w, &h);
1869
1870 sima->cursor[0] = values[0] / w;
1871 sima->cursor[1] = values[1] / h;
1872 }
1873}
1874
1875static void rna_SpaceImageEditor_image_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1876{
1877 SpaceImage *sima = (SpaceImage *)ptr->data;
1878 Image *ima = sima->image;
1879
1880 /* make sure all the iuser settings are valid for the sima image */
1881 if (ima) {
1882 if (ima->rr) {
1883 if (BKE_image_multilayer_index(sima->image->rr, &sima->iuser) == nullptr) {
1884 BKE_image_init_imageuser(sima->image, &sima->iuser);
1885 }
1886 }
1887 else {
1888 BKE_image_multiview_index(ima, &sima->iuser);
1889 }
1890 }
1891}
1892
1893static void rna_SpaceImageEditor_scopes_update(bContext *C, PointerRNA *ptr)
1894{
1895 SpaceImage *sima = (SpaceImage *)ptr->data;
1896 ImBuf *ibuf;
1897 void *lock;
1898
1899 /* TODO(lukas): Support tiles in scopes? */
1900 ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
1901 if (ibuf) {
1902 ED_space_image_scopes_update(C, sima, ibuf, true);
1904 }
1906}
1907
1908static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(bContext * /*C*/,
1909 PointerRNA *ptr,
1910 PropertyRNA * /*prop*/,
1911 bool * /*r_free*/)
1912{
1913 static const EnumPropertyItem pivot_items[] = {
1914 {V3D_AROUND_CENTER_BOUNDS, "CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center", ""},
1915 {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""},
1916 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
1918 "INDIVIDUAL_ORIGINS",
1919 ICON_PIVOT_INDIVIDUAL,
1920 "Individual Origins",
1921 "Pivot around each selected island's own median point"},
1922 {0, nullptr, 0, nullptr, nullptr},
1923 };
1924
1925 SpaceImage *sima = (SpaceImage *)ptr->data;
1926
1927 if (sima->mode == SI_MODE_PAINT) {
1929 }
1930 else {
1931 return pivot_items;
1932 }
1933}
1934
1935static void rna_SpaceUVEditor_tile_grid_shape_set(PointerRNA *ptr, const int *values)
1936{
1937 SpaceImage *data = (SpaceImage *)(ptr->data);
1938
1939 int clamp[2] = {10, 100};
1940 for (int i = 0; i < 2; i++) {
1941 data->tile_grid_shape[i] = std::clamp(values[i], 1, clamp[i]);
1942 }
1943}
1944
1945static void rna_SpaceUVEditor_custom_grid_subdiv_set(PointerRNA *ptr, const int *values)
1946{
1947 SpaceImage *data = (SpaceImage *)(ptr->data);
1948
1949 for (int i = 0; i < 2; i++) {
1950 data->custom_grid_subdiv[i] = std::clamp(values[i], 1, 5000);
1951 }
1952}
1953
1954/* Space Text Editor */
1955
1956static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, bool value)
1957{
1958 SpaceText *st = (SpaceText *)(ptr->data);
1959
1960 st->wordwrap = value;
1961 st->left = 0;
1962}
1963
1964static void rna_SpaceTextEditor_text_set(PointerRNA *ptr,
1965 PointerRNA value,
1966 ReportList * /*reports*/)
1967{
1968 SpaceText *st = (SpaceText *)(ptr->data);
1969
1970 st->text = static_cast<Text *>(value.data);
1971 if (st->text != nullptr) {
1972 id_us_ensure_real((ID *)st->text);
1973 }
1974
1975 ScrArea *area = rna_area_from_space(ptr);
1976 if (area) {
1978 if (region) {
1979 ED_space_text_scroll_to_cursor(st, region, true);
1980 }
1981 }
1982}
1983
1984static bool rna_SpaceTextEditor_text_is_syntax_highlight_supported(SpaceText *space)
1985{
1986 return ED_text_is_syntax_highlight_supported(space->text);
1987}
1988
1989static void rna_SpaceTextEditor_updateEdited(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
1990{
1991 SpaceText *st = (SpaceText *)ptr->data;
1992
1993 if (st->text) {
1995 }
1996}
1997
1998static int rna_SpaceTextEditor_visible_lines_get(PointerRNA *ptr)
1999{
2000 const SpaceText *st = static_cast<SpaceText *>(ptr->data);
2002}
2003
2004/* Space Properties */
2005
2006/* NOTE: this function exists only to avoid id reference-counting. */
2007static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr,
2008 PointerRNA value,
2009 ReportList * /*reports*/)
2010{
2011 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2012 sbuts->pinid = static_cast<ID *>(value.data);
2013}
2014
2015static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr)
2016{
2017 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2018
2019 if (sbuts->pinid) {
2020 return ID_code_to_RNA_type(GS(sbuts->pinid->name));
2021 }
2022
2023 return &RNA_ID;
2024}
2025
2026static void rna_SpaceProperties_pin_id_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2027{
2028 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2029 ID *id = sbuts->pinid;
2030
2031 if (id == nullptr) {
2032 sbuts->flag &= ~SB_PIN_CONTEXT;
2033 return;
2034 }
2035
2036 switch (GS(id->name)) {
2037 case ID_MA:
2039 break;
2040 case ID_TE:
2042 break;
2043 case ID_WO:
2045 break;
2046 case ID_LA:
2047 WM_main_add_notifier(NC_LAMP, nullptr);
2048 break;
2049 default:
2050 break;
2051 }
2052}
2053
2054static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
2055{
2056 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2057
2058 sbuts->mainb = value;
2059 sbuts->mainbuser = value;
2060}
2061
2062static const EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext * /*C*/,
2063 PointerRNA *ptr,
2064 PropertyRNA * /*prop*/,
2065 bool *r_free)
2066{
2067 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2068 EnumPropertyItem *item = nullptr;
2069
2070 /* Although it would never reach this amount, a theoretical maximum number of tabs
2071 * is BCONTEXT_TOT * 2, with every tab displayed and a spacer in every other item. */
2072 short context_tabs_array[BCONTEXT_TOT * 2];
2073 int totitem = ED_buttons_tabs_list(sbuts, context_tabs_array);
2074 BLI_assert(totitem <= ARRAY_SIZE(context_tabs_array));
2075
2076 int totitem_added = 0;
2077 bool add_separator = true;
2078 for (int i = 0; i < totitem; i++) {
2079 if (context_tabs_array[i] == -1) {
2080 if (add_separator) {
2081 RNA_enum_item_add_separator(&item, &totitem_added);
2082 add_separator = false;
2083 }
2084 continue;
2085 }
2086
2087 RNA_enum_items_add_value(&item, &totitem_added, buttons_context_items, context_tabs_array[i]);
2088 add_separator = true;
2089
2090 /* Add the object data icon dynamically for the data tab. */
2091 if (context_tabs_array[i] == BCONTEXT_DATA) {
2092 (item + totitem_added - 1)->icon = sbuts->dataicon;
2093 }
2094 }
2095
2096 RNA_enum_item_end(&item, &totitem_added);
2097 *r_free = true;
2098
2099 return item;
2100}
2101
2102static void rna_SpaceProperties_context_update(Main * /*bmain*/,
2103 Scene * /*scene*/,
2104 PointerRNA *ptr)
2105{
2106 SpaceProperties *sbuts = (SpaceProperties *)(ptr->data);
2107 /* XXX BCONTEXT_DATA is ugly, but required for lights... See #51318. */
2109 sbuts->preview = 1;
2110 }
2111}
2112
2113static int rna_SpaceProperties_tab_search_results_getlength(const PointerRNA *ptr,
2114 int length[RNA_MAX_ARRAY_DIMENSION])
2115{
2116 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2117
2118 short context_tabs_array[BCONTEXT_TOT * 2]; /* Dummy variable. */
2119 const int tabs_len = ED_buttons_tabs_list(sbuts, context_tabs_array);
2120
2121 length[0] = tabs_len;
2122
2123 return length[0];
2124}
2125
2126static void rna_SpaceProperties_tab_search_results_get(PointerRNA *ptr, bool *values)
2127{
2128 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2129
2130 short context_tabs_array[BCONTEXT_TOT * 2]; /* Dummy variable. */
2131 const int tabs_len = ED_buttons_tabs_list(sbuts, context_tabs_array);
2132
2133 for (int i = 0; i < tabs_len; i++) {
2134 values[i] = ED_buttons_tab_has_search_result(sbuts, i);
2135 }
2136}
2137
2138static void rna_SpaceProperties_search_filter_get(PointerRNA *ptr, char *value)
2139{
2140 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2141 const char *search_filter = ED_buttons_search_string_get(sbuts);
2142
2143 strcpy(value, search_filter);
2144}
2145
2146static int rna_SpaceProperties_search_filter_length(PointerRNA *ptr)
2147{
2148 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2149
2150 return ED_buttons_search_string_length(sbuts);
2151}
2152
2153static void rna_SpaceProperties_search_filter_set(PointerRNA *ptr, const char *value)
2154{
2155 SpaceProperties *sbuts = static_cast<SpaceProperties *>(ptr->data);
2156
2157 ED_buttons_search_string_set(sbuts, value);
2158}
2159
2160static void rna_SpaceProperties_search_filter_update(Main * /*bmain*/,
2161 Scene * /*scene*/,
2162 PointerRNA *ptr)
2163{
2164 ScrArea *area = rna_area_from_space(ptr);
2165
2166 /* Update the search filter flag for the main region with the panels. */
2168 BLI_assert(main_region != nullptr);
2169 ED_region_search_filter_update(area, main_region);
2170}
2171
2172/* Space Console */
2173static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
2174{
2175 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2176 memcpy(value, ci->line, ci->len + 1);
2177}
2178
2179static int rna_ConsoleLine_body_length(PointerRNA *ptr)
2180{
2181 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2182 return ci->len;
2183}
2184
2185static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
2186{
2187 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2188 int len = strlen(value);
2189
2190 if ((len >= ci->len_alloc) || (len * 2 < ci->len_alloc)) { /* allocate a new string */
2191 MEM_freeN(ci->line);
2192 ci->line = static_cast<char *>(MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline"));
2193 ci->len_alloc = len + 1;
2194 }
2195 memcpy(ci->line, value, len + 1);
2196 ci->len = len;
2197
2198 if (ci->cursor > len) {
2199 /* clamp the cursor */
2200 ci->cursor = len;
2201 }
2202}
2203
2204static int rna_ConsoleLine_current_character_get(PointerRNA *ptr)
2205{
2206 const ConsoleLine *ci = (ConsoleLine *)ptr->data;
2207 return BLI_str_utf8_offset_to_index(ci->line, ci->len, ci->cursor);
2208}
2209
2210static void rna_ConsoleLine_current_character_set(PointerRNA *ptr, const int index)
2211{
2212 ConsoleLine *ci = (ConsoleLine *)ptr->data;
2213 ci->cursor = BLI_str_utf8_offset_from_index(ci->line, ci->len, index);
2214}
2215
2216/* Space Dopesheet */
2217
2218static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr,
2219 PointerRNA value,
2220 ReportList * /*reports*/)
2221{
2222 SpaceAction *saction = (SpaceAction *)(ptr->data);
2223 bAction *act = (bAction *)value.data;
2224
2225 if ((act == nullptr) || (act->idroot == 0)) {
2226 /* just set if we're clearing the action or if the action is "amorphous" still */
2227 saction->action = act;
2228 }
2229 else {
2230 /* action to set must strictly meet the mode criteria... */
2231 if (saction->mode == SACTCONT_ACTION) {
2232 /* currently, this is "object-level" only, until we have some way of specifying this */
2233 if (act->idroot == ID_OB) {
2234 saction->action = act;
2235 }
2236 else {
2237 printf(
2238 "ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level "
2239 "animation\n",
2240 act->id.name + 2);
2241 }
2242 }
2243 else if (saction->mode == SACTCONT_SHAPEKEY) {
2244 /* As the name says, "shape-key level" only. */
2245 if (act->idroot == ID_KE) {
2246 saction->action = act;
2247 }
2248 else {
2249 printf(
2250 "ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate "
2251 "Shape Keys\n",
2252 act->id.name + 2);
2253 }
2254 }
2255 else {
2256 printf(
2257 "ACK: who's trying to set an action while not in a mode displaying a single Action "
2258 "only?\n");
2259 }
2260 }
2261}
2262
2263static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
2264{
2265 SpaceAction *saction = (SpaceAction *)(ptr->data);
2266 const Scene *scene = CTX_data_scene(C);
2267 ViewLayer *view_layer = CTX_data_view_layer(C);
2268 Main *bmain = CTX_data_main(C);
2269
2270 BKE_view_layer_synced_ensure(scene, view_layer);
2271 Object *obact = BKE_view_layer_active_object_get(view_layer);
2272 if (obact == nullptr) {
2273 return;
2274 }
2275
2276 AnimData *adt = nullptr;
2277 ID *id = nullptr;
2278 switch (saction->mode) {
2279 case SACTCONT_ACTION:
2280 /* TODO: context selector could help decide this with more control? */
2281 adt = BKE_animdata_ensure_id(&obact->id);
2282 id = &obact->id;
2283 break;
2284 case SACTCONT_SHAPEKEY: {
2285 Key *key = BKE_key_from_object(obact);
2286 if (key == nullptr) {
2287 return;
2288 }
2289 adt = BKE_animdata_ensure_id(&key->id);
2290 id = &key->id;
2291 break;
2292 }
2293 case SACTCONT_GPENCIL:
2294 case SACTCONT_DOPESHEET:
2295 case SACTCONT_MASK:
2296 case SACTCONT_CACHEFILE:
2297 case SACTCONT_TIMELINE:
2298 return;
2299 }
2300
2301 if (adt == nullptr) {
2302 /* No animdata was added, so the depsgraph also doesn't need tagging. */
2303 return;
2304 }
2305
2306 /* Don't do anything if old and new actions are the same... */
2307 if (adt->action == saction->action) {
2308 return;
2309 }
2310
2311 /* Exit editmode first - we cannot change actions while in tweak-mode. */
2312 BKE_nla_tweakmode_exit({*id, *adt});
2313
2314 /* To prevent data loss (i.e. if users flip between actions using the Browse menu),
2315 * stash this action if nothing else uses it.
2316 *
2317 * EXCEPTION:
2318 * This callback runs when unlinking actions. In that case, we don't want to
2319 * stash the action, as the user is signaling that they want to detach it.
2320 * This can be reviewed again later,
2321 * but it could get annoying if we keep these instead.
2322 */
2323 if (adt->action != nullptr && adt->action->id.us <= 0 && saction->action != nullptr) {
2324 /* XXX: Things here get dodgy if this action is only partially completed,
2325 * and the user then uses the browse menu to get back to this action,
2326 * assigning it as the active action (i.e. the stash strip gets out of sync)
2327 */
2329 }
2330
2331 BKE_animdata_set_action(nullptr, id, saction->action);
2332
2334
2335 /* Update relations as well, so new time source dependency is added. */
2337}
2338
2339static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr)
2340{
2341 SpaceAction *saction = (SpaceAction *)(ptr->data);
2342 ScrArea *area = CTX_wm_area(C);
2343 const Scene *scene = CTX_data_scene(C);
2344 ViewLayer *view_layer = CTX_data_view_layer(C);
2345 BKE_view_layer_synced_ensure(scene, view_layer);
2346 Object *obact = BKE_view_layer_active_object_get(view_layer);
2347
2348 /* special exceptions for ShapeKey Editor mode */
2349 if (saction->mode == SACTCONT_SHAPEKEY) {
2350 Key *key = BKE_key_from_object(obact);
2351
2352 /* 1) update the action stored for the editor */
2353 if (key) {
2354 saction->action = (key->adt) ? key->adt->action : nullptr;
2355 }
2356 else {
2357 saction->action = nullptr;
2358 }
2359 }
2360 /* make sure action stored is valid */
2361 else if (saction->mode == SACTCONT_ACTION) {
2362 /* 1) update the action stored for the editor */
2363 /* TODO: context selector could help decide this with more control? */
2364 if (obact) {
2365 saction->action = (obact->adt) ? obact->adt->action : nullptr;
2366 }
2367 else {
2368 saction->action = nullptr;
2369 }
2370 }
2371
2372 /* Collapse (and show) summary channel and hide channel list for timeline */
2373 if (saction->mode == SACTCONT_TIMELINE) {
2375 saction->ads.filterflag |= ADS_FILTER_SUMMARY;
2376 }
2377
2378 if (area && area->spacedata.first == saction) {
2379 ARegion *channels_region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS);
2380 if (channels_region) {
2381 if (saction->mode == SACTCONT_TIMELINE) {
2382 channels_region->flag |= RGN_FLAG_HIDDEN;
2383 }
2384 else {
2385 channels_region->flag &= ~RGN_FLAG_HIDDEN;
2386 }
2387 ED_region_visibility_change_update(C, area, channels_region);
2388 }
2389 }
2390
2391 /* recalculate extents of channel list */
2393
2394 /* store current mode as "old mode",
2395 * so that returning from other editors doesn't always reset to "Action Editor" */
2396 if (saction->mode != SACTCONT_TIMELINE) {
2397 saction->mode_prev = saction->mode;
2398 }
2399}
2400
2401/* Space Graph Editor */
2402
2403static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *ptr)
2404{
2405 ScrArea *area = rna_area_from_space(ptr);
2406 SpaceGraph *sipo = (SpaceGraph *)ptr->data;
2407
2408 /* for "Drivers" mode, enable all the necessary bits and pieces */
2409 if (sipo->mode == SIPO_MODE_DRIVERS) {
2410 ED_drivers_editor_init(C, area);
2411 ED_area_tag_redraw(area);
2412 }
2413
2414 /* after changing view mode, must force recalculation of F-Curve colors
2415 * which can only be achieved using refresh as opposed to redraw
2416 */
2417 ED_area_tag_refresh(area);
2418}
2419
2420static void rna_SpaceGraphEditor_normalize_update(bContext *C, PointerRNA * /*ptr*/)
2421{
2422 bAnimContext ac;
2423
2424 if (ANIM_animdata_get_context(C, &ac) == 0) {
2425 return;
2426 }
2427
2430}
2431
2432static bool rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
2433{
2434 SpaceGraph *sipo = (SpaceGraph *)(ptr->data);
2435 return (BLI_listbase_is_empty(&sipo->runtime.ghost_curves) == false);
2436}
2437
2438static void rna_SpaceConsole_rect_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2439{
2440 SpaceConsole *sc = static_cast<SpaceConsole *>(ptr->data);
2442}
2443
2444static void rna_SequenceEditor_update_cache(Main * /*bmain*/, Scene *scene, PointerRNA * /*ptr*/)
2445{
2446 SEQ_cache_cleanup(scene);
2447}
2448
2449static void seq_build_proxy(bContext *C, PointerRNA *ptr)
2450{
2451 if (U.sequencer_proxy_setup != USER_SEQ_PROXY_SETUP_AUTOMATIC) {
2452 return;
2453 }
2454
2455 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2456 Scene *scene = CTX_data_scene(C);
2458
2460 wmJob *wm_job = ED_seq_proxy_wm_job_get(C);
2461 ProxyJob *pj = ED_seq_proxy_job_get(C, wm_job);
2462
2463 LISTBASE_FOREACH (Sequence *, seq, seqbase) {
2464 if (seq->type != SEQ_TYPE_MOVIE || seq->strip == nullptr || seq->strip->proxy == nullptr) {
2465 continue;
2466 }
2467
2468 /* Add new proxy size. */
2469 seq->strip->proxy->build_size_flags |= SEQ_rendersize_to_proxysize(sseq->render_size);
2470
2471 /* Build proxy. */
2473 pj->main, pj->depsgraph, pj->scene, seq, file_list, &pj->queue, true);
2474 }
2475
2476 BLI_gset_free(file_list, MEM_freeN);
2477
2478 if (!WM_jobs_is_running(wm_job)) {
2479 G.is_break = false;
2480 WM_jobs_start(CTX_wm_manager(C), wm_job);
2481 }
2482
2484}
2485
2486static void rna_SequenceEditor_render_size_update(bContext *C, PointerRNA *ptr)
2487{
2488 seq_build_proxy(C, ptr);
2489 rna_SequenceEditor_update_cache(CTX_data_main(C), CTX_data_scene(C), ptr);
2490}
2491
2492static bool rna_SequenceEditor_clamp_view_get(PointerRNA *ptr)
2493{
2494 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2495 return (sseq->flag & SEQ_CLAMP_VIEW) != 0;
2496}
2497
2498static void rna_SequenceEditor_clamp_view_set(PointerRNA *ptr, bool value)
2499{
2500 SpaceSeq *sseq = static_cast<SpaceSeq *>(ptr->data);
2501 ScrArea *area;
2502 ARegion *region;
2503
2504 area = rna_area_from_space(ptr); /* can be nullptr */
2505 if (area == nullptr) {
2506 return;
2507 }
2508
2510 if (region) {
2511 if (value) {
2512 sseq->flag |= SEQ_CLAMP_VIEW;
2513 region->v2d.align &= ~V2D_ALIGN_NO_NEG_Y;
2514 }
2515 else {
2516 sseq->flag &= ~SEQ_CLAMP_VIEW;
2517 region->v2d.align |= V2D_ALIGN_NO_NEG_Y;
2518 }
2519 }
2520}
2521
2522static void rna_Sequencer_view_type_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
2523{
2524 ScrArea *area = rna_area_from_space(ptr);
2525 ED_area_tag_refresh(area);
2526}
2527
2528static PointerRNA rna_SpaceSequenceEditor_preview_overlay_get(PointerRNA *ptr)
2529{
2530 return rna_pointer_inherit_refine(ptr, &RNA_SequencerPreviewOverlay, ptr->data);
2531}
2532
2533static std::optional<std::string> rna_SpaceSequencerPreviewOverlay_path(const PointerRNA *ptr)
2534{
2535 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2536 return fmt::format(
2537 "{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "preview_overlay");
2538}
2539
2540static PointerRNA rna_SpaceSequenceEditor_timeline_overlay_get(PointerRNA *ptr)
2541{
2542 return rna_pointer_inherit_refine(ptr, &RNA_SequencerTimelineOverlay, ptr->data);
2543}
2544
2545static std::optional<std::string> rna_SpaceSequencerTimelineOverlay_path(const PointerRNA *ptr)
2546{
2547 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2548 return fmt::format(
2549 "{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "timeline_overlay");
2550}
2551
2552static PointerRNA rna_SpaceSequenceEditor_cache_overlay_get(PointerRNA *ptr)
2553{
2554 return rna_pointer_inherit_refine(ptr, &RNA_SequencerCacheOverlay, ptr->data);
2555}
2556
2557static std::optional<std::string> rna_SpaceSequencerCacheOverlay_path(const PointerRNA *ptr)
2558{
2559 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2560 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "cache_overlay");
2561}
2562
2563static float rna_SpaceSequenceEditor_zoom_percentage_get(PointerRNA *ptr)
2564{
2565 ScrArea *area = rna_area_from_space(ptr);
2566 if (area == nullptr) {
2567 return 100.0f;
2568 }
2570 if (region == nullptr) {
2571 return 100.0f;
2572 }
2573
2574 View2D *v2d = &region->v2d;
2575 const float zoom = 1.0f / (BLI_rctf_size_x(&v2d->cur) / float(BLI_rcti_size_x(&v2d->mask))) *
2576 +100.0f;
2577 return zoom;
2578}
2579
2580static void rna_SpaceSequenceEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
2581{
2582 ScrArea *area = rna_area_from_space(ptr);
2583 if (area == nullptr) {
2584 return;
2585 }
2587 if (region == nullptr) {
2588 return;
2589 }
2590
2591 View2D *v2d = &region->v2d;
2592 BLI_rctf_resize(&v2d->cur,
2593 float(BLI_rcti_size_x(&v2d->mask)) / (value / 100.0f),
2594 float(BLI_rcti_size_y(&v2d->mask)) / (value / 100.0f));
2595 ED_region_tag_redraw(region);
2596}
2597
2598/* Space Node Editor */
2599static PointerRNA rna_SpaceNode_overlay_get(PointerRNA *ptr)
2600{
2601 return rna_pointer_inherit_refine(ptr, &RNA_SpaceNodeOverlay, ptr->data);
2602}
2603
2604static bool rna_SpaceNode_supports_previews(PointerRNA *ptr)
2605{
2606 return ED_node_supports_preview(static_cast<SpaceNode *>(ptr->data));
2607}
2608
2609static std::optional<std::string> rna_SpaceNodeOverlay_path(const PointerRNA *ptr)
2610{
2611 std::optional<std::string> editor_path = BKE_screen_path_from_screen_to_space(ptr);
2612 return fmt::format("{}{}{}", editor_path.value_or(""), editor_path ? "." : "", "overlay");
2613}
2614
2615static void rna_SpaceNodeEditor_node_tree_set(PointerRNA *ptr,
2616 const PointerRNA value,
2617 ReportList * /*reports*/)
2618{
2619 SpaceNode *snode = (SpaceNode *)ptr->data;
2620 ED_node_tree_start(snode, (bNodeTree *)value.data, nullptr, nullptr);
2621}
2622
2623static bool rna_SpaceNodeEditor_geometry_nodes_tool_tree_poll(PointerRNA * /*ptr*/,
2624 const PointerRNA value)
2625{
2626 const bNodeTree &ntree = *static_cast<const bNodeTree *>(value.data);
2627 if (ntree.type != NTREE_GEOMETRY) {
2628 return false;
2629 }
2630 if (!ntree.geometry_node_asset_traits) {
2631 return false;
2632 }
2634 return false;
2635 }
2636 return true;
2637}
2638
2639static bool space_node_node_geometry_nodes_poll(const SpaceNode &snode, const bNodeTree &ntree)
2640{
2643 if (!ntree.geometry_node_asset_traits) {
2644 return false;
2645 }
2647 return false;
2648 }
2649 return true;
2651 if (!ntree.geometry_node_asset_traits) {
2652 return false;
2653 }
2655 return false;
2656 }
2657 return true;
2658 }
2659 return false;
2660}
2661
2662static bool rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, const PointerRNA value)
2663{
2664 SpaceNode *snode = (SpaceNode *)ptr->data;
2665 bNodeTree *ntree = (bNodeTree *)value.data;
2666
2667 /* node tree type must match the selected type in node editor */
2668 if (!STREQ(snode->tree_idname, ntree->idname)) {
2669 return false;
2670 }
2671 if (ntree->type == NTREE_GEOMETRY) {
2672 if (!space_node_node_geometry_nodes_poll(*snode, *ntree)) {
2673 return false;
2674 }
2675 }
2676 return true;
2677}
2678
2679static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA * /*ptr*/)
2680{
2682}
2683
2684static void rna_SpaceNodeEditor_geometry_nodes_type_update(Main * /*main*/,
2685 Scene * /*scene*/,
2686 PointerRNA *ptr)
2687{
2688 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
2690 snode->flag &= ~SNODE_PIN;
2691 }
2692}
2693
2694static int rna_SpaceNodeEditor_tree_type_get(PointerRNA *ptr)
2695{
2696 SpaceNode *snode = (SpaceNode *)ptr->data;
2698}
2699static void rna_SpaceNodeEditor_tree_type_set(PointerRNA *ptr, int value)
2700{
2701 SpaceNode *snode = (SpaceNode *)ptr->data;
2703}
2704static bool rna_SpaceNodeEditor_tree_type_poll(void *Cv, blender::bke::bNodeTreeType *type)
2705{
2706 bContext *C = (bContext *)Cv;
2707 if (type->poll) {
2708 return type->poll(C, type);
2709 }
2710 else {
2711 return true;
2712 }
2713}
2714
2715static void rna_SpaceNodeEditor_cursor_location_get(PointerRNA *ptr, float value[2])
2716{
2717 const SpaceNode *snode = (SpaceNode *)ptr->data;
2718
2719 ED_node_cursor_location_get(snode, value);
2720}
2721
2722static void rna_SpaceNodeEditor_cursor_location_set(PointerRNA *ptr, const float value[2])
2723{
2724 SpaceNode *snode = (SpaceNode *)ptr->data;
2725
2726 ED_node_cursor_location_set(snode, value);
2727}
2728
2730{
2731 return rna_node_tree_type_itemf(C, rna_SpaceNodeEditor_tree_type_poll, r_free);
2732}
2733
2734static const EnumPropertyItem *rna_SpaceNodeEditor_tree_type_itemf(bContext *C,
2735 PointerRNA * /*ptr*/,
2736 PropertyRNA * /*prop*/,
2737 bool *r_free)
2738{
2739 return RNA_enum_node_tree_types_itemf_impl(C, r_free);
2740}
2741
2742static void rna_SpaceNodeEditor_path_get(PointerRNA *ptr, char *value)
2743{
2744 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
2745 ED_node_tree_path_get(snode, value);
2746}
2747
2748static int rna_SpaceNodeEditor_path_length(PointerRNA *ptr)
2749{
2750 SpaceNode *snode = static_cast<SpaceNode *>(ptr->data);
2751 return ED_node_tree_path_length(snode);
2752}
2753
2754static void rna_SpaceNodeEditor_path_clear(SpaceNode *snode, bContext *C)
2755{
2756 ED_node_tree_start(snode, nullptr, nullptr, nullptr);
2758}
2759
2760static void rna_SpaceNodeEditor_path_start(SpaceNode *snode, bContext *C, PointerRNA *node_tree)
2761{
2762 ED_node_tree_start(snode, (bNodeTree *)node_tree->data, nullptr, nullptr);
2764}
2765
2766static void rna_SpaceNodeEditor_path_append(SpaceNode *snode,
2767 bContext *C,
2769 PointerRNA *node)
2770{
2772 snode, static_cast<bNodeTree *>(node_tree->data), static_cast<bNode *>(node->data));
2774}
2775
2776static void rna_SpaceNodeEditor_path_pop(SpaceNode *snode, bContext *C)
2777{
2778 ED_node_tree_pop(snode);
2780}
2781
2782static void rna_SpaceNodeEditor_show_backdrop_update(Main * /*bmain*/,
2783 Scene * /*scene*/,
2784 PointerRNA * /*ptr*/)
2785{
2788}
2789
2790static void rna_SpaceNodeEditor_cursor_location_from_region(SpaceNode *snode,
2791 bContext *C,
2792 int x,
2793 int y)
2794{
2795 ARegion *region = CTX_wm_region(C);
2796
2797 float cursor_location[2];
2798
2799 UI_view2d_region_to_view(&region->v2d, x, y, &cursor_location[0], &cursor_location[1]);
2800 cursor_location[0] /= UI_SCALE_FAC;
2801 cursor_location[1] /= UI_SCALE_FAC;
2802
2803 ED_node_cursor_location_set(snode, cursor_location);
2804}
2805
2806static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr,
2807 PointerRNA value,
2808 ReportList * /*reports*/)
2809{
2810 SpaceClip *sc = (SpaceClip *)(ptr->data);
2811 bScreen *screen = (bScreen *)ptr->owner_id;
2812
2813 ED_space_clip_set_clip(nullptr, screen, sc, (MovieClip *)value.data);
2814}
2815
2816static void rna_SpaceClipEditor_mask_set(PointerRNA *ptr,
2817 PointerRNA value,
2818 ReportList * /*reports*/)
2819{
2820 SpaceClip *sc = (SpaceClip *)(ptr->data);
2821
2822 ED_space_clip_set_mask(nullptr, sc, (Mask *)value.data);
2823}
2824
2825static void rna_SpaceClipEditor_clip_mode_update(Main * /*bmain*/,
2826 Scene * /*scene*/,
2827 PointerRNA *ptr)
2828{
2829 SpaceClip *sc = (SpaceClip *)(ptr->data);
2830
2831 if (sc->mode == SC_MODE_MASKEDIT && sc->view != SC_VIEW_CLIP) {
2832 /* Make sure we are in the right view for mask editing */
2833 sc->view = SC_VIEW_CLIP;
2834 ScrArea *area = rna_area_from_space(ptr);
2835 ED_area_tag_refresh(area);
2836 }
2837
2838 sc->scopes.ok = 0;
2839}
2840
2841static void rna_SpaceClipEditor_lock_selection_update(Main * /*bmain*/,
2842 Scene * /*scene*/,
2843 PointerRNA *ptr)
2844{
2845 SpaceClip *sc = (SpaceClip *)(ptr->data);
2846
2847 sc->xlockof = 0.0f;
2848 sc->ylockof = 0.0f;
2849}
2850
2851static void rna_SpaceClipEditor_view_type_update(Main * /*bmain*/,
2852 Scene * /*scene*/,
2853 PointerRNA *ptr)
2854{
2855 ScrArea *area = rna_area_from_space(ptr);
2856 ED_area_tag_refresh(area);
2857}
2858
2859static float rna_SpaceClipEditor_zoom_percentage_get(PointerRNA *ptr)
2860{
2861 SpaceClip *sc = (SpaceClip *)ptr->data;
2862 return sc->zoom * 100.0f;
2863}
2864
2865static void rna_SpaceClipEditor_zoom_percentage_set(PointerRNA *ptr, const float value)
2866{
2867 SpaceClip *sc = (SpaceClip *)ptr->data;
2868 sc->zoom = value / 100.0f;
2869}
2870
2871/* File browser. */
2872
2873static std::optional<std::string> rna_FileSelectParams_path(const PointerRNA * /*ptr*/)
2874{
2875 return "params";
2876}
2877
2878int rna_FileSelectParams_filename_editable(const PointerRNA *ptr, const char **r_info)
2879{
2880 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
2881
2882 if (params && (params->flag & FILE_DIRSEL_ONLY)) {
2883 *r_info = "Only directories can be chosen for the current operation.";
2884 return 0;
2885 }
2886
2887 return params ? int(PROP_EDITABLE) : 0;
2888}
2889
2890static bool rna_FileSelectParams_use_lib_get(PointerRNA *ptr)
2891{
2892 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
2893
2894 return params && (params->type == FILE_LOADLIB);
2895}
2896
2897static const EnumPropertyItem *rna_FileSelectParams_recursion_level_itemf(bContext * /*C*/,
2898 PointerRNA *ptr,
2899 PropertyRNA * /*prop*/,
2900 bool *r_free)
2901{
2902 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
2903
2904 if (params && params->type != FILE_LOADLIB) {
2905 EnumPropertyItem *item = nullptr;
2906 int totitem = 0;
2907
2912
2913 RNA_enum_item_end(&item, &totitem);
2914 *r_free = true;
2915
2916 return item;
2917 }
2918
2919 *r_free = false;
2921}
2922
2923static void rna_FileSelectPrams_filter_glob_set(PointerRNA *ptr, const char *value)
2924{
2925 FileSelectParams *params = static_cast<FileSelectParams *>(ptr->data);
2926
2927 STRNCPY(params->filter_glob, value);
2928
2929 /* Remove stupid things like last group being a wildcard-only one. */
2931}
2932
2933static PointerRNA rna_FileSelectParams_filter_id_get(PointerRNA *ptr)
2934{
2935 return rna_pointer_inherit_refine(ptr, &RNA_FileSelectIDFilter, ptr->data);
2936}
2937
2938static int rna_FileAssetSelectParams_asset_library_get(PointerRNA *ptr)
2939{
2941 /* Just an extra sanity check to ensure this isn't somehow called for RNA_FileSelectParams. */
2942 BLI_assert(ptr->type == &RNA_FileAssetSelectParams);
2943
2945}
2946
2947static void rna_FileAssetSelectParams_asset_library_set(PointerRNA *ptr, int value)
2948{
2951}
2952
2953static PointerRNA rna_FileAssetSelectParams_filter_id_get(PointerRNA *ptr)
2954{
2955 return rna_pointer_inherit_refine(ptr, &RNA_FileAssetSelectIDFilter, ptr->data);
2956}
2957
2958static PointerRNA rna_FileBrowser_FileSelectEntry_asset_data_get_impl(const PointerRNA *ptr)
2959{
2960 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
2961
2962 if (!entry->asset) {
2963 return PointerRNA_NULL;
2964 }
2965
2966 AssetMetaData *asset_data = &entry->asset->get_metadata();
2967
2968 /* Note that the owning ID of the RNA pointer (`ptr->owner_id`) has to be set carefully:
2969 * Local IDs (`entry->id`) own their asset metadata themselves. Asset metadata from other blend
2970 * files are owned by the file browser (`entry`). Only if this is set correctly, we can tell from
2971 * the metadata RNA pointer if the metadata is stored locally and can thus be edited or not. */
2972
2973 if (entry->asset->is_local_id()) {
2974 PointerRNA id_ptr = RNA_id_pointer_create(entry->id);
2975 return rna_pointer_inherit_refine(&id_ptr, &RNA_AssetMetaData, asset_data);
2976 }
2977
2978 return rna_pointer_inherit_refine(ptr, &RNA_AssetMetaData, asset_data);
2979}
2980
2981static int rna_FileBrowser_FileSelectEntry_name_editable(const PointerRNA *ptr,
2982 const char **r_info)
2983{
2984 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
2985
2986 /* This actually always returns 0 (the name is never editable) but we want to get a disabled
2987 * message returned to `r_info` in some cases. */
2988
2989 if (entry->asset) {
2990 PointerRNA asset_data_ptr = rna_FileBrowser_FileSelectEntry_asset_data_get_impl(ptr);
2991 /* Get disabled hint from asset metadata polling. */
2992 rna_AssetMetaData_editable(&asset_data_ptr, r_info);
2993 }
2994
2995 return 0;
2996}
2997
2998static PointerRNA rna_FileBrowser_FileSelectEntry_asset_data_get(PointerRNA *ptr)
2999{
3000 return rna_FileBrowser_FileSelectEntry_asset_data_get_impl(ptr);
3001}
3002
3003static void rna_FileBrowser_FileSelectEntry_name_get(PointerRNA *ptr, char *value)
3004{
3005 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3006 strcpy(value, entry->name);
3007}
3008
3009static int rna_FileBrowser_FileSelectEntry_name_length(PointerRNA *ptr)
3010{
3011 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3012 return int(strlen(entry->name));
3013}
3014
3015static void rna_FileBrowser_FileSelectEntry_relative_path_get(PointerRNA *ptr, char *value)
3016{
3017 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3018 strcpy(value, entry->relpath);
3019}
3020
3021static int rna_FileBrowser_FileSelectEntry_relative_path_length(PointerRNA *ptr)
3022{
3023 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3024 return int(strlen(entry->relpath));
3025}
3026
3027static int rna_FileBrowser_FileSelectEntry_preview_icon_id_get(PointerRNA *ptr)
3028{
3029 const FileDirEntry *entry = static_cast<const FileDirEntry *>(ptr->data);
3030 return ED_file_icon(entry);
3031}
3032
3033static StructRNA *rna_FileBrowser_params_typef(PointerRNA *ptr)
3034{
3035 SpaceFile *sfile = static_cast<SpaceFile *>(ptr->data);
3037
3038 if (params == ED_fileselect_get_file_params(sfile)) {
3039 return &RNA_FileSelectParams;
3040 }
3041 if (params == (void *)ED_fileselect_get_asset_params(sfile)) {
3042 return &RNA_FileAssetSelectParams;
3043 }
3044
3045 BLI_assert_msg(0, "Could not identify file select parameters");
3046 return nullptr;
3047}
3048
3049static PointerRNA rna_FileBrowser_params_get(PointerRNA *ptr)
3050{
3051 SpaceFile *sfile = static_cast<SpaceFile *>(ptr->data);
3053 StructRNA *params_struct = rna_FileBrowser_params_typef(ptr);
3054
3055 if (params && params_struct) {
3056 return rna_pointer_inherit_refine(ptr, params_struct, params);
3057 }
3058
3059 return rna_pointer_inherit_refine(ptr, nullptr, nullptr);
3060}
3061
3062static void rna_FileBrowser_FSMenuEntry_path_get(PointerRNA *ptr, char *value)
3063{
3064 char *path = ED_fsmenu_entry_get_path(static_cast<FSMenuEntry *>(ptr->data));
3065
3066 strcpy(value, path ? path : "");
3067}
3068
3069static int rna_FileBrowser_FSMenuEntry_path_length(PointerRNA *ptr)
3070{
3071 char *path = ED_fsmenu_entry_get_path(static_cast<FSMenuEntry *>(ptr->data));
3072
3073 return int(path ? strlen(path) : 0);
3074}
3075
3076static void rna_FileBrowser_FSMenuEntry_path_set(PointerRNA *ptr, const char *value)
3077{
3078 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3079
3080 /* NOTE: this will write to file immediately.
3081 * Not nice (and to be fixed ultimately), but acceptable in this case for now. */
3082 ED_fsmenu_entry_set_path(fsm, value);
3083}
3084
3085static void rna_FileBrowser_FSMenuEntry_name_get(PointerRNA *ptr, char *value)
3086{
3087 strcpy(value, ED_fsmenu_entry_get_name(static_cast<FSMenuEntry *>(ptr->data)));
3088}
3089
3090static int rna_FileBrowser_FSMenuEntry_name_length(PointerRNA *ptr)
3091{
3092 return int(strlen(ED_fsmenu_entry_get_name(static_cast<FSMenuEntry *>(ptr->data))));
3093}
3094
3095static void rna_FileBrowser_FSMenuEntry_name_set(PointerRNA *ptr, const char *value)
3096{
3097 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3098
3099 /* NOTE: this will write to file immediately.
3100 * Not nice (and to be fixed ultimately), but acceptable in this case for now. */
3101 ED_fsmenu_entry_set_name(fsm, value);
3102}
3103
3104static int rna_FileBrowser_FSMenuEntry_name_get_editable(const PointerRNA *ptr,
3105 const char ** /*r_info*/)
3106{
3107 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3108
3109 return fsm->save ? int(PROP_EDITABLE) : 0;
3110}
3111
3112static int rna_FileBrowser_FSMenuEntry_icon_get(PointerRNA *ptr)
3113{
3114 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3115 return ED_fsmenu_entry_get_icon(fsm);
3116}
3117
3118static void rna_FileBrowser_FSMenuEntry_icon_set(PointerRNA *ptr, int value)
3119{
3120 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3121 ED_fsmenu_entry_set_icon(fsm, value);
3122}
3123
3124static bool rna_FileBrowser_FSMenuEntry_use_save_get(PointerRNA *ptr)
3125{
3126 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3127 return fsm->save;
3128}
3129
3130static bool rna_FileBrowser_FSMenuEntry_is_valid_get(PointerRNA *ptr)
3131{
3132 FSMenuEntry *fsm = static_cast<FSMenuEntry *>(ptr->data);
3133 return fsm->valid;
3134}
3135
3136static void rna_FileBrowser_FSMenu_next(CollectionPropertyIterator *iter)
3137{
3138 ListBaseIterator *internal = &iter->internal.listbase;
3139
3140 if (internal->skip) {
3141 do {
3142 internal->link = (Link *)(((FSMenuEntry *)(internal->link))->next);
3143 iter->valid = (internal->link != nullptr);
3144 } while (iter->valid && internal->skip(iter, internal->link));
3145 }
3146 else {
3147 internal->link = (Link *)(((FSMenuEntry *)(internal->link))->next);
3148 iter->valid = (internal->link != nullptr);
3149 }
3150}
3151
3152static void rna_FileBrowser_FSMenu_begin(CollectionPropertyIterator *iter, FSMenuCategory category)
3153{
3154 ListBaseIterator *internal = &iter->internal.listbase;
3155
3156 FSMenu *fsmenu = ED_fsmenu_get();
3157 FSMenuEntry *fsmentry = ED_fsmenu_get_category(fsmenu, category);
3158
3159 internal->link = (fsmentry) ? (Link *)fsmentry : nullptr;
3160 internal->skip = nullptr;
3161
3162 iter->valid = (internal->link != nullptr);
3163}
3164
3165static PointerRNA rna_FileBrowser_FSMenu_get(CollectionPropertyIterator *iter)
3166{
3167 ListBaseIterator *internal = &iter->internal.listbase;
3168 PointerRNA r_ptr = RNA_pointer_create(nullptr, &RNA_FileBrowserFSMenuEntry, internal->link);
3169 return r_ptr;
3170}
3171
3172static void rna_FileBrowser_FSMenu_end(CollectionPropertyIterator * /*iter*/) {}
3173
3174static void rna_FileBrowser_FSMenuSystem_data_begin(CollectionPropertyIterator *iter,
3175 PointerRNA * /*ptr*/)
3176{
3177 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_SYSTEM);
3178}
3179
3180static int rna_FileBrowser_FSMenuSystem_data_length(PointerRNA * /*ptr*/)
3181{
3182 FSMenu *fsmenu = ED_fsmenu_get();
3183
3185}
3186
3187static void rna_FileBrowser_FSMenuSystemBookmark_data_begin(CollectionPropertyIterator *iter,
3188 PointerRNA * /*ptr*/)
3189{
3190 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_SYSTEM_BOOKMARKS);
3191}
3192
3193static int rna_FileBrowser_FSMenuSystemBookmark_data_length(PointerRNA * /*ptr*/)
3194{
3195 FSMenu *fsmenu = ED_fsmenu_get();
3196
3198}
3199
3200static void rna_FileBrowser_FSMenuBookmark_data_begin(CollectionPropertyIterator *iter,
3201 PointerRNA * /*ptr*/)
3202{
3203 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_BOOKMARKS);
3204}
3205
3206static int rna_FileBrowser_FSMenuBookmark_data_length(PointerRNA * /*ptr*/)
3207{
3208 FSMenu *fsmenu = ED_fsmenu_get();
3209
3211}
3212
3213static void rna_FileBrowser_FSMenuRecent_data_begin(CollectionPropertyIterator *iter,
3214 PointerRNA * /*ptr*/)
3215{
3216 rna_FileBrowser_FSMenu_begin(iter, FS_CATEGORY_RECENT);
3217}
3218
3219static int rna_FileBrowser_FSMenuRecent_data_length(PointerRNA * /*ptr*/)
3220{
3221 FSMenu *fsmenu = ED_fsmenu_get();
3222
3224}
3225
3226static int rna_FileBrowser_FSMenu_active_get(PointerRNA *ptr, const FSMenuCategory category)
3227{
3228 SpaceFile *sf = static_cast<SpaceFile *>(ptr->data);
3229 int actnr = -1;
3230
3231 switch (category) {
3232 case FS_CATEGORY_SYSTEM:
3233 actnr = sf->systemnr;
3234 break;
3236 actnr = sf->system_bookmarknr;
3237 break;
3239 actnr = sf->bookmarknr;
3240 break;
3241 case FS_CATEGORY_RECENT:
3242 actnr = sf->recentnr;
3243 break;
3244 case FS_CATEGORY_OTHER:
3245 /* pass. */
3246 break;
3247 }
3248
3249 return actnr;
3250}
3251
3252static void rna_FileBrowser_FSMenu_active_set(PointerRNA *ptr,
3253 int value,
3254 const FSMenuCategory category)
3255{
3256 SpaceFile *sf = static_cast<SpaceFile *>(ptr->data);
3257 FSMenu *fsmenu = ED_fsmenu_get();
3258 FSMenuEntry *fsm = ED_fsmenu_get_entry(fsmenu, category, value);
3259
3260 if (fsm && sf->params) {
3261 switch (category) {
3262 case FS_CATEGORY_SYSTEM:
3263 sf->systemnr = value;
3264 break;
3266 sf->system_bookmarknr = value;
3267 break;
3269 sf->bookmarknr = value;
3270 break;
3271 case FS_CATEGORY_RECENT:
3272 sf->recentnr = value;
3273 break;
3274 case FS_CATEGORY_OTHER:
3275 /* pass. */
3276 break;
3277 }
3278
3279 STRNCPY(sf->params->dir, fsm->path);
3280 }
3281}
3282
3283static void rna_FileBrowser_FSMenu_active_range(PointerRNA * /*ptr*/,
3284 int *min,
3285 int *max,
3286 int *softmin,
3287 int *softmax,
3288 const FSMenuCategory category)
3289{
3290 FSMenu *fsmenu = ED_fsmenu_get();
3291
3292 *min = *softmin = -1;
3293 *max = *softmax = ED_fsmenu_get_nentries(fsmenu, category) - 1;
3294}
3295
3296static void rna_FileBrowser_FSMenu_active_update(bContext *C, PointerRNA *ptr)
3297{
3298 ScrArea *area = rna_area_from_space(ptr);
3299 ED_file_change_dir_ex(C, area);
3300}
3301
3302static int rna_FileBrowser_FSMenuSystem_active_get(PointerRNA *ptr)
3303{
3304 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_SYSTEM);
3305}
3306
3307static void rna_FileBrowser_FSMenuSystem_active_set(PointerRNA *ptr, int value)
3308{
3309 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_SYSTEM);
3310}
3311
3312static void rna_FileBrowser_FSMenuSystem_active_range(
3313 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3314{
3315 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_SYSTEM);
3316}
3317
3318static int rna_FileBrowser_FSMenuSystemBookmark_active_get(PointerRNA *ptr)
3319{
3320 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_SYSTEM_BOOKMARKS);
3321}
3322
3323static void rna_FileBrowser_FSMenuSystemBookmark_active_set(PointerRNA *ptr, int value)
3324{
3325 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_SYSTEM_BOOKMARKS);
3326}
3327
3328static void rna_FileBrowser_FSMenuSystemBookmark_active_range(
3329 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3330{
3331 rna_FileBrowser_FSMenu_active_range(
3332 ptr, min, max, softmin, softmax, FS_CATEGORY_SYSTEM_BOOKMARKS);
3333}
3334
3335static int rna_FileBrowser_FSMenuBookmark_active_get(PointerRNA *ptr)
3336{
3337 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_BOOKMARKS);
3338}
3339
3340static void rna_FileBrowser_FSMenuBookmark_active_set(PointerRNA *ptr, int value)
3341{
3342 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_BOOKMARKS);
3343}
3344
3345static void rna_FileBrowser_FSMenuBookmark_active_range(
3346 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3347{
3348 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_BOOKMARKS);
3349}
3350
3351static int rna_FileBrowser_FSMenuRecent_active_get(PointerRNA *ptr)
3352{
3353 return rna_FileBrowser_FSMenu_active_get(ptr, FS_CATEGORY_RECENT);
3354}
3355
3356static void rna_FileBrowser_FSMenuRecent_active_set(PointerRNA *ptr, int value)
3357{
3358 rna_FileBrowser_FSMenu_active_set(ptr, value, FS_CATEGORY_RECENT);
3359}
3360
3361static void rna_FileBrowser_FSMenuRecent_active_range(
3362 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
3363{
3364 rna_FileBrowser_FSMenu_active_range(ptr, min, max, softmin, softmax, FS_CATEGORY_RECENT);
3365}
3366
3367static void rna_SpaceFileBrowser_browse_mode_update(Main * /*bmain*/,
3368 Scene * /*scene*/,
3369 PointerRNA *ptr)
3370{
3371 ScrArea *area = rna_area_from_space(ptr);
3372 ED_area_tag_refresh(area);
3373}
3374
3375static void rna_SpaceSpreadsheet_geometry_component_type_update(Main * /*bmain*/,
3376 Scene * /*scene*/,
3377 PointerRNA *ptr)
3378{
3379 using namespace blender;
3380 SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data;
3381 switch (sspreadsheet->geometry_component_type) {
3382 case int(bke::GeometryComponent::Type::Mesh): {
3383 if (!ELEM(bke::AttrDomain(sspreadsheet->attribute_domain),
3384 bke::AttrDomain::Point,
3385 bke::AttrDomain::Edge,
3386 bke::AttrDomain::Face,
3387 bke::AttrDomain::Corner))
3388 {
3389 sspreadsheet->attribute_domain = uint8_t(bke::AttrDomain::Point);
3390 }
3391 break;
3392 }
3393 case int(bke::GeometryComponent::Type::PointCloud): {
3394 sspreadsheet->attribute_domain = uint8_t(bke::AttrDomain::Point);
3395 break;
3396 }
3397 case int(bke::GeometryComponent::Type::Instance): {
3398 sspreadsheet->attribute_domain = uint8_t(bke::AttrDomain::Instance);
3399 break;
3400 }
3401 case int(bke::GeometryComponent::Type::Volume): {
3402 break;
3403 }
3404 case int(bke::GeometryComponent::Type::Curve): {
3405 if (!ELEM(bke::AttrDomain(sspreadsheet->attribute_domain),
3406 bke::AttrDomain::Point,
3407 bke::AttrDomain::Curve))
3408 {
3409 sspreadsheet->attribute_domain = uint8_t(bke::AttrDomain::Point);
3410 }
3411 break;
3412 }
3413 }
3414}
3415
3416const EnumPropertyItem *rna_SpaceSpreadsheet_attribute_domain_itemf(bContext * /*C*/,
3417 PointerRNA *ptr,
3418 PropertyRNA * /*prop*/,
3419 bool *r_free)
3420{
3421 using namespace blender;
3422 SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data;
3423 auto component_type = bke::GeometryComponent::Type(sspreadsheet->geometry_component_type);
3424 if (sspreadsheet->object_eval_state == SPREADSHEET_OBJECT_EVAL_STATE_ORIGINAL) {
3425 ID *used_id = ed::spreadsheet::get_current_id(sspreadsheet);
3426 if (used_id != nullptr) {
3427 if (GS(used_id->name) == ID_OB) {
3428 Object *used_object = (Object *)used_id;
3429 if (used_object->type == OB_POINTCLOUD) {
3430 component_type = bke::GeometryComponent::Type::PointCloud;
3431 }
3432 else {
3433 component_type = bke::GeometryComponent::Type::Mesh;
3434 }
3435 }
3436 }
3437 }
3438
3439 static EnumPropertyItem mesh_vertex_domain_item = {
3440 int(bke::AttrDomain::Point), "POINT", 0, "Vertex", "Attribute per point/vertex"};
3441
3442 EnumPropertyItem *item_array = nullptr;
3443 int items_len = 0;
3444 for (const EnumPropertyItem *item = rna_enum_attribute_domain_items; item->identifier != nullptr;
3445 item++)
3446 {
3447 if (component_type == bke::GeometryComponent::Type::Mesh) {
3448 if (!ELEM(bke::AttrDomain(item->value),
3449 bke::AttrDomain::Corner,
3450 bke::AttrDomain::Edge,
3451 bke::AttrDomain::Point,
3452 bke::AttrDomain::Face))
3453 {
3454 continue;
3455 }
3456 }
3457 if (component_type == bke::GeometryComponent::Type::PointCloud) {
3458 if (bke::AttrDomain(item->value) != bke::AttrDomain::Point) {
3459 continue;
3460 }
3461 }
3462 if (component_type == bke::GeometryComponent::Type::Curve) {
3463 if (!ELEM(bke::AttrDomain(item->value), bke::AttrDomain::Point, bke::AttrDomain::Curve)) {
3464 continue;
3465 }
3466 }
3467 if (bke::AttrDomain(item->value) == bke::AttrDomain::Point &&
3468 component_type == bke::GeometryComponent::Type::Mesh)
3469 {
3470 RNA_enum_item_add(&item_array, &items_len, &mesh_vertex_domain_item);
3471 }
3472 else {
3473 RNA_enum_item_add(&item_array, &items_len, item);
3474 }
3475 }
3476 RNA_enum_item_end(&item_array, &items_len);
3477
3478 *r_free = true;
3479 return item_array;
3480}
3481
3482static StructRNA *rna_viewer_path_elem_refine(PointerRNA *ptr)
3483{
3484 ViewerPathElem *elem = static_cast<ViewerPathElem *>(ptr->data);
3485 switch (ViewerPathElemType(elem->type)) {
3487 return &RNA_IDViewerPathElem;
3489 return &RNA_ModifierViewerPathElem;
3491 return &RNA_GroupNodeViewerPathElem;
3493 return &RNA_SimulationZoneViewerPathElem;
3495 return &RNA_ViewerNodeViewerPathElem;
3497 return &RNA_RepeatZoneViewerPathElem;
3499 return &RNA_ForeachGeometryElementZoneViewerPathElem;
3500 }
3502 return nullptr;
3503}
3504
3505static void rna_FileAssetSelectParams_catalog_id_get(PointerRNA *ptr, char *value)
3506{
3507 const FileAssetSelectParams *params = static_cast<FileAssetSelectParams *>(ptr->data);
3508 BLI_uuid_format(value, params->catalog_id);
3509}
3510
3511static int rna_FileAssetSelectParams_catalog_id_length(PointerRNA * /*ptr*/)
3512{
3513 return UUID_STRING_SIZE - 1;
3514}
3515
3516static void rna_FileAssetSelectParams_catalog_id_set(PointerRNA *ptr, const char *value)
3517{
3519
3520 if (value[0] == '\0') {
3521 params->catalog_id = BLI_uuid_nil();
3522 params->asset_catalog_visibility = FILE_SHOW_ASSETS_ALL_CATALOGS;
3523 return;
3524 }
3525
3526 bUUID new_uuid;
3527 if (!BLI_uuid_parse_string(&new_uuid, value)) {
3528 printf("UUID %s not formatted correctly, ignoring new value\n", value);
3529 return;
3530 }
3531
3532 params->catalog_id = new_uuid;
3533 params->asset_catalog_visibility = FILE_SHOW_ASSETS_FROM_CATALOG;
3534}
3535
3536#else
3537
3539 {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Display white edges with black outline"},
3540 {SI_UVDT_DASH, "DASH", 0, "Dash", "Display dashed black-white edges"},
3541 {SI_UVDT_BLACK, "BLACK", 0, "Black", "Display black edges"},
3542 {SI_UVDT_WHITE, "WHITE", 0, "White", "Display white edges"},
3543 {0, nullptr, 0, nullptr, nullptr},
3544};
3545
3547 /* Categories */
3548 {FILTER_ID_SCE, "category_scene", ICON_SCENE_DATA, "Scenes", "Show scenes"},
3549 {FILTER_ID_AC, "category_animation", ICON_ANIM_DATA, "Animations", "Show animation data"},
3551 "category_object",
3552 ICON_OUTLINER_COLLECTION,
3553 "Objects & Collections",
3554 "Show objects and collections"},
3557 "category_geometry",
3558 ICON_GEOMETRY_NODES,
3559 "Geometry",
3560 "Show meshes, curves, lattice, armatures and metaballs data"},
3562 "category_shading",
3563 ICON_MATERIAL_DATA,
3564 "Shading",
3565 "Show materials, node-trees, textures and Freestyle's line-styles"},
3567 "category_image",
3568 ICON_IMAGE_DATA,
3569 "Images & Sounds",
3570 "Show images, movie clips, sounds and masks"},
3572 "category_environment",
3573 ICON_WORLD_DATA,
3574 "Environment",
3575 "Show worlds, lights, cameras and speakers"},
3578 "category_misc",
3579 ICON_GREASEPENCIL,
3580 "Miscellaneous",
3581 "Show other data types"},
3582 {0, nullptr, 0, nullptr, nullptr},
3583};
3584
3585static void rna_def_space_generic_show_region_toggles(StructRNA *srna, int region_type_mask)
3586{
3587 PropertyRNA *prop;
3588
3589# define DEF_SHOW_REGION_PROPERTY(identifier, label, description) \
3590 { \
3591 prop = RNA_def_property(srna, STRINGIFY(identifier), PROP_BOOLEAN, PROP_NONE); \
3592 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); \
3593 RNA_def_property_boolean_funcs(prop, \
3594 STRINGIFY(rna_Space_##identifier##_get), \
3595 STRINGIFY(rna_Space_##identifier##_set)); \
3596 RNA_def_property_ui_text(prop, label, description); \
3597 RNA_def_property_update(prop, 0, STRINGIFY(rna_Space_##identifier##_update)); \
3598 } \
3599 ((void)0)
3600
3601 if (region_type_mask & (1 << RGN_TYPE_TOOL_HEADER)) {
3602 region_type_mask &= ~(1 << RGN_TYPE_TOOL_HEADER);
3603 DEF_SHOW_REGION_PROPERTY(show_region_tool_header, "Tool Settings", "");
3604 }
3605 if (region_type_mask & (1 << RGN_TYPE_HEADER)) {
3606 region_type_mask &= ~(1 << RGN_TYPE_HEADER);
3607 DEF_SHOW_REGION_PROPERTY(show_region_header, "Header", "");
3608 }
3609 if (region_type_mask & (1 << RGN_TYPE_FOOTER)) {
3610 region_type_mask &= ~(1 << RGN_TYPE_FOOTER);
3611 DEF_SHOW_REGION_PROPERTY(show_region_footer, "Footer", "");
3612 }
3613 if (region_type_mask & (1 << RGN_TYPE_TOOLS)) {
3614 region_type_mask &= ~(1 << RGN_TYPE_TOOLS);
3615 DEF_SHOW_REGION_PROPERTY(show_region_toolbar, "Toolbar", "");
3616 }
3617 if (region_type_mask & (1 << RGN_TYPE_TOOL_PROPS)) {
3618 region_type_mask &= ~(1 << RGN_TYPE_TOOL_PROPS);
3619 DEF_SHOW_REGION_PROPERTY(show_region_tool_props, "Toolbar", "");
3620 }
3621 if (region_type_mask & (1 << RGN_TYPE_CHANNELS)) {
3622 region_type_mask &= ~(1 << RGN_TYPE_CHANNELS);
3623 DEF_SHOW_REGION_PROPERTY(show_region_channels, "Channels", "");
3624 }
3625 if (region_type_mask & (1 << RGN_TYPE_UI)) {
3626 region_type_mask &= ~(1 << RGN_TYPE_UI);
3627 DEF_SHOW_REGION_PROPERTY(show_region_ui, "Sidebar", "");
3628 }
3629 if (region_type_mask & (1 << RGN_TYPE_HUD)) {
3630 region_type_mask &= ~(1 << RGN_TYPE_HUD);
3631 DEF_SHOW_REGION_PROPERTY(show_region_hud, "Adjust Last Operation", "");
3632 }
3633 if (region_type_mask & ((1 << RGN_TYPE_ASSET_SHELF) | (1 << RGN_TYPE_ASSET_SHELF_HEADER))) {
3634 region_type_mask &= ~((1 << RGN_TYPE_ASSET_SHELF) | (1 << RGN_TYPE_ASSET_SHELF_HEADER));
3635 DEF_SHOW_REGION_PROPERTY(show_region_asset_shelf, "Asset Shelf", "");
3636 }
3637 BLI_assert(region_type_mask == 0);
3638}
3639
3640static void rna_def_space(BlenderRNA *brna)
3641{
3642 StructRNA *srna;
3643 PropertyRNA *prop;
3644
3645 srna = RNA_def_struct(brna, "Space", nullptr);
3646 RNA_def_struct_sdna(srna, "SpaceLink");
3647 RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
3648 RNA_def_struct_path_func(srna, "BKE_screen_path_from_screen_to_space");
3649 RNA_def_struct_refine_func(srna, "rna_Space_refine");
3650
3651 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
3652 RNA_def_property_enum_sdna(prop, nullptr, "spacetype");
3654 /* When making this editable, take care for the special case of global areas
3655 * (see rna_Area_type_set). */
3657 RNA_def_property_ui_text(prop, "Type", "Space data type");
3658
3659 /* Access to #V2D_VIEWSYNC_SCREEN_TIME. */
3660 prop = RNA_def_property(srna, "show_locked_time", PROP_BOOLEAN, PROP_NONE);
3661 RNA_def_property_boolean_funcs(prop, "rna_Space_view2d_sync_get", "rna_Space_view2d_sync_set");
3663 "Sync Visible Range",
3664 "Synchronize the visible timeline range with other time-based editors");
3665 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Space_view2d_sync_update");
3666
3668}
3669
3670/* for all spaces that use a mask */
3671static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *mask_set_func)
3672{
3673 PropertyRNA *prop;
3674
3675 static const EnumPropertyItem overlay_mode_items[] = {
3677 "ALPHACHANNEL",
3678 ICON_NONE,
3679 "Alpha Channel",
3680 "Show alpha channel of the mask"},
3682 "COMBINED",
3683 ICON_NONE,
3684 "Combined",
3685 "Combine space background image with the mask"},
3686 {0, nullptr, 0, nullptr, nullptr},
3687 };
3688
3689 prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE);
3690 RNA_def_property_pointer_sdna(prop, nullptr, "mask_info.mask");
3692 RNA_def_property_ui_text(prop, "Mask", "Mask displayed and edited in this space");
3693 RNA_def_property_pointer_funcs(prop, nullptr, mask_set_func, nullptr, nullptr);
3694 RNA_def_property_update(prop, noteflag, nullptr);
3695
3696 /* mask drawing */
3697 prop = RNA_def_property(srna, "mask_display_type", PROP_ENUM, PROP_NONE);
3698 RNA_def_property_enum_sdna(prop, nullptr, "mask_info.draw_type");
3700 RNA_def_property_ui_text(prop, "Edge Display Type", "Display type for mask splines");
3701 RNA_def_property_update(prop, noteflag, nullptr);
3702
3703 prop = RNA_def_property(srna, "show_mask_spline", PROP_BOOLEAN, PROP_NONE);
3704 RNA_def_property_boolean_sdna(prop, nullptr, "mask_info.draw_flag", MASK_DRAWFLAG_SPLINE);
3705 RNA_def_property_ui_text(prop, "Show Mask Spline", "");
3706 RNA_def_property_update(prop, noteflag, nullptr);
3707
3708 prop = RNA_def_property(srna, "show_mask_overlay", PROP_BOOLEAN, PROP_NONE);
3709 RNA_def_property_boolean_sdna(prop, nullptr, "mask_info.draw_flag", MASK_DRAWFLAG_OVERLAY);
3710 RNA_def_property_ui_text(prop, "Show Mask Overlay", "");
3711 RNA_def_property_update(prop, noteflag, nullptr);
3712
3713 prop = RNA_def_property(srna, "mask_overlay_mode", PROP_ENUM, PROP_NONE);
3714 RNA_def_property_enum_sdna(prop, nullptr, "mask_info.overlay_mode");
3715 RNA_def_property_enum_items(prop, overlay_mode_items);
3716 RNA_def_property_ui_text(prop, "Overlay Mode", "Overlay mode of rasterized mask");
3717 RNA_def_property_update(prop, noteflag, nullptr);
3718
3719 prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_FACTOR);
3720 RNA_def_property_float_sdna(prop, nullptr, "mask_info.blend_factor");
3721 RNA_def_property_range(prop, 0.0f, 1.0f);
3722 RNA_def_property_ui_range(prop, 0, 1., 0.1, 1);
3723 RNA_def_property_ui_text(prop, "Blending Factor", "Overlay blending factor of rasterized mask");
3724 RNA_def_property_update(prop, noteflag, nullptr);
3725}
3726
3728{
3729 StructRNA *srna;
3730 PropertyRNA *prop;
3731
3732 static const EnumPropertyItem dt_uvstretch_items[] = {
3733 {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
3734 {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
3735 {0, nullptr, 0, nullptr, nullptr},
3736 };
3737
3738 static const EnumPropertyItem pixel_round_mode_items[] = {
3739 {SI_PIXEL_ROUND_DISABLED, "DISABLED", 0, "Disabled", "Don't round to pixels"},
3740 {SI_PIXEL_ROUND_CORNER, "CORNER", 0, "Corner", "Round to pixel corners"},
3741 {SI_PIXEL_ROUND_CENTER, "CENTER", 0, "Center", "Round to pixel centers"},
3742 {0, nullptr, 0, nullptr, nullptr},
3743 };
3744
3745 static const EnumPropertyItem grid_shape_source_items[] = {
3746 {SI_GRID_SHAPE_DYNAMIC, "DYNAMIC", 0, "Dynamic", "Dynamic grid"},
3747 {SI_GRID_SHAPE_FIXED, "FIXED", 0, "Fixed", "Manually set grid divisions"},
3748 {SI_GRID_SHAPE_PIXEL, "PIXEL", 0, "Pixel", "Grid aligns with pixels from image"},
3749 {0, nullptr, 0, nullptr, nullptr},
3750 };
3751
3752 srna = RNA_def_struct(brna, "SpaceUVEditor", nullptr);
3753 RNA_def_struct_sdna(srna, "SpaceImage");
3754 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
3755 RNA_def_struct_path_func(srna, "rna_SpaceUVEditor_path");
3756 RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
3757
3758 /* drawing */
3759 prop = RNA_def_property(srna, "edge_display_type", PROP_ENUM, PROP_NONE);
3760 RNA_def_property_enum_sdna(prop, nullptr, "dt_uv");
3762 RNA_def_property_ui_text(prop, "Display As", "Display style for UV edges");
3764
3765 prop = RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
3766 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_STRETCH);
3768 prop,
3769 "Display Stretch",
3770 "Display faces colored according to the difference in shape between UVs and "
3771 "their 3D coordinates (blue for low distortion, red for high distortion)");
3773
3774 prop = RNA_def_property(srna, "display_stretch_type", PROP_ENUM, PROP_NONE);
3775 RNA_def_property_enum_sdna(prop, nullptr, "dt_uvstretch");
3776 RNA_def_property_enum_items(prop, dt_uvstretch_items);
3777 RNA_def_property_ui_text(prop, "Display Stretch Type", "Type of stretch to display");
3780
3781 prop = RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
3782 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAWSHADOW);
3784 prop, "Display Modified Edges", "Display edges after modifiers are applied");
3786
3787 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
3788 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_METADATA);
3789 RNA_def_property_ui_text(prop, "Show Metadata", "Display metadata properties of the image");
3791
3792 prop = RNA_def_property(srna, "show_texpaint", PROP_BOOLEAN, PROP_NONE);
3795 prop, "Display Texture Paint UVs", "Display overlay of texture paint UV layer");
3797
3798 prop = RNA_def_property(srna, "show_pixel_coords", PROP_BOOLEAN, PROP_NONE);
3801 prop, "Pixel Coordinates", "Display UV coordinates in pixels rather than from 0.0 to 1.0");
3803
3804 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
3806 RNA_def_property_ui_text(prop, "Display Faces", "Display faces over the image");
3808
3809 prop = RNA_def_property(srna, "tile_grid_shape", PROP_INT, PROP_XYZ);
3810 RNA_def_property_int_sdna(prop, nullptr, "tile_grid_shape");
3811 RNA_def_property_array(prop, 2);
3813 RNA_def_property_range(prop, 1, 100);
3814 RNA_def_property_int_funcs(prop, nullptr, "rna_SpaceUVEditor_tile_grid_shape_set", nullptr);
3816 prop, "Tile Grid Shape", "How many tiles will be shown in the background");
3818
3819 prop = RNA_def_property(srna, "show_grid_over_image", PROP_BOOLEAN, PROP_NONE);
3820 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_GRID_OVER_IMAGE);
3822 RNA_def_property_ui_text(prop, "Grid Over Image", "Show the grid over the image");
3824
3825 prop = RNA_def_property(srna, "grid_shape_source", PROP_ENUM, PROP_NONE);
3826 RNA_def_property_enum_items(prop, grid_shape_source_items);
3827 RNA_def_property_ui_text(prop, "Grid Shape Source", "Specify source for the grid shape");
3829
3830 prop = RNA_def_property(srna, "custom_grid_subdivisions", PROP_INT, PROP_XYZ);
3831 RNA_def_property_int_sdna(prop, nullptr, "custom_grid_subdiv");
3832 RNA_def_property_array(prop, 2);
3834 RNA_def_property_range(prop, 1, 5000);
3835 RNA_def_property_int_funcs(prop, nullptr, "rna_SpaceUVEditor_custom_grid_subdiv_set", nullptr);
3837 prop, "Dynamic Grid Size", "Number of grid units in UV space that make one UV Unit");
3839
3840 prop = RNA_def_property(srna, "uv_opacity", PROP_FLOAT, PROP_FACTOR);
3841 RNA_def_property_float_sdna(prop, nullptr, "uv_opacity");
3842 RNA_def_property_range(prop, 0.0f, 1.0f);
3843 RNA_def_property_ui_text(prop, "UV Opacity", "Opacity of UV overlays");
3845
3846 prop = RNA_def_property(srna, "stretch_opacity", PROP_FLOAT, PROP_FACTOR);
3847 RNA_def_property_float_sdna(prop, nullptr, "stretch_opacity");
3848 RNA_def_property_range(prop, 0.0f, 1.0f);
3849 RNA_def_property_ui_text(prop, "Stretch Opacity", "Opacity of the UV Stretch overlay");
3851
3852 prop = RNA_def_property(srna, "pixel_round_mode", PROP_ENUM, PROP_NONE);
3853 RNA_def_property_enum_items(prop, pixel_round_mode_items);
3854 RNA_def_property_ui_text(prop, "Round to Pixels", "Round UVs to pixels while editing");
3856
3857 prop = RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
3858 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_CLIP_UV);
3860 "Constrain to Image Bounds",
3861 "Constraint to stay within the image bounds while editing");
3863
3864 prop = RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
3865 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_LIVE_UNWRAP);
3867 prop,
3868 "Live Unwrap",
3869 "Continuously unwrap the selected UV island while transforming pinned vertices");
3871}
3872
3874{
3875 StructRNA *srna;
3876 PropertyRNA *prop;
3877
3878 static const EnumPropertyItem display_mode_items[] = {
3879 {SO_SCENES,
3880 "SCENES",
3881 ICON_SCENE_DATA,
3882 "Scenes",
3883 "Display scenes and their view layers, collections and objects"},
3885 "VIEW_LAYER",
3886 ICON_RENDER_RESULT,
3887 "View Layer",
3888 "Display collections and objects in the view layer"},
3889 {SO_SEQUENCE,
3890 "SEQUENCE",
3891 ICON_SEQUENCE,
3892 "Video Sequencer",
3893 "Display data belonging to the Video Sequencer"},
3894 {SO_LIBRARIES,
3895 "LIBRARIES",
3896 ICON_FILE_BLEND,
3897 "Blender File",
3898 "Display data of current file and linked libraries"},
3899 {SO_DATA_API,
3900 "DATA_API",
3901 ICON_RNA,
3902 "Data API",
3903 "Display low level Blender data and its properties"},
3905 "LIBRARY_OVERRIDES",
3906 ICON_LIBRARY_DATA_OVERRIDE,
3907 "Library Overrides",
3908 "Display data-blocks with library overrides and list their overridden properties"},
3910 "ORPHAN_DATA",
3911 ICON_ORPHAN_DATA,
3912 "Unused Data",
3913 "Display data that is unused and/or will be lost when the file is reloaded"},
3914 {0, nullptr, 0, nullptr, nullptr},
3915 };
3916
3917 static const EnumPropertyItem lib_override_view_mode[] = {
3919 "PROPERTIES",
3920 ICON_NONE,
3921 "Properties",
3922 "Display all local override data-blocks with their overridden properties and buttons to "
3923 "edit them"},
3925 "HIERARCHIES",
3926 ICON_NONE,
3927 "Hierarchies",
3928 "Display library override relationships"},
3929 {0, nullptr, 0, nullptr, nullptr},
3930 };
3931
3932 static const EnumPropertyItem filter_state_items[] = {
3933 {SO_FILTER_OB_ALL, "ALL", 0, "All", "Show all objects in the view layer"},
3934 {SO_FILTER_OB_VISIBLE, "VISIBLE", 0, "Visible", "Show visible objects"},
3935 {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected", "Show selected objects"},
3936 {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active object"},
3937 {SO_FILTER_OB_SELECTABLE, "SELECTABLE", 0, "Selectable", "Show only selectable objects"},
3938 {0, nullptr, 0, nullptr, nullptr},
3939 };
3940
3941 srna = RNA_def_struct(brna, "SpaceOutliner", "Space");
3942 RNA_def_struct_sdna(srna, "SpaceOutliner");
3943 RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
3944
3945 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
3946 RNA_def_property_enum_sdna(prop, nullptr, "outlinevis");
3947 RNA_def_property_enum_items(prop, display_mode_items);
3948 RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
3950
3951 prop = RNA_def_property(srna, "lib_override_view_mode", PROP_ENUM, PROP_NONE);
3952 RNA_def_property_enum_items(prop, lib_override_view_mode);
3954 "Library Override View Mode",
3955 "Choose different visualizations of library override data");
3957
3958 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
3959 RNA_def_property_string_sdna(prop, nullptr, "search_string");
3960 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
3963
3964 prop = RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
3965 RNA_def_property_boolean_sdna(prop, nullptr, "search_flags", SO_FIND_CASE_SENSITIVE);
3967 prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
3969
3970 prop = RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
3971 RNA_def_property_boolean_sdna(prop, nullptr, "search_flags", SO_FIND_COMPLETE);
3973 prop, "Complete Matches Only", "Only use complete matches of search string");
3975
3976 prop = RNA_def_property(srna, "use_sort_alpha", PROP_BOOLEAN, PROP_NONE);
3978 RNA_def_property_ui_text(prop, "Sort Alphabetically", "");
3980
3981 prop = RNA_def_property(srna, "use_sync_select", PROP_BOOLEAN, PROP_NONE);
3982 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_SYNC_SELECT);
3984 prop, "Sync Outliner Selection", "Sync outliner selection with other editors");
3986
3987 prop = RNA_def_property(srna, "show_mode_column", PROP_BOOLEAN, PROP_NONE);
3988 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SO_MODE_COLUMN);
3990 prop, "Show Mode Column", "Show the mode column for mode toggle and activation");
3992
3993 /* Granular restriction column option. */
3994 prop = RNA_def_property(srna, "show_restrict_column_enable", PROP_BOOLEAN, PROP_NONE);
3995 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_ENABLE);
3996 RNA_def_property_ui_text(prop, "Exclude from View Layer", "Exclude from view layer");
3997 RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, 0);
3999
4000 prop = RNA_def_property(srna, "show_restrict_column_select", PROP_BOOLEAN, PROP_NONE);
4001 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_SELECT);
4002 RNA_def_property_ui_text(prop, "Selectable", "Selectable");
4003 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
4005
4006 prop = RNA_def_property(srna, "show_restrict_column_hide", PROP_BOOLEAN, PROP_NONE);
4007 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_HIDE);
4008 RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
4009 RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, 0);
4011
4012 prop = RNA_def_property(srna, "show_restrict_column_viewport", PROP_BOOLEAN, PROP_NONE);
4013 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_VIEWPORT);
4014 RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
4015 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0);
4017
4018 prop = RNA_def_property(srna, "show_restrict_column_render", PROP_BOOLEAN, PROP_NONE);
4019 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_RENDER);
4020 RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");
4021 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 0);
4023
4024 prop = RNA_def_property(srna, "show_restrict_column_holdout", PROP_BOOLEAN, PROP_NONE);
4025 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_HOLDOUT);
4026 RNA_def_property_ui_text(prop, "Holdout", "Holdout");
4027 RNA_def_property_ui_icon(prop, ICON_HOLDOUT_ON, 0);
4029
4030 prop = RNA_def_property(srna, "show_restrict_column_indirect_only", PROP_BOOLEAN, PROP_NONE);
4031 RNA_def_property_boolean_sdna(prop, nullptr, "show_restrict_flags", SO_RESTRICT_INDIRECT_ONLY);
4032 RNA_def_property_ui_text(prop, "Indirect Only", "Indirect only");
4033 RNA_def_property_ui_icon(prop, ICON_INDIRECT_ONLY_ON, 0);
4035
4036 /* Filters. */
4037 prop = RNA_def_property(srna, "use_filter_object", PROP_BOOLEAN, PROP_NONE);
4039 RNA_def_property_ui_text(prop, "Filter Objects", "Show objects");
4041
4042 prop = RNA_def_property(srna, "use_filter_object_content", PROP_BOOLEAN, PROP_NONE);
4045 prop, "Show Object Contents", "Show what is inside the objects elements");
4047
4048 prop = RNA_def_property(srna, "use_filter_children", PROP_BOOLEAN, PROP_NONE);
4050 RNA_def_property_ui_text(prop, "Show Object Children", "Show children");
4052
4053 prop = RNA_def_property(srna, "use_filter_collection", PROP_BOOLEAN, PROP_NONE);
4055 RNA_def_property_ui_text(prop, "Show Collections", "Show collections");
4057
4058 prop = RNA_def_property(srna, "use_filter_view_layers", PROP_BOOLEAN, PROP_NONE);
4060 RNA_def_property_ui_text(prop, "Show All View Layers", "Show all the view layers");
4062
4063 /* Filters object state. */
4064 prop = RNA_def_property(srna, "filter_state", PROP_ENUM, PROP_NONE);
4065 RNA_def_property_enum_sdna(prop, nullptr, "filter_state");
4066 RNA_def_property_enum_items(prop, filter_state_items);
4067 RNA_def_property_ui_text(prop, "Object State Filter", "");
4069
4070 prop = RNA_def_property(srna, "filter_invert", PROP_BOOLEAN, PROP_NONE);
4072 RNA_def_property_ui_text(prop, "Invert", "Invert the object state filter");
4074
4075 /* Filters object type. */
4076 prop = RNA_def_property(srna, "use_filter_object_mesh", PROP_BOOLEAN, PROP_NONE);
4078 RNA_def_property_ui_text(prop, "Show Meshes", "Show mesh objects");
4080
4081 prop = RNA_def_property(srna, "use_filter_object_armature", PROP_BOOLEAN, PROP_NONE);
4083 RNA_def_property_ui_text(prop, "Show Armatures", "Show armature objects");
4085
4086 prop = RNA_def_property(srna, "use_filter_object_empty", PROP_BOOLEAN, PROP_NONE);
4088 RNA_def_property_ui_text(prop, "Show Empties", "Show empty objects");
4090
4091 prop = RNA_def_property(srna, "use_filter_object_light", PROP_BOOLEAN, PROP_NONE);
4093 RNA_def_property_ui_text(prop, "Show Lights", "Show light objects");
4095
4096 prop = RNA_def_property(srna, "use_filter_object_camera", PROP_BOOLEAN, PROP_NONE);
4098 RNA_def_property_ui_text(prop, "Show Cameras", "Show camera objects");
4100
4101 prop = RNA_def_property(srna, "use_filter_object_grease_pencil", PROP_BOOLEAN, PROP_NONE);
4103 RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show grease pencil objects");
4105
4106 prop = RNA_def_property(srna, "use_filter_object_others", PROP_BOOLEAN, PROP_NONE);
4109 prop, "Show Other Objects", "Show curves, lattices, light probes, fonts, ...");
4111
4112 /* Libraries filter. */
4113 prop = RNA_def_property(srna, "use_filter_id_type", PROP_BOOLEAN, PROP_NONE);
4114 RNA_def_property_boolean_sdna(prop, nullptr, "filter", SO_FILTER_ID_TYPE);
4115 RNA_def_property_ui_text(prop, "Filter by Type", "Show only data-blocks of one type");
4117
4118 prop = RNA_def_property(srna, "filter_id_type", PROP_ENUM, PROP_NONE);
4119 RNA_def_property_enum_sdna(prop, nullptr, "filter_id_type");
4121 RNA_def_property_ui_text(prop, "Filter by Type", "Data-block type to show");
4123
4124 prop = RNA_def_property(srna, "use_filter_lib_override_system", PROP_BOOLEAN, PROP_NONE);
4127 prop,
4128 "Show System Overrides",
4129 "For libraries with overrides created, show the overridden values that are "
4130 "defined/controlled automatically (e.g. to make users of an overridden data-block point to "
4131 "the override data, not the original linked data)");
4133}
4134
4136{
4137 StructRNA *srna;
4138 PropertyRNA *prop;
4139
4140 static const EnumPropertyItem background_type_items[] = {
4141 {V3D_SHADING_BACKGROUND_THEME, "THEME", 0, "Theme", "Use the theme for background color"},
4142 {V3D_SHADING_BACKGROUND_WORLD, "WORLD", 0, "World", "Use the world for background color"},
4144 "VIEWPORT",
4145 0,
4146 "Viewport",
4147 "Use a custom color limited to this viewport only"},
4148 {0, nullptr, 0, nullptr, nullptr},
4149 };
4150
4151 static const EnumPropertyItem cavity_type_items[] = {
4153 "WORLD",
4154 0,
4155 "World",
4156 "Cavity shading computed in world space, useful for larger-scale occlusion"},
4158 "SCREEN",
4159 0,
4160 "Screen",
4161 "Curvature-based shading, useful for making fine details more visible"},
4162 {V3D_SHADING_CAVITY_BOTH, "BOTH", 0, "Both", "Use both effects simultaneously"},
4163 {0, nullptr, 0, nullptr, nullptr},
4164 };
4165
4166 static const EnumPropertyItem use_compositor_items[] = {
4168 "DISABLED",
4169 0,
4170 "Disabled",
4171 "The compositor is disabled"},
4173 "CAMERA",
4174 0,
4175 "Camera",
4176 "The compositor is enabled only in camera view"},
4178 "ALWAYS",
4179 0,
4180 "Always",
4181 "The compositor is always enabled regardless of the view"},
4182 {0, nullptr, 0, nullptr, nullptr},
4183 };
4184
4185 /* Note these settings are used for both 3D viewport and the OpenGL render
4186 * engine in the scene, so can't assume to always be part of a screen. */
4187 srna = RNA_def_struct(brna, "View3DShading", nullptr);
4188 RNA_def_struct_path_func(srna, "rna_View3DShading_path");
4190 srna, "3D View Shading Settings", "Settings for shading in the 3D viewport");
4191 RNA_def_struct_idprops_func(srna, "rna_View3DShading_idprops");
4192
4193 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
4196 "rna_3DViewShading_type_get",
4197 "rna_3DViewShading_type_set",
4198 "rna_3DViewShading_type_itemf");
4200 prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
4202 prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, "rna_3DViewShading_type_update");
4203
4204 prop = RNA_def_property(srna, "light", PROP_ENUM, PROP_NONE);
4205 RNA_def_property_enum_sdna(prop, nullptr, "light");
4207 RNA_def_property_ui_text(prop, "Lighting", "Lighting Method for Solid/Texture Viewport Shading");
4209
4210 prop = RNA_def_property(srna, "show_object_outline", PROP_BOOLEAN, PROP_NONE);
4213 RNA_def_property_ui_text(prop, "Outline", "Show Object Outline");
4215
4216 prop = RNA_def_property(srna, "studio_light", PROP_ENUM, PROP_NONE);
4220 "rna_View3DShading_studio_light_get",
4221 "rna_View3DShading_studio_light_set",
4222 "rna_View3DShading_studio_light_itemf");
4223 RNA_def_property_ui_text(prop, "Studiolight", "Studio lighting setup");
4225
4226 prop = RNA_def_property(srna, "use_world_space_lighting", PROP_BOOLEAN, PROP_NONE);
4230 prop, "World Space Lighting", "Make the lighting fixed and not follow the camera");
4232
4233 prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE);
4236 prop, "Backface Culling", "Use back face culling to hide the back side of faces");
4238
4239 prop = RNA_def_property(srna, "show_cavity", PROP_BOOLEAN, PROP_NONE);
4240 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_CAVITY);
4242 RNA_def_property_ui_text(prop, "Cavity", "Show Cavity");
4244
4245 prop = RNA_def_property(srna, "cavity_type", PROP_ENUM, PROP_NONE);
4246 RNA_def_property_enum_items(prop, cavity_type_items);
4247 RNA_def_property_ui_text(prop, "Cavity Type", "Way to display the cavity shading");
4250
4251 prop = RNA_def_property(srna, "curvature_ridge_factor", PROP_FLOAT, PROP_FACTOR);
4252 RNA_def_property_float_sdna(prop, nullptr, "curvature_ridge_factor");
4253 RNA_def_property_ui_text(prop, "Curvature Ridge", "Factor for the curvature ridges");
4254 RNA_def_property_range(prop, 0.0f, 2.0f);
4257
4258 prop = RNA_def_property(srna, "curvature_valley_factor", PROP_FLOAT, PROP_FACTOR);
4259 RNA_def_property_float_sdna(prop, nullptr, "curvature_valley_factor");
4260 RNA_def_property_ui_text(prop, "Curvature Valley", "Factor for the curvature valleys");
4261 RNA_def_property_range(prop, 0.0f, 2.0f);
4264
4265 prop = RNA_def_property(srna, "cavity_ridge_factor", PROP_FLOAT, PROP_FACTOR);
4266 RNA_def_property_float_sdna(prop, nullptr, "cavity_ridge_factor");
4267 RNA_def_property_ui_text(prop, "Cavity Ridge", "Factor for the cavity ridges");
4268 RNA_def_property_range(prop, 0.0f, 250.0f);
4269 RNA_def_property_ui_range(prop, 0.00f, 2.5f, 1, 3);
4272
4273 prop = RNA_def_property(srna, "cavity_valley_factor", PROP_FLOAT, PROP_FACTOR);
4274 RNA_def_property_float_sdna(prop, nullptr, "cavity_valley_factor");
4275 RNA_def_property_ui_text(prop, "Cavity Valley", "Factor for the cavity valleys");
4276 RNA_def_property_range(prop, 0.0f, 250.0f);
4277 RNA_def_property_ui_range(prop, 0.00f, 2.5f, 1, 3);
4280
4281 prop = RNA_def_property(srna, "selected_studio_light", PROP_POINTER, PROP_NONE);
4282 RNA_def_property_struct_type(prop, "StudioLight");
4284 RNA_def_property_ui_text(prop, "Studio Light", "Selected StudioLight");
4286 prop, "rna_View3DShading_selected_studio_light_get", nullptr, nullptr, nullptr);
4289
4290 prop = RNA_def_property(srna, "studiolight_rotate_z", PROP_FLOAT, PROP_ANGLE);
4291 RNA_def_property_float_sdna(prop, nullptr, "studiolight_rot_z");
4293 prop, "Studiolight Rotation", "Rotation of the studiolight around the Z-Axis");
4297
4298 prop = RNA_def_property(srna, "studiolight_intensity", PROP_FLOAT, PROP_FACTOR);
4299 RNA_def_property_float_sdna(prop, nullptr, "studiolight_intensity");
4301 RNA_def_property_ui_text(prop, "Strength", "Strength of the studiolight");
4302 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4303 RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3);
4305
4306 prop = RNA_def_property(srna, "studiolight_background_alpha", PROP_FLOAT, PROP_FACTOR);
4307 RNA_def_property_float_sdna(prop, nullptr, "studiolight_background");
4308 RNA_def_property_ui_text(prop, "World Opacity", "Show the studiolight in the background");
4309 RNA_def_property_range(prop, 0.0f, 1.0f);
4310 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
4313
4314 prop = RNA_def_property(srna, "studiolight_background_blur", PROP_FLOAT, PROP_FACTOR);
4315 RNA_def_property_float_sdna(prop, nullptr, "studiolight_blur");
4316 RNA_def_property_ui_text(prop, "Blur", "Blur the studiolight in the background");
4318 RNA_def_property_range(prop, 0.0f, 1.0f);
4319 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
4322
4323 prop = RNA_def_property(srna, "use_studiolight_view_rotation", PROP_BOOLEAN, PROP_NONE);
4325 prop, nullptr, "flag", V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION);
4329 prop, "World Space Lighting", "Make the HDR rotation fixed and not follow the camera");
4331
4332 prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE);
4333 RNA_def_property_enum_sdna(prop, nullptr, "color_type");
4335 RNA_def_property_ui_text(prop, "Color", "Color Type");
4338 prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, "rna_GPencil_update");
4339
4340 prop = RNA_def_property(srna, "wireframe_color_type", PROP_ENUM, PROP_NONE);
4341 RNA_def_property_enum_sdna(prop, nullptr, "wire_color_type");
4343 RNA_def_property_ui_text(prop, "Wire Color", "Wire Color Type");
4345
4346 prop = RNA_def_property(srna, "single_color", PROP_FLOAT, PROP_COLOR);
4347 RNA_def_property_float_sdna(prop, nullptr, "single_color");
4348 RNA_def_property_array(prop, 3);
4349 RNA_def_property_ui_text(prop, "Color", "Color for single color mode");
4350 RNA_def_property_range(prop, 0.0f, 1.0f);
4352
4353 prop = RNA_def_property(srna, "background_type", PROP_ENUM, PROP_NONE);
4354 RNA_def_property_enum_items(prop, background_type_items);
4355 RNA_def_property_ui_text(prop, "Background", "Way to display the background");
4358
4359 prop = RNA_def_property(srna, "background_color", PROP_FLOAT, PROP_COLOR);
4360 RNA_def_property_array(prop, 3);
4361 RNA_def_property_ui_text(prop, "Background Color", "Color for custom background color");
4362 RNA_def_property_range(prop, 0.0f, 1.0f);
4364
4365 prop = RNA_def_property(srna, "show_shadows", PROP_BOOLEAN, PROP_NONE);
4366 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_SHADOW);
4368 RNA_def_property_ui_text(prop, "Shadow", "Show Shadow");
4370
4371 prop = RNA_def_property(srna, "show_xray", PROP_BOOLEAN, PROP_NONE);
4372 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SHADING_XRAY);
4374 RNA_def_property_ui_text(prop, "Show X-Ray", "Show whole scene transparent");
4376
4377 prop = RNA_def_property(srna, "show_xray_wireframe", PROP_BOOLEAN, PROP_NONE);
4380 RNA_def_property_ui_text(prop, "Show X-Ray", "Show whole scene transparent");
4382
4383 prop = RNA_def_property(srna, "xray_alpha", PROP_FLOAT, PROP_FACTOR);
4384 RNA_def_property_float_sdna(prop, nullptr, "xray_alpha");
4385 RNA_def_property_ui_text(prop, "X-Ray Alpha", "Amount of alpha to use");
4386 RNA_def_property_range(prop, 0.0f, 1.0f);
4389
4390 prop = RNA_def_property(srna, "xray_alpha_wireframe", PROP_FLOAT, PROP_FACTOR);
4391 RNA_def_property_float_sdna(prop, nullptr, "xray_alpha_wire");
4392 RNA_def_property_ui_text(prop, "X-Ray Alpha", "Amount of alpha to use");
4393 RNA_def_property_range(prop, 0.0f, 1.0f);
4396
4397 prop = RNA_def_property(srna, "use_dof", PROP_BOOLEAN, PROP_NONE);
4401 prop,
4402 "Depth Of Field",
4403 "Use depth of field on viewport using the values from the active camera");
4405
4406 prop = RNA_def_property(srna, "use_scene_lights", PROP_BOOLEAN, PROP_NONE);
4410 RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene");
4412
4413 prop = RNA_def_property(srna, "use_scene_world", PROP_BOOLEAN, PROP_NONE);
4417 RNA_def_property_ui_text(prop, "Scene World", "Use scene world for lighting");
4419
4420 prop = RNA_def_property(srna, "use_scene_lights_render", PROP_BOOLEAN, PROP_NONE);
4423 RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene");
4425
4426 prop = RNA_def_property(srna, "use_scene_world_render", PROP_BOOLEAN, PROP_NONE);
4429 RNA_def_property_ui_text(prop, "Scene World", "Use scene world for lighting");
4431
4432 prop = RNA_def_property(srna, "show_specular_highlight", PROP_BOOLEAN, PROP_NONE);
4435 RNA_def_property_ui_text(prop, "Specular Highlights", "Render specular highlights");
4437
4438 prop = RNA_def_property(srna, "object_outline_color", PROP_FLOAT, PROP_COLOR);
4439 RNA_def_property_float_sdna(prop, nullptr, "object_outline_color");
4440 RNA_def_property_array(prop, 3);
4441 RNA_def_property_ui_text(prop, "Outline Color", "Color for object outline");
4442 RNA_def_property_range(prop, 0.0f, 1.0f);
4444
4445 prop = RNA_def_property(srna, "shadow_intensity", PROP_FLOAT, PROP_FACTOR);
4446 RNA_def_property_float_sdna(prop, nullptr, "shadow_intensity");
4447 RNA_def_property_ui_text(prop, "Shadow Intensity", "Darkness of shadows");
4448 RNA_def_property_range(prop, 0.0f, 1.0f);
4449 RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 3);
4452
4453 prop = RNA_def_property(srna, "render_pass", PROP_ENUM, PROP_NONE);
4454 RNA_def_property_enum_sdna(prop, nullptr, "render_pass");
4456 RNA_def_property_ui_text(prop, "Render Pass", "Render Pass to show in the viewport");
4458 "rna_3DViewShading_render_pass_get",
4459 "rna_3DViewShading_render_pass_set",
4460 "rna_3DViewShading_render_pass_itemf");
4462
4463 prop = RNA_def_property(srna, "aov_name", PROP_STRING, PROP_NONE);
4464 RNA_def_property_string_sdna(prop, nullptr, "aov_name");
4465 RNA_def_property_ui_text(prop, "Shader AOV Name", "Name of the active Shader AOV");
4468
4469 prop = RNA_def_property(srna, "use_compositor", PROP_ENUM, PROP_NONE);
4470 RNA_def_property_enum_sdna(prop, nullptr, "use_compositor");
4471 RNA_def_property_enum_items(prop, use_compositor_items);
4474 prop, "Compositor", "When to preview the compositor output inside the viewport");
4477 "rna_SpaceView3D_shading_use_compositor_update");
4478}
4479
4481{
4482 StructRNA *srna;
4483 PropertyRNA *prop;
4484
4485 srna = RNA_def_struct(brna, "View3DOverlay", nullptr);
4486 RNA_def_struct_sdna(srna, "View3D");
4487 RNA_def_struct_nested(brna, srna, "SpaceView3D");
4488 RNA_def_struct_path_func(srna, "rna_View3DOverlay_path");
4490 srna, "3D View Overlay Settings", "Settings for display of overlays in the 3D viewport");
4491
4492 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
4494 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like gizmos and outlines");
4495 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
4496
4497 prop = RNA_def_property(srna, "show_ortho_grid", PROP_BOOLEAN, PROP_NONE);
4498 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_ORTHO_GRID);
4499 RNA_def_property_ui_text(prop, "Display Grid", "Show grid in orthographic side view");
4501
4502 prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
4503 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_FLOOR);
4504 RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid");
4506
4507 prop = RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
4508 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_X);
4509 RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line");
4511
4512 prop = RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
4513 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_Y);
4514 RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line");
4516
4517 prop = RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
4518 RNA_def_property_boolean_sdna(prop, nullptr, "gridflag", V3D_SHOW_Z);
4519 RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line");
4521
4522 prop = RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
4523 RNA_def_property_float_sdna(prop, nullptr, "grid");
4525 prop, "Grid Scale", "Multiplier for the distance between 3D View grid lines");
4526 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4527 RNA_def_property_ui_range(prop, 0.001f, 1000.0f, 0.1f, 3);
4529
4530 prop = RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
4531 RNA_def_property_int_sdna(prop, nullptr, "gridlines");
4533 prop, "Grid Lines", "Number of grid lines to display in perspective view");
4534 RNA_def_property_range(prop, 0, 1024);
4536
4537 prop = RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
4538 RNA_def_property_int_sdna(prop, nullptr, "gridsubdiv");
4539 RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions between grid lines");
4540 RNA_def_property_range(prop, 1, 1024);
4542
4543 prop = RNA_def_property(srna, "grid_scale_unit", PROP_FLOAT, PROP_NONE);
4545 RNA_def_property_float_funcs(prop, "rna_View3DOverlay_GridScaleUnit_get", nullptr, nullptr);
4547 prop, "Grid Scale Unit", "Grid cell size scaled by scene unit system settings");
4548
4549 prop = RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
4550 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_SELECT_OUTLINE);
4552 prop, "Outline Selected", "Show an outline highlight around selected objects");
4554
4555 prop = RNA_def_property(srna, "show_object_origins", PROP_BOOLEAN, PROP_NONE);
4557 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_OBJECT_ORIGINS);
4558 RNA_def_property_ui_text(prop, "Object Origins", "Show object center dots");
4560
4561 prop = RNA_def_property(srna, "show_object_origins_all", PROP_BOOLEAN, PROP_NONE);
4562 RNA_def_property_boolean_sdna(prop, nullptr, "flag", V3D_DRAW_CENTERS);
4564 prop,
4565 "All Object Origins",
4566 "Show the object origin center dot for all (selected and unselected) objects");
4568
4569 prop = RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
4572 "Relationship Lines",
4573 "Show dashed lines indicating parent or constraint relationships");
4575
4576 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
4578 RNA_def_property_ui_text(prop, "Show 3D Cursor", "Display 3D Cursor Overlay");
4580
4581 prop = RNA_def_property(srna, "show_text", PROP_BOOLEAN, PROP_NONE);
4582 RNA_def_property_boolean_negative_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_TEXT);
4583 RNA_def_property_ui_text(prop, "Show Text", "Display overlay text");
4585
4586 prop = RNA_def_property(srna, "show_stats", PROP_BOOLEAN, PROP_NONE);
4587 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_STATS);
4588 RNA_def_property_ui_text(prop, "Show Statistics", "Display scene statistics overlay text");
4590
4591 /* show camera composition guides */
4592 prop = RNA_def_property(srna, "show_camera_guides", PROP_BOOLEAN, PROP_NONE);
4594 RNA_def_property_ui_text(prop, "Show Camera Guides", "Show camera composition guides");
4596
4597 prop = RNA_def_property(srna, "show_camera_passepartout", PROP_BOOLEAN, PROP_NONE);
4599 RNA_def_property_ui_text(prop, "Show Passepartout", "Show camera passepartout");
4601
4602 prop = RNA_def_property(srna, "show_extras", PROP_BOOLEAN, PROP_NONE);
4604 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_OBJECT_XTRAS);
4606 prop, "Extras", "Object details, including empty wire, cameras and other visual guides");
4608
4609 prop = RNA_def_property(srna, "show_light_colors", PROP_BOOLEAN, PROP_NONE);
4610 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SHOW_LIGHT_COLORS);
4611 RNA_def_property_ui_text(prop, "Light Colors", "Show light colors");
4613
4614 prop = RNA_def_property(srna, "show_bones", PROP_BOOLEAN, PROP_NONE);
4615 RNA_def_property_boolean_negative_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_BONES);
4617 prop, "Show Bones", "Display bones (disable to show motion paths only)");
4619
4620 prop = RNA_def_property(srna, "show_face_orientation", PROP_BOOLEAN, PROP_NONE);
4621 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_FACE_ORIENTATION);
4623 RNA_def_property_ui_text(prop, "Face Orientation", "Show the Face Orientation Overlay");
4625
4626 prop = RNA_def_property(srna, "show_fade_inactive", PROP_BOOLEAN, PROP_NONE);
4627 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_FADE_INACTIVE);
4630 prop, "Fade Inactive Objects", "Fade inactive geometry using the viewport background color");
4632
4633 prop = RNA_def_property(srna, "fade_inactive_alpha", PROP_FLOAT, PROP_FACTOR);
4634 RNA_def_property_float_sdna(prop, nullptr, "overlay.fade_alpha");
4635 RNA_def_property_ui_text(prop, "Opacity", "Strength of the fade effect");
4636 RNA_def_property_range(prop, 0.0f, 1.0f);
4638 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
4639
4640 prop = RNA_def_property(srna, "show_xray_bone", PROP_BOOLEAN, PROP_NONE);
4641 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_BONE_SELECT);
4643 RNA_def_property_ui_text(prop, "Show Bone X-Ray", "Show the bone selection overlay");
4644 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
4645
4646 prop = RNA_def_property(srna, "xray_alpha_bone", PROP_FLOAT, PROP_FACTOR);
4647 RNA_def_property_float_sdna(prop, nullptr, "overlay.xray_alpha_bone");
4648 RNA_def_property_ui_text(prop, "Opacity", "Opacity to use for bone selection");
4649 RNA_def_property_range(prop, 0.0f, 1.0f);
4651 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
4652
4653 prop = RNA_def_property(srna, "bone_wire_alpha", PROP_FLOAT, PROP_FACTOR);
4654 RNA_def_property_float_sdna(prop, nullptr, "overlay.bone_wire_alpha");
4656 prop, "Bone Wireframe Opacity", "Maximum opacity of bones in wireframe display mode");
4657 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4658 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 2);
4660 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
4661
4662 prop = RNA_def_property(srna, "show_motion_paths", PROP_BOOLEAN, PROP_NONE);
4664 prop, nullptr, "overlay.flag", V3D_OVERLAY_HIDE_MOTION_PATHS);
4666 RNA_def_property_ui_text(prop, "Motion Paths", "Show the Motion Paths Overlay");
4668
4669 prop = RNA_def_property(srna, "show_onion_skins", PROP_BOOLEAN, PROP_NONE);
4670 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_ONION_SKINS);
4672 RNA_def_property_ui_text(prop, "Onion Skins", "Show the Onion Skinning Overlay");
4674
4675 prop = RNA_def_property(srna, "show_look_dev", PROP_BOOLEAN, PROP_NONE);
4676 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_LOOK_DEV);
4678 RNA_def_property_ui_text(prop, "HDRI Preview", "Show HDRI preview spheres");
4680
4681 prop = RNA_def_property(srna, "show_wireframes", PROP_BOOLEAN, PROP_NONE);
4682 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_WIREFRAMES);
4684 RNA_def_property_ui_text(prop, "Wireframe", "Show face edges wires");
4686
4687 prop = RNA_def_property(srna, "wireframe_threshold", PROP_FLOAT, PROP_FACTOR);
4688 RNA_def_property_float_sdna(prop, nullptr, "overlay.wireframe_threshold");
4690 "Wireframe Threshold",
4691 "Adjust the angle threshold for displaying edges "
4692 "(1.0 for all)");
4693 RNA_def_property_range(prop, 0.0f, 1.0f);
4696
4697 prop = RNA_def_property(srna, "wireframe_opacity", PROP_FLOAT, PROP_FACTOR);
4698 RNA_def_property_float_sdna(prop, nullptr, "overlay.wireframe_opacity");
4700 "Wireframe Opacity",
4701 "Opacity of the displayed edges "
4702 "(1.0 for opaque)");
4703 RNA_def_property_range(prop, 0.0f, 1.0f);
4706
4707 prop = RNA_def_property(srna, "show_viewer_attribute", PROP_BOOLEAN, PROP_NONE);
4708 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_VIEWER_ATTRIBUTE);
4710 RNA_def_property_ui_text(prop, "Viewer Node", "Show attribute overlay for active viewer node");
4712
4713 prop = RNA_def_property(srna, "viewer_attribute_opacity", PROP_FLOAT, PROP_FACTOR);
4714 RNA_def_property_float_sdna(prop, nullptr, "overlay.viewer_attribute_opacity");
4716 prop, "Viewer Attribute Opacity", "Opacity of the attribute that is currently visualized");
4717 RNA_def_property_range(prop, 0.0f, 1.0f);
4720
4721 prop = RNA_def_property(srna, "show_viewer_text", PROP_BOOLEAN, PROP_NONE);
4725 prop, "View Attribute Text", "Show attribute values as text in viewport");
4727
4728 prop = RNA_def_property(srna, "show_paint_wire", PROP_BOOLEAN, PROP_NONE);
4729 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.paint_flag", V3D_OVERLAY_PAINT_WIRE);
4730 RNA_def_property_ui_text(prop, "Show Wire", "Use wireframe display in painting modes");
4732
4733 prop = RNA_def_property(srna, "show_wpaint_contours", PROP_BOOLEAN, PROP_NONE);
4734 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.wpaint_flag", V3D_OVERLAY_WPAINT_CONTOURS);
4736 prop,
4737 "Show Weight Contours",
4738 "Show contour lines formed by points with the same interpolated weight");
4740
4741 prop = RNA_def_property(srna, "show_weight", PROP_BOOLEAN, PROP_NONE);
4742 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_WEIGHT);
4743 RNA_def_property_ui_text(prop, "Show Weights", "Display weights in editmode");
4745
4746 prop = RNA_def_property(srna, "show_retopology", PROP_BOOLEAN, PROP_NONE);
4747 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_RETOPOLOGY);
4749 "Retopology",
4750 "Hide the solid mesh and offset the overlay towards the view. "
4751 "Selection is occluded by inactive geometry, unless X-Ray is enabled");
4753
4754 prop = RNA_def_property(srna, "retopology_offset", PROP_FLOAT, PROP_DISTANCE);
4755 RNA_def_property_float_sdna(prop, nullptr, "overlay.retopology_offset");
4757 prop, "Retopology Offset", "Offset used to draw edit mesh in front of other geometry");
4758 RNA_def_property_range(prop, 0.0f, FLT_MAX);
4759 RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1f, 3);
4762
4763 prop = RNA_def_property(srna, "show_face_normals", PROP_BOOLEAN, PROP_NONE);
4764 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_NORMALS);
4765 RNA_def_property_ui_text(prop, "Display Normals", "Display face normals as lines");
4767
4768 prop = RNA_def_property(srna, "show_vertex_normals", PROP_BOOLEAN, PROP_NONE);
4769 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_VERT_NORMALS);
4770 RNA_def_property_ui_text(prop, "Display Vertex Normals", "Display vertex normals as lines");
4772
4773 prop = RNA_def_property(srna, "show_split_normals", PROP_BOOLEAN, PROP_NONE);
4774 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_LOOP_NORMALS);
4776 prop, "Display Split Normals", "Display vertex-per-face normals as lines");
4778
4779 prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
4780 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACES);
4781 RNA_def_property_ui_text(prop, "Display Faces", "Display a face selection overlay");
4783
4784 prop = RNA_def_property(srna, "show_face_center", PROP_BOOLEAN, PROP_NONE);
4785 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_DOT);
4787 prop,
4788 "Display Face Center",
4789 "Display face center when face selection is enabled in solid shading modes");
4791
4792 prop = RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
4793 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CREASES);
4795 prop, "Display Creases", "Display creases created for Subdivision Surface modifier");
4797
4798 prop = RNA_def_property(srna, "show_edge_bevel_weight", PROP_BOOLEAN, PROP_NONE);
4799 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_BWEIGHTS);
4801 prop, "Display Bevel Weights", "Display weights created for the Bevel modifier");
4803
4804 prop = RNA_def_property(srna, "show_edge_seams", PROP_BOOLEAN, PROP_NONE);
4805 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_SEAMS);
4806 RNA_def_property_ui_text(prop, "Display Seams", "Display UV unwrapping seams");
4808
4809 prop = RNA_def_property(srna, "show_edge_sharp", PROP_BOOLEAN, PROP_NONE);
4810 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_SHARP);
4812 prop, "Display Sharp", "Display sharp edges, used with the Edge Split modifier");
4814
4815 prop = RNA_def_property(srna, "show_freestyle_edge_marks", PROP_BOOLEAN, PROP_NONE);
4817 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FREESTYLE_EDGE);
4819 "Display Freestyle Edge Marks",
4820 "Display Freestyle edge marks, used with the Freestyle renderer");
4822
4823 prop = RNA_def_property(srna, "show_freestyle_face_marks", PROP_BOOLEAN, PROP_NONE);
4825 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FREESTYLE_FACE);
4827 "Display Freestyle Face Marks",
4828 "Display Freestyle face marks, used with the Freestyle renderer");
4830
4831 prop = RNA_def_property(srna, "show_statvis", PROP_BOOLEAN, PROP_NONE);
4832 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_STATVIS);
4834 prop, "Mesh Analysis", "Display statistical information about the mesh");
4836
4837 prop = RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
4838 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_EDGE_LEN);
4840 prop,
4841 "Edge Length",
4842 "Display selected edge lengths, using global values when set in the transform panel");
4844
4845 prop = RNA_def_property(srna, "show_extra_edge_angle", PROP_BOOLEAN, PROP_NONE);
4846 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_EDGE_ANG);
4848 prop,
4849 "Edge Angle",
4850 "Display selected edge angle, using global values when set in the transform panel");
4852
4853 prop = RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
4854 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_ANG);
4856 "Face Angles",
4857 "Display the angles in the selected edges, "
4858 "using global values when set in the transform panel");
4860
4861 prop = RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
4862 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_AREA);
4864 "Face Area",
4865 "Display the area of selected faces, "
4866 "using global values when set in the transform panel");
4868
4869 prop = RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
4870 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_INDICES);
4872 prop, "Indices", "Display the index numbers of selected vertices, edges, and faces");
4874
4875 prop = RNA_def_property(srna, "display_handle", PROP_ENUM, PROP_NONE);
4876 RNA_def_property_enum_sdna(prop, nullptr, "overlay.handle_display");
4879 prop, "Display Handles", "Limit the display of curve handles in edit mode");
4880 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
4881
4882 prop = RNA_def_property(srna, "show_curve_normals", PROP_BOOLEAN, PROP_NONE);
4883 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CU_NORMALS);
4884 RNA_def_property_ui_text(prop, "Draw Normals", "Display 3D curve normals in editmode");
4886
4887 prop = RNA_def_property(srna, "normals_length", PROP_FLOAT, PROP_FACTOR);
4888 RNA_def_property_float_sdna(prop, nullptr, "overlay.normals_length");
4889 RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
4890 RNA_def_property_range(prop, 0.00001, 100000.0);
4891 RNA_def_property_ui_range(prop, 0.01, 2.0, 1, 2);
4894
4895 prop = RNA_def_property(srna, "normals_constant_screen_size", PROP_FLOAT, PROP_PIXEL);
4896 RNA_def_property_float_sdna(prop, nullptr, "overlay.normals_constant_screen_size");
4897 RNA_def_property_ui_text(prop, "Normal Screen Size", "Screen size for normals in the 3D view");
4898 RNA_def_property_range(prop, 0.0, 100000.0);
4899 RNA_def_property_ui_range(prop, 1.0, 100.0, 50, 0);
4901
4902 prop = RNA_def_property(srna, "use_normals_constant_screen_size", PROP_BOOLEAN, PROP_NONE);
4904 prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS);
4906 "Constant Screen Size Normals",
4907 "Keep size of normals constant in relation to 3D view");
4909
4910 prop = RNA_def_property(srna, "texture_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
4911 RNA_def_property_float_sdna(prop, nullptr, "overlay.texture_paint_mode_opacity");
4913 prop, "Stencil Mask Opacity", "Opacity of the texture paint mode stencil mask overlay");
4914 RNA_def_property_range(prop, 0.0f, 1.0f);
4916
4917 prop = RNA_def_property(srna, "vertex_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
4918 RNA_def_property_float_sdna(prop, nullptr, "overlay.vertex_paint_mode_opacity");
4920 prop, "Stencil Mask Opacity", "Opacity of the texture paint mode stencil mask overlay");
4921 RNA_def_property_range(prop, 0.0f, 1.0f);
4923
4924 prop = RNA_def_property(srna, "weight_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
4925 RNA_def_property_float_sdna(prop, nullptr, "overlay.weight_paint_mode_opacity");
4927 prop, "Weight Paint Opacity", "Opacity of the weight paint mode overlay");
4928 RNA_def_property_range(prop, 0.0f, 1.0f);
4930
4931 prop = RNA_def_property(srna, "sculpt_mode_mask_opacity", PROP_FLOAT, PROP_FACTOR);
4932 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_mode_mask_opacity");
4933 RNA_def_property_ui_text(prop, "Sculpt Mask Opacity", "");
4934 RNA_def_property_range(prop, 0.0f, 1.0f);
4936
4937 prop = RNA_def_property(srna, "show_sculpt_curves_cage", PROP_BOOLEAN, PROP_NONE);
4938 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SCULPT_CURVES_CAGE);
4940 prop, "Sculpt Curves Cage", "Show original curves that are currently being edited");
4942
4943 prop = RNA_def_property(srna, "sculpt_curves_cage_opacity", PROP_FLOAT, PROP_FACTOR);
4944 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_curves_cage_opacity");
4946 prop, "Curves Sculpt Cage Opacity", "Opacity of the cage overlay in curves sculpt mode");
4947 RNA_def_property_range(prop, 0.0f, 1.0f);
4949
4950 prop = RNA_def_property(srna, "sculpt_mode_face_sets_opacity", PROP_FLOAT, PROP_FACTOR);
4951 RNA_def_property_float_sdna(prop, nullptr, "overlay.sculpt_mode_face_sets_opacity");
4952 RNA_def_property_ui_text(prop, "Sculpt Face Sets Opacity", "");
4953 RNA_def_property_range(prop, 0.0f, 1.0f);
4955
4956 prop = RNA_def_property(srna, "show_sculpt_mask", PROP_BOOLEAN, PROP_NONE);
4957 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", V3D_OVERLAY_SCULPT_SHOW_MASK);
4958 RNA_def_property_ui_text(prop, "Sculpt Show Mask", "");
4960
4961 prop = RNA_def_property(srna, "show_sculpt_face_sets", PROP_BOOLEAN, PROP_NONE);
4963 RNA_def_property_ui_text(prop, "Sculpt Show Face Sets", "");
4965
4966 /* grease pencil paper settings */
4967 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
4968 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_ANNOTATION);
4969 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
4971
4972 prop = RNA_def_property(srna, "use_gpencil_fade_objects", PROP_BOOLEAN, PROP_NONE);
4973 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_FADE_OBJECTS);
4975 prop,
4976 "Fade Objects",
4977 "Fade all viewport objects with a full color layer to improve visibility");
4979
4980 prop = RNA_def_property(srna, "use_gpencil_grid", PROP_BOOLEAN, PROP_NONE);
4981 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_GRID);
4982 RNA_def_property_ui_text(prop, "Use Grid", "Display a grid over grease pencil paper");
4984
4985 prop = RNA_def_property(srna, "use_gpencil_fade_layers", PROP_BOOLEAN, PROP_NONE);
4988 prop, "Fade Layers", "Toggle fading of Grease Pencil layers except the active one");
4989 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
4990
4991 prop = RNA_def_property(srna, "use_gpencil_fade_gp_objects", PROP_BOOLEAN, PROP_NONE);
4994 prop, "Fade Grease Pencil Objects", "Fade Grease Pencil Objects, except the active one");
4995 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
4996
4997 prop = RNA_def_property(srna, "use_gpencil_canvas_xray", PROP_BOOLEAN, PROP_NONE);
4998 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_GRID_XRAY);
4999 RNA_def_property_ui_text(prop, "Canvas X-Ray", "Show Canvas grid in front");
5000 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
5001
5002 prop = RNA_def_property(srna, "use_gpencil_show_directions", PROP_BOOLEAN, PROP_NONE);
5005 "Stroke Direction",
5006 "Show stroke drawing direction with a bigger green dot (start) "
5007 "and smaller red dot (end) points");
5008 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
5009
5010 prop = RNA_def_property(srna, "use_gpencil_show_material_name", PROP_BOOLEAN, PROP_NONE);
5013 prop, "Stroke Material Name", "Show material name assigned to each stroke");
5014 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
5015
5016 prop = RNA_def_property(srna, "gpencil_grid_opacity", PROP_FLOAT, PROP_NONE);
5017 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_opacity");
5018 RNA_def_property_range(prop, 0.1f, 1.0f);
5019 RNA_def_property_ui_text(prop, "Opacity", "Canvas grid opacity");
5021
5022 prop = RNA_def_property(srna, "gpencil_grid_color", PROP_FLOAT, PROP_COLOR);
5023 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_color");
5024 RNA_def_property_array(prop, 3);
5025 RNA_def_property_ui_text(prop, "Grid Color", "Canvas grid color");
5026 RNA_def_property_range(prop, 0.0f, 1.0f);
5028
5029 prop = RNA_def_property(srna, "gpencil_grid_scale", PROP_FLOAT, PROP_XYZ);
5030 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_scale");
5031 RNA_def_property_array(prop, 2);
5032 RNA_def_property_ui_text(prop, "Scale", "Canvas grid scale");
5033 RNA_def_property_range(prop, 0.0f, FLT_MAX);
5035
5036 prop = RNA_def_property(srna, "gpencil_grid_offset", PROP_FLOAT, PROP_DISTANCE);
5037 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_grid_offset");
5038 RNA_def_property_array(prop, 2);
5039 RNA_def_property_ui_text(prop, "Offset", "Canvas grid offset");
5041
5042 prop = RNA_def_property(srna, "gpencil_grid_subdivisions", PROP_INT, PROP_NONE);
5043 RNA_def_property_int_sdna(prop, nullptr, "overlay.gpencil_grid_subdivisions");
5044 RNA_def_property_range(prop, 1, 100);
5045 RNA_def_property_ui_text(prop, "Subdivisions", "Canvas grid subdivisions");
5047
5048 /* Paper opacity factor */
5049 prop = RNA_def_property(srna, "gpencil_fade_objects", PROP_FLOAT, PROP_NONE);
5050 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_paper_opacity");
5051 RNA_def_property_range(prop, 0.0f, 1.0f);
5052 RNA_def_property_ui_text(prop, "Opacity", "Fade factor");
5054
5055 /* Paper opacity factor */
5056 prop = RNA_def_property(srna, "gpencil_fade_layer", PROP_FLOAT, PROP_NONE);
5057 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_fade_layer");
5058 RNA_def_property_range(prop, 0.0f, 1.0f);
5061 prop, "Opacity", "Fade layer opacity for Grease Pencil layers except the active one");
5062 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
5063
5064 /* show edit lines */
5065 prop = RNA_def_property(srna, "use_gpencil_edit_lines", PROP_BOOLEAN, PROP_NONE);
5066 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_EDIT_LINES);
5067 RNA_def_property_ui_text(prop, "Show Edit Lines", "Show Edit Lines when editing strokes");
5068 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
5069
5070 prop = RNA_def_property(srna, "use_gpencil_multiedit_line_only", PROP_BOOLEAN, PROP_NONE);
5072 RNA_def_property_ui_text(prop, "Lines Only", "Show Edit Lines only in multiframe");
5073 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
5074
5075 /* main grease pencil onion switch */
5076 prop = RNA_def_property(srna, "use_gpencil_onion_skin", PROP_BOOLEAN, PROP_NONE);
5077 RNA_def_property_boolean_sdna(prop, nullptr, "gp_flag", V3D_GP_SHOW_ONION_SKIN);
5079 prop, "Onion Skins", "Show ghosts of the keyframes before and after the current frame");
5080 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
5081
5082 /* vertex opacity */
5083 prop = RNA_def_property(srna, "vertex_opacity", PROP_FLOAT, PROP_FACTOR);
5084 RNA_def_property_float_sdna(prop, nullptr, "vertex_opacity");
5085 RNA_def_property_range(prop, 0.0f, 1.0f);
5086 RNA_def_property_ui_text(prop, "Vertex Opacity", "Opacity for edit vertices");
5088 RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_GPencil_update");
5089
5090 /* Vertex Paint opacity factor */
5091 prop = RNA_def_property(srna, "gpencil_vertex_paint_opacity", PROP_FLOAT, PROP_FACTOR);
5092 RNA_def_property_float_sdna(prop, nullptr, "overlay.gpencil_vertex_paint_opacity");
5093 RNA_def_property_range(prop, 0.0f, 1.0f);
5094 RNA_def_property_ui_text(prop, "Opacity", "Vertex Paint mix factor");
5095 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
5096
5097 /* Developer Debug overlay */
5098
5099 prop = RNA_def_property(srna, "use_debug_freeze_view_culling", PROP_BOOLEAN, PROP_NONE);
5100 RNA_def_property_boolean_sdna(prop, nullptr, "debug_flag", V3D_DEBUG_FREEZE_CULLING);
5101 RNA_def_property_ui_text(prop, "Freeze Culling", "Freeze view culling bounds");
5103}
5104
5106{
5107 StructRNA *srna;
5108 PropertyRNA *prop;
5109
5110 static const EnumPropertyItem rv3d_persp_items[] = {
5111 {RV3D_PERSP, "PERSP", 0, "Perspective", ""},
5112 {RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
5113 {RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
5114 {0, nullptr, 0, nullptr, nullptr},
5115 };
5116
5117 static const EnumPropertyItem bundle_drawtype_items[] = {
5118 {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""},
5119 {OB_ARROWS, "ARROWS", 0, "Arrows", ""},
5120 {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""},
5121 {OB_CIRCLE, "CIRCLE", 0, "Circle", ""},
5122 {OB_CUBE, "CUBE", 0, "Cube", ""},
5123 {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""},
5124 {OB_EMPTY_CONE, "CONE", 0, "Cone", ""},
5125 {0, nullptr, 0, nullptr, nullptr},
5126 };
5127
5128 srna = RNA_def_struct(brna, "SpaceView3D", "Space");
5129 RNA_def_struct_sdna(srna, "View3D");
5130 RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
5131
5133 ((1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_TOOLS) |
5134 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) |
5135 (1 << RGN_TYPE_ASSET_SHELF)));
5136
5137 prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
5139 RNA_def_property_pointer_sdna(prop, nullptr, "camera");
5141 prop,
5142 "Camera",
5143 "Active camera used in this view (when unlocked from the scene's active camera)");
5144 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_camera_update");
5145
5146 /* render border */
5147 prop = RNA_def_property(srna, "use_render_border", PROP_BOOLEAN, PROP_NONE);
5148 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_RENDER_BORDER);
5151 "Render Region",
5152 "Use a region within the frame size for rendered viewport "
5153 "(when not viewing through the camera)");
5155
5156 prop = RNA_def_property(srna, "render_border_min_x", PROP_FLOAT, PROP_NONE);
5157 RNA_def_property_float_sdna(prop, nullptr, "render_border.xmin");
5158 RNA_def_property_range(prop, 0.0f, 1.0f);
5159 RNA_def_property_ui_text(prop, "Region Minimum X", "Minimum X value for the render region");
5161
5162 prop = RNA_def_property(srna, "render_border_min_y", PROP_FLOAT, PROP_NONE);
5163 RNA_def_property_float_sdna(prop, nullptr, "render_border.ymin");
5164 RNA_def_property_range(prop, 0.0f, 1.0f);
5165 RNA_def_property_ui_text(prop, "Region Minimum Y", "Minimum Y value for the render region");
5167
5168 prop = RNA_def_property(srna, "render_border_max_x", PROP_FLOAT, PROP_NONE);
5169 RNA_def_property_float_sdna(prop, nullptr, "render_border.xmax");
5170 RNA_def_property_range(prop, 0.0f, 1.0f);
5171 RNA_def_property_ui_text(prop, "Region Maximum X", "Maximum X value for the render region");
5173
5174 prop = RNA_def_property(srna, "render_border_max_y", PROP_FLOAT, PROP_NONE);
5175 RNA_def_property_float_sdna(prop, nullptr, "render_border.ymax");
5176 RNA_def_property_range(prop, 0.0f, 1.0f);
5177 RNA_def_property_ui_text(prop, "Region Maximum Y", "Maximum Y value for the render region");
5179
5180 prop = RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
5182 RNA_def_property_pointer_sdna(prop, nullptr, "ob_center");
5184 prop, "Lock to Object", "3D View center is locked to this object's position");
5186
5187 prop = RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
5188 RNA_def_property_string_sdna(prop, nullptr, "ob_center_bone");
5190 prop, "Lock to Bone", "3D View center is locked to this bone's position");
5192
5193 prop = RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
5194 RNA_def_property_boolean_sdna(prop, nullptr, "ob_center_cursor", 1);
5196 prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
5198
5199 prop = RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
5200 RNA_def_property_pointer_sdna(prop, nullptr, "localvd");
5202 prop,
5203 "Local View",
5204 "Display an isolated subset of objects, apart from the scene visibility");
5205
5206 prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_UNIT_CAMERA);
5207 RNA_def_property_float_sdna(prop, nullptr, "lens");
5208 RNA_def_property_ui_text(prop, "Lens", "Viewport lens angle");
5209 RNA_def_property_range(prop, 1.0f, 250.0f);
5211
5212 prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
5213 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
5214 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
5216 prop, "Clip Start", "3D View near clipping distance (perspective view only)");
5218
5219 prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
5220 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
5221 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
5222 RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
5224
5225 prop = RNA_def_property(srna, "lock_camera", PROP_BOOLEAN, PROP_NONE);
5226 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_LOCK_CAMERA);
5228 prop, "Lock Camera to View", "Enable view navigation within the camera view");
5230
5231 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
5232 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", V3D_GIZMO_HIDE);
5233 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
5235
5236 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
5238 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
5240
5241 prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE);
5243 RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item");
5245
5246 prop = RNA_def_property(srna, "show_gizmo_modifier", PROP_BOOLEAN, PROP_NONE);
5248 RNA_def_property_ui_text(prop, "Modifier Gizmo", "Gizmos for the active modifier");
5250
5251 prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE);
5252 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", V3D_GIZMO_HIDE_TOOL);
5253 RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo");
5255
5256 /* Per object type gizmo display flags. */
5257
5258 prop = RNA_def_property(srna, "show_gizmo_object_translate", PROP_BOOLEAN, PROP_NONE);
5260 prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_TRANSLATE);
5261 RNA_def_property_ui_text(prop, "Show Object Location", "Gizmo to adjust location");
5263
5264 prop = RNA_def_property(srna, "show_gizmo_object_rotate", PROP_BOOLEAN, PROP_NONE);
5265 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_ROTATE);
5266 RNA_def_property_ui_text(prop, "Show Object Rotation", "Gizmo to adjust rotation");
5268
5269 prop = RNA_def_property(srna, "show_gizmo_object_scale", PROP_BOOLEAN, PROP_NONE);
5270 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_object", V3D_GIZMO_SHOW_OBJECT_SCALE);
5271 RNA_def_property_ui_text(prop, "Show Object Scale", "Gizmo to adjust scale");
5273
5274 /* Empty Object Data. */
5275 prop = RNA_def_property(srna, "show_gizmo_empty_image", PROP_BOOLEAN, PROP_NONE);
5276 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_empty", V3D_GIZMO_SHOW_EMPTY_IMAGE);
5277 RNA_def_property_ui_text(prop, "Show Empty Image", "Gizmo to adjust image size and position");
5279
5280 prop = RNA_def_property(srna, "show_gizmo_empty_force_field", PROP_BOOLEAN, PROP_NONE);
5282 prop, nullptr, "gizmo_show_empty", V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD);
5283 RNA_def_property_ui_text(prop, "Show Empty Force Field", "Gizmo to adjust the force field");
5285
5286 /* Light Object Data. */
5287 prop = RNA_def_property(srna, "show_gizmo_light_size", PROP_BOOLEAN, PROP_NONE);
5288 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_light", V3D_GIZMO_SHOW_LIGHT_SIZE);
5289 RNA_def_property_ui_text(prop, "Show Light Size", "Gizmo to adjust spot and area size");
5291
5292 prop = RNA_def_property(srna, "show_gizmo_light_look_at", PROP_BOOLEAN, PROP_NONE);
5293 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_light", V3D_GIZMO_SHOW_LIGHT_LOOK_AT);
5295 prop, "Show Light Look-At", "Gizmo to adjust the direction of the light");
5297
5298 /* Camera Object Data. */
5299 prop = RNA_def_property(srna, "show_gizmo_camera_lens", PROP_BOOLEAN, PROP_NONE);
5300 RNA_def_property_boolean_sdna(prop, nullptr, "gizmo_show_camera", V3D_GIZMO_SHOW_CAMERA_LENS);
5302 prop, "Show Camera Lens", "Gizmo to adjust camera focal length or orthographic scale");
5304
5305 prop = RNA_def_property(srna, "show_gizmo_camera_dof_distance", PROP_BOOLEAN, PROP_NONE);
5307 prop, nullptr, "gizmo_show_camera", V3D_GIZMO_SHOW_CAMERA_DOF_DIST);
5309 "Show Camera Focus Distance",
5310 "Gizmo to adjust camera focus distance "
5311 "(depends on limits display)");
5313
5314 prop = RNA_def_property(srna, "use_local_camera", PROP_BOOLEAN, PROP_NONE);
5315 RNA_def_property_boolean_negative_sdna(prop, nullptr, "scenelock", 1);
5316 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SpaceView3D_use_local_camera_set");
5318 "Use Local Camera",
5319 "Use a local camera in this view, rather than scene's active camera");
5321
5322 prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
5323 RNA_def_property_struct_type(prop, "RegionView3D");
5324 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", nullptr, nullptr, nullptr);
5326 prop,
5327 "3D Region",
5328 "3D region for this space. When the space is in quad view, the camera region");
5329
5330 prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE);
5331 RNA_def_property_struct_type(prop, "RegionView3D");
5333 "rna_SpaceView3D_region_quadviews_begin",
5334 "rna_iterator_listbase_next",
5335 "rna_iterator_listbase_end",
5336 "rna_SpaceView3D_region_quadviews_get",
5337 nullptr,
5338 nullptr,
5339 nullptr,
5340 nullptr);
5342 "Quad View Regions",
5343 "3D regions (the third one defines quad view settings, "
5344 "the fourth one is same as 'region_3d')");
5345
5346 prop = RNA_def_property(srna, "show_reconstruction", PROP_BOOLEAN, PROP_NONE);
5349 prop, "Show Reconstruction", "Display reconstruction data from active movie clip");
5351
5352 prop = RNA_def_property(srna, "tracks_display_size", PROP_FLOAT, PROP_NONE);
5353 RNA_def_property_range(prop, 0.0, FLT_MAX);
5354 RNA_def_property_ui_range(prop, 0, 5, 1, 3);
5355 RNA_def_property_float_sdna(prop, nullptr, "bundle_size");
5356 RNA_def_property_ui_text(prop, "Tracks Size", "Display size of tracks from reconstructed data");
5358
5359 prop = RNA_def_property(srna, "tracks_display_type", PROP_ENUM, PROP_NONE);
5360 RNA_def_property_enum_sdna(prop, nullptr, "bundle_drawtype");
5361 RNA_def_property_enum_items(prop, bundle_drawtype_items);
5362 RNA_def_property_ui_text(prop, "Tracks Display Type", "Viewport display style for tracks");
5364
5365 prop = RNA_def_property(srna, "show_camera_path", PROP_BOOLEAN, PROP_NONE);
5366 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_CAMERAPATH);
5367 RNA_def_property_ui_text(prop, "Show Camera Path", "Show reconstructed camera path");
5369
5370 prop = RNA_def_property(srna, "show_bundle_names", PROP_BOOLEAN, PROP_NONE);
5371 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_BUNDLENAME);
5373 prop, "Show 3D Marker Names", "Show names for reconstructed tracks objects");
5375
5376 prop = RNA_def_property(srna, "use_local_collections", PROP_BOOLEAN, PROP_NONE);
5379 prop, "Local Collections", "Display a different set of collections in this viewport");
5382 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_use_local_collections_update");
5383
5384 /* Stereo Settings */
5385 prop = RNA_def_property(srna, "stereo_3d_eye", PROP_ENUM, PROP_NONE);
5386 RNA_def_property_enum_sdna(prop, nullptr, "multiview_eye");
5388 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceView3D_stereo3d_camera_itemf");
5389 RNA_def_property_ui_text(prop, "Stereo Eye", "Current stereo eye being displayed");
5391
5392 prop = RNA_def_property(srna, "stereo_3d_camera", PROP_ENUM, PROP_NONE);
5393 RNA_def_property_enum_sdna(prop, nullptr, "stereo3d_camera");
5395 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceView3D_stereo3d_camera_itemf");
5396 RNA_def_property_ui_text(prop, "Camera", "");
5398
5399 prop = RNA_def_property(srna, "show_stereo_3d_cameras", PROP_BOOLEAN, PROP_NONE);
5400 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPCAMERAS);
5401 RNA_def_property_ui_text(prop, "Cameras", "Show the left and right cameras");
5403
5404 prop = RNA_def_property(srna, "show_stereo_3d_convergence_plane", PROP_BOOLEAN, PROP_NONE);
5405 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPPLANE);
5406 RNA_def_property_ui_text(prop, "Plane", "Show the stereo 3D convergence plane");
5408
5409 prop = RNA_def_property(srna, "stereo_3d_convergence_plane_alpha", PROP_FLOAT, PROP_FACTOR);
5410 RNA_def_property_float_sdna(prop, nullptr, "stereo3d_convergence_alpha");
5411 RNA_def_property_ui_text(prop, "Plane Alpha", "Opacity (alpha) of the convergence plane");
5413
5414 prop = RNA_def_property(srna, "show_stereo_3d_volume", PROP_BOOLEAN, PROP_NONE);
5415 RNA_def_property_boolean_sdna(prop, nullptr, "stereo3d_flag", V3D_S3D_DISPVOLUME);
5416 RNA_def_property_ui_text(prop, "Volume", "Show the stereo 3D frustum volume");
5418
5419 prop = RNA_def_property(srna, "stereo_3d_volume_alpha", PROP_FLOAT, PROP_FACTOR);
5420 RNA_def_property_float_sdna(prop, nullptr, "stereo3d_volume_alpha");
5421 RNA_def_property_ui_text(prop, "Volume Alpha", "Opacity (alpha) of the cameras' frustum volume");
5423
5424 prop = RNA_def_property(srna, "mirror_xr_session", PROP_BOOLEAN, PROP_NONE);
5427 prop,
5428 "Mirror VR Session",
5429 "Synchronize the viewer perspective of virtual reality sessions with this 3D viewport");
5431 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_mirror_xr_session_update");
5432
5435 "rna_SpaceView3D_object_type_visibility_update");
5436
5437 /* Helper for drawing the icon. */
5438 prop = RNA_def_property(srna, "icon_from_show_object_viewport", PROP_INT, PROP_NONE);
5440 prop, "rna_SpaceView3D_icon_from_show_object_viewport_get", nullptr, nullptr);
5442 RNA_def_property_ui_text(prop, "Visibility Icon", "");
5443
5444 prop = RNA_def_property(srna, "show_viewer", PROP_BOOLEAN, PROP_NONE);
5445 RNA_def_property_boolean_sdna(prop, nullptr, "flag2", V3D_SHOW_VIEWER);
5446 RNA_def_property_ui_text(prop, "Show Viewer", "Display non-final geometry from viewer nodes");
5448
5449 /* Nested Structs */
5450 prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
5452 RNA_def_property_struct_type(prop, "View3DShading");
5453 RNA_def_property_ui_text(prop, "Shading Settings", "Settings for shading in the 3D viewport");
5454
5455 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
5457 RNA_def_property_struct_type(prop, "View3DOverlay");
5458 RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_overlay_get", nullptr, nullptr, nullptr);
5460 prop, "Overlay Settings", "Settings for display of overlays in the 3D viewport");
5461
5464
5465 /* *** Animated *** */
5467 /* region */
5468
5469 srna = RNA_def_struct(brna, "RegionView3D", nullptr);
5470 RNA_def_struct_sdna(srna, "RegionView3D");
5471 RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");
5472
5473 prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
5474 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_LOCK_ROTATION);
5476 prop, "Lock Rotation", "Lock view rotation of side views to Top/Front/Right");
5477 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
5478
5479 prop = RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
5480 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_BOXVIEW);
5481 RNA_def_property_ui_text(prop, "Sync Zoom/Pan", "Sync view position between side views");
5482 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
5483
5484 prop = RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
5485 RNA_def_property_boolean_sdna(prop, nullptr, "viewlock", RV3D_BOXCLIP);
5487 prop, "Clip Contents", "Clip view contents based on what is visible in other side views");
5489 prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
5490
5491 prop = RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
5492 RNA_def_property_float_sdna(prop, nullptr, "persmat");
5494 prop, PROP_EDITABLE); /* XXX: for now, it's too risky for users to do this */
5497 prop, "Perspective Matrix", "Current perspective matrix (``window_matrix * view_matrix``)");
5498
5499 prop = RNA_def_property(srna, "window_matrix", PROP_FLOAT, PROP_MATRIX);
5500 RNA_def_property_float_sdna(prop, nullptr, "winmat");
5503 RNA_def_property_ui_text(prop, "Window Matrix", "Current window matrix");
5504
5505 prop = RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
5506 RNA_def_property_float_sdna(prop, nullptr, "viewmat");
5508 RNA_def_property_float_funcs(prop, nullptr, "rna_RegionView3D_view_matrix_set", nullptr);
5509 RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix");
5511
5512 prop = RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
5513 RNA_def_property_enum_sdna(prop, nullptr, "persp");
5514 RNA_def_property_enum_items(prop, rv3d_persp_items);
5515 RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
5517
5518 prop = RNA_def_property(srna, "is_perspective", PROP_BOOLEAN, PROP_NONE);
5519 RNA_def_property_boolean_sdna(prop, nullptr, "is_persp", 1);
5520 RNA_def_property_ui_text(prop, "Is Perspective", "");
5522
5523 /* WARNING: Using "orthographic" in this name isn't correct and could be changed. */
5524 prop = RNA_def_property(srna, "is_orthographic_side_view", PROP_BOOLEAN, PROP_NONE);
5525 RNA_def_property_boolean_sdna(prop, nullptr, "view", 0);
5527 "rna_RegionView3D_is_orthographic_side_view_get",
5528 "rna_RegionView3D_is_orthographic_side_view_set");
5530 prop,
5531 "Is Axis Aligned",
5532 "Whether the current view is aligned to an axis "
5533 "(does not check whether the view is orthographic, use \"is_perspective\" for that). "
5534 "Setting this will rotate the view to the closest axis");
5535
5536 /* This isn't directly accessible from the UI, only an operator. */
5537 prop = RNA_def_property(srna, "use_clip_planes", PROP_BOOLEAN, PROP_NONE);
5538 RNA_def_property_boolean_sdna(prop, nullptr, "rflag", RV3D_CLIPPING);
5539 RNA_def_property_ui_text(prop, "Use Clip Planes", "");
5540
5541 const int default_value[] = {6, 4};
5542 prop = RNA_def_property(srna, "clip_planes", PROP_FLOAT, PROP_NONE);
5543 RNA_def_property_float_sdna(prop, nullptr, "clip");
5544 RNA_def_property_multi_array(prop, 2, default_value);
5545 RNA_def_property_ui_text(prop, "Clip Planes", "");
5546
5547 prop = RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
5548# if 0
5549 RNA_def_property_float_sdna(prop, nullptr, "ofs"); /* can't use because it's negated */
5550# else
5551 RNA_def_property_array(prop, 3);
5553 prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", nullptr);
5554# endif
5555 RNA_def_property_ui_text(prop, "View Location", "View pivot location");
5556 RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT);
5557 RNA_def_property_update(prop, NC_WINDOW, nullptr);
5558
5559 prop = RNA_def_property(
5560 srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); /* can't use because it's inverted */
5561# if 0
5562 RNA_def_property_float_sdna(prop, nullptr, "viewquat");
5563# else
5564 RNA_def_property_array(prop, 4);
5566 prop, "rna_RegionView3D_view_rotation_get", "rna_RegionView3D_view_rotation_set", nullptr);
5567# endif
5568 RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
5570
5571 /* not sure we need rna access to these but adding anyway */
5572 prop = RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
5573 RNA_def_property_float_sdna(prop, nullptr, "dist");
5574 RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
5576
5577 prop = RNA_def_property(srna, "view_camera_zoom", PROP_FLOAT, PROP_UNSIGNED);
5578 RNA_def_property_float_sdna(prop, nullptr, "camzoom");
5579 RNA_def_property_ui_text(prop, "Camera Zoom", "Zoom factor in camera view");
5582
5583 prop = RNA_def_property(srna, "view_camera_offset", PROP_FLOAT, PROP_NONE);
5584 RNA_def_property_float_sdna(prop, nullptr, "camdx");
5585 RNA_def_property_array(prop, 2);
5586 RNA_def_property_ui_text(prop, "Camera Offset", "View shift in camera view");
5588
5590}
5591
5593{
5594 StructRNA *srna;
5595 PropertyRNA *prop;
5596
5597 static const EnumPropertyItem tab_sync_items[] = {
5599 "ALWAYS",
5600 0,
5601 "Always",
5602 "Always change tabs when clicking an icon in an outliner"},
5604 "NEVER",
5605 0,
5606 "Never",
5607 "Never change tabs when clicking an icon in an outliner"},
5609 "AUTO",
5610 0,
5611 "Auto",
5612 "Change tabs only when this editor shares a border with an outliner"},
5613 {0, nullptr, 0, nullptr, nullptr},
5614 };
5615
5616 srna = RNA_def_struct(brna, "SpaceProperties", "Space");
5617 RNA_def_struct_sdna(srna, "SpaceProperties");
5618 RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
5619
5620 prop = RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
5621 RNA_def_property_enum_sdna(prop, nullptr, "mainb");
5624 prop, nullptr, "rna_SpaceProperties_context_set", "rna_SpaceProperties_context_itemf");
5625 RNA_def_property_ui_text(prop, "", "");
5628 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update");
5629
5630 /* pinned data */
5631 prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
5632 RNA_def_property_pointer_sdna(prop, nullptr, "pinid");
5633 RNA_def_property_struct_type(prop, "ID");
5634 /* NOTE: custom set function is ONLY to avoid rna setting a user for this. */
5636 nullptr,
5637 "rna_SpaceProperties_pin_id_set",
5638 "rna_SpaceProperties_pin_id_typef",
5639 nullptr);
5642 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");
5643
5644 prop = RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
5645 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SB_PIN_CONTEXT);
5646 RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
5647
5648 /* Property search. */
5649
5650 prop = RNA_def_property(srna, "tab_search_results", PROP_BOOLEAN, PROP_NONE);
5651 RNA_def_property_array(prop, 0); /* Dynamic length, see next line. */
5654 RNA_def_property_boolean_funcs(prop, "rna_SpaceProperties_tab_search_results_get", nullptr);
5655 RNA_def_property_dynamic_array_funcs(prop, "rna_SpaceProperties_tab_search_results_getlength");
5657 prop, "Tab Search Results", "Whether or not each visible tab has a search result");
5658
5659 prop = RNA_def_property(srna, "search_filter", PROP_STRING, PROP_NONE);
5660 /* The search filter is stored in the property editor's runtime which
5661 * is only defined in an internal header, so use the getter / setter here. */
5663 "rna_SpaceProperties_search_filter_get",
5664 "rna_SpaceProperties_search_filter_length",
5665 "rna_SpaceProperties_search_filter_set");
5666 RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
5669 prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_search_filter_update");
5670
5671 /* Outliner sync. */
5672 prop = RNA_def_property(srna, "outliner_sync", PROP_ENUM, PROP_NONE);
5673 RNA_def_property_enum_sdna(prop, nullptr, "outliner_sync");
5674 RNA_def_property_enum_items(prop, tab_sync_items);
5676 "Outliner Sync",
5677 "Change to the corresponding tab when outliner data icons are clicked");
5679}
5680
5682{
5683 StructRNA *srna;
5684 PropertyRNA *prop;
5685
5686 srna = RNA_def_struct(brna, "SpaceImageOverlay", nullptr);
5687 RNA_def_struct_sdna(srna, "SpaceImage");
5688 RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
5689 RNA_def_struct_path_func(srna, "rna_SpaceImageOverlay_path");
5691 srna, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
5692
5693 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
5694 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_SHOW_OVERLAYS);
5695 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like UV Maps and Metadata");
5697
5698 prop = RNA_def_property(srna, "show_grid_background", PROP_BOOLEAN, PROP_NONE);
5699 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SI_OVERLAY_SHOW_GRID_BACKGROUND);
5700 RNA_def_property_ui_text(prop, "Display Background", "Show the grid background and borders");
5702}
5703
5705{
5706 StructRNA *srna;
5707 PropertyRNA *prop;
5708
5709 srna = RNA_def_struct(brna, "SpaceImageEditor", "Space");
5710 RNA_def_struct_sdna(srna, "SpaceImage");
5711 RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
5712
5714 ((1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_TOOLS) |
5715 (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) |
5716 (1 << RGN_TYPE_ASSET_SHELF)));
5717
5718 /* image */
5719 prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
5721 prop, nullptr, "rna_SpaceImageEditor_image_set", nullptr, nullptr);
5722 RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
5725 prop,
5726 NC_GEOM | ND_DATA,
5727 "rna_SpaceImageEditor_image_update"); /* is handled in image editor too */
5728
5729 prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
5731 RNA_def_property_pointer_sdna(prop, nullptr, "iuser");
5733 prop,
5734 "Image User",
5735 "Parameters defining which layer, pass and frame of the image is displayed");
5737
5738 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
5739 RNA_def_property_pointer_sdna(prop, nullptr, "scopes");
5740 RNA_def_property_struct_type(prop, "Scopes");
5741 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics");
5743 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
5744
5745 prop = RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
5746 RNA_def_property_boolean_sdna(prop, nullptr, "pin", 0);
5748 prop, "Image Pin", "Display current image regardless of object selection");
5749 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
5751
5752 prop = RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
5753 RNA_def_property_pointer_sdna(prop, nullptr, "sample_line_hist");
5754 RNA_def_property_struct_type(prop, "Histogram");
5755 RNA_def_property_ui_text(prop, "Line Sample", "Sampled colors along line");
5756
5757 prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
5758 RNA_def_property_array(prop, 2);
5760 RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_zoom_get", nullptr, nullptr);
5761 RNA_def_property_ui_text(prop, "Zoom", "Zoom factor");
5762
5763 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
5765 "rna_SpaceImageEditor_zoom_percentage_get",
5766 "rna_SpaceImageEditor_zoom_percentage_set",
5767 nullptr);
5768 RNA_def_property_float_default(prop, 100.0);
5769 RNA_def_property_range(prop, .4, 80000);
5770 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
5771 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
5772
5773 /* image draw */
5774 prop = RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
5775 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_DRAW_TILE);
5777 prop, "Display Repeated", "Display the image repeated outside of the main view");
5779
5780 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
5781 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SI_SHOW_GPENCIL);
5782 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
5784
5785 prop = RNA_def_property(srna, "display_channels", PROP_ENUM, PROP_NONE);
5786 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
5789 "rna_SpaceImageEditor_display_channels_get",
5790 nullptr,
5791 "rna_SpaceImageEditor_display_channels_itemf");
5792 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to display");
5794
5795 prop = RNA_def_property(srna, "show_stereo_3d", PROP_BOOLEAN, PROP_NONE);
5797 prop, "rna_SpaceImageEditor_show_stereo_get", "rna_SpaceImageEditor_show_stereo_set");
5798 RNA_def_property_ui_text(prop, "Show Stereo", "Display the image in Stereo 3D");
5799 RNA_def_property_ui_icon(prop, ICON_CAMERA_STEREO, 0);
5801 prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_show_stereo_update");
5802
5803 /* uv */
5804 prop = RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
5806 RNA_def_property_struct_type(prop, "SpaceUVEditor");
5808 prop, "rna_SpaceImageEditor_uvedit_get", nullptr, nullptr, nullptr);
5809 RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
5810
5811 /* mode (hidden in the UI, see 'ui_mode') */
5812 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
5813 RNA_def_property_enum_sdna(prop, nullptr, "mode");
5815 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
5816 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
5817
5818 prop = RNA_def_property(srna, "ui_mode", PROP_ENUM, PROP_NONE);
5819 RNA_def_property_enum_sdna(prop, nullptr, "mode");
5821 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
5822 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
5823
5824 /* transform */
5825 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
5826 RNA_def_property_array(prop, 2);
5828 "rna_SpaceImageEditor_cursor_location_get",
5829 "rna_SpaceImageEditor_cursor_location_set",
5830 nullptr);
5831 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
5833
5834 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
5835 RNA_def_property_enum_sdna(prop, nullptr, "around");
5837 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_SpaceImageEditor_pivot_itemf");
5838 RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
5840
5841 /* grease pencil */
5842 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
5843 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
5844 RNA_def_property_struct_type(prop, "GreasePencil");
5846 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
5848 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
5850
5851 /* update */
5852 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
5853 RNA_def_property_boolean_sdna(prop, nullptr, "lock", 0);
5855 "Update Automatically",
5856 "Update other affected window spaces automatically to reflect changes "
5857 "during interactive operations such as transform");
5858
5859 /* state */
5860 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
5861 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", nullptr);
5863 RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
5864
5865 prop = RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
5866 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", nullptr);
5868 RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
5869
5870 prop = RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
5871 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", nullptr);
5873 RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
5874
5875 prop = RNA_def_property(srna, "show_maskedit", PROP_BOOLEAN, PROP_NONE);
5876 RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_maskedit_get", nullptr);
5878 RNA_def_property_ui_text(prop, "Show Mask Editor", "Show Mask editing related properties");
5879
5880 /* Gizmo Toggles. */
5881 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
5882 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SI_GIZMO_HIDE);
5883 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
5885
5886 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
5888 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
5890
5891 /* Overlays */
5892 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
5894 RNA_def_property_struct_type(prop, "SpaceImageOverlay");
5895 RNA_def_property_pointer_funcs(prop, "rna_SpaceImage_overlay_get", nullptr, nullptr, nullptr);
5897 prop, "Overlay Settings", "Settings for display of overlays in the UV/Image editor");
5898
5901
5902 /* mask */
5903 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mask_set");
5904}
5905
5907{
5908 StructRNA *srna;
5909 PropertyRNA *prop;
5910
5911 srna = RNA_def_struct(brna, "SequencerPreviewOverlay", nullptr);
5912 RNA_def_struct_sdna(srna, "SpaceSeq");
5913 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
5914 RNA_def_struct_path_func(srna, "rna_SpaceSequencerPreviewOverlay_path");
5915 RNA_def_struct_ui_text(srna, "Preview Overlay Settings", "");
5916
5917 prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE);
5919 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_SAFE_MARGINS);
5921 prop, "Safe Areas", "Show TV title safe and action safe areas in preview");
5923
5924 prop = RNA_def_property(srna, "show_safe_center", PROP_BOOLEAN, PROP_NONE);
5926 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_SAFE_CENTER);
5928 prop, "Center-Cut Safe Areas", "Show safe areas to fit content in a different aspect ratio");
5930
5931 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
5932 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_METADATA);
5933 RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of first visible strip");
5935
5936 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
5937 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_GPENCIL);
5938 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
5940
5941 prop = RNA_def_property(srna, "show_image_outline", PROP_BOOLEAN, PROP_NONE);
5943 prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_OUTLINE_SELECTED);
5944 RNA_def_property_ui_text(prop, "Image Outline", "");
5946
5947 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
5948 RNA_def_property_boolean_sdna(prop, nullptr, "preview_overlay.flag", SEQ_PREVIEW_SHOW_2D_CURSOR);
5949 RNA_def_property_ui_text(prop, "2D Cursor", "");
5951}
5952
5954{
5955 StructRNA *srna;
5956 PropertyRNA *prop;
5957
5958 srna = RNA_def_struct(brna, "SequencerTimelineOverlay", nullptr);
5959 RNA_def_struct_sdna(srna, "SpaceSeq");
5960 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
5961 RNA_def_struct_path_func(srna, "rna_SpaceSequencerTimelineOverlay_path");
5962 RNA_def_struct_ui_text(srna, "Timeline Overlay Settings", "");
5963
5964 static const EnumPropertyItem waveform_type_display_items[] = {
5966 "ALL_WAVEFORMS",
5967 0,
5968 "On",
5969 "Display waveforms for all sound strips"},
5970 {0, "DEFAULT_WAVEFORMS", 0, "Strip", "Display waveforms depending on strip setting"},
5972 "NO_WAVEFORMS",
5973 0,
5974 "Off",
5975 "Don't display waveforms for any sound strips"},
5976 {0, nullptr, 0, nullptr, nullptr},
5977 };
5978
5979 prop = RNA_def_property(srna, "waveform_display_type", PROP_ENUM, PROP_NONE);
5980 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "timeline_overlay.flag");
5981 RNA_def_property_enum_items(prop, waveform_type_display_items);
5982 RNA_def_property_ui_text(prop, "Waveform Display", "How Waveforms are displayed");
5984
5985 static const EnumPropertyItem waveform_style_display_items[] = {
5986 {0, "FULL_WAVEFORMS", 0, "Full", "Display full waveform"},
5988 "HALF_WAVEFORMS",
5989 0,
5990 "Half",
5991 "Display upper half of the absolute value waveform"},
5992 {0, nullptr, 0, nullptr, nullptr},
5993 };
5994
5995 prop = RNA_def_property(srna, "waveform_display_style", PROP_ENUM, PROP_NONE);
5996 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "timeline_overlay.flag");
5997 RNA_def_property_enum_items(prop, waveform_style_display_items);
5998 RNA_def_property_ui_text(prop, "Waveform Style", "How Waveforms are displayed");
6000
6001 prop = RNA_def_property(srna, "show_fcurves", PROP_BOOLEAN, PROP_NONE);
6002 RNA_def_property_boolean_sdna(prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_FCURVES);
6003 RNA_def_property_ui_text(prop, "Show F-Curves", "Display strip opacity/volume curve");
6005
6006 prop = RNA_def_property(srna, "show_strip_name", PROP_BOOLEAN, PROP_NONE);
6008 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_NAME);
6009 RNA_def_property_ui_text(prop, "Show Name", "");
6011
6012 prop = RNA_def_property(srna, "show_strip_source", PROP_BOOLEAN, PROP_NONE);
6014 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_SOURCE);
6016 prop, "Show Source", "Display path to source file, or name of source datablock");
6018
6019 prop = RNA_def_property(srna, "show_strip_duration", PROP_BOOLEAN, PROP_NONE);
6021 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_DURATION);
6022 RNA_def_property_ui_text(prop, "Show Duration", "");
6024
6025 prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
6026 RNA_def_property_boolean_sdna(prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_GRID);
6027 RNA_def_property_ui_text(prop, "Show Grid", "Show vertical grid lines");
6029
6030 prop = RNA_def_property(srna, "show_strip_offset", PROP_BOOLEAN, PROP_NONE);
6032 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_OFFSETS);
6033 RNA_def_property_ui_text(prop, "Show Offsets", "Display strip in/out offsets");
6035
6036 prop = RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
6038 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_THUMBNAILS);
6039 RNA_def_property_ui_text(prop, "Show Thumbnails", "Show strip thumbnails");
6041
6042 prop = RNA_def_property(srna, "show_strip_tag_color", PROP_BOOLEAN, PROP_NONE);
6044 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG);
6046 prop, "Show Color Tags", "Display the strip color tags in the sequencer");
6048
6049 prop = RNA_def_property(srna, "show_strip_retiming", PROP_BOOLEAN, PROP_NONE);
6051 prop, nullptr, "timeline_overlay.flag", SEQ_TIMELINE_SHOW_STRIP_RETIMING);
6052 RNA_def_property_ui_text(prop, "Show Retiming Keys", "Display retiming keys on top of strips");
6054}
6055
6057{
6058 StructRNA *srna;
6059 PropertyRNA *prop;
6060
6061 srna = RNA_def_struct(brna, "SequencerCacheOverlay", nullptr);
6062 RNA_def_struct_sdna(srna, "SpaceSeq");
6063 RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor");
6064 RNA_def_struct_path_func(srna, "rna_SpaceSequencerCacheOverlay_path");
6065 RNA_def_struct_ui_text(srna, "Cache Overlay Settings", "");
6066
6067 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
6068 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW);
6069 RNA_def_property_ui_text(prop, "Show Cache", "Visualize cached images on the timeline");
6071
6072 prop = RNA_def_property(srna, "show_cache_final_out", PROP_BOOLEAN, PROP_NONE);
6073 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_FINAL_OUT);
6074 RNA_def_property_ui_text(prop, "Final Images", "Visualize cached complete frames");
6076
6077 prop = RNA_def_property(srna, "show_cache_raw", PROP_BOOLEAN, PROP_NONE);
6078 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_RAW);
6079 RNA_def_property_ui_text(prop, "Raw Images", "Visualize cached raw images");
6081
6082 prop = RNA_def_property(srna, "show_cache_preprocessed", PROP_BOOLEAN, PROP_NONE);
6083 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_PREPROCESSED);
6084 RNA_def_property_ui_text(prop, "Preprocessed Images", "Visualize cached pre-processed images");
6086
6087 prop = RNA_def_property(srna, "show_cache_composite", PROP_BOOLEAN, PROP_NONE);
6088 RNA_def_property_boolean_sdna(prop, nullptr, "cache_overlay.flag", SEQ_CACHE_SHOW_COMPOSITE);
6089 RNA_def_property_ui_text(prop, "Composite Images", "Visualize cached composite images");
6091}
6092
6094{
6095 StructRNA *srna;
6096 PropertyRNA *prop;
6097
6098 static const EnumPropertyItem display_mode_items[] = {
6099 {SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
6100 {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
6101 {SEQ_DRAW_IMG_RGBPARADE, "RGB_PARADE", ICON_RENDERLAYERS, "RGB Parade", ""},
6102 {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
6103 {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
6104 {0, nullptr, 0, nullptr, nullptr},
6105 };
6106
6107 static const EnumPropertyItem proxy_render_size_items[] = {
6108 {SEQ_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
6109 {SEQ_RENDER_SIZE_SCENE, "SCENE", 0, "Scene size", ""},
6110 {SEQ_RENDER_SIZE_PROXY_25, "PROXY_25", 0, "25%", ""},
6111 {SEQ_RENDER_SIZE_PROXY_50, "PROXY_50", 0, "50%", ""},
6112 {SEQ_RENDER_SIZE_PROXY_75, "PROXY_75", 0, "75%", ""},
6113 {SEQ_RENDER_SIZE_PROXY_100, "PROXY_100", 0, "100%", ""},
6114 {0, nullptr, 0, nullptr, nullptr},
6115 };
6116
6117 static const EnumPropertyItem overlay_frame_type_items[] = {
6118 {SEQ_OVERLAY_FRAME_TYPE_RECT, "RECTANGLE", 0, "Rectangle", "Show rectangle area overlay"},
6119 {SEQ_OVERLAY_FRAME_TYPE_REFERENCE, "REFERENCE", 0, "Reference", "Show reference frame only"},
6120 {SEQ_OVERLAY_FRAME_TYPE_CURRENT, "CURRENT", 0, "Current", "Show current frame only"},
6121 {0, nullptr, 0, nullptr, nullptr},
6122 };
6123
6124 static const EnumPropertyItem preview_channels_items[] = {
6126 "COLOR_ALPHA",
6127 ICON_IMAGE_RGB_ALPHA,
6128 "Color & Alpha",
6129 "Display image with RGB colors and alpha transparency"},
6130 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
6131 {0, nullptr, 0, nullptr, nullptr},
6132 };
6133
6134 srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
6135 RNA_def_struct_sdna(srna, "SpaceSeq");
6136 RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
6137
6139 (1 << RGN_TYPE_TOOL_HEADER) | (1 << RGN_TYPE_UI) |
6140 (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_HUD) |
6141 (1 << RGN_TYPE_CHANNELS));
6142
6143 /* view type, fairly important */
6144 prop = RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
6145 RNA_def_property_enum_sdna(prop, nullptr, "view");
6148 prop, "View Type", "Type of the Sequencer view (sequencer, preview or both)");
6149 RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
6150
6151 /* display type, fairly important */
6152 prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
6153 RNA_def_property_enum_sdna(prop, nullptr, "mainb");
6154 RNA_def_property_enum_items(prop, display_mode_items);
6156 prop, "Display Mode", "View mode to use for displaying sequencer output");
6158
6159 /* flags */
6160 prop = RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
6161 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_DRAWFRAMES);
6162 RNA_def_property_ui_text(prop, "Display Frames", "Display frames rather than seconds");
6164
6165 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
6166 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_MARKER_TRANS);
6167 RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips");
6169
6170 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
6172 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
6174
6175 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
6176 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_SHOW_MARKERS);
6178 prop,
6179 "Show Markers",
6180 "If any exists, show markers in a separate row at the bottom of the editor");
6182
6183 prop = RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
6184 RNA_def_property_int_sdna(prop, nullptr, "chanshown");
6186 prop,
6187 "Display Channel",
6188 "The channel number shown in the image preview. 0 is the result of all strips combined");
6190 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
6191
6192 prop = RNA_def_property(srna, "preview_channels", PROP_ENUM, PROP_NONE);
6193 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
6194 RNA_def_property_enum_items(prop, preview_channels_items);
6195 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the preview to display");
6196 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
6197
6198 prop = RNA_def_property(srna, "use_zoom_to_fit", PROP_BOOLEAN, PROP_NONE);
6199 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_ZOOM_TO_FIT);
6201 prop, "Zoom to Fit", "Automatically zoom preview image to make it fully fit the region");
6203
6204 prop = RNA_def_property(srna, "show_overexposed", PROP_INT, PROP_NONE);
6205 RNA_def_property_int_sdna(prop, nullptr, "zebra");
6206 RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
6207 RNA_def_property_range(prop, 0, 110);
6209
6210 prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
6211 RNA_def_property_enum_sdna(prop, nullptr, "render_size");
6212 RNA_def_property_enum_items(prop, proxy_render_size_items);
6214 "Proxy Render Size",
6215 "Display preview using full resolution or different proxy resolutions");
6218 prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_render_size_update");
6219
6220 prop = RNA_def_property(srna, "use_proxies", PROP_BOOLEAN, PROP_NONE);
6221 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_USE_PROXIES);
6223 prop, "Use Proxies", "Use optimized files for faster scrubbing when available");
6224 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
6225
6226 prop = RNA_def_property(srna, "use_clamp_view", PROP_BOOLEAN, PROP_NONE);
6227 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_CLAMP_VIEW);
6229 prop, "rna_SequenceEditor_clamp_view_get", "rna_SequenceEditor_clamp_view_set");
6231 prop, "Limit View to Contents", "Limit timeline height to maximum used channel slot");
6233
6234 /* grease pencil */
6235 prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
6236 RNA_def_property_pointer_sdna(prop, nullptr, "gpd");
6237 RNA_def_property_struct_type(prop, "GreasePencil");
6239 prop, nullptr, nullptr, nullptr, "rna_GPencil_datablocks_annotations_poll");
6241 RNA_def_property_ui_text(prop, "Grease Pencil", "Grease Pencil data for this Preview region");
6243
6244 prop = RNA_def_property(srna, "overlay_frame_type", PROP_ENUM, PROP_NONE);
6245 RNA_def_property_enum_sdna(prop, nullptr, "overlay_frame_type");
6246 RNA_def_property_enum_items(prop, overlay_frame_type_items);
6247 RNA_def_property_ui_text(prop, "Overlay Type", "Overlay display method");
6249
6250 prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
6251 RNA_def_property_boolean_sdna(prop, nullptr, "draw_flag", SEQ_DRAW_BACKDROP);
6252 RNA_def_property_ui_text(prop, "Use Backdrop", "Display result under strips");
6254
6255 prop = RNA_def_property(srna, "show_transform_preview", PROP_BOOLEAN, PROP_NONE);
6256 RNA_def_property_boolean_sdna(prop, nullptr, "draw_flag", SEQ_DRAW_TRANSFORM_PREVIEW);
6257 RNA_def_property_ui_text(prop, "Transform Preview", "Show preview of the transformed frames");
6259
6260 /* Gizmo toggles. */
6261 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
6262 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SEQ_GIZMO_HIDE);
6263 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
6265
6266 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
6268 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
6270
6271 prop = RNA_def_property(srna, "show_gizmo_context", PROP_BOOLEAN, PROP_NONE);
6273 RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item");
6275
6276 prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE);
6277 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SEQ_GIZMO_HIDE_TOOL);
6278 RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo");
6280
6281 /* Overlay settings. */
6282 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
6283 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SEQ_SHOW_OVERLAY);
6284 RNA_def_property_ui_text(prop, "Show Overlays", "");
6286
6287 prop = RNA_def_property(srna, "preview_overlay", PROP_POINTER, PROP_NONE);
6289 RNA_def_property_struct_type(prop, "SequencerPreviewOverlay");
6291 prop, "rna_SpaceSequenceEditor_preview_overlay_get", nullptr, nullptr, nullptr);
6292 RNA_def_property_ui_text(prop, "Preview Overlay Settings", "Settings for display of overlays");
6293
6294 prop = RNA_def_property(srna, "timeline_overlay", PROP_POINTER, PROP_NONE);
6296 RNA_def_property_struct_type(prop, "SequencerTimelineOverlay");
6298 prop, "rna_SpaceSequenceEditor_timeline_overlay_get", nullptr, nullptr, nullptr);
6299 RNA_def_property_ui_text(prop, "Timeline Overlay Settings", "Settings for display of overlays");
6300
6301 prop = RNA_def_property(srna, "cache_overlay", PROP_POINTER, PROP_NONE);
6303 RNA_def_property_struct_type(prop, "SequencerCacheOverlay");
6305 prop, "rna_SpaceSequenceEditor_cache_overlay_get", nullptr, nullptr, nullptr);
6306 RNA_def_property_ui_text(prop, "Cache Overlay Settings", "Settings for display of overlays");
6310
6311 /* transform */
6312 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
6313 RNA_def_property_float_sdna(prop, nullptr, "cursor");
6314 RNA_def_property_array(prop, 2);
6315 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
6317
6318 /* Zoom. */
6319 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
6321 "rna_SpaceSequenceEditor_zoom_percentage_get",
6322 "rna_SpaceSequenceEditor_zoom_percentage_set",
6323 nullptr);
6324 RNA_def_property_float_default(prop, 100.0);
6325 RNA_def_property_range(prop, .4, 80000);
6326 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
6327 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
6328}
6329
6331{
6332 StructRNA *srna;
6333 PropertyRNA *prop;
6334 FunctionRNA *func;
6335
6336 srna = RNA_def_struct(brna, "SpaceTextEditor", "Space");
6337 RNA_def_struct_sdna(srna, "SpaceText");
6338 RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
6339
6341
6342 /* text */
6343 prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
6345 RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
6346 RNA_def_property_pointer_funcs(prop, nullptr, "rna_SpaceTextEditor_text_set", nullptr, nullptr);
6348
6349 /* display */
6350 prop = RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
6351 RNA_def_property_boolean_sdna(prop, nullptr, "wordwrap", 0);
6352 RNA_def_property_boolean_funcs(prop, nullptr, "rna_SpaceTextEditor_word_wrap_set");
6354 prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
6355 RNA_def_property_ui_icon(prop, ICON_WORDWRAP_ON, 0);
6357
6358 prop = RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
6359 RNA_def_property_boolean_sdna(prop, nullptr, "showlinenrs", 0);
6360 RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
6361 RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_ON, 0);
6363
6364 func = RNA_def_function(srna,
6365 "is_syntax_highlight_supported",
6366 "rna_SpaceTextEditor_text_is_syntax_highlight_supported");
6368 RNA_def_boolean(func, "is_syntax_highlight_supported", false, "", ""));
6370 "Returns True if the editor supports syntax highlighting "
6371 "for the current text datablock");
6372
6373 prop = RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
6374 RNA_def_property_boolean_sdna(prop, nullptr, "showsyntax", 0);
6375 RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
6376 RNA_def_property_ui_icon(prop, ICON_SYNTAX_ON, 0);
6378
6379 prop = RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
6380 RNA_def_property_boolean_sdna(prop, nullptr, "line_hlight", 0);
6381 RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
6383
6384 prop = RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
6385 RNA_def_property_int_sdna(prop, nullptr, "tabnumber");
6386 RNA_def_property_range(prop, 2, 8);
6387 RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
6388 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited");
6389
6390 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
6391 RNA_def_property_int_sdna(prop, nullptr, "lheight");
6392 RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */
6393 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
6395
6396 prop = RNA_def_property(srna, "show_margin", PROP_BOOLEAN, PROP_NONE);
6397 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_SHOW_MARGIN);
6398 RNA_def_property_ui_text(prop, "Show Margin", "Show right margin");
6400
6401 prop = RNA_def_property(srna, "margin_column", PROP_INT, PROP_NONE);
6402 RNA_def_property_int_sdna(prop, nullptr, "margin_column");
6403 RNA_def_property_range(prop, 0, 1024);
6404 RNA_def_property_ui_text(prop, "Margin Column", "Column number to show right margin at");
6406
6407 prop = RNA_def_property(srna, "top", PROP_INT, PROP_NONE);
6408 RNA_def_property_int_sdna(prop, nullptr, "top");
6409 RNA_def_property_range(prop, 0, INT_MAX);
6410 RNA_def_property_ui_text(prop, "Top Line", "Top line visible");
6412
6413 prop = RNA_def_property(srna, "visible_lines", PROP_INT, PROP_NONE);
6415 RNA_def_property_int_funcs(prop, "rna_SpaceTextEditor_visible_lines_get", nullptr, nullptr);
6417 prop, "Visible Lines", "Amount of lines that can be visible in current editor");
6418
6419 /* functionality options */
6420 prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
6421 RNA_def_property_boolean_sdna(prop, nullptr, "overwrite", 1);
6423 prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
6425
6426 prop = RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
6427 RNA_def_property_boolean_sdna(prop, nullptr, "live_edit", 1);
6428 RNA_def_property_ui_text(prop, "Live Edit", "Run Python while editing");
6430
6431 /* find */
6432 prop = RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
6433 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_FIND_ALL);
6435 prop, "Find All", "Search in all text data-blocks, instead of only the active one");
6437
6438 prop = RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
6439 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_FIND_WRAP);
6441 prop, "Find Wrap", "Search again from the start of the file when reaching the end");
6443
6444 prop = RNA_def_property(srna, "use_match_case", PROP_BOOLEAN, PROP_NONE);
6445 RNA_def_property_boolean_sdna(prop, nullptr, "flags", ST_MATCH_CASE);
6447 prop, "Match Case", "Search string is sensitive to uppercase and lowercase letters");
6449
6450 prop = RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
6451 RNA_def_property_string_sdna(prop, nullptr, "findstr");
6452 RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
6454
6455 prop = RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
6456 RNA_def_property_string_sdna(prop, nullptr, "replacestr");
6458 prop, "Replace Text", "Text to replace selected text with using the replace tool");
6460
6461 RNA_api_space_text(srna);
6462}
6463
6465{
6466 StructRNA *srna;
6467 PropertyRNA *prop;
6468
6469 srna = RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
6470 RNA_def_struct_sdna(srna, "SpaceAction");
6471 RNA_def_struct_ui_text(srna, "Space Dope Sheet Editor", "Dope Sheet space data");
6472
6474 srna, (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
6475
6476 /* data */
6477 prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
6480 nullptr,
6481 "rna_SpaceDopeSheetEditor_action_set",
6482 nullptr,
6483 "rna_Action_actedit_assign_poll");
6484 RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
6487 prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
6488
6489 /* mode (hidden in the UI, see 'ui_mode') */
6490 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6491 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6493 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6496 prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
6497
6498 prop = RNA_def_property(srna, "ui_mode", PROP_ENUM, PROP_NONE);
6499 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6501 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6504 prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
6505
6506 /* display */
6507 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
6508 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SACTION_DRAWTIME);
6509 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
6511
6512 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
6513 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SACTION_SLIDERS);
6514 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
6516
6517 prop = RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
6520 "Show Pose Markers",
6521 "Show markers belonging to the active action instead of Scene markers "
6522 "(Action and Shape Key Editors only)");
6524
6525 prop = RNA_def_property(srna, "show_interpolation", PROP_BOOLEAN, PROP_NONE);
6528 "Show Handles and Interpolation",
6529 "Display keyframe handle types and non-Bézier interpolation modes");
6531
6532 prop = RNA_def_property(srna, "show_extremes", PROP_BOOLEAN, PROP_NONE);
6535 "Show Curve Extremes",
6536 "Mark keyframes where the key value flow changes direction, based on "
6537 "comparison with adjacent keys");
6539
6540 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
6543 prop,
6544 "Show Markers",
6545 "If any exists, show markers in a separate row at the bottom of the editor");
6547
6548 /* editing */
6549 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
6551 RNA_def_property_ui_text(prop, "Auto-Merge Keyframes", "Automatically merge nearby keyframes");
6553
6554 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
6557 prop,
6558 "Realtime Updates",
6559 "When transforming keyframes, changes to the animation data are flushed to other views");
6561
6562 prop = RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
6564 RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
6565
6566 /* dopesheet */
6567 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
6568 RNA_def_property_struct_type(prop, "DopeSheet");
6569 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
6570 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
6571
6572 /* displaying cache status */
6573 prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
6574 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_DISPLAY);
6575 RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");
6577
6578 prop = RNA_def_property(srna, "cache_softbody", PROP_BOOLEAN, PROP_NONE);
6579 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SOFTBODY);
6580 RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");
6582
6583 prop = RNA_def_property(srna, "cache_particles", PROP_BOOLEAN, PROP_NONE);
6584 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_PARTICLES);
6585 RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");
6587
6588 prop = RNA_def_property(srna, "cache_cloth", PROP_BOOLEAN, PROP_NONE);
6589 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_CLOTH);
6590 RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");
6592
6593 prop = RNA_def_property(srna, "cache_smoke", PROP_BOOLEAN, PROP_NONE);
6594 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SMOKE);
6595 RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");
6597
6598 prop = RNA_def_property(srna, "cache_simulation_nodes", PROP_BOOLEAN, PROP_NONE);
6599 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_SIMULATION_NODES);
6601 prop, "Simulation Nodes", "Show the active object's simulation nodes cache and bake data");
6603
6604 prop = RNA_def_property(srna, "cache_dynamicpaint", PROP_BOOLEAN, PROP_NONE);
6605 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_DYNAMICPAINT);
6606 RNA_def_property_ui_text(prop, "Dynamic Paint", "Show the active object's Dynamic Paint cache");
6608
6609 prop = RNA_def_property(srna, "cache_rigidbody", PROP_BOOLEAN, PROP_NONE);
6610 RNA_def_property_boolean_sdna(prop, nullptr, "cache_display", TIME_CACHE_RIGIDBODY);
6611 RNA_def_property_ui_text(prop, "Rigid Body", "Show the active object's Rigid Body cache");
6613}
6614
6616{
6617 StructRNA *srna;
6618 PropertyRNA *prop;
6619
6620 /* this is basically the same as the one for the 3D-View, but with some entries omitted */
6621 static const EnumPropertyItem gpivot_items[] = {
6623 "BOUNDING_BOX_CENTER",
6624 ICON_PIVOT_BOUNDBOX,
6625 "Bounding Box Center",
6626 ""},
6627 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", ""},
6629 "INDIVIDUAL_ORIGINS",
6630 ICON_PIVOT_INDIVIDUAL,
6631 "Individual Centers",
6632 ""},
6633 /*{V3D_AROUND_CENTER_MEDIAN, "MEDIAN_POINT", 0, "Median Point", ""}, */
6634 /*{V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""}, */
6635 {0, nullptr, 0, nullptr, nullptr},
6636 };
6637
6638 srna = RNA_def_struct(brna, "SpaceGraphEditor", "Space");
6639 RNA_def_struct_sdna(srna, "SpaceGraph");
6640 RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
6641
6643 srna, (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
6644
6645 /* mode */
6646 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6647 RNA_def_property_enum_sdna(prop, nullptr, "mode");
6649 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
6652 prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
6653
6654 /* display */
6655 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
6656 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_DRAWTIME);
6657 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
6659
6660 prop = RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
6661 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_SLIDERS);
6662 RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
6664
6665 prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
6667 RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bézier control points");
6669
6670 prop = RNA_def_property(srna, "use_auto_lock_translation_axis", PROP_BOOLEAN, PROP_NONE);
6671 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_AUTOLOCK_AXIS);
6673 "Auto-Lock Key Axis",
6674 "Automatically locks the movement of keyframes to the dominant axis");
6676
6677 prop = RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
6680 prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
6682
6683 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
6684 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_SHOW_MARKERS);
6686 prop,
6687 "Show Markers",
6688 "If any exists, show markers in a separate row at the bottom of the editor");
6690
6691 prop = RNA_def_property(srna, "show_extrapolation", PROP_BOOLEAN, PROP_NONE);
6693 RNA_def_property_ui_text(prop, "Show Extrapolation", "");
6695
6696 /* editing */
6697 prop = RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
6699 RNA_def_property_ui_text(prop, "Auto-Merge Keyframes", "Automatically merge nearby keyframes");
6701
6702 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
6705 prop,
6706 "Realtime Updates",
6707 "When transforming keyframes, changes to the animation data are flushed to other views");
6709
6710 /* cursor */
6711 prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
6713 RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
6715
6716 prop = RNA_def_property(srna, "cursor_position_x", PROP_FLOAT, PROP_NONE);
6717 RNA_def_property_float_sdna(prop, nullptr, "cursorTime");
6719 prop, "Cursor X-Value", "Graph Editor 2D-Value cursor - X-Value component");
6721
6722 prop = RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
6723 RNA_def_property_float_sdna(prop, nullptr, "cursorVal");
6725 prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
6727
6728 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
6729 RNA_def_property_enum_sdna(prop, nullptr, "around");
6730 RNA_def_property_enum_items(prop, gpivot_items);
6731 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
6733
6734 /* Dope-sheet. */
6735 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
6736 RNA_def_property_struct_type(prop, "DopeSheet");
6737 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
6738 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
6739
6740 /* Read-only state info. */
6741 prop = RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
6742 RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", nullptr);
6745 prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
6746
6747 /* Normalize curves. */
6748 prop = RNA_def_property(srna, "use_normalization", PROP_BOOLEAN, PROP_NONE);
6749 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SIPO_NORMALIZE);
6751 "Use Normalization",
6752 "Display curves in normalized range from -1 to 1, "
6753 "for easier editing of multiple curves with different ranges");
6756 prop, NC_SPACE | ND_SPACE_GRAPH, "rna_SpaceGraphEditor_normalize_update");
6757
6758 prop = RNA_def_property(srna, "use_auto_normalization", PROP_BOOLEAN, PROP_NONE);
6761 "Auto Normalization",
6762 "Automatically recalculate curve normalization on every curve edit");
6764}
6765
6767{
6768 StructRNA *srna;
6769 PropertyRNA *prop;
6770
6771 srna = RNA_def_struct(brna, "SpaceNLA", "Space");
6772 RNA_def_struct_sdna(srna, "SpaceNla");
6773 RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
6774
6776 srna, (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD) | (1 << RGN_TYPE_CHANNELS));
6777
6778 /* display */
6779 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
6780 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNLA_DRAWTIME);
6781 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
6783
6784 prop = RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
6786 RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips");
6788
6789 prop = RNA_def_property(srna, "show_local_markers", PROP_BOOLEAN, PROP_NONE);
6792 prop,
6793 "Show Local Markers",
6794 "Show action-local markers on the strips, useful when synchronizing timing across strips");
6796
6797 prop = RNA_def_property(srna, "show_markers", PROP_BOOLEAN, PROP_NONE);
6798 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNLA_SHOW_MARKERS);
6800 prop,
6801 "Show Markers",
6802 "If any exists, show markers in a separate row at the bottom of the editor");
6804
6805 /* editing */
6806 prop = RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
6809 prop,
6810 "Realtime Updates",
6811 "When transforming strips, changes to the animation data are flushed to other views");
6813
6814 /* dopesheet */
6815 prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
6816 RNA_def_property_struct_type(prop, "DopeSheet");
6817 RNA_def_property_pointer_sdna(prop, nullptr, "ads");
6818 RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
6819}
6820
6822{
6823 static const EnumPropertyItem console_line_type_items[] = {
6824 {CONSOLE_LINE_OUTPUT, "OUTPUT", 0, "Output", ""},
6825 {CONSOLE_LINE_INPUT, "INPUT", 0, "Input", ""},
6826 {CONSOLE_LINE_INFO, "INFO", 0, "Info", ""},
6827 {CONSOLE_LINE_ERROR, "ERROR", 0, "Error", ""},
6828 {0, nullptr, 0, nullptr, nullptr},
6829 };
6830
6831 StructRNA *srna;
6832 PropertyRNA *prop;
6833
6834 srna = RNA_def_struct(brna, "ConsoleLine", nullptr);
6835 RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
6836
6837 prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
6839 prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
6840 RNA_def_property_ui_text(prop, "Line", "Text in the line");
6843
6844 prop = RNA_def_property(
6845 srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
6847 "rna_ConsoleLine_current_character_get",
6848 "rna_ConsoleLine_current_character_set",
6849 nullptr);
6851
6852 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
6853 RNA_def_property_enum_sdna(prop, nullptr, "type");
6854 RNA_def_property_enum_items(prop, console_line_type_items);
6855 RNA_def_property_ui_text(prop, "Type", "Console line type when used in scrollback");
6856}
6857
6859{
6860 StructRNA *srna;
6861 PropertyRNA *prop;
6862
6863 srna = RNA_def_struct(brna, "SpaceConsole", "Space");
6864 RNA_def_struct_sdna(srna, "SpaceConsole");
6865 RNA_def_struct_ui_text(srna, "Space Console", "Interactive Python console");
6866
6867 /* display */
6868 prop = RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
6869 RNA_def_property_int_sdna(prop, nullptr, "lheight");
6870 RNA_def_property_range(prop, 1, 256); /* Large range since Hi-DPI scales down size. */
6871 RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
6872 RNA_def_property_update(prop, 0, "rna_SpaceConsole_rect_update");
6873
6874 prop = RNA_def_property(
6875 srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
6876 RNA_def_property_int_sdna(prop, nullptr, "sel_start");
6878
6879 prop = RNA_def_property(
6880 srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
6881 RNA_def_property_int_sdna(prop, nullptr, "sel_end");
6883
6884 prop = RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
6885 RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
6886
6887 prop = RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
6888 RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
6890
6891 prop = RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
6892 RNA_def_property_collection_sdna(prop, nullptr, "history", nullptr);
6893 RNA_def_property_struct_type(prop, "ConsoleLine");
6894 RNA_def_property_ui_text(prop, "History", "Command history");
6895
6896 prop = RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
6897 RNA_def_property_collection_sdna(prop, nullptr, "scrollback", nullptr);
6898 RNA_def_property_struct_type(prop, "ConsoleLine");
6899 RNA_def_property_ui_text(prop, "Output", "Command output");
6900}
6901
6902/* Filter for datablock types in link/append. */
6904{
6905
6906 StructRNA *srna = RNA_def_struct(brna, "FileSelectIDFilter", nullptr);
6907 RNA_def_struct_sdna(srna, "FileSelectParams");
6908 RNA_def_struct_nested(brna, srna, "FileSelectParams");
6910 srna, "File Select ID Filter", "Which ID types to show/hide, when browsing a library");
6911
6912 const IDFilterEnumPropertyItem *individual_ids_and_categories[] = {
6915 nullptr,
6916 };
6917 for (uint i = 0; individual_ids_and_categories[i]; i++) {
6918 for (int j = 0; individual_ids_and_categories[i][j].identifier; j++) {
6920 srna, individual_ids_and_categories[i][j].identifier, PROP_BOOLEAN, PROP_NONE);
6922 prop, nullptr, "filter_id", individual_ids_and_categories[i][j].flag);
6924 individual_ids_and_categories[i][j].name,
6925 individual_ids_and_categories[i][j].description);
6926 RNA_def_property_ui_icon(prop, individual_ids_and_categories[i][j].icon, 0);
6928 }
6929 }
6930}
6931
6932/* Filter for datablock types in the Asset Browser. */
6934{
6935 StructRNA *srna = RNA_def_struct(brna, "FileAssetSelectIDFilter", nullptr);
6936 RNA_def_struct_sdna(srna, "FileSelectParams");
6937 RNA_def_struct_nested(brna, srna, "FileSelectParams");
6939 "File Select Asset Filter",
6940 "Which asset types to show/hide, when browsing an asset library");
6941
6942 static char experimental_prop_names[INDEX_ID_MAX][MAX_NAME];
6943
6944 for (uint i = 0; rna_enum_id_type_filter_items[i].identifier; i++) {
6946 const bool is_experimental = (ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS & item->flag) == 0;
6947
6948 const char *identifier = rna_enum_id_type_filter_items[i].identifier;
6949 if (is_experimental) {
6950 /* Create name for experimental property and store in static buffer. */
6951 SNPRINTF(experimental_prop_names[i], "experimental_%s", identifier);
6952 identifier = experimental_prop_names[i];
6953 }
6954
6955 PropertyRNA *prop = RNA_def_property(srna, identifier, PROP_BOOLEAN, PROP_NONE);
6956 RNA_def_property_boolean_sdna(prop, nullptr, "filter_id", item->flag);
6957 RNA_def_property_ui_text(prop, item->name, item->description);
6958 RNA_def_property_ui_icon(prop, item->icon, 0);
6960 }
6961}
6962
6964{
6965 PropertyRNA *prop;
6966 StructRNA *srna = RNA_def_struct(brna, "FileSelectEntry", nullptr);
6967 RNA_def_struct_sdna(srna, "FileDirEntry");
6968 RNA_def_struct_ui_text(srna, "File Select Entry", "A file viewable in the File Browser");
6969
6970 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
6971 RNA_def_property_editable_func(prop, "rna_FileBrowser_FileSelectEntry_name_editable");
6974 "rna_FileBrowser_FileSelectEntry_name_get",
6975 "rna_FileBrowser_FileSelectEntry_name_length",
6976 nullptr);
6977 RNA_def_property_ui_text(prop, "Name", "");
6978 RNA_def_struct_name_property(srna, prop);
6979
6980 prop = RNA_def_property(srna, "relative_path", PROP_STRING, PROP_FILEPATH);
6982 "rna_FileBrowser_FileSelectEntry_relative_path_get",
6983 "rna_FileBrowser_FileSelectEntry_relative_path_length",
6984 nullptr);
6986 "Relative Path",
6987 "Path relative to the directory currently displayed in the File "
6988 "Browser (includes the file name)");
6990
6991 prop = RNA_def_int(
6992 srna,
6993 "preview_icon_id",
6994 0,
6995 INT_MIN,
6996 INT_MAX,
6997 "Icon ID",
6998 "Unique integer identifying the preview of this file as an icon (zero means invalid)",
6999 INT_MIN,
7000 INT_MAX);
7003 prop, "rna_FileBrowser_FileSelectEntry_preview_icon_id_get", nullptr, nullptr);
7004
7005 prop = RNA_def_property(srna, "asset_data", PROP_POINTER, PROP_NONE);
7006 RNA_def_property_struct_type(prop, "AssetMetaData");
7008 prop, "rna_FileBrowser_FileSelectEntry_asset_data_get", nullptr, nullptr, nullptr);
7010 prop, "Asset Data", "Asset data, valid if the file represents an asset");
7011}
7012
7014{
7015 StructRNA *srna;
7016 PropertyRNA *prop;
7017
7018 static const EnumPropertyItem file_display_items[] = {
7020 "LIST_VERTICAL",
7021 ICON_LONGDISPLAY,
7022 "Vertical List",
7023 "Display files as a vertical list"},
7025 "LIST_HORIZONTAL",
7026 ICON_SHORTDISPLAY,
7027 "Horizontal List",
7028 "Display files as a horizontal list"},
7029 {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
7030 {0, nullptr, 0, nullptr, nullptr},
7031 };
7032
7033 static const EnumPropertyItem display_size_items[] = {
7034 {32, "TINY", 0, "Tiny", ""},
7035 {64, "SMALL", 0, "Small", ""},
7036 {96, "NORMAL", 0, "Medium", ""},
7037 {128, "BIG", 0, "Big", ""},
7038 {192, "LARGE", 0, "Large", ""},
7039 {0, nullptr, 0, nullptr, nullptr},
7040 };
7041
7042 srna = RNA_def_struct(brna, "FileSelectParams", nullptr);
7043 RNA_def_struct_path_func(srna, "rna_FileSelectParams_path");
7044 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
7045
7046 prop = RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
7047 RNA_def_property_string_sdna(prop, nullptr, "title");
7048 RNA_def_property_ui_text(prop, "Title", "Title for the file browser");
7050
7051 /* Use BYTESTRING rather than DIRPATH as sub-type so UI code doesn't add OT_directory_browse
7052 * button when displaying this prop in the file browser (it would just open a file browser). That
7053 * should be the only effective difference between the two. */
7054 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_BYTESTRING);
7055 RNA_def_property_string_sdna(prop, nullptr, "dir");
7056 RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
7058
7059 prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
7060 RNA_def_property_string_sdna(prop, nullptr, "file");
7061 RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
7062 RNA_def_property_editable_func(prop, "rna_FileSelectParams_filename_editable");
7064
7065 prop = RNA_def_property(srna, "use_library_browsing", PROP_BOOLEAN, PROP_NONE);
7067 prop, "Library Browser", "Whether we may browse Blender files' content or not");
7069 RNA_def_property_boolean_funcs(prop, "rna_FileSelectParams_use_lib_get", nullptr);
7070
7071 prop = RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
7072 RNA_def_property_enum_sdna(prop, nullptr, "display");
7073 RNA_def_property_enum_items(prop, file_display_items);
7074 RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
7076
7077 prop = RNA_def_property(srna, "recursion_level", PROP_ENUM, PROP_NONE);
7080 prop, nullptr, nullptr, "rna_FileSelectParams_recursion_level_itemf");
7081 RNA_def_property_ui_text(prop, "Recursion", "Numbers of dirtree levels to show simultaneously");
7083
7084 prop = RNA_def_property(srna, "show_details_size", PROP_BOOLEAN, PROP_NONE);
7085 RNA_def_property_boolean_sdna(prop, nullptr, "details_flags", FILE_DETAILS_SIZE);
7086 RNA_def_property_ui_text(prop, "File Size", "Show a column listing the size of each file");
7088
7089 prop = RNA_def_property(srna, "show_details_datetime", PROP_BOOLEAN, PROP_NONE);
7090 RNA_def_property_boolean_sdna(prop, nullptr, "details_flags", FILE_DETAILS_DATETIME);
7092 prop,
7093 "File Modification Date",
7094 "Show a column listing the date and time of modification for each file");
7096
7097 prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
7098 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_FILTER);
7099 RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
7101
7102 prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
7104 RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
7106
7107 prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
7108 RNA_def_property_enum_sdna(prop, nullptr, "sort");
7110 RNA_def_property_ui_text(prop, "Sort", "");
7112
7113 prop = RNA_def_property(srna, "use_sort_invert", PROP_BOOLEAN, PROP_NONE);
7114 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_SORT_INVERT);
7116 prop, "Reverse Sorting", "Sort items descending, from highest value to lowest");
7118
7119 prop = RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
7120 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_IMAGE);
7121 RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
7122 RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
7124
7125 prop = RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
7126 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_BLENDER);
7127 RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
7128 RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
7130
7131 prop = RNA_def_property(srna, "use_filter_backup", PROP_BOOLEAN, PROP_NONE);
7134 prop, "Filter Blender Backup Files", "Show .blend1, .blend2, etc. files");
7135 RNA_def_property_ui_icon(prop, ICON_FILE_BACKUP, 0);
7137
7138 prop = RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
7139 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_MOVIE);
7140 RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
7141 RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
7143
7144 prop = RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
7145 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_PYSCRIPT);
7146 RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
7147 RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
7149
7150 prop = RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
7151 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_FTFONT);
7152 RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
7153 RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
7155
7156 prop = RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
7157 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_SOUND);
7158 RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
7159 RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
7161
7162 prop = RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
7163 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_TEXT);
7164 RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
7165 RNA_def_property_ui_icon(prop, ICON_FILE_TEXT, 0);
7167
7168 prop = RNA_def_property(srna, "use_filter_volume", PROP_BOOLEAN, PROP_NONE);
7169 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_VOLUME);
7170 RNA_def_property_ui_text(prop, "Filter Volume", "Show 3D volume files");
7171 RNA_def_property_ui_icon(prop, ICON_FILE_VOLUME, 0);
7173
7174 prop = RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
7175 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_FOLDER);
7176 RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
7177 RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
7179
7180 prop = RNA_def_property(srna, "use_filter_blendid", PROP_BOOLEAN, PROP_NONE);
7181 RNA_def_property_boolean_sdna(prop, nullptr, "filter", FILE_TYPE_BLENDERLIB);
7183 prop, "Filter Blender IDs", "Show .blend files items (objects, materials, etc.)");
7184 RNA_def_property_ui_icon(prop, ICON_BLENDER, 0);
7186
7187 prop = RNA_def_property(srna, "use_filter_asset_only", PROP_BOOLEAN, PROP_NONE);
7188 RNA_def_property_boolean_sdna(prop, nullptr, "flag", FILE_ASSETS_ONLY);
7190 prop, "Only Assets", "Hide .blend files items that are not data-blocks with asset metadata");
7192
7193 prop = RNA_def_property(srna, "filter_id", PROP_POINTER, PROP_NONE);
7195 RNA_def_property_struct_type(prop, "FileSelectIDFilter");
7197 prop, "rna_FileSelectParams_filter_id_get", nullptr, nullptr, nullptr);
7199 prop, "Filter ID Types", "Which ID types to show/hide, when browsing a library");
7200
7201 prop = RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
7202 RNA_def_property_string_sdna(prop, nullptr, "filter_glob");
7204 "Extension Filter",
7205 "UNIX shell-like filename patterns matching, supports wildcards ('*') "
7206 "and list of patterns separated by ';'");
7207 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_FileSelectPrams_filter_glob_set");
7209
7210 prop = RNA_def_property(srna, "filter_search", PROP_STRING, PROP_NONE);
7211 RNA_def_property_string_sdna(prop, nullptr, "filter_search");
7213 prop, "Name or Tag Filter", "Filter by name or tag, supports '*' wildcard");
7216
7217 prop = RNA_def_property(srna, "display_size", PROP_INT, PROP_NONE);
7218 RNA_def_property_int_sdna(prop, nullptr, "thumbnail_size");
7219 RNA_def_property_ui_text(prop, "Display Size", "Change the size of thumbnails");
7222 RNA_def_property_range(prop, 16, 256);
7223 RNA_def_property_ui_range(prop, 24, 256, 1, 0);
7224
7225 prop = RNA_def_property(srna, "display_size_discrete", PROP_ENUM, PROP_NONE);
7226 RNA_def_property_enum_sdna(prop, nullptr, "thumbnail_size");
7227 RNA_def_property_enum_items(prop, display_size_items);
7229 prop, "Display Size", "Change the size of thumbnails in discrete steps");
7231}
7232
7234{
7235 StructRNA *srna;
7236 PropertyRNA *prop;
7237
7238 static const EnumPropertyItem asset_import_method_items[] = {
7240 "FOLLOW_PREFS",
7241 0,
7242 "Follow Preferences",
7243 "Use the import method set in the Preferences for this asset library, don't override it "
7244 "for this Asset Browser"},
7245 {FILE_ASSET_IMPORT_LINK, "LINK", 0, "Link", "Import the assets as linked data-block"},
7247 "APPEND",
7248 0,
7249 "Append",
7250 "Import the assets as copied data-block, with no link to the original asset data-block"},
7252 "APPEND_REUSE",
7253 0,
7254 "Append (Reuse Data)",
7255 "Import the assets as copied data-block while avoiding multiple copies of nested, "
7256 "typically heavy data. For example the textures of a material asset, or the mesh of an "
7257 "object asset, don't have to be copied every time this asset is imported. The instances of "
7258 "the asset share the data instead"},
7259 {0, nullptr, 0, nullptr, nullptr},
7260 };
7261
7262 srna = RNA_def_struct(brna, "FileAssetSelectParams", "FileSelectParams");
7264 srna, "Asset Select Parameters", "Settings for the file selection in Asset Browser mode");
7265
7267 "rna_FileAssetSelectParams_asset_library_get",
7268 "rna_FileAssetSelectParams_asset_library_set");
7269 RNA_def_property_ui_text(prop, "Asset Library", "");
7271
7272 prop = RNA_def_property(srna, "catalog_id", PROP_STRING, PROP_NONE);
7274 "rna_FileAssetSelectParams_catalog_id_get",
7275 "rna_FileAssetSelectParams_catalog_id_length",
7276 "rna_FileAssetSelectParams_catalog_id_set");
7277 RNA_def_property_ui_text(prop, "Catalog UUID", "The UUID of the catalog shown in the browser");
7279
7280 prop = RNA_def_property(srna, "filter_asset_id", PROP_POINTER, PROP_NONE);
7282 RNA_def_property_struct_type(prop, "FileAssetSelectIDFilter");
7284 prop, "rna_FileAssetSelectParams_filter_id_get", nullptr, nullptr, nullptr);
7286 "Filter Asset Types",
7287 "Which asset types to show/hide, when browsing an asset library");
7288
7289 prop = RNA_def_property(srna, "import_method", PROP_ENUM, PROP_NONE);
7290 RNA_def_property_enum_items(prop, asset_import_method_items);
7291 RNA_def_property_ui_text(prop, "Import Method", "Determine how the asset will be imported");
7292 /* Asset drag info saved by buttons stores the import method, so the space must redraw when
7293 * import method changes. */
7295}
7296
7298{
7299 StructRNA *srna;
7300 PropertyRNA *prop;
7301
7302 srna = RNA_def_struct(brna, "FileBrowserFSMenuEntry", nullptr);
7303 RNA_def_struct_sdna(srna, "FSMenuEntry");
7304 RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
7305
7306 prop = RNA_def_property(srna, "path", PROP_STRING, PROP_FILEPATH);
7308 "rna_FileBrowser_FSMenuEntry_path_get",
7309 "rna_FileBrowser_FSMenuEntry_path_length",
7310 "rna_FileBrowser_FSMenuEntry_path_set");
7311 RNA_def_property_ui_text(prop, "Path", "");
7313
7314 /* Use #PROP_FILENAME sub-type so the UI can manipulate non-UTF8 names. */
7315 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_FILENAME);
7317 "rna_FileBrowser_FSMenuEntry_name_get",
7318 "rna_FileBrowser_FSMenuEntry_name_length",
7319 "rna_FileBrowser_FSMenuEntry_name_set");
7320 RNA_def_property_editable_func(prop, "rna_FileBrowser_FSMenuEntry_name_get_editable");
7321 RNA_def_property_ui_text(prop, "Name", "");
7322 RNA_def_struct_name_property(srna, prop);
7323
7324 prop = RNA_def_property(srna, "icon", PROP_INT, PROP_NONE);
7326 "rna_FileBrowser_FSMenuEntry_icon_get",
7327 "rna_FileBrowser_FSMenuEntry_icon_set",
7328 nullptr);
7329 RNA_def_property_ui_text(prop, "Icon", "");
7330
7331 prop = RNA_def_property(srna, "use_save", PROP_BOOLEAN, PROP_NONE);
7332 RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_use_save_get", nullptr);
7334 prop, "Save", "Whether this path is saved in bookmarks, or generated from OS");
7336
7337 prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
7338 RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_is_valid_get", nullptr);
7339 RNA_def_property_ui_text(prop, "Valid", "Whether this path is currently reachable");
7341}
7342
7344{
7345 StructRNA *srna;
7346 PropertyRNA *prop;
7347
7348 srna = RNA_def_struct(brna, "SpaceFileBrowser", "Space");
7349 RNA_def_struct_sdna(srna, "SpaceFile");
7350 RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
7351
7353 srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_TOOL_PROPS));
7354
7355 prop = RNA_def_property(srna, "browse_mode", PROP_ENUM, PROP_NONE);
7358 prop,
7359 "Browsing Mode",
7360 "Type of the File Editor view (regular file browsing or asset browsing)");
7361 RNA_def_property_update(prop, 0, "rna_SpaceFileBrowser_browse_mode_update");
7362
7363 prop = RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
7364 RNA_def_property_struct_type(prop, "FileSelectParams");
7366 prop, "rna_FileBrowser_params_get", nullptr, "rna_FileBrowser_params_typef", nullptr);
7368 prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser");
7369
7370 prop = RNA_def_property(srna, "active_operator", PROP_POINTER, PROP_NONE);
7371 RNA_def_property_pointer_sdna(prop, nullptr, "op");
7372 RNA_def_property_ui_text(prop, "Active Operator", "");
7373
7374 /* keep this for compatibility with existing presets,
7375 * not exposed in c++ api because of keyword conflict */
7376 prop = RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
7377 RNA_def_property_pointer_sdna(prop, nullptr, "op");
7378 RNA_def_property_ui_text(prop, "Active Operator", "");
7379
7380 /* bookmarks, recent files etc. */
7381 prop = RNA_def_collection(srna,
7382 "system_folders",
7383 "FileBrowserFSMenuEntry",
7384 "System Folders",
7385 "System's folders (usually root, available hard drives, etc)");
7387 "rna_FileBrowser_FSMenuSystem_data_begin",
7388 "rna_FileBrowser_FSMenu_next",
7389 "rna_FileBrowser_FSMenu_end",
7390 "rna_FileBrowser_FSMenu_get",
7391 "rna_FileBrowser_FSMenuSystem_data_length",
7392 nullptr,
7393 nullptr,
7394 nullptr);
7396
7397 prop = RNA_def_int(srna,
7398 "system_folders_active",
7399 -1,
7400 -1,
7401 INT_MAX,
7402 "Active System Folder",
7403 "Index of active system folder (-1 if none)",
7404 -1,
7405 INT_MAX);
7406 RNA_def_property_int_sdna(prop, nullptr, "systemnr");
7408 "rna_FileBrowser_FSMenuSystem_active_get",
7409 "rna_FileBrowser_FSMenuSystem_active_set",
7410 "rna_FileBrowser_FSMenuSystem_active_range");
7413 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7414
7415 prop = RNA_def_collection(srna,
7416 "system_bookmarks",
7417 "FileBrowserFSMenuEntry",
7418 "System Bookmarks",
7419 "System's bookmarks");
7421 "rna_FileBrowser_FSMenuSystemBookmark_data_begin",
7422 "rna_FileBrowser_FSMenu_next",
7423 "rna_FileBrowser_FSMenu_end",
7424 "rna_FileBrowser_FSMenu_get",
7425 "rna_FileBrowser_FSMenuSystemBookmark_data_length",
7426 nullptr,
7427 nullptr,
7428 nullptr);
7430
7431 prop = RNA_def_int(srna,
7432 "system_bookmarks_active",
7433 -1,
7434 -1,
7435 INT_MAX,
7436 "Active System Bookmark",
7437 "Index of active system bookmark (-1 if none)",
7438 -1,
7439 INT_MAX);
7440 RNA_def_property_int_sdna(prop, nullptr, "system_bookmarknr");
7442 "rna_FileBrowser_FSMenuSystemBookmark_active_get",
7443 "rna_FileBrowser_FSMenuSystemBookmark_active_set",
7444 "rna_FileBrowser_FSMenuSystemBookmark_active_range");
7447 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7448
7449 prop = RNA_def_collection(
7450 srna, "bookmarks", "FileBrowserFSMenuEntry", "Bookmarks", "User's bookmarks");
7452 "rna_FileBrowser_FSMenuBookmark_data_begin",
7453 "rna_FileBrowser_FSMenu_next",
7454 "rna_FileBrowser_FSMenu_end",
7455 "rna_FileBrowser_FSMenu_get",
7456 "rna_FileBrowser_FSMenuBookmark_data_length",
7457 nullptr,
7458 nullptr,
7459 nullptr);
7461
7462 prop = RNA_def_int(srna,
7463 "bookmarks_active",
7464 -1,
7465 -1,
7466 INT_MAX,
7467 "Active Bookmark",
7468 "Index of active bookmark (-1 if none)",
7469 -1,
7470 INT_MAX);
7471 RNA_def_property_int_sdna(prop, nullptr, "bookmarknr");
7473 "rna_FileBrowser_FSMenuBookmark_active_get",
7474 "rna_FileBrowser_FSMenuBookmark_active_set",
7475 "rna_FileBrowser_FSMenuBookmark_active_range");
7478 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7479
7480 prop = RNA_def_collection(
7481 srna, "recent_folders", "FileBrowserFSMenuEntry", "Recent Folders", "");
7483 "rna_FileBrowser_FSMenuRecent_data_begin",
7484 "rna_FileBrowser_FSMenu_next",
7485 "rna_FileBrowser_FSMenu_end",
7486 "rna_FileBrowser_FSMenu_get",
7487 "rna_FileBrowser_FSMenuRecent_data_length",
7488 nullptr,
7489 nullptr,
7490 nullptr);
7492
7493 prop = RNA_def_int(srna,
7494 "recent_folders_active",
7495 -1,
7496 -1,
7497 INT_MAX,
7498 "Active Recent Folder",
7499 "Index of active recent folder (-1 if none)",
7500 -1,
7501 INT_MAX);
7502 RNA_def_property_int_sdna(prop, nullptr, "recentnr");
7504 "rna_FileBrowser_FSMenuRecent_active_get",
7505 "rna_FileBrowser_FSMenuRecent_active_set",
7506 "rna_FileBrowser_FSMenuRecent_active_range");
7509 prop, NC_SPACE | ND_SPACE_FILE_PARAMS, "rna_FileBrowser_FSMenu_active_update");
7510
7512}
7513
7515{
7516 StructRNA *srna;
7517 PropertyRNA *prop;
7518
7519 srna = RNA_def_struct(brna, "SpaceInfo", "Space");
7520 RNA_def_struct_sdna(srna, "SpaceInfo");
7521 RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
7522
7523 /* reporting display */
7524 prop = RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
7525 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_DEBUG);
7526 RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
7528
7529 prop = RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
7530 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_INFO);
7531 RNA_def_property_ui_text(prop, "Show Info", "Display general information");
7533
7534 prop = RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
7535 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_OP);
7536 RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
7538
7539 prop = RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
7540 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_WARN);
7541 RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
7543
7544 prop = RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
7545 RNA_def_property_boolean_sdna(prop, nullptr, "rpt_mask", INFO_RPT_ERR);
7546 RNA_def_property_ui_text(prop, "Show Error", "Display error text");
7548}
7549
7551{
7552 static const EnumPropertyItem filter_type_items[] = {
7553 {0, "NAME", 0, "Name", "Filter based on the operator name"},
7554 {1, "KEY", 0, "Key-Binding", "Filter based on key bindings"},
7555 {0, nullptr, 0, nullptr, nullptr},
7556 };
7557
7558 StructRNA *srna;
7559 PropertyRNA *prop;
7560
7561 srna = RNA_def_struct(brna, "SpacePreferences", "Space");
7562 RNA_def_struct_sdna(srna, "SpaceUserPref");
7563 RNA_def_struct_ui_text(srna, "Space Preferences", "Blender preferences space data");
7564
7565 prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
7566 RNA_def_property_enum_sdna(prop, nullptr, "filter_type");
7567 RNA_def_property_enum_items(prop, filter_type_items);
7568 RNA_def_property_ui_text(prop, "Filter Type", "Filter method");
7570
7571 prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
7572 RNA_def_property_string_sdna(prop, nullptr, "filter");
7574 RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
7575}
7576
7578{
7579 StructRNA *srna;
7580 PropertyRNA *prop;
7581
7582 srna = RNA_def_struct(brna, "NodeTreePath", nullptr);
7583 RNA_def_struct_sdna(srna, "bNodeTreePath");
7584 RNA_def_struct_ui_text(srna, "Node Tree Path", "Element of the node space tree path");
7585
7586 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
7587 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
7589 RNA_def_property_ui_text(prop, "Node Tree", "Base node tree from context");
7590}
7591
7593{
7594 StructRNA *srna;
7595 PropertyRNA *prop, *parm;
7596 FunctionRNA *func;
7597
7598 RNA_def_property_srna(cprop, "SpaceNodeEditorPath");
7599 srna = RNA_def_struct(brna, "SpaceNodeEditorPath", nullptr);
7600 RNA_def_struct_sdna(srna, "SpaceNode");
7601 RNA_def_struct_ui_text(srna, "Space Node Editor Path", "History of node trees in the editor");
7602
7603 prop = RNA_def_property(srna, "to_string", PROP_STRING, PROP_NONE);
7605 prop, "rna_SpaceNodeEditor_path_get", "rna_SpaceNodeEditor_path_length", nullptr);
7607 RNA_def_struct_ui_text(srna, "Path", "Get the node tree path as a string");
7609
7610 func = RNA_def_function(srna, "clear", "rna_SpaceNodeEditor_path_clear");
7611 RNA_def_function_ui_description(func, "Reset the node tree path");
7613
7614 func = RNA_def_function(srna, "start", "rna_SpaceNodeEditor_path_start");
7615 RNA_def_function_ui_description(func, "Set the root node tree");
7617 parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", "");
7619
7620 func = RNA_def_function(srna, "append", "rna_SpaceNodeEditor_path_append");
7621 RNA_def_function_ui_description(func, "Append a node group tree to the path");
7623 parm = RNA_def_pointer(
7624 func, "node_tree", "NodeTree", "Node Tree", "Node tree to append to the node editor path");
7626 parm = RNA_def_pointer(func, "node", "Node", "Node", "Group node linking to this node tree");
7628
7629 func = RNA_def_function(srna, "pop", "rna_SpaceNodeEditor_path_pop");
7630 RNA_def_function_ui_description(func, "Remove the last node tree from the path");
7632}
7633
7635{
7636 StructRNA *srna;
7637 PropertyRNA *prop;
7638
7639 static const EnumPropertyItem preview_shapes[] = {
7640 {SN_OVERLAY_PREVIEW_FLAT, "FLAT", ICON_MESH_PLANE, "Flat", "Use the default flat previews"},
7642 "3D",
7643 ICON_SPHERE,
7644 "3D",
7645 "Use the material preview scene for the node previews"},
7646 {0, nullptr, 0, nullptr, nullptr},
7647 };
7648
7649 srna = RNA_def_struct(brna, "SpaceNodeOverlay", nullptr);
7650 RNA_def_struct_sdna(srna, "SpaceNode");
7651 RNA_def_struct_nested(brna, srna, "SpaceNodeEditor");
7652 RNA_def_struct_path_func(srna, "rna_SpaceNodeOverlay_path");
7654 srna, "Overlay Settings", "Settings for display of overlays in the Node Editor");
7655
7656 prop = RNA_def_property(srna, "show_overlays", PROP_BOOLEAN, PROP_NONE);
7657 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_OVERLAYS);
7659 RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like colored or dashed wires");
7661
7662 prop = RNA_def_property(srna, "show_wire_color", PROP_BOOLEAN, PROP_NONE);
7663 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_WIRE_COLORS);
7666 prop, "Show Wire Colors", "Color node links based on their connected sockets");
7668
7669 prop = RNA_def_property(srna, "show_reroute_auto_labels", PROP_BOOLEAN, PROP_NONE);
7671 prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_REROUTE_AUTO_LABELS);
7674 "Show Reroute Auto Labels",
7675 "Label reroute nodes based on the label of connected reroute nodes");
7677
7678 prop = RNA_def_property(srna, "show_timing", PROP_BOOLEAN, PROP_NONE);
7679 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_TIMINGS);
7681 RNA_def_property_ui_text(prop, "Show Timing", "Display each node's last execution time");
7683
7684 prop = RNA_def_property(srna, "show_context_path", PROP_BOOLEAN, PROP_NONE);
7685 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_PATH);
7687 RNA_def_property_ui_text(prop, "Show Tree Path", "Display breadcrumbs for the editor's context");
7689
7690 prop = RNA_def_property(srna, "show_named_attributes", PROP_BOOLEAN, PROP_NONE);
7694 prop, "Show Named Attributes", "Show when nodes are using named attributes");
7696
7697 prop = RNA_def_property(srna, "show_previews", PROP_BOOLEAN, PROP_NONE);
7698 RNA_def_property_boolean_sdna(prop, nullptr, "overlay.flag", SN_OVERLAY_SHOW_PREVIEWS);
7701 prop, "Show Node Previews", "Display each node's preview if node is toggled");
7703
7704 prop = RNA_def_property(srna, "preview_shape", PROP_ENUM, PROP_NONE);
7705 RNA_def_property_enum_sdna(prop, nullptr, "overlay.preview_shape");
7706 RNA_def_property_enum_items(prop, preview_shapes);
7708 RNA_def_property_ui_text(prop, "Preview Shape", "Preview shape used by the node previews");
7710}
7711
7713{
7714 StructRNA *srna;
7715 PropertyRNA *prop;
7716
7717 static const EnumPropertyItem texture_id_type_items[] = {
7718 {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World"},
7719 {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"},
7720# ifdef WITH_FREESTYLE
7722 "LINESTYLE",
7723 ICON_LINE_DATA,
7724 "Line Style",
7725 "Edit texture nodes from Line Style"},
7726# endif
7727 {0, nullptr, 0, nullptr, nullptr},
7728 };
7729
7730 static const EnumPropertyItem shader_type_items[] = {
7731 {SNODE_SHADER_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit shader nodes from Object"},
7732 {SNODE_SHADER_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit shader nodes from World"},
7733# ifdef WITH_FREESTYLE
7735 "LINESTYLE",
7736 ICON_LINE_DATA,
7737 "Line Style",
7738 "Edit shader nodes from Line Style"},
7739# endif
7740 {0, nullptr, 0, nullptr, nullptr},
7741 };
7742
7743 static const EnumPropertyItem geometry_nodes_type_items[] = {
7745 "MODIFIER",
7746 0,
7747 "Modifier",
7748 "Edit node group from active object's active modifier"},
7750 "TOOL",
7751 0,
7752 "Tool",
7753 "Edit any geometry node group for use as an operator"},
7754 {0, nullptr, 0, nullptr, nullptr},
7755 };
7756
7757 static const EnumPropertyItem backdrop_channels_items[] = {
7759 "COLOR_ALPHA",
7760 ICON_IMAGE_RGB_ALPHA,
7761 "Color & Alpha",
7762 "Display image with RGB colors and alpha transparency"},
7763 {0, "COLOR", ICON_IMAGE_RGB, "Color", "Display image with RGB colors"},
7764 {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Display alpha transparency channel"},
7765 {SNODE_SHOW_R, "RED", ICON_COLOR_RED, "Red", ""},
7766 {SNODE_SHOW_G, "GREEN", ICON_COLOR_GREEN, "Green", ""},
7767 {SNODE_SHOW_B, "BLUE", ICON_COLOR_BLUE, "Blue", ""},
7768 {0, nullptr, 0, nullptr, nullptr},
7769 };
7770
7771 static const EnumPropertyItem insert_ofs_dir_items[] = {
7772 {SNODE_INSERTOFS_DIR_RIGHT, "RIGHT", 0, "Right"},
7773 {SNODE_INSERTOFS_DIR_LEFT, "LEFT", 0, "Left"},
7774 {0, nullptr, 0, nullptr, nullptr},
7775 };
7776
7777 static const EnumPropertyItem dummy_items[] = {
7778 {0, "DUMMY", 0, "", ""},
7779 {0, nullptr, 0, nullptr, nullptr},
7780 };
7781
7782 srna = RNA_def_struct(brna, "SpaceNodeEditor", "Space");
7783 RNA_def_struct_sdna(srna, "SpaceNode");
7784 RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data");
7785
7787
7788 prop = RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
7789 RNA_def_property_enum_items(prop, dummy_items);
7791 "rna_SpaceNodeEditor_tree_type_get",
7792 "rna_SpaceNodeEditor_tree_type_set",
7793 "rna_SpaceNodeEditor_tree_type_itemf");
7794 RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit");
7796
7797 prop = RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
7798 RNA_def_property_enum_sdna(prop, nullptr, "texfrom");
7799 RNA_def_property_enum_items(prop, texture_id_type_items);
7800 RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from");
7803
7804 prop = RNA_def_property(srna, "shader_type", PROP_ENUM, PROP_NONE);
7805 RNA_def_property_enum_sdna(prop, nullptr, "shaderfrom");
7806 RNA_def_property_enum_items(prop, shader_type_items);
7807 RNA_def_property_ui_text(prop, "Shader Type", "Type of data to take shader from");
7810
7811 prop = RNA_def_property(srna, "geometry_nodes_type", PROP_ENUM, PROP_NONE);
7812 RNA_def_property_enum_sdna(prop, nullptr, "geometry_nodes_type");
7813 RNA_def_property_enum_items(prop, geometry_nodes_type_items);
7814 RNA_def_property_ui_text(prop, "Geometry Nodes Type", "");
7817 prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_geometry_nodes_type_update");
7818
7819 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
7821 RNA_def_property_ui_text(prop, "ID", "Data-block whose nodes are being edited");
7822
7823 prop = RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
7824 RNA_def_property_pointer_sdna(prop, nullptr, "from");
7827 prop, "ID From", "Data-block from which the edited data-block is linked");
7828
7829 prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE);
7830 RNA_def_property_collection_sdna(prop, nullptr, "treepath", nullptr);
7831 RNA_def_property_struct_type(prop, "NodeTreePath");
7833 prop, "Node Tree Path", "Path from the data-block to the currently edited node tree");
7834 rna_def_space_node_path_api(brna, prop);
7835
7836 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
7838 nullptr,
7839 "rna_SpaceNodeEditor_node_tree_set",
7840 nullptr,
7841 "rna_SpaceNodeEditor_node_tree_poll");
7842 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
7844 RNA_def_property_ui_text(prop, "Node Tree", "Base node tree from context");
7845 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
7846
7847 prop = RNA_def_property(srna, "edit_tree", PROP_POINTER, PROP_NONE);
7848 RNA_def_property_pointer_sdna(prop, nullptr, "edittree");
7850 RNA_def_property_ui_text(prop, "Edit Tree", "Node tree being displayed and edited");
7851
7852 prop = RNA_def_property(srna, "pin", PROP_BOOLEAN, PROP_NONE);
7853 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_PIN);
7854 RNA_def_property_ui_text(prop, "Pinned", "Use the pinned node tree");
7855 RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
7857
7858 prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
7859 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_BACKDRAW);
7861 prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
7863 prop, NC_SPACE | ND_SPACE_NODE_VIEW, "rna_SpaceNodeEditor_show_backdrop_update");
7864
7865 prop = RNA_def_property(srna, "geometry_nodes_tool_tree", PROP_POINTER, PROP_NONE);
7867 prop, nullptr, nullptr, nullptr, "rna_SpaceNodeEditor_geometry_nodes_tool_tree_poll");
7869 RNA_def_property_ui_text(prop, "Node Tool Tree", "Node group to edit as node tool");
7870 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
7871
7872 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
7873 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SNODE_SHOW_GPENCIL);
7874 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
7876
7877 prop = RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
7878 RNA_def_property_float_sdna(prop, nullptr, "zoom");
7880 RNA_def_property_range(prop, 0.01f, FLT_MAX);
7881 RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
7882 RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor");
7884
7885 prop = RNA_def_property(srna, "backdrop_offset", PROP_FLOAT, PROP_NONE);
7886 RNA_def_property_float_sdna(prop, nullptr, "xof");
7887 RNA_def_property_array(prop, 2);
7888 RNA_def_property_ui_text(prop, "Backdrop Offset", "Backdrop offset");
7890
7891 prop = RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
7892 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
7893 RNA_def_property_enum_items(prop, backdrop_channels_items);
7894 RNA_def_property_ui_text(prop, "Display Channels", "Channels of the image to draw");
7896 /* the mx/my "cursor" in the node editor is used only by operators to store the mouse position */
7897 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
7898 RNA_def_property_array(prop, 2);
7900 "rna_SpaceNodeEditor_cursor_location_get",
7901 "rna_SpaceNodeEditor_cursor_location_set",
7902 nullptr);
7903 RNA_def_property_ui_text(prop, "Cursor Location", "Location for adding new nodes");
7905
7906 prop = RNA_def_property(srna, "insert_offset_direction", PROP_ENUM, PROP_NONE);
7907 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "insert_ofs_dir");
7908 RNA_def_property_enum_items(prop, insert_ofs_dir_items);
7910 prop, "Auto-offset Direction", "Direction to offset nodes on insertion");
7912
7913 /* Overlays */
7914 prop = RNA_def_property(srna, "overlay", PROP_POINTER, PROP_NONE);
7916 RNA_def_property_struct_type(prop, "SpaceNodeOverlay");
7917 RNA_def_property_pointer_funcs(prop, "rna_SpaceNode_overlay_get", nullptr, nullptr, nullptr);
7919 prop, "Overlay Settings", "Settings for display of overlays in the Node Editor");
7920
7921 prop = RNA_def_property(srna, "supports_previews", PROP_BOOLEAN, PROP_NONE);
7922 RNA_def_property_boolean_funcs(prop, "rna_SpaceNode_supports_previews", nullptr);
7925 "Supports Previews",
7926 "Whether the node editor's type supports displaying node previews");
7927
7929 RNA_api_space_node(srna);
7930}
7931
7933{
7934 StructRNA *srna;
7935 PropertyRNA *prop;
7936
7937 static const EnumPropertyItem view_items[] = {
7938 {SC_VIEW_CLIP, "CLIP", ICON_SEQUENCE, "Clip", "Show editing clip preview"},
7939 {SC_VIEW_GRAPH, "GRAPH", ICON_GRAPH, "Graph", "Show graph view for active element"},
7941 "DOPESHEET",
7942 ICON_ACTION,
7943 "Dope Sheet",
7944 "Dope Sheet view for tracking data"},
7945 {0, nullptr, 0, nullptr, nullptr},
7946 };
7947
7948 static const EnumPropertyItem annotation_source_items[] = {
7950 "CLIP",
7951 0,
7952 "Clip",
7953 "Show annotation data-block which belongs to movie clip"},
7955 "TRACK",
7956 0,
7957 "Track",
7958 "Show annotation data-block which belongs to active track"},
7959 {0, nullptr, 0, nullptr, nullptr},
7960 };
7961
7962 static const EnumPropertyItem pivot_items[] = {
7964 "BOUNDING_BOX_CENTER",
7965 ICON_PIVOT_BOUNDBOX,
7966 "Bounding Box Center",
7967 "Pivot around bounding box center of selected object(s)"},
7968 {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "2D Cursor", "Pivot around the 2D cursor"},
7970 "INDIVIDUAL_ORIGINS",
7971 ICON_PIVOT_INDIVIDUAL,
7972 "Individual Origins",
7973 "Pivot around each object's own origin"},
7975 "MEDIAN_POINT",
7976 ICON_PIVOT_MEDIAN,
7977 "Median Point",
7978 "Pivot around the median point of selected objects"},
7979 {0, nullptr, 0, nullptr, nullptr},
7980 };
7981
7982 srna = RNA_def_struct(brna, "SpaceClipEditor", "Space");
7983 RNA_def_struct_sdna(srna, "SpaceClip");
7984 RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data");
7985
7987 srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_HUD));
7988
7989 /* movieclip */
7990 prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
7992 RNA_def_property_ui_text(prop, "Movie Clip", "Movie clip displayed and edited in this space");
7993 RNA_def_property_pointer_funcs(prop, nullptr, "rna_SpaceClipEditor_clip_set", nullptr, nullptr);
7995
7996 /* clip user */
7997 prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
7999 RNA_def_property_struct_type(prop, "MovieClipUser");
8000 RNA_def_property_pointer_sdna(prop, nullptr, "user");
8002 prop, "Movie Clip User", "Parameters defining which frame of the movie clip is displayed");
8004
8005 /* mask */
8006 rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_mask_set");
8007
8008 /* mode */
8009 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
8010 RNA_def_property_enum_sdna(prop, nullptr, "mode");
8012 RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
8014 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_clip_mode_update");
8015
8016 /* view */
8017 prop = RNA_def_property(srna, "view", PROP_ENUM, PROP_NONE);
8018 RNA_def_property_enum_sdna(prop, nullptr, "view");
8019 RNA_def_property_enum_items(prop, view_items);
8020 RNA_def_property_ui_text(prop, "View", "Type of the clip editor view");
8022 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_view_type_update");
8023
8024 /* show pattern */
8025 prop = RNA_def_property(srna, "show_marker_pattern", PROP_BOOLEAN, PROP_NONE);
8026 RNA_def_property_ui_text(prop, "Show Marker Pattern", "Show pattern boundbox for markers");
8029
8030 /* show search */
8031 prop = RNA_def_property(srna, "show_marker_search", PROP_BOOLEAN, PROP_NONE);
8032 RNA_def_property_ui_text(prop, "Show Marker Search", "Show search boundbox for markers");
8035
8036 /* lock to selection */
8037 prop = RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE);
8039 prop, "Lock to Selection", "Lock viewport to selected markers during playback");
8040 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_LOCK_SELECTION);
8042 prop, NC_SPACE | ND_SPACE_CLIP, "rna_SpaceClipEditor_lock_selection_update");
8043
8044 /* lock to time cursor */
8045 prop = RNA_def_property(srna, "lock_time_cursor", PROP_BOOLEAN, PROP_NONE);
8047 prop, "Lock to Time Cursor", "Lock curves view to time cursor during playback and tracking");
8048 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_LOCK_TIMECURSOR);
8050
8051 /* show markers paths */
8052 prop = RNA_def_property(srna, "show_track_path", PROP_BOOLEAN, PROP_NONE);
8053 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_TRACK_PATH);
8054 RNA_def_property_ui_text(prop, "Show Track Path", "Show path of how track moves");
8056
8057 /* path length */
8058 prop = RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
8059 RNA_def_property_int_sdna(prop, nullptr, "path_length");
8060 RNA_def_property_range(prop, 0, INT_MAX);
8061 RNA_def_property_ui_text(prop, "Path Length", "Length of displaying path, in frames");
8063
8064 /* show tiny markers */
8065 prop = RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE);
8066 RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers in a more compact manner");
8067 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_TINY_MARKER);
8069
8070 /* show bundles */
8071 prop = RNA_def_property(srna, "show_bundles", PROP_BOOLEAN, PROP_NONE);
8072 RNA_def_property_ui_text(prop, "Show Bundles", "Show projection of 3D markers into footage");
8073 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_BUNDLES);
8075
8076 /* mute footage */
8077 prop = RNA_def_property(srna, "use_mute_footage", PROP_BOOLEAN, PROP_NONE);
8078 RNA_def_property_ui_text(prop, "Mute Footage", "Mute footage and show black background instead");
8079 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_MUTE_FOOTAGE);
8081
8082 /* hide disabled */
8083 prop = RNA_def_property(srna, "show_disabled", PROP_BOOLEAN, PROP_NONE);
8084 RNA_def_property_ui_text(prop, "Show Disabled", "Show disabled tracks from the footage");
8087
8088 prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
8089 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_METADATA);
8090 RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of clip");
8092
8093 /* scopes */
8094 prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
8095 RNA_def_property_pointer_sdna(prop, nullptr, "scopes");
8096 RNA_def_property_struct_type(prop, "MovieClipScopes");
8097 RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize movie clip statistics");
8098
8099 /* show names */
8100 prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
8101 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_NAMES);
8102 RNA_def_property_ui_text(prop, "Show Names", "Show track names and status");
8104
8105 /* show grid */
8106 prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE);
8107 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_GRID);
8108 RNA_def_property_ui_text(prop, "Show Grid", "Show grid showing lens distortion");
8110
8111 /* show stable */
8112 prop = RNA_def_property(srna, "show_stable", PROP_BOOLEAN, PROP_NONE);
8113 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_STABLE);
8115 prop, "Show Stable", "Show stable footage in editor (if stabilization is enabled)");
8117
8118 /* manual calibration */
8119 prop = RNA_def_property(srna, "use_manual_calibration", PROP_BOOLEAN, PROP_NONE);
8121 RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers");
8123
8124 /* show annotation */
8125 prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
8126 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_ANNOTATION);
8127 RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
8129
8130 /* show filters */
8131 prop = RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE);
8132 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_FILTERS);
8133 RNA_def_property_ui_text(prop, "Show Filters", "Show filters for graph editor");
8135
8136 /* show graph_frames */
8137 prop = RNA_def_property(srna, "show_graph_frames", PROP_BOOLEAN, PROP_NONE);
8140 prop,
8141 "Show Frames",
8142 "Show curve for per-frame average error (camera motion should be solved first)");
8144
8145 /* show graph tracks motion */
8146 prop = RNA_def_property(srna, "show_graph_tracks_motion", PROP_BOOLEAN, PROP_NONE);
8149 prop,
8150 "Show Tracks Motion",
8151 "Display the speed curves (in \"x\" direction red, in \"y\" direction green) "
8152 "for the selected tracks");
8154
8155 /* show graph tracks motion */
8156 prop = RNA_def_property(srna, "show_graph_tracks_error", PROP_BOOLEAN, PROP_NONE);
8159 prop, "Show Tracks Error", "Display the reprojection error curve for selected tracks");
8161
8162 /* show_only_selected */
8163 prop = RNA_def_property(srna, "show_graph_only_selected", PROP_BOOLEAN, PROP_NONE);
8166 prop, "Only Show Selected", "Only include channels relating to selected objects and data");
8167 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
8169
8170 /* show_hidden */
8171 prop = RNA_def_property(srna, "show_graph_hidden", PROP_BOOLEAN, PROP_NONE);
8174 prop, "Display Hidden", "Include channels from objects/bone that are not visible");
8175 RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
8177
8178 /* ** channels ** */
8179
8180 /* show_red_channel */
8181 prop = RNA_def_property(srna, "show_red_channel", PROP_BOOLEAN, PROP_NONE);
8182 RNA_def_property_boolean_negative_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_DISABLE_RED);
8183 RNA_def_property_ui_text(prop, "Show Red Channel", "Show red channel in the frame");
8185
8186 /* show_green_channel */
8187 prop = RNA_def_property(srna, "show_green_channel", PROP_BOOLEAN, PROP_NONE);
8188 RNA_def_property_boolean_negative_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_DISABLE_GREEN);
8189 RNA_def_property_ui_text(prop, "Show Green Channel", "Show green channel in the frame");
8191
8192 /* show_blue_channel */
8193 prop = RNA_def_property(srna, "show_blue_channel", PROP_BOOLEAN, PROP_NONE);
8194 RNA_def_property_boolean_negative_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_DISABLE_BLUE);
8195 RNA_def_property_ui_text(prop, "Show Blue Channel", "Show blue channel in the frame");
8197
8198 /* preview_grayscale */
8199 prop = RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
8200 RNA_def_property_boolean_sdna(prop, nullptr, "postproc_flag", MOVIECLIP_PREVIEW_GRAYSCALE);
8201 RNA_def_property_ui_text(prop, "Grayscale", "Display frame in grayscale mode");
8203
8204 /* timeline */
8205 prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
8206 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SC_SHOW_SECONDS);
8207 RNA_def_property_ui_text(prop, "Use Timecode", "Show timing as a timecode instead of frames");
8209
8210 /* grease pencil source */
8211 prop = RNA_def_property(srna, "annotation_source", PROP_ENUM, PROP_NONE);
8212 RNA_def_property_enum_sdna(prop, nullptr, "gpencil_src");
8213 RNA_def_property_enum_items(prop, annotation_source_items);
8214 RNA_def_property_ui_text(prop, "Annotation Source", "Where the annotation comes from");
8217
8218 /* transform */
8219 prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
8220 RNA_def_property_float_sdna(prop, nullptr, "cursor");
8221 RNA_def_property_array(prop, 2);
8222 RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
8224
8225 /* pivot point */
8226 prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
8227 RNA_def_property_enum_sdna(prop, nullptr, "around");
8228 RNA_def_property_enum_items(prop, pivot_items);
8229 RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
8231
8232 /* Gizmo Toggles. */
8233 prop = RNA_def_property(srna, "show_gizmo", PROP_BOOLEAN, PROP_NONE);
8234 RNA_def_property_boolean_negative_sdna(prop, nullptr, "gizmo_flag", SCLIP_GIZMO_HIDE);
8235 RNA_def_property_ui_text(prop, "Show Gizmo", "Show gizmos of all types");
8237
8238 prop = RNA_def_property(srna, "show_gizmo_navigate", PROP_BOOLEAN, PROP_NONE);
8240 RNA_def_property_ui_text(prop, "Navigate Gizmo", "Viewport navigation gizmo");
8242
8243 /* Zoom. */
8244 prop = RNA_def_property(srna, "zoom_percentage", PROP_FLOAT, PROP_PERCENTAGE);
8246 "rna_SpaceClipEditor_zoom_percentage_get",
8247 "rna_SpaceClipEditor_zoom_percentage_set",
8248 nullptr);
8249 RNA_def_property_float_default(prop, 100.0);
8250 RNA_def_property_range(prop, .4f, 80000);
8251 RNA_def_property_ui_range(prop, 25, 400, 100, 0);
8252 RNA_def_property_ui_text(prop, "Zoom", "Zoom percentage");
8253}
8254
8256{
8257 StructRNA *srna;
8258 PropertyRNA *prop;
8259
8260 srna = RNA_def_struct(brna, "SpreadsheetColumnID", nullptr);
8261 RNA_def_struct_sdna(srna, "SpreadsheetColumnID");
8263 srna, "Spreadsheet Column ID", "Data used to identify a spreadsheet column");
8264
8265 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
8266 RNA_def_property_ui_text(prop, "Column Name", "");
8268}
8269
8271{
8272 StructRNA *srna;
8273 PropertyRNA *prop;
8274
8275 static const EnumPropertyItem data_type_items[] = {
8276 {SPREADSHEET_VALUE_TYPE_INT32, "INT32", ICON_NONE, "Integer", ""},
8277 {SPREADSHEET_VALUE_TYPE_FLOAT, "FLOAT", ICON_NONE, "Float", ""},
8278 {SPREADSHEET_VALUE_TYPE_BOOL, "BOOLEAN", ICON_NONE, "Boolean", ""},
8279 {SPREADSHEET_VALUE_TYPE_INSTANCES, "INSTANCES", ICON_NONE, "Instances", ""},
8280 {0, nullptr, 0, nullptr, nullptr},
8281 };
8282
8283 srna = RNA_def_struct(brna, "SpreadsheetColumn", nullptr);
8284 RNA_def_struct_sdna(srna, "SpreadsheetColumn");
8286 srna, "Spreadsheet Column", "Persistent data associated with a spreadsheet column");
8287
8288 prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);
8289 RNA_def_property_enum_sdna(prop, nullptr, "data_type");
8290 RNA_def_property_enum_items(prop, data_type_items);
8292 prop, "Data Type", "The data type of the corresponding column visible in the spreadsheet");
8295
8297
8298 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8299 RNA_def_property_struct_type(prop, "SpreadsheetColumnID");
8301 prop, "ID", "Data used to identify the corresponding data from the data source");
8302}
8303
8305{
8306 StructRNA *srna;
8307 PropertyRNA *prop;
8308
8309 static const EnumPropertyItem rule_operation_items[] = {
8310 {SPREADSHEET_ROW_FILTER_EQUAL, "EQUAL", ICON_NONE, "Equal To", ""},
8311 {SPREADSHEET_ROW_FILTER_GREATER, "GREATER", ICON_NONE, "Greater Than", ""},
8312 {SPREADSHEET_ROW_FILTER_LESS, "LESS", ICON_NONE, "Less Than", ""},
8313 {0, nullptr, 0, nullptr, nullptr},
8314 };
8315
8316 srna = RNA_def_struct(brna, "SpreadsheetRowFilter", nullptr);
8317 RNA_def_struct_sdna(srna, "SpreadsheetRowFilter");
8318 RNA_def_struct_ui_text(srna, "Spreadsheet Row Filter", "");
8319
8320 prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
8322 RNA_def_property_ui_text(prop, "Enabled", "");
8323 RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1);
8325
8326 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
8328 RNA_def_property_ui_text(prop, "Show Expanded", "");
8329 RNA_def_property_ui_icon(prop, ICON_RIGHTARROW, 1);
8331
8332 prop = RNA_def_property(srna, "column_name", PROP_STRING, PROP_NONE);
8333 RNA_def_property_ui_text(prop, "Column Name", "");
8335
8336 prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
8337 RNA_def_property_enum_items(prop, rule_operation_items);
8338 RNA_def_property_ui_text(prop, "Operation", "");
8340
8341 prop = RNA_def_property(srna, "value_float", PROP_FLOAT, PROP_NONE);
8342 RNA_def_property_ui_text(prop, "Float Value", "");
8344
8345 prop = RNA_def_property(srna, "value_float2", PROP_FLOAT, PROP_NONE);
8346 RNA_def_property_array(prop, 2);
8347 RNA_def_property_ui_text(prop, "2D Vector Value", "");
8349
8350 prop = RNA_def_property(srna, "value_float3", PROP_FLOAT, PROP_NONE);
8351 RNA_def_property_array(prop, 3);
8352 RNA_def_property_ui_text(prop, "Vector Value", "");
8354
8355 prop = RNA_def_property(srna, "value_color", PROP_FLOAT, PROP_NONE);
8356 RNA_def_property_array(prop, 4);
8357 RNA_def_property_ui_text(prop, "Color Value", "");
8359
8360 prop = RNA_def_property(srna, "value_string", PROP_STRING, PROP_NONE);
8361 RNA_def_property_ui_text(prop, "Text Value", "");
8363
8364 prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
8365 RNA_def_property_ui_text(prop, "Threshold", "How close float values need to be to be equal");
8366 RNA_def_property_range(prop, 0.0, FLT_MAX);
8368
8369 prop = RNA_def_property(srna, "value_int", PROP_INT, PROP_NONE);
8370 RNA_def_property_int_sdna(prop, nullptr, "value_int");
8371 RNA_def_property_ui_text(prop, "Integer Value", "");
8373
8374 prop = RNA_def_property(srna, "value_int8", PROP_INT, PROP_NONE);
8375 RNA_def_property_int_sdna(prop, nullptr, "value_int");
8376 RNA_def_property_range(prop, -128, 127);
8377 RNA_def_property_ui_text(prop, "8-Bit Integer Value", "");
8379
8380 prop = RNA_def_property(srna, "value_int2", PROP_INT, PROP_NONE);
8381 RNA_def_property_array(prop, 2);
8382 RNA_def_property_ui_text(prop, "2D Vector Value", "");
8384
8385 prop = RNA_def_property(srna, "value_boolean", PROP_BOOLEAN, PROP_NONE);
8387 RNA_def_property_ui_text(prop, "Boolean Value", "");
8389}
8390
8392 {VIEWER_PATH_ELEM_TYPE_ID, "ID", ICON_NONE, "ID", ""},
8393 {VIEWER_PATH_ELEM_TYPE_MODIFIER, "MODIFIER", ICON_NONE, "Modifier", ""},
8394 {VIEWER_PATH_ELEM_TYPE_GROUP_NODE, "GROUP_NODE", ICON_NONE, "Group Node", ""},
8395 {VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE, "SIMULATION_ZONE", ICON_NONE, "Simulation Zone", ""},
8396 {VIEWER_PATH_ELEM_TYPE_VIEWER_NODE, "VIEWER_NODE", ICON_NONE, "Viewer Node", ""},
8397 {VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE, "REPEAT_ZONE", ICON_NONE, "Repeat", ""},
8399 "FOREACH_GEOMETRY_ELEMENT_ZONE",
8400 ICON_NONE,
8401 "For Each Geometry Element",
8402 ""},
8403 {0, nullptr, 0, nullptr, nullptr},
8404};
8405
8407{
8408 StructRNA *srna;
8409 PropertyRNA *prop;
8410
8411 srna = RNA_def_struct(brna, "ViewerPathElem", nullptr);
8412 RNA_def_struct_ui_text(srna, "Viewer Path Element", "Element of a viewer path");
8413 RNA_def_struct_refine_func(srna, "rna_viewer_path_elem_refine");
8414
8415 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
8417 RNA_def_property_ui_text(prop, "Type", "Type of the path element");
8419
8420 prop = RNA_def_property(srna, "ui_name", PROP_STRING, PROP_NONE);
8422 prop, "UI Name", "Name that can be displayed in the UI for this element");
8424}
8425
8427{
8428 StructRNA *srna;
8429 PropertyRNA *prop;
8430
8431 srna = RNA_def_struct(brna, "IDViewerPathElem", "ViewerPathElem");
8432
8433 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
8434 RNA_def_property_ui_text(prop, "ID", "");
8435}
8436
8438{
8439 StructRNA *srna;
8440 PropertyRNA *prop;
8441
8442 srna = RNA_def_struct(brna, "ModifierViewerPathElem", "ViewerPathElem");
8443
8444 prop = RNA_def_property(srna, "modifier_name", PROP_STRING, PROP_NONE);
8445 RNA_def_property_ui_text(prop, "Modifier Name", "");
8446}
8447
8449{
8450 StructRNA *srna;
8451 PropertyRNA *prop;
8452
8453 srna = RNA_def_struct(brna, "GroupNodeViewerPathElem", "ViewerPathElem");
8454
8455 prop = RNA_def_property(srna, "node_id", PROP_INT, PROP_NONE);
8456 RNA_def_property_ui_text(prop, "Node ID", "");
8457}
8458
8460{
8461 StructRNA *srna;
8462 PropertyRNA *prop;
8463
8464 srna = RNA_def_struct(brna, "SimulationZoneViewerPathElem", "ViewerPathElem");
8465
8466 prop = RNA_def_property(srna, "sim_output_node_id", PROP_INT, PROP_NONE);
8467 RNA_def_property_ui_text(prop, "Simulation Output Node ID", "");
8468}
8469
8471{
8472 StructRNA *srna;
8473 PropertyRNA *prop;
8474
8475 srna = RNA_def_struct(brna, "RepeatZoneViewerPathElem", "ViewerPathElem");
8476
8477 prop = RNA_def_property(srna, "repeat_output_node_id", PROP_INT, PROP_NONE);
8478 RNA_def_property_ui_text(prop, "Repeat Output Node ID", "");
8479}
8480
8482{
8483 StructRNA *srna;
8484 PropertyRNA *prop;
8485
8486 srna = RNA_def_struct(brna, "ForeachGeometryElementZoneViewerPathElem", "ViewerPathElem");
8487
8488 prop = RNA_def_property(srna, "zone_output_node_id", PROP_INT, PROP_NONE);
8489 RNA_def_property_ui_text(prop, "Zone Output Node ID", "");
8490}
8491
8493{
8494 StructRNA *srna;
8495 PropertyRNA *prop;
8496
8497 srna = RNA_def_struct(brna, "ViewerNodeViewerPathElem", "ViewerPathElem");
8498
8499 prop = RNA_def_property(srna, "node_id", PROP_INT, PROP_NONE);
8500 RNA_def_property_ui_text(prop, "Node ID", "");
8501}
8502
8504{
8505 StructRNA *srna;
8506 PropertyRNA *prop;
8507
8516
8517 srna = RNA_def_struct(brna, "ViewerPath", nullptr);
8518 RNA_def_struct_ui_text(srna, "Viewer Path", "Path to data that is viewed");
8519
8520 prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE);
8521 RNA_def_property_struct_type(prop, "ViewerPathElem");
8522 RNA_def_property_ui_text(prop, "Viewer Path", nullptr);
8523}
8524
8526{
8527 PropertyRNA *prop;
8528 StructRNA *srna;
8529
8530 static const EnumPropertyItem object_eval_state_items[] = {
8532 "EVALUATED",
8533 ICON_NONE,
8534 "Evaluated",
8535 "Use data from fully or partially evaluated object"},
8537 "ORIGINAL",
8538 ICON_NONE,
8539 "Original",
8540 "Use data from original object without any modifiers applied"},
8542 "VIEWER_NODE",
8543 ICON_NONE,
8544 "Viewer Node",
8545 "Use intermediate data from viewer node"},
8546 {0, nullptr, 0, nullptr, nullptr},
8547 };
8548
8549 srna = RNA_def_struct(brna, "SpaceSpreadsheet", "Space");
8550 RNA_def_struct_ui_text(srna, "Space Spreadsheet", "Spreadsheet space data");
8551
8553 (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) |
8554 (1 << RGN_TYPE_CHANNELS) | (1 << RGN_TYPE_FOOTER));
8555
8556 prop = RNA_def_property(srna, "is_pinned", PROP_BOOLEAN, PROP_NONE);
8558 RNA_def_property_ui_text(prop, "Is Pinned", "Context path is pinned");
8560
8561 prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
8562 RNA_def_property_boolean_sdna(prop, nullptr, "filter_flag", SPREADSHEET_FILTER_ENABLE);
8563 RNA_def_property_ui_text(prop, "Use Filter", "");
8565
8566 prop = RNA_def_property(srna, "display_viewer_path_collapsed", PROP_BOOLEAN, PROP_NONE);
8568 RNA_def_property_ui_text(prop, "Display Context Path Collapsed", "");
8570
8571 prop = RNA_def_property(srna, "viewer_path", PROP_POINTER, PROP_NONE);
8573 prop, "Viewer Path", "Path to the data that is displayed in the spreadsheet");
8574
8575 prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
8578 prop, "Show Only Selected", "Only include rows that correspond to selected elements");
8579 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
8581
8582 prop = RNA_def_property(srna, "geometry_component_type", PROP_ENUM, PROP_NONE);
8585 prop, "Geometry Component", "Part of the geometry to display data from");
8588 "rna_SpaceSpreadsheet_geometry_component_type_update");
8589
8590 prop = RNA_def_property(srna, "attribute_domain", PROP_ENUM, PROP_NONE);
8593 prop, nullptr, nullptr, "rna_SpaceSpreadsheet_attribute_domain_itemf");
8594 RNA_def_property_ui_text(prop, "Attribute Domain", "Attribute domain to display");
8596
8597 prop = RNA_def_property(srna, "object_eval_state", PROP_ENUM, PROP_NONE);
8598 RNA_def_property_enum_items(prop, object_eval_state_items);
8599 RNA_def_property_ui_text(prop, "Object Evaluation State", "");
8601
8603
8604 prop = RNA_def_property(srna, "columns", PROP_COLLECTION, PROP_NONE);
8605 RNA_def_property_collection_sdna(prop, nullptr, "columns", nullptr);
8606 RNA_def_property_struct_type(prop, "SpreadsheetColumn");
8607 RNA_def_property_ui_text(prop, "Columns", "Persistent data associated with spreadsheet columns");
8609
8611
8612 prop = RNA_def_property(srna, "row_filters", PROP_COLLECTION, PROP_NONE);
8613 RNA_def_property_collection_sdna(prop, nullptr, "row_filters", nullptr);
8614 RNA_def_property_struct_type(prop, "SpreadsheetRowFilter");
8615 RNA_def_property_ui_text(prop, "Row Filters", "Filters to remove rows from the displayed data");
8617}
8618
8648
8649#endif
Main runtime representation of an asset.
AnimData * BKE_animdata_ensure_id(ID *id)
Definition anim_data.cc:103
bool BKE_animdata_set_action(ReportList *reports, ID *id, bAction *act)
Definition anim_data.cc:194
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:1820
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:306
bool BKE_id_is_in_global_main(ID *id)
Definition lib_id.cc:2433
#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:2777
bool BKE_scene_uses_blender_eevee(const Scene *scene)
Definition scene.cc:2771
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:883
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:815
@ 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:97
#define BLI_assert(a)
Definition BLI_assert.h:50
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:57
struct GSet GSet
Definition BLI_ghash.h:341
bool BLI_ghashutil_strcmp(const void *a, const void *b)
unsigned int BLI_ghashutil_strhash_p(const void *ptr)
GSet * BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
Definition BLI_ghash.c:944
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
Definition BLI_ghash.c:1034
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
int BLI_findstringindex(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#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:193
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:189
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.h:197
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition rct.c:651
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:597
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)
size_t size_t size_t 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 ARRAY_SIZE(arr)
#define UNUSED_VARS(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define ELEM(...)
#define STREQ(a, b)
bUUID BLI_uuid_nil(void)
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_EDITOR_VIEW3D
#define BLT_I18NCONTEXT_ID_TEXT
#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)
#define FILTER_ID_GD_LEGACY
Definition DNA_ID.h:1169
#define FILTER_ID_OB
Definition DNA_ID.h:1181
#define FILTER_ID_MC
Definition DNA_ID.h:1177
#define FILTER_ID_SPK
Definition DNA_ID.h:1185
#define FILTER_ID_CF
Definition DNA_ID.h:1192
@ ID_RECALC_TRANSFORM
Definition DNA_ID.h:1021
@ ID_RECALC_ANIMATION
Definition DNA_ID.h:1044
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1041
@ ID_RECALC_BASE_FLAGS
Definition DNA_ID.h:1071
#define FILTER_ID_AC
Definition DNA_ID.h:1164
#define FILTER_ID_MA
Definition DNA_ID.h:1175
#define FILTER_ID_CA
Definition DNA_ID.h:1167
#define FILTER_ID_SO
Definition DNA_ID.h:1186
#define FILTER_ID_PT
Definition DNA_ID.h:1196
#define FILTER_ID_CU_LEGACY
Definition DNA_ID.h:1168
#define FILTER_ID_BR
Definition DNA_ID.h:1166
#define FILTER_ID_WS
Definition DNA_ID.h:1193
#define FILTER_ID_MB
Definition DNA_ID.h:1176
#define FILTER_ID_VF
Definition DNA_ID.h:1189
#define FILTER_ID_LA
Definition DNA_ID.h:1172
#define FILTER_ID_GR
Definition DNA_ID.h:1170
#define FILTER_ID_TE
Definition DNA_ID.h:1187
#define FILTER_ID_LT
Definition DNA_ID.h:1174
#define FILTER_ID_LS
Definition DNA_ID.h:1173
#define FILTER_ID_PA
Definition DNA_ID.h:1191
#define FILTER_ID_CV
Definition DNA_ID.h:1195
#define FILTER_ID_ME
Definition DNA_ID.h:1178
#define FILTER_ID_AR
Definition DNA_ID.h:1165
#define FILTER_ID_MSK
Definition DNA_ID.h:1179
#define INDEX_ID_MAX
Definition DNA_ID.h:1328
#define FILTER_ID_PC
Definition DNA_ID.h:1183
#define ID_IS_OVERRIDE_LIBRARY(_id)
Definition DNA_ID.h:683
#define FILTER_ID_PAL
Definition DNA_ID.h:1182
#define FILTER_ID_IM
Definition DNA_ID.h:1171
#define FILTER_ID_SCE
Definition DNA_ID.h:1184
#define FILTER_ID_LP
Definition DNA_ID.h:1194
#define FILTER_ID_VO
Definition DNA_ID.h:1197
#define FILTER_ID_WO
Definition DNA_ID.h:1190
#define FILTER_ID_NT
Definition DNA_ID.h:1180
#define FILTER_ID_TXT
Definition DNA_ID.h:1188
@ 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
#define MAX_NAME
Definition DNA_defs.h:50
@ IMA_SHOW_STEREO
eViewLayerEEVEEPassType
@ EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL
@ EEVEE_RENDER_PASS_AO
@ EEVEE_RENDER_PASS_NORMAL
@ EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT
@ EEVEE_RENDER_PASS_DIFFUSE_LIGHT
@ EEVEE_RENDER_PASS_VOLUME_LIGHT
@ EEVEE_RENDER_PASS_AOV
@ EEVEE_RENDER_PASS_DIFFUSE_COLOR
@ EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET
@ EEVEE_RENDER_PASS_ENVIRONMENT
@ EEVEE_RENDER_PASS_COMBINED
@ EEVEE_RENDER_PASS_SPECULAR_LIGHT
@ EEVEE_RENDER_PASS_SPECULAR_COLOR
@ EEVEE_RENDER_PASS_EMIT
@ EEVEE_RENDER_PASS_MIST
@ EEVEE_RENDER_PASS_TRANSPARENT
@ EEVEE_RENDER_PASS_SHADOW
@ EEVEE_RENDER_PASS_POSITION
@ AOV_CONFLICT
@ MASK_OVERLAY_COMBINED
@ MASK_OVERLAY_ALPHACHANNEL
@ MASK_DRAWFLAG_SPLINE
@ MASK_DRAWFLAG_OVERLAY
@ 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_POINTCLOUD
@ OB_GPENCIL_LEGACY
@ OB_EMPTY_CONE
@ OB_SINGLE_ARROW
@ OB_PLAINAXES
@ OB_ARROWS
@ OB_CIRCLE
@ OB_CUBE
@ OB_EMPTY_SPHERE
@ SCE_VIEWS_FORMAT_MULTIVIEW
@ STEREO_LEFT_ID
@ STEREO_RIGHT_ID
@ RGN_ALIGN_NONE
@ RGN_ALIGN_QSPLIT
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_TOOL_HEADER
@ RGN_TYPE_UI
@ RGN_TYPE_ASSET_SHELF_HEADER
@ RGN_TYPE_WINDOW
@ RGN_TYPE_ASSET_SHELF
@ RGN_TYPE_HUD
@ RGN_TYPE_PREVIEW
@ RGN_TYPE_FOOTER
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_TYPE_TOOL_PROPS
@ RGN_FLAG_HIDDEN
@ RGN_FLAG_HIDDEN_BY_USER
@ SEQ_TYPE_MOVIE
@ SN_OVERLAY_SHOW_PATH
@ SN_OVERLAY_SHOW_PREVIEWS
@ SN_OVERLAY_SHOW_WIRE_COLORS
@ SN_OVERLAY_SHOW_REROUTE_AUTO_LABELS
@ SN_OVERLAY_SHOW_TIMINGS
@ SN_OVERLAY_SHOW_OVERLAYS
@ SN_OVERLAY_SHOW_NAMED_ATTRIBUTES
@ SI_DRAW_TILE
@ SI_SHOW_ZBUF
@ SI_GRID_OVER_IMAGE
@ SI_NO_DRAW_TEXPAINT
@ 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
@ SNODE_INSERTOFS_DIR_RIGHT
@ SNODE_INSERTOFS_DIR_LEFT
@ FILE_SORT_ALPHA
@ FILE_SORT_TIME
@ FILE_SORT_EXTENSION
@ FILE_SORT_SIZE
@ SI_OVERLAY_SHOW_OVERLAYS
@ SI_OVERLAY_SHOW_GRID_BACKGROUND
@ 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
eSpace_Type
@ SPACE_TEXT
@ SPACE_CLIP
@ SPACE_ACTION
@ SPACE_CONSOLE
@ SPACE_OUTLINER
@ SPACE_STATUSBAR
@ SPACE_TOPBAR
@ SPACE_NODE
@ SPACE_SPREADSHEET
@ SPACE_USERPREF
@ SPACE_FILE
@ SPACE_PROPERTIES
@ SPACE_NLA
@ SPACE_SEQ
@ SPACE_EMPTY
@ SPACE_SCRIPT
@ SPACE_IMAGE
@ SPACE_GRAPH
@ SPACE_VIEW3D
@ SPACE_INFO
@ SEQ_TIMELINE_SHOW_FCURVES
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_THUMBNAILS
@ SEQ_TIMELINE_SHOW_STRIP_RETIMING
@ SEQ_TIMELINE_SHOW_STRIP_OFFSETS
@ SEQ_TIMELINE_ALL_WAVEFORMS
@ SEQ_TIMELINE_WAVEFORMS_HALF
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SEQ_TIMELINE_SHOW_GRID
@ SEQ_TIMELINE_NO_WAVEFORMS
@ SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG
SpaceNodeGeometryNodesType
@ SNODE_GEOMETRY_MODIFIER
@ SNODE_GEOMETRY_TOOL
@ SI_UVDT_BLACK
@ SI_UVDT_DASH
@ SI_UVDT_WHITE
@ SI_UVDT_OUTLINE
@ SC_VIEW_GRAPH
@ SC_VIEW_CLIP
@ SC_VIEW_DOPESHEET
@ FILE_DETAILS_DATETIME
@ FILE_DETAILS_SIZE
@ SO_FIND_COMPLETE
@ SO_FIND_CASE_SENSITIVE
@ SN_OVERLAY_PREVIEW_3D
@ SN_OVERLAY_PREVIEW_FLAT
@ SEQ_VIEW_SEQUENCE_PREVIEW
@ SEQ_VIEW_SEQUENCE
@ SEQ_VIEW_PREVIEW
@ SCLIP_GIZMO_HIDE
@ SCLIP_GIZMO_HIDE_NAVIGATE
@ 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
@ 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
@ SEQ_DRAW_BACKDROP
@ 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_GIZMO_HIDE
@ SI_GIZMO_HIDE_NAVIGATE
@ 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_PREPROCESSED
@ SEQ_CACHE_SHOW_RAW
@ SEQ_CACHE_SHOW_COMPOSITE
@ SEQ_CACHE_SHOW
@ SEQ_CACHE_SHOW_FINAL_OUT
@ FILE_FILTER
@ FILE_SORT_INVERT
@ FILE_DIRSEL_ONLY
@ FILE_ASSETS_ONLY
@ FILE_HIDE_DOT
@ SEQ_DRAW_IMG_VECTORSCOPE
@ SEQ_DRAW_IMG_RGBPARADE
@ SEQ_DRAW_IMG_HISTOGRAM
@ SEQ_DRAW_IMG_IMBUF
@ SEQ_DRAW_IMG_WAVEFORM
@ 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
@ 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_CONTEXT_PATH_COLLAPSED
@ SPREADSHEET_FLAG_PINNED
@ 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
@ USER_SEQ_PROXY_SETUP_AUTOMATIC
#define UI_SCALE_FAC
#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)
#define RV3D_CAMZOOM_MAX
@ V3D_DEBUG_FREEZE_CULLING
@ 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
@ RV3D_CLIPPING
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CURSOR
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_GIZMO_SHOW_CAMERA_DOF_DIST
@ V3D_GIZMO_SHOW_CAMERA_LENS
@ 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_OVERLAY_PAINT_WIRE
@ 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_OVERLAY_WPAINT_CONTOURS
@ V3D_GP_SHOW_MATERIAL_NAME
@ V3D_GP_FADE_OBJECTS
@ V3D_GP_SHOW_MULTIEDIT_LINES
@ 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_HIDE_TOOL
@ V3D_GIZMO_HIDE_MODIFIER
@ V3D_GIZMO_HIDE
@ V3D_GIZMO_HIDE_NAVIGATE
@ V3D_GIZMO_HIDE_CONTEXT
@ V3D_SHOW_FLOOR
@ V3D_SHOW_Z
@ V3D_SHOW_X
@ V3D_SHOW_Y
@ V3D_SHOW_ORTHO_GRID
@ V3D_GIZMO_SHOW_LIGHT_LOOK_AT
@ V3D_GIZMO_SHOW_LIGHT_SIZE
@ V3D_GIZMO_SHOW_OBJECT_ROTATE
@ V3D_GIZMO_SHOW_OBJECT_SCALE
@ V3D_GIZMO_SHOW_OBJECT_TRANSLATE
@ V3D_SHADING_CAVITY_BOTH
@ V3D_SHADING_CAVITY_SSAO
@ V3D_SHADING_CAVITY_CURVATURE
#define RV3D_CAMZOOM_MIN
@ CURVE_HANDLE_NONE
@ CURVE_HANDLE_ALL
@ CURVE_HANDLE_SELECTED
@ RV3D_CAMOB
@ RV3D_PERSP
@ RV3D_ORTHO
@ RV3D_LOCK_ROTATION
@ RV3D_BOXVIEW
@ RV3D_BOXCLIP
@ 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
@ V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD
@ V3D_GIZMO_SHOW_EMPTY_IMAGE
@ V3D_LOCAL_COLLECTIONS
@ V3D_DRAW_CENTERS
@ V3D_SELECT_OUTLINE
@ V3D_XR_SESSION_MIRROR
@ V3D_HIDE_HELPLINES
@ RV3D_VIEW_USER
@ V3D_S3D_DISPCAMERAS
@ V3D_S3D_DISPPLANE
@ V3D_S3D_DISPVOLUME
@ 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_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)
const char * ED_buttons_search_string_get(SpaceProperties *sbuts)
int ED_buttons_tabs_list(SpaceProperties *sbuts, short *context_tabs_array)
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:110
int ED_file_icon(const FileDirEntry *file)
Definition filelist.cc:1374
int ED_fsmenu_get_nentries(FSMenu *fsmenu, FSMenuCategory category)
Definition fsmenu.cc:98
FSMenu * ED_fsmenu_get()
Definition fsmenu.cc:45
void ED_fsmenu_entry_set_name(FSMenuEntry *fsentry, const char *name)
Definition fsmenu.cc:188
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:174
FileSelectParams * ED_fileselect_get_active_params(const SpaceFile *sfile)
Definition filesel.cc:380
void ED_file_change_dir_ex(bContext *C, ScrArea *area)
Definition filesel.cc:1148
char * ED_fsmenu_entry_get_path(FSMenuEntry *fsentry)
Definition fsmenu.cc:123
void ED_fsmenu_entry_set_icon(FSMenuEntry *fsentry, int icon)
Definition fsmenu.cc:152
int ED_fsmenu_entry_get_icon(FSMenuEntry *fsentry)
Definition fsmenu.cc:147
FileSelectParams * ED_fileselect_get_file_params(const SpaceFile *sfile)
Definition filesel.cc:398
FSMenuEntry * ED_fsmenu_get_category(FSMenu *fsmenu, FSMenuCategory category)
Definition fsmenu.cc:53
FileAssetSelectParams * ED_fileselect_get_asset_params(const SpaceFile *sfile)
Definition filesel.cc:403
void ED_fsmenu_entry_set_path(FSMenuEntry *fsentry, const char *path)
Definition fsmenu.cc:128
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:513
void ED_node_tree_push(SpaceNode *snode, bNodeTree *ntree, bNode *gnode)
void ED_node_cursor_location_set(SpaceNode *snode, const float value[2])
void ED_node_tree_path_get(SpaceNode *snode, char *value)
int ED_node_tree_path_length(SpaceNode *snode)
void ED_node_tree_pop(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:543
void ED_node_tree_start(SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from)
Definition space_node.cc:66
void ED_node_tree_update(const bContext *C)
Definition node_draw.cc:147
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:708
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:790
void ED_region_toggle_hidden(bContext *C, ARegion *region)
Definition area.cc:2276
void ED_region_visibility_change_update(bContext *C, ScrArea *area, ARegion *region)
Definition area.cc:2254
void ED_region_visibility_change_update_animated(bContext *C, ScrArea *area, ARegion *region)
void ED_area_tag_refresh(ScrArea *area)
Definition area.cc:737
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:634
void ED_area_type_hud_ensure(bContext *C, ScrArea *area)
int ED_space_text_visible_lines_get(const SpaceText *st)
Definition text_draw.cc:44
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)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
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:396
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_CONTEXT
Definition RNA_types.hh:679
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_COLLECTION
Definition RNA_types.hh:71
@ PROP_UNIT_CAMERA
Definition RNA_types.hh:86
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:127
PropertyFlag
Definition RNA_types.hh:201
@ PROP_DYNAMIC
Definition RNA_types.hh:317
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:296
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:273
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_TEXTEDIT_UPDATE
Definition RNA_types.hh:227
@ PROP_HIDDEN
Definition RNA_types.hh:239
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:253
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition RNA_types.hh:522
@ PROP_MATRIX
Definition RNA_types.hh:168
@ PROP_XYZ
Definition RNA_types.hh:172
@ PROP_DISTANCE
Definition RNA_types.hh:159
@ PROP_BYTESTRING
Definition RNA_types.hh:143
@ PROP_FILENAME
Definition RNA_types.hh:141
@ PROP_COLOR
Definition RNA_types.hh:163
@ PROP_PIXEL
Definition RNA_types.hh:151
@ PROP_ANGLE
Definition RNA_types.hh:155
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_PERCENTAGE
Definition RNA_types.hh:153
@ PROP_FACTOR
Definition RNA_types.hh:154
@ PROP_TRANSLATION
Definition RNA_types.hh:164
@ PROP_UNSIGNED
Definition RNA_types.hh:152
@ PROP_QUATERNION
Definition RNA_types.hh:170
@ PROP_FILEPATH
Definition RNA_types.hh:139
constexpr PointerRNA PointerRNA_NULL
Definition RNA_types.hh:45
constexpr int SEQ_MAX_CHANNELS
void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
Definition view2d.cc:861
#define V2D_LOCK_SET
Definition UI_view2d.hh:83
bool UI_view2d_area_supports_sync(ScrArea *area)
Definition view2d.cc:856
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:1663
#define ND_SEQUENCER
Definition WM_types.hh:404
#define NC_WORLD
Definition WM_types.hh:354
#define ND_SHADING
Definition WM_types.hh:444
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:501
#define NC_WINDOW
Definition WM_types.hh:342
#define NC_NODE
Definition WM_types.hh:361
#define NC_GEOM
Definition WM_types.hh:360
#define ND_DATA
Definition WM_types.hh:475
#define ND_SPACE_DOPESHEET
Definition WM_types.hh:499
#define NC_ANIMATION
Definition WM_types.hh:355
#define ND_SPACE_NLA
Definition WM_types.hh:500
#define ND_SPACE_NODE
Definition WM_types.hh:492
#define ND_DISPLAY
Definition WM_types.hh:458
#define NC_MOVIECLIP
Definition WM_types.hh:364
#define ND_SPACE_PROPERTIES
Definition WM_types.hh:495
#define NC_SCENE
Definition WM_types.hh:345
#define ND_SPACE_NODE_VIEW
Definition WM_types.hh:502
#define ND_NODES
Definition WM_types.hh:403
#define ND_TOOLSETTINGS
Definition WM_types.hh:416
#define ND_SPACE_IMAGE
Definition WM_types.hh:488
#define NA_EDITED
Definition WM_types.hh:550
#define ND_SPACE_GRAPH
Definition WM_types.hh:498
#define NC_TEXT
Definition WM_types.hh:353
#define NC_MATERIAL
Definition WM_types.hh:347
#define NC_LAMP
Definition WM_types.hh:349
#define NC_IMAGE
Definition WM_types.hh:351
#define ND_SPACE_CLIP
Definition WM_types.hh:505
#define ND_SPACE_INFO_REPORT
Definition WM_types.hh:486
#define ND_SPACE_TIME
Definition WM_types.hh:497
#define NC_GPENCIL
Definition WM_types.hh:366
#define NC_TEXTURE
Definition WM_types.hh:348
#define ND_SPACE_TEXT
Definition WM_types.hh:496
#define ND_SPACE_SPREADSHEET
Definition WM_types.hh:507
#define ND_SPACE_VIEW3D
Definition WM_types.hh:494
#define ND_KEYFRAME
Definition WM_types.hh:461
#define NS_VIEW3D_SHADING
Definition WM_types.hh:543
#define ND_SPACE_CONSOLE
Definition WM_types.hh:485
#define ND_SPACE_FILE_PARAMS
Definition WM_types.hh:489
#define NC_SPACE
Definition WM_types.hh:359
#define ND_SPACE_OUTLINER
Definition WM_types.hh:493
#define ND_SPACE_FILE_LIST
Definition WM_types.hh:490
void ANIM_frame_channel_y_extents(bContext *C, bAnimContext *ac)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
volatile int lock
unsigned int U
Definition btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
#define printf
#define offsetof(t, d)
int len
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void SEQ_cache_cleanup(Scene *scene)
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
RenderEngineType * RE_engines_find(const char *idname)
#define GS(x)
Definition iris.cc:202
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
ccl_device_inline float4 mask(const int4 mask, const float4 a)
#define G(x, y, z)
int main()
int library_reference_to_enum_value(const AssetLibraryReference *library)
AssetLibraryReference library_reference_from_enum_value(int value)
bool SEQ_proxy_rebuild_context(Main *bmain, Depsgraph *depsgraph, Scene *scene, Sequence *seq, GSet *file_list, ListBase *queue, bool build_only_on_bad_performance)
Definition proxy.cc:420
int SEQ_rendersize_to_proxysize(int render_size)
Definition proxy.cc:67
ProxyJob * ED_seq_proxy_job_get(const bContext *C, wmJob *wm_job)
Definition proxy_job.cc:66
wmJob * ED_seq_proxy_wm_job_get(const bContext *C)
Definition proxy_job.cc:83
const EnumPropertyItem rna_enum_id_type_items[]
Definition rna_ID.cc:35
const IDFilterEnumPropertyItem rna_enum_id_type_filter_items[]
Definition rna_ID.cc:122
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
void * rna_iterator_listbase_get(CollectionPropertyIterator *iter)
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:720
const EnumPropertyItem rna_enum_attribute_domain_items[]
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_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_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_transform_pivot_full_items[]
Definition rna_scene.cc:566
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:413
#define SACT_ITEM_MASK
Definition rna_space.cc:242
static void rna_def_repeat_zone_viewer_path_elem(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_type_items[]
Definition rna_space.cc:97
static const EnumPropertyItem rna_enum_view3dshading_render_pass_type_items[]
Definition rna_space.cc:450
static const EnumPropertyItem stereo3d_camera_items[]
Definition rna_space.cc:343
static void rna_def_space_node_path_api(BlenderRNA *brna, PropertyRNA *cprop)
static const EnumPropertyItem rna_enum_studio_light_items[]
Definition rna_space.cc:445
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:401
const EnumPropertyItem rna_enum_space_sequencer_view_type_items[]
Definition rna_space.cc:202
#define SI_ITEM_MASK
Definition rna_space.cc:305
static void rna_def_spreadsheet_column(BlenderRNA *brna)
static const EnumPropertyItem rna_enum_shading_wire_color_type_items[]
Definition rna_space.cc:434
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:246
static void rna_def_fileselect_params(BlenderRNA *brna)
#define DEF_SHOW_REGION_PROPERTY(identifier, label, description)
#define SACT_ITEM_SHAPEKEY
Definition rna_space.cc:232
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 const EnumPropertyItem fileselectparams_recursion_level_items[]
Definition rna_space.cc:518
#define SI_ITEM_VIEW(identifier, name, icon)
Definition rna_space.cc:293
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:219
static void rna_def_filemenu_entry(BlenderRNA *brna)
static EnumPropertyItem rna_enum_space_action_ui_mode_items[]
Definition rna_space.cc:265
static const EnumPropertyItem rna_enum_shading_color_type_items[]
Definition rna_space.cc:420
#define SI_ITEM_PAINT
Definition rna_space.cc:301
static void rna_def_space_sequencer_timeline_overlay(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_image_mode_items[]
Definition rna_space.cc:325
static const EnumPropertyItem rna_enum_space_image_mode_ui_items[]
Definition rna_space.cc:318
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:375
static const EnumPropertyItem buttons_context_items[]
Definition rna_space.cc:488
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 rna_enum_curve_display_handle_items[]
Definition rna_space.cc:531
static void rna_def_id_viewer_path_elem(BlenderRNA *brna)
#define SACT_ITEM_ACTION
Definition rna_space.cc:227
const EnumPropertyItem rna_enum_space_file_browse_mode_items[]
Definition rna_space.cc:213
const EnumPropertyItem rna_enum_clip_editor_mode_items[]
Definition rna_space.cc:480
#define SACT_ITEM_GPENCIL
Definition rna_space.cc:237
#define SACT_ITEM_TIMELINE
Definition rna_space.cc:223
#define V3D_S3D_CAMERA_LEFT
Definition rna_space.cc:336
static EnumPropertyItem rna_enum_space_action_mode_all_items[]
Definition rna_space.cc:255
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:68
const EnumPropertyItem rna_enum_space_image_mode_all_items[]
Definition rna_space.cc:310
static void rna_def_spreadsheet_column_id(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_graph_mode_items[]
Definition rna_space.cc:192
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[]
#define V3D_S3D_CAMERA_RIGHT
Definition rna_space.cc:337
const EnumPropertyItem rna_enum_fileselect_params_sort_items[]
Definition rna_space.cc:358
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)
#define SI_ITEM_UV
Definition rna_space.cc:297
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:382
#define V3D_S3D_CAMERA_S3D
Definition rna_space.cc:338
static void rna_def_space_node(BlenderRNA *brna)
const EnumPropertyItem rna_enum_space_action_mode_items[]
Definition rna_space.cc:279
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)
ListBase * SEQ_active_seqbase_get(const Editing *ed)
Definition sequencer.cc:416
Editing * SEQ_editing_get(const Scene *scene)
Definition sequencer.cc:262
static void seq_build_proxy(bContext *C, blender::Span< Sequence * > movie_strips)
#define min(a, b)
Definition sort.c:32
#define FLT_MAX
Definition stdcycles.h:14
unsigned char uint8_t
Definition stdint.h:78
void * regiondata
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:455
union CollectionPropertyIterator::@1329 internal
const char * identifier
Definition RNA_types.hh:506
const char * name
Definition RNA_types.hh:510
const char * description
Definition RNA_types.hh:512
AssetRepresentationHandle * asset
const char * name
Definition DNA_ID.h:413
int us
Definition DNA_ID.h:435
char name[66]
Definition DNA_ID.h:425
struct RenderResult * rr
struct AnimData * adt
IteratorSkipFunc skip
Definition RNA_types.hh:418
void * last
void * first
ListBase wm
Definition BKE_main.hh:239
ListBase objects
Definition BKE_main.hh:212
struct AnimData * adt
ID * owner_id
Definition RNA_types.hh:40
StructRNA * type
Definition RNA_types.hh:41
void * data
Definition RNA_types.hh:42
Main * main
Definition clip_ops.cc:1177
Depsgraph * depsgraph
Definition SEQ_proxy.hh:38
Scene * scene
Definition clip_ops.cc:1176
ListBase queue
Definition SEQ_proxy.hh:40
SpaceAction_Runtime runtime
struct MovieClipScopes scopes
short system_bookmarknr
FileSelectParams * params
SpaceGraph_Runtime runtime
int tile_grid_shape[2]
int custom_grid_subdiv[2]
struct ImageUser iuser
struct Image * image
char tree_idname[64]
char geometry_nodes_type
short render_size
struct Text * text
int icon_id_matcap_flipped
char name[FILE_MAXFILE]
struct IDProperty * prop
struct Object * camera
short scenelock
int object_type_exclude_select
int object_type_exclude_viewport
View3DShading shading
ListBase aovs
ScrArea * area
char idname[64]
struct GeometryNodeAssetTraits * geometry_node_asset_traits
Universally Unique Identifier according to RFC4122.
#define N_(msgid)
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126
bool WM_jobs_is_running(const wmJob *wm_job)
Definition wm_jobs.cc:317
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition wm_jobs.cc:455
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)
uint8_t flag
Definition wm_window.cc:138
bool WM_xr_session_exists(const wmXrData *xr)