diff options
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_node_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 36 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_view3d_defaults.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_view3d_types.h | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_viewer_path_types.h | 40 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_workspace_types.h | 8 |
6 files changed, 65 insertions, 35 deletions
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index dbda24fb8b7..963567133d9 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -1598,6 +1598,8 @@ typedef struct NodeGeometryImageTexture { typedef struct NodeGeometryViewer { /* eCustomDataType. */ int8_t data_type; + /* eAttrDomain. */ + int8_t domain; } NodeGeometryViewer; typedef struct NodeGeometryUVUnwrap { diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 5a819ead4ec..7f0dd2f9be6 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -22,6 +22,7 @@ #include "DNA_vec_types.h" /* Hum ... Not really nice... but needed for spacebuts. */ #include "DNA_view2d_types.h" +#include "DNA_viewer_path_types.h" #ifdef __cplusplus extern "C" { @@ -1888,32 +1889,6 @@ typedef struct SpreadsheetColumn { char *display_name; } SpreadsheetColumn; -/** - * An item in SpaceSpreadsheet.context_path. - * This is a bases struct for the structs below. - */ -typedef struct SpreadsheetContext { - struct SpreadsheetContext *next, *prev; - /* eSpaceSpreadsheet_ContextType. */ - int type; - char _pad[4]; -} SpreadsheetContext; - -typedef struct SpreadsheetContextObject { - SpreadsheetContext base; - struct Object *object; -} SpreadsheetContextObject; - -typedef struct SpreadsheetContextModifier { - SpreadsheetContext base; - char *modifier_name; -} SpreadsheetContextModifier; - -typedef struct SpreadsheetContextNode { - SpreadsheetContext base; - char *node_name; -} SpreadsheetContextNode; - typedef struct SpaceSpreadsheet { SpaceLink *next, *prev; /** Storage of regions for inactive spaces. */ @@ -1930,12 +1905,11 @@ typedef struct SpaceSpreadsheet { ListBase row_filters; /** - * List of #SpreadsheetContext. - * This is a path to the data that is displayed in the spreadsheet. - * It can be set explicitly by an action of the user (e.g. clicking the preview icon in a - * geometry node) or it can be derived from context automatically based on some heuristic. + * Context that is currently displayed in the editor. This is usually a either a single object + * (in original/evaluated mode) or path to a viewer node. This is retrieved from the workspace + * but can be pinned so that it stays constant even when the active node changes. */ - ListBase context_path; + ViewerPath viewer_path; /* eSpaceSpreadsheet_FilterFlag. */ uint8_t filter_flag; diff --git a/source/blender/makesdna/DNA_view3d_defaults.h b/source/blender/makesdna/DNA_view3d_defaults.h index b2d17b0ea22..c6c93c33086 100644 --- a/source/blender/makesdna/DNA_view3d_defaults.h +++ b/source/blender/makesdna/DNA_view3d_defaults.h @@ -36,8 +36,10 @@ #define _DNA_DEFAULT_View3DOverlay \ { \ + .flag = V3D_OVERLAY_VIEWER_ATTRIBUTE, \ .wireframe_threshold = 1.0f, \ .wireframe_opacity = 1.0f, \ + .viewer_attribute_opacity = 0.8f, \ .xray_alpha_bone = 0.5f, \ .bone_wire_alpha = 1.0f, \ .fade_alpha = 0.40f, \ @@ -81,7 +83,7 @@ .gridflag = V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_FLOOR | V3D_SHOW_ORTHO_GRID, \ \ .flag = V3D_SELECT_OUTLINE, \ - .flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION, \ + .flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION | V3D_SHOW_VIEWER, \ \ .lens = 50.0f, \ .clip_start = 0.01f, \ diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 2b422f9aebf..f3e56ba7039 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -22,6 +22,7 @@ struct wmTimer; #include "DNA_movieclip_types.h" #include "DNA_object_types.h" #include "DNA_view3d_enums.h" +#include "DNA_viewer_path_types.h" #ifdef __cplusplus extern "C" { @@ -205,6 +206,7 @@ typedef struct View3DOverlay { float weight_paint_mode_opacity; float sculpt_mode_mask_opacity; float sculpt_mode_face_sets_opacity; + float viewer_attribute_opacity; /** Armature edit/pose mode settings. */ float xray_alpha_bone; @@ -227,8 +229,6 @@ typedef struct View3DOverlay { float gpencil_vertex_paint_opacity; /** Handles display type for curves. */ int handle_display; - - char _pad[4]; } View3DOverlay; /** #View3DOverlay.handle_display */ @@ -348,6 +348,9 @@ typedef struct View3D { View3DShading shading; View3DOverlay overlay; + /** Path to the viewer node that is currently previewed. This is retrieved from the workspace. */ + ViewerPath viewer_path; + /** Runtime evaluation data (keep last). */ View3D_Runtime runtime; } View3D; @@ -443,7 +446,7 @@ enum { /** #View3D.flag2 (int) */ #define V3D_HIDE_OVERLAYS (1 << 2) -#define V3D_FLAG2_UNUSED_3 (1 << 3) /* cleared */ +#define V3D_SHOW_VIEWER (1 << 3) #define V3D_SHOW_ANNOTATION (1 << 4) #define V3D_LOCK_CAMERA (1 << 5) #define V3D_FLAG2_UNUSED_6 (1 << 6) /* cleared */ @@ -528,6 +531,7 @@ enum { V3D_OVERLAY_HIDE_OBJECT_ORIGINS = (1 << 10), V3D_OVERLAY_STATS = (1 << 11), V3D_OVERLAY_FADE_INACTIVE = (1 << 12), + V3D_OVERLAY_VIEWER_ATTRIBUTE = (1 << 13), }; /** #View3DOverlay.edit_flag */ diff --git a/source/blender/makesdna/DNA_viewer_path_types.h b/source/blender/makesdna/DNA_viewer_path_types.h new file mode 100644 index 00000000000..8f470b66ca0 --- /dev/null +++ b/source/blender/makesdna/DNA_viewer_path_types.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include "BLI_listbase.h" +#include "BLI_utildefines.h" + +struct ID; + +typedef enum ViewerPathElemType { + VIEWER_PATH_ELEM_TYPE_ID = 0, + VIEWER_PATH_ELEM_TYPE_MODIFIER = 1, + VIEWER_PATH_ELEM_TYPE_NODE = 2, +} ViewerPathElemType; + +typedef struct ViewerPathElem { + struct ViewerPathElem *next, *prev; + int type; + char _pad[4]; +} ViewerPathElem; + +typedef struct IDViewerPathElem { + ViewerPathElem base; + struct ID *id; +} IDViewerPathElem; + +typedef struct ModifierViewerPathElem { + ViewerPathElem base; + char *modifier_name; +} ModifierViewerPathElem; + +typedef struct NodeViewerPathElem { + ViewerPathElem base; + char *node_name; +} NodeViewerPathElem; + +typedef struct ViewerPath { + /** List of #ViewerPathElem. */ + ListBase path; +} ViewerPath; diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h index 1a6e19c31ad..e99f317f057 100644 --- a/source/blender/makesdna/DNA_workspace_types.h +++ b/source/blender/makesdna/DNA_workspace_types.h @@ -10,6 +10,7 @@ #include "DNA_ID.h" #include "DNA_asset_types.h" +#include "DNA_viewer_path_types.h" #ifdef __cplusplus extern "C" { @@ -143,6 +144,13 @@ typedef struct WorkSpace { /** Workspace-wide active asset library, for asset UIs to use (e.g. asset view UI template). The * Asset Browser has its own and doesn't use this. */ AssetLibraryReference asset_library_ref; + + /** + * Ground truth for the currently active viewer node. When a viewer node is activated its path is + * set here. Editors can check here for which node is active (currently the node editor, + * spreadsheet and viewport do this). + */ + ViewerPath viewer_path; } WorkSpace; /** |