diff options
author | Julian Eisel <julian@blender.org> | 2022-06-15 21:20:21 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-06-15 21:20:21 +0300 |
commit | 6fc388743dffd9d297210790584f0fbab2c5d6e1 (patch) | |
tree | a7e311120f2e14c097b88334002fe158b759f2c1 /source/blender/makesdna | |
parent | 66204860ca37c6be8379a3737a25644ad8b24c61 (diff) | |
parent | 43ddfdb1a530b5424fa150bb38f8dfe311acd25e (diff) |
Merge branch 'master' into asset-browser-grid-view
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_anim_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_brush_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_cloth_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_curves_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_modifier_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_lineart_types.h | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 21 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_node_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 112 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 4 |
14 files changed, 104 insertions, 78 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 1989118bef9..451c921c4ef 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -472,7 +472,7 @@ typedef struct Library { ushort tag; char _pad_0[6]; - /* Temp data needed by read/write code, and liboverride recursive resync. */ + /** Temp data needed by read/write code, and lib-override recursive re-synchronized. */ int temp_index; /** See BLENDER_FILE_VERSION, BLENDER_FILE_SUBVERSION, needed for do_versions. */ short versionfile, subversionfile; diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index c1dfab8a041..e2b58cefef6 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -771,7 +771,7 @@ typedef enum eNlaStrip_Blend_Mode { NLASTRIP_MODE_COMBINE, } eNlaStrip_Blend_Mode; -/** NLA Strip Extrpolation Mode. */ +/** NLA Strip Extrapolation Mode. */ typedef enum eNlaStrip_Extrapolate_Mode { /* extend before first frame if no previous strips in track, * and always hold+extend last frame */ diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 24e77ecf87f..d13496b21f7 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -97,7 +97,7 @@ typedef struct BrushGpencilSettings { /** Simplify adaptive factor */ float simplify_f; - /** Mix colorfactor */ + /** Mix color-factor. */ float vertex_factor; int vertex_mode; diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h index e79a53704c9..8ac899df701 100644 --- a/source/blender/makesdna/DNA_cloth_types.h +++ b/source/blender/makesdna/DNA_cloth_types.h @@ -20,8 +20,8 @@ extern "C" { * Mass-Spring Model to Describe Rigid Cloth Behavior by Xavier Provot. * * I've tried to keep similar, if not exact names for the variables as - * are presented in the paper. Where I've changed the concept slightly, - * as in stepsPerFrame compared to the time step in the paper, I've used + * are presented in the paper. Where I've changed the concept slightly, + * as in `stepsPerFrame` compared to the time step in the paper, I've used * variables with different names to minimize confusion. */ diff --git a/source/blender/makesdna/DNA_curves_types.h b/source/blender/makesdna/DNA_curves_types.h index 9690c342fdd..ed909c283c4 100644 --- a/source/blender/makesdna/DNA_curves_types.h +++ b/source/blender/makesdna/DNA_curves_types.h @@ -157,6 +157,13 @@ typedef struct Curves { */ struct Object *surface; + /** + * The name of the attribute on the surface #Mesh used to give meaning to the UV attachment + * coordinates stored on each curve. Expected to be a 2D vector attribute on the face corner + * domain. + */ + char *surface_uv_map; + /* Draw Cache. */ void *batch_cache; } Curves; diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index c20fb180fcd..56963bae3e1 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -1098,7 +1098,7 @@ typedef struct LineartGpencilModifierData { struct LineartCache *cache; /* Keep a pointer to the render buffer so we can call destroy from ModifierData. */ - struct LineartRenderBuffer *render_buffer_ptr; + struct LineartData *la_data_ptr; } LineartGpencilModifierData; diff --git a/source/blender/makesdna/DNA_lineart_types.h b/source/blender/makesdna/DNA_lineart_types.h index df496269644..444a0e6f247 100644 --- a/source/blender/makesdna/DNA_lineart_types.h +++ b/source/blender/makesdna/DNA_lineart_types.h @@ -14,7 +14,7 @@ * Edge flags and usage flags are used by with scene/object/gpencil modifier bits, and those values * needs to stay consistent throughout. */ -/* These flags are used for 1 time calculation, not stroke selection afterwards. */ +/** These flags are used for 1 time calculation, not stroke selection afterwards. */ typedef enum eLineartMainFlags { LRT_INTERSECTION_AS_CONTOUR = (1 << 0), LRT_EVERYTHING_AS_CONTOUR = (1 << 1), @@ -48,9 +48,11 @@ typedef enum eLineartEdgeFlag { LRT_EDGE_FLAG_INTERSECTION = (1 << 4), LRT_EDGE_FLAG_LOOSE = (1 << 5), /* LRT_EDGE_FLAG_FOR_FUTURE = (1 << 7), */ - /* Limited to 8 bits for edge type flag, don't add anymore because `BMEdge->head.eflag` only has - * 8 bits. So unless we changed this into a non-single-bit flag thing, we keep it this way. */ - /** Also used as discarded line mark. */ + /** + * It's a legacy limit of 8 bits for feature lines that come from original mesh edges. It should + * not be needed in current object loading scheme, but might still be relevant if we are to + * implement edit-mesh loading, so don't exceed 8 bits just yet. + */ LRT_EDGE_FLAG_CHAIN_PICKED = (1 << 8), LRT_EDGE_FLAG_CLIPPED = (1 << 9), /** Limited to 16 bits for the entire thing. */ diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 4a57f60be26..2eca84959b8 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -32,6 +32,7 @@ struct MVert; struct Material; struct Mesh; struct SubdivCCG; +struct SubsurfRuntimeData; # # @@ -83,7 +84,7 @@ typedef struct Mesh_Runtime { /** * Data used to efficiently draw the mesh in the viewport, especially useful when - * the same mesh is used in many objects or instances. See `draw_cache_impl_mesh.c`. + * the same mesh is used in many objects or instances. See `draw_cache_impl_mesh.cc`. */ void *batch_cache; @@ -123,26 +124,18 @@ typedef struct Mesh_Runtime { /** * Settings for lazily evaluating the subdivision on the CPU if needed. These are - * set in the modifier when GPU subdivision can be performed. + * set in the modifier when GPU subdivision can be performed, and owned by the by + * the modifier in the object. */ - SessionUUID subsurf_session_uuid; - char subsurf_resolution; - char subsurf_do_loop_normals; - char subsurf_apply_render; - char subsurf_use_optimal_display; - - /* Cached from the draw code for stats display. */ - int subsurf_totvert; - int subsurf_totedge; - int subsurf_totpoly; - int subsurf_totloop; - char _pad2[2]; + struct SubsurfRuntimeData *subsurf_runtime_data; + void *_pad1; /** * Caches for lazily computed vertex and polygon normals. These are stored here rather than in * #CustomData because they can be calculated on a const mesh, and adding custom data layers on a * const mesh is not thread-safe. */ + char _pad2[6]; char vert_normals_dirty; char poly_normals_dirty; float (*vert_normals)[3]; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 6e3ce7e98a8..f148116eba8 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -178,13 +178,6 @@ typedef enum { SUBSURF_BOUNDARY_SMOOTH_PRESERVE_CORNERS = 1, } eSubsurfBoundarySmooth; -typedef struct SubsurfRuntimeData { - /* Cached subdivision surface descriptor, with topology and settings. */ - struct Subdiv *subdiv; - char set_by_draw_code; - char _pad[7]; -} SubsurfRuntimeData; - typedef struct SubsurfModifierData { ModifierData modifier; diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 9dc2971b322..25c8a1f1514 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -1915,12 +1915,6 @@ typedef enum GeometryNodeBooleanOperation { GEO_NODE_BOOLEAN_DIFFERENCE = 2, } GeometryNodeBooleanOperation; -typedef enum GeometryNodeSplineType { - GEO_NODE_SPLINE_TYPE_BEZIER = 0, - GEO_NODE_SPLINE_TYPE_NURBS = 1, - GEO_NODE_SPLINE_TYPE_POLY = 2, -} GeometryNodeSplineType; - typedef enum GeometryNodeCurvePrimitiveCircleMode { GEO_NODE_CURVE_PRIMITIVE_CIRCLE_TYPE_POINTS = 0, GEO_NODE_CURVE_PRIMITIVE_CIRCLE_TYPE_RADIUS = 1 diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index f257833efe8..698fbe8ee8f 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -374,7 +374,7 @@ typedef struct Object { /** Dupliface scale. */ float instance_faces_scale; - /** Custom index, for renderpasses. */ + /** Custom index, for render-passes. */ short index; /** Current deformation group, NOTE: index starts at 1. */ unsigned short actdef DNA_DEPRECATED; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 1be27e0354c..1c62a550e60 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -991,6 +991,9 @@ typedef struct Sculpt { // float pivot[3]; XXX not used? int flags; + /* Transform tool. */ + int transform_mode; + int automasking_flags; /* Control tablet input */ @@ -1011,6 +1014,8 @@ typedef struct Sculpt { float constant_detail; float detail_percent; + char _pad[4]; + struct Object *gravity_object; } Sculpt; @@ -1490,18 +1495,19 @@ typedef struct ToolSettings { /* Transform */ char transform_pivot_point; char transform_flag; - /** Snap elements (per spacetype). */ + /** Snap elements (per spacetype), #eSnapMode. */ char snap_mode; char snap_node_mode; char snap_uv_mode; - /** Generic flags (per spacetype). */ + /** Generic flags (per spacetype), #eSnapFlag. */ char snap_flag; char snap_flag_node; char snap_flag_seq; char snap_uv_flag; - /** Default snap source. */ + /** Default snap source, #eSnapSourceSelect. */ + /* TODO(@gfxcoder): Rename `snap_target` to `snap_source_point`, because target is incorrect. */ char snap_target; - /** Snap mask for transform modes. */ + /** Snap mask for transform modes, #eSnapTransformMode. */ char snap_transform_mode_flag; char proportional_edit, prop_mode; @@ -2075,30 +2081,64 @@ enum { }; /** #ToolSettings.snap_flag */ -#define SCE_SNAP (1 << 0) -#define SCE_SNAP_ROTATE (1 << 1) -#define SCE_SNAP_PEEL_OBJECT (1 << 2) -#define SCE_SNAP_PROJECT (1 << 3) -#define SCE_SNAP_NO_SELF (1 << 4) -#define SCE_SNAP_ABS_GRID (1 << 5) -#define SCE_SNAP_BACKFACE_CULLING (1 << 6) - -/** #ToolSettings.snap_target */ -#define SCE_SNAP_TARGET_CLOSEST 0 -#define SCE_SNAP_TARGET_CENTER 1 -#define SCE_SNAP_TARGET_MEDIAN 2 -#define SCE_SNAP_TARGET_ACTIVE 3 +typedef enum eSnapFlag { + SCE_SNAP = (1 << 0), + SCE_SNAP_ROTATE = (1 << 1), + SCE_SNAP_PEEL_OBJECT = (1 << 2), + SCE_SNAP_PROJECT = (1 << 3), + SCE_SNAP_NO_SELF = (1 << 4), + SCE_SNAP_ABS_GRID = (1 << 5), + SCE_SNAP_BACKFACE_CULLING = (1 << 6), +} eSnapFlag; +/* Due to dependency conflicts with Cycles, header cannot directly include `BLI_utildefines.h`. */ +/* TODO: move this macro to a more general place. */ +#ifdef ENUM_OPERATORS +ENUM_OPERATORS(eSnapFlag, SCE_SNAP_BACKFACE_CULLING) +#endif + +/** #ToolSettings.snap_target and #TransSnap.source_select */ +typedef enum eSnapSourceSelect { + SCE_SNAP_SOURCE_CLOSEST = 0, + SCE_SNAP_SOURCE_CENTER = 1, + SCE_SNAP_SOURCE_MEDIAN = 2, + SCE_SNAP_SOURCE_ACTIVE = 3, +} eSnapSourceSelect; + +/** #TransSnap.target_select and #ToolSettings.snap_flag (SCE_SNAP_NO_SELF) */ +typedef enum eSnapTargetSelect { + SCE_SNAP_TARGET_ALL = 0, + SCE_SNAP_TARGET_NOT_SELECTED = 1, + SCE_SNAP_TARGET_NOT_ACTIVE = 2, + SCE_SNAP_TARGET_NOT_EDITED = 3, + SCE_SNAP_TARGET_ONLY_SELECTABLE = 4, +} eSnapTargetSelect; /** #ToolSettings.snap_mode */ -#define SCE_SNAP_MODE_VERTEX (1 << 0) -#define SCE_SNAP_MODE_EDGE (1 << 1) -#define SCE_SNAP_MODE_FACE (1 << 2) -#define SCE_SNAP_MODE_VOLUME (1 << 3) -#define SCE_SNAP_MODE_EDGE_MIDPOINT (1 << 4) -#define SCE_SNAP_MODE_EDGE_PERPENDICULAR (1 << 5) -#define SCE_SNAP_MODE_GEOM \ - (SCE_SNAP_MODE_VERTEX | SCE_SNAP_MODE_EDGE | SCE_SNAP_MODE_FACE | \ - SCE_SNAP_MODE_EDGE_PERPENDICULAR | SCE_SNAP_MODE_EDGE_MIDPOINT) +typedef enum eSnapMode { + SCE_SNAP_MODE_NONE = 0, + SCE_SNAP_MODE_VERTEX = (1 << 0), + SCE_SNAP_MODE_EDGE = (1 << 1), + SCE_SNAP_MODE_FACE = (1 << 2), /* TODO(@gfxcoder): Rename to `SCE_SNAP_MODE_FACE_RAYCAST` + when other face snapping methods are added. */ + SCE_SNAP_MODE_VOLUME = (1 << 3), + SCE_SNAP_MODE_EDGE_MIDPOINT = (1 << 4), + SCE_SNAP_MODE_EDGE_PERPENDICULAR = (1 << 5), + SCE_SNAP_MODE_GEOM = (SCE_SNAP_MODE_VERTEX | SCE_SNAP_MODE_EDGE | SCE_SNAP_MODE_FACE | + SCE_SNAP_MODE_EDGE_PERPENDICULAR | SCE_SNAP_MODE_EDGE_MIDPOINT), + + /** #ToolSettings.snap_node_mode */ + SCE_SNAP_MODE_NODE_X = (1 << 0), + SCE_SNAP_MODE_NODE_Y = (1 << 1), + + /* #ToolSettings.snap_mode and #ToolSettings.snap_node_mode and #ToolSettings.snap_uv_mode */ + SCE_SNAP_MODE_INCREMENT = (1 << 6), + SCE_SNAP_MODE_GRID = (1 << 7), +} eSnapMode; +/* Due to dependency conflicts with Cycles, header cannot directly include `BLI_utildefines.h`. */ +/* TODO: move this macro to a more general place. */ +#ifdef ENUM_OPERATORS +ENUM_OPERATORS(eSnapMode, SCE_SNAP_MODE_GRID) +#endif /** #SequencerToolSettings.snap_mode */ #define SEQ_SNAP_TO_STRIPS (1 << 0) @@ -2110,22 +2150,12 @@ enum { #define SEQ_SNAP_IGNORE_SOUND (1 << 1) #define SEQ_SNAP_CURRENT_FRAME_TO_STRIPS (1 << 2) -/** #ToolSettings.snap_node_mode */ -#define SCE_SNAP_MODE_NODE_X (1 << 0) -#define SCE_SNAP_MODE_NODE_Y (1 << 1) - -/** - * #ToolSettings.snap_mode and #ToolSettings.snap_node_mode - */ -#define SCE_SNAP_MODE_INCREMENT (1 << 6) -#define SCE_SNAP_MODE_GRID (1 << 7) - /** #ToolSettings.snap_transform_mode_flag */ -enum { +typedef enum eSnapTransformMode { SCE_SNAP_TRANSFORM_MODE_TRANSLATE = (1 << 0), SCE_SNAP_TRANSFORM_MODE_ROTATE = (1 << 1), SCE_SNAP_TRANSFORM_MODE_SCALE = (1 << 2), -}; +} eSnapTransformMode; /** #ToolSettings.selectmode */ #define SCE_SELECT_VERTEX (1 << 0) /* for mesh */ @@ -2279,6 +2309,12 @@ typedef enum eSculptFlags { SCULPT_HIDE_FACE_SETS = (1 << 17), } eSculptFlags; +/* Sculpt.transform_mode */ +typedef enum eSculptTransformMode { + SCULPT_TRANSFORM_MODE_ALL_VERTICES = 0, + SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC = 1, +} eSculptTrasnformMode; + /** PaintModeSettings.mode */ typedef enum ePaintCanvasSource { /** Paint on the active node of the active material slot. */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index ac38eb10342..f701a550296 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -2008,6 +2008,7 @@ typedef enum eSpreadsheetColumnValueType { SPREADSHEET_VALUE_TYPE_INSTANCES = 6, SPREADSHEET_VALUE_TYPE_STRING = 7, SPREADSHEET_VALUE_TYPE_BYTE_COLOR = 8, + SPREADSHEET_VALUE_TYPE_INT8 = 9, } eSpreadsheetColumnValueType; /** diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 2a90212c24e..df965d7b6fd 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -315,7 +315,7 @@ typedef struct ThemeSpace { char _pad5[3]; float dash_alpha; - /* syntax for textwindow and nodes */ + /* Syntax for text-window and nodes. */ unsigned char syntaxl[4], syntaxs[4]; /* in nodespace used for backdrop matte */ unsigned char syntaxb[4], syntaxn[4]; /* in nodespace used for color input */ unsigned char syntaxv[4], syntaxc[4]; /* in nodespace used for converter group */ @@ -860,7 +860,7 @@ typedef struct UserDef { float glalphaclip; - /** #eAutokey_Mode, autokeying mode. */ + /** #eAutokey_Mode, auto-keying mode. */ short autokey_mode; /** Flags for autokeying. */ short autokey_flag; |